MyBB Hacks

Full Version: Showing on member profile
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have been working on upgrading a plugin from 1.4 (Show referrals on Profile) and i have it all fixed apart from one weird thing.

If I view my profile from this link:

http://www.leefish.nl/mybb/member.php?action=profile

Then I have zero referrals.

If I view my own profile via this link:

http://www.leefish.nl/mybb/user-1.html

Then it shows my referrals correctly.

Any idea what I may be doing wrong?

Plugin attached. EDIT: Download it on LEEFISH. Guests can download Smile

LINK: http://www.leefish.nl/mybb/forum-51-page-1.html
Your first link isn't valid (I get an error page).
I think you need a "uid" in the URL, eg:
http://ww.leefish.nl/mybb/member.php?act...http://ww.leefish.nl/mybb/member.php?action=pro
^ ...In which it shows me the same referrals as your other link.
I'm sorry, I think I was not clear (again) I have a link in the header - my profile - which is constructed to use this code:

Code:
<span><a href="{$mybb->settings['bburl']}/member.php?action=profile">My Profile</a></span>


A lot of mybb sites seem to use this construct for a profile link. When I click on that link (My Profile) THEN it gives the link below:

Code:
http://www.leefish.nl/mybb/member.php?action=profile


And that is when the referrals are not visible.

I would like to be able to share this update, but as so many sites are using this construct then it could be perceived as broken. Thats bad, so I was wondering how to make the plugin see that the link

Code:
http://www.leefish.nl/mybb/member.php?action=profile

is the same as

Code:
http://www.leefish.nl/mybb/user-1.html 

(12-08-2010 05:17 PM)leefish Wrote: [ -> ]I'm sorry, I think I was not clear (again) I have a link in the header - my profile - which is constructed to use this code:

Code:
<span><a href="{$mybb->settings['bburl']}/member.php?action=profile">My Profile</a></span>


A lot of mybb sites seem to use this construct for a profile link. When I click on that link (My Profile) THEN it gives the link below:

Code:
http://www.leefish.nl/mybb/member.php?action=profile

But that's an invalid link as there's no uid in the URL.
It probably should be

HTML Code
<span><a href="{$mybb->settings['bburl']}/member.php?action=profile&amp;uid={$mybb->user['uid']}">My Profile</a></span>


But if you want the SEF/SEO URLs, you need to use get_profile_link somewhere, eg:

PHP Code:
$userlink = get_profile_link($mybb->user['uid']);



EDIT: okay, it looks like MyBB will fall back to the current user if no uid is supplied.
In which case, you'd retrieve the user ID through $uid.  In other words, replace $mybb->input['uid'] with $GLOBALS['uid']

Thank you - that has fixed it - its weird though, as that OTHER link construct was/is definitely working...... But it only worked if it was the logged in user viewing the profile.

So if I clicked it - it showed my profile, but if another member of leefish used it it showed their profile. Anyway, I feel sure that this construct is better.

Thank you

Smile
(12-08-2010 06:33 PM)ZiNgA BuRgA Wrote: [ -> ]EDIT: okay, it looks like MyBB will fall back to the current user if no uid is supplied.
In which case, you'd retrieve the user ID through $uid.  In other words, replace $mybb->input['uid'] with $GLOBALS['uid']

Interesting - if I use the $GLOBALS['uid'] construct then its the same as before - no referrals showing on profile via that "My Profile" link in the member block, whereas if I use the uid={$mybb->user['uid']} construct then referrals show on profile via "My Profile" link in the member block.
If I wasn't clear, I was referring to changing the code in the plugin, from:

Code:
AND u.referrer = '".intval($mybb->input['uid'])."'

to

Code:
AND u.referrer = '".intval($GLOBALS['uid'])."'

Oh. Gosh I am thick.

yay - it worked Smile

Thank you
Reference URL's