News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Custom Profile Field w/ Member ID Reference Link in 2.0 RC5

Started by duckydan69, March 15, 2011, 10:07:11 AM

Previous topic - Next topic

duckydan69

I would like to make a custom profile field that takes the user to a link:

/viewcollection?userid=['member']['id']

This will allow someone to view that users collection.  The ['member']['id'] would be tied to the memberid of the person with the link in their profile and not the person who clicks on that link.

How can I do this?

I would like it to either be in their signature or in their profile field on every post.

Arantor

Not with the custom profile fields, as far as I remember.

Where, exactly do you want it? (I'm thinking that signature would be a one line change to add it into, you see)

duckydan69

Signature field would be find as long as it is forced and cannot be removed.  Otherwise to the left of the post where AIM and stuff normally is but if it's easier Signature would work.

Arantor

Find Sources/Load.php

Find this line inside it:
$profile['signature'] = parse_bbc($profile['signature'], true, 'sig' . $profile['id_member']);

Replace it with:
$profile['signature'] = '<a href="/viewcollection?userid=' . $profile['id_member'] . '">View my collection!</a><br />' . parse_bbc($profile['signature'], true, 'sig' . $profile['id_member']);

Change the text to suit, of course, just be careful if you go to put a ' in it.

duckydan69

That's great, thanks!  One last question, can I repeat that line and add 3 links in a row?

I.e.

View Collection
View Trade List
View Wanted List


or is that pushing it?

Arantor

Well, you wouldn't repeat the line, you'd embed them all into one... what are the other links?

duckydan69

I think I figured it out...

$profile['signature'] = '<a href="/viewcollection?userid=' . $profile['id_member'] . '">View my collection!</a><br /><a href="/viewtradelist?userid=' . $profile['id_member'] . '">View my trade list!</a><br /><a href="/viewwantedlist?userid=' . $profile['id_member'] . '">View my wish list!</a><br />' . parse_bbc($profile['signature'], true, 'sig' . $profile['id_member']);

Update... no I missed something as that crashed the forum.....

Arantor


Advertisement: