Link to members forum?

Need help with your forum? Ask away. Remember though that there's always http://www.phpbb.com/community

Moderator: Experts

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

Link to members forum?

Post by Graham » Mon Nov 24, 2008 8:52 am

Hi
My site is a poetry site where each member has their own forum to post their poems.
What I want is, under their avatar, to have a link that goes right to their forum.
So you would have under my avatar,
Graham, which takes you to my profile (this is obviously already there), and beneath that
Poems by Graham, which would take you directly to my forum.
Is it possible?

Thanks
Graham

User avatar
DavidIQ
Site Admin
Posts: 581
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

Re: Link to members forum?

Post by DavidIQ » Mon Nov 24, 2008 9:10 am

It's possible. You'll need to create a custom profile field in which they could put their forum id. Then you would need to modify the template for viewtopic.html a bit to add the link. The url should be of the format "viewforum.php?f=2" where 2 is the id number of the forum. If you need further help let me know and I'll have to look at it a bit later but hopefully this is enough to give you an idea of what to do.

EDIT: Actually I'll probably need to take a look later either way...you may need to do some code modification.

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

Re: Link to members forum?

Post by Graham » Mon Nov 24, 2008 12:11 pm

David,

I think I'll wait a bit till you've managed to have a look further in to the possibility of doing it.
There's no rush, I'm sure you're busy enough as it is.

Thanks

Graham

User avatar
DavidIQ
Site Admin
Posts: 581
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

Re: Link to members forum?

Post by DavidIQ » Wed Nov 26, 2008 12:10 pm

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=

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

Re: Link to members forum?

Post by Graham » Thu Nov 27, 2008 4:08 am

Morning David,

I've got the custom field to show in the user profile, and I've entered a forum number, but it does not show underneath the user name on the forum when viewing a topic posted by the user.
I'm testing it out on a desktop server XAMPP, not sure if that's anything to do with it or not?


Thanks
Graham

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

Re: Link to members forum?

Post by Graham » Thu Nov 27, 2008 7:39 am

David,
Just for information, tried it now on my live board still no luck, which is dammed annoying as I see DavidIQ's Poems under your name!!

Graham

User avatar
DavidIQ
Site Admin
Posts: 581
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

Re: Link to members forum?

Post by DavidIQ » Thu Nov 27, 2008 9:36 am

Did you do the style edit?

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

Re: Link to members forum?

Post by Graham » Thu Nov 27, 2008 10:44 am

Yep, did that bit. ;)

User avatar
DavidIQ
Site Admin
Posts: 581
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

Re: Link to members forum?

Post by DavidIQ » Thu Nov 27, 2008 3:03 pm

I re-registered. Please activate my account and add me to the admin group so I can take a look at what's up.

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

Re: Link to members forum?

Post by Graham » Thu Nov 27, 2008 4:07 pm

OK David you're account is active and you have Admin rank.

Thanks
Graham

User avatar
DavidIQ
Site Admin
Posts: 581
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

Re: Link to members forum?

Post by DavidIQ » Thu Nov 27, 2008 5:41 pm

I have admin rank but not admin permissions which is what I need ;-)

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

Re: Link to members forum?

Post by Graham » Thu Nov 27, 2008 6:06 pm

OK David,

Sorry about that, all should be right now.

Graham

User avatar
DavidIQ
Site Admin
Posts: 581
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

Re: Link to members forum?

Post by DavidIQ » Thu Nov 27, 2008 6:44 pm

You had it all right :-)
I didn't mention that there was a setting you needed to enable. I assumed it was enabled by default but it was disabled by default instead. The feature was in "Load Settings" and it's called "Display custom profile fields on topic pages". I enabled it and now the field shows. Also took care of the user profile. Edited memberlist_view.html and replaced this:

Code: Select all

		<!-- BEGIN custom_fields --><dt>{custom_fields.PROFILE_FIELD_NAME}:</dt> <dd>{custom_fields.PROFILE_FIELD_VALUE}</dd><!-- END custom_fields -->
with this:

Code: Select all

		<!-- BEGIN custom_fields --><!-- IF custom_fields.PROFILE_FIELD_NAME == 'My Poems' --><dt>&nbsp;</dt><dd><a href="./viewforum.php?f={custom_fields.PROFILE_FIELD_VALUE}">Poems by {USERNAME}</a></dd><!-- ELSE --><dt>{custom_fields.PROFILE_FIELD_NAME}:</dt> <dd>{custom_fields.PROFILE_FIELD_VALUE}</dd><!-- ENDIF --><!-- END custom_fields -->

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

Re: Link to members forum?

Post by Graham » Fri Nov 28, 2008 4:01 am

David,
Thank you for all your help, I asked this same question at phpBB, here is the only reply I recieved.
I don't know any easy way to do what you are asking. You can add a link to the profile pretty easily, but how to assign a specific forum to that user? Would take a lot of configuring based on how many members you have.
The members could just put it in their signature as an alternative.
Can I now reply to that telling people if they want the answer to visit here.
I think you should make it a Mod so that users could use it for 'My Favourite Forum'.

Thanks again
Graham

PS
I'll leave you as a member this time.

User avatar
DavidIQ
Site Admin
Posts: 581
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

Re: Link to members forum?

Post by DavidIQ » Fri Nov 28, 2008 8:48 am

Linked that topic back to here ;-)

Thanks.

Post Reply