Link to members forum?

Need help with your forum? Ask away. Remember though that there's always

Moderator: Experts

Posts: 76
Joined: Mon Oct 20, 2008 3:31 am
Location: UK

Re: Link to members forum?

Post by Graham »

Hi David,
Just a quick note, I placed the code in viewtopic_body.html a little higher so that it's under username.
Now when you look at one of my topics you see under my Avatar

Poems by Graham

Nothing Major just more aesthetic. ;)
Thanks again for all the help.


Posts: 9
Joined: Sat Jun 25, 2011 1:43 am

Re: Link to members forum?

Post by Clair »

DavidIQ wrote:Got it going and without doing any physical code changes :-D
Here's what you do to get this working.

1st PART:

First you'll need to create a custom profile field: ACP -> Users and Groups -> Custom profile fields. Create a new one and call it "My Poems" and select "Numbers" from the drop-down. Make field identification "my_poems_forum", Display Profile Field - Yes, Display in user control panel - selected, Description that I put: "Enter the forum ID/Number where your poems are stored at." but you can make that anything you want. Once you finish that you have a custom profile field for all the users to enter the forum ID for their poems in their profile.

2nd PART:

This is a bit more tricky but I'll make it as easy as possible. Go to the Styles tab then click on templates and edit for your style. Select viewtopic_body.html and find this part (assuming you're using a prosilver-based style):

Code: Select all

			<dd><strong>{postrow.custom_fields.PROFILE_FIELD_NAME}:</strong> {postrow.custom_fields.PROFILE_FIELD_VALUE}</dd>
Replace with:

Code: Select all

		<!-- IF postrow.custom_fields.PROFILE_FIELD_NAME == 'My Poems' -->
			<dd><strong><a href="./viewforum.php?f={postrow.custom_fields.PROFILE_FIELD_VALUE}">{postrow.POST_AUTHOR}'s Poems</a></strong></dd>
		<!-- ELSE -->
			<dd><strong>{postrow.custom_fields.PROFILE_FIELD_NAME}:</strong> {postrow.custom_fields.PROFILE_FIELD_VALUE}</dd>
		<!-- ENDIF -->
That should be it. You'll need to explain to your users how to get their forum's id by looking at the URL for their forum and getting the number after f=
i like ur post.......... thanks for sharing this.......

Post Reply