Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
custom-topic
Profile link from chat box stopped working
Avatar
Nate
Member
sp_UserOfflineSmall Offline
Oct 15, 2015 - 12:47 pm
sp_QuotePost Quote

The admin of this site helped me with integration code a couple of years ago but I noticed today it doesn't work anymore. I use CBox for a chat box on my website and you guys helped me set it up so the username links to the member's profile from inside the chat box.

So when you hover over a name in the chat box it shows "http://www.rockitpro.com/sf-forum/profile/jc229/" but when clicked it takes you to your own profile because it should show the member's id number instead of his actual screen name. Here is the code:

<?php 
 global $user_ID, $user_identity, $user_login; 
 sp_forum_api_support();
 $profile_url = sp_url('profile').$user_login;
 $avatar = sp_UserAvatar('get=1&context=user', $user_ID);
 $avatar_url = $avatar->url;
 ?>
<!-- BEGIN CBOX - www.cbox.ws - v001 -->
<div id="cboxdiv" style="text-align:center; line-height:0">
<ul><li>
<iframe frameborder="0" width="321" height="225" src="http://www5.cbox.ws/box/?boxid=377963&boxtag=6685&sec=main" scrolling="auto" allowtransparency="yes" name="cboxmain" style="border:#DBE2ED 0px solid;" id="cboxmain"></iframe>
<iframe frameborder="0" width="321" height="75" src="http://www5.cbox.ws/box/?boxid=377963&boxtag=6685&sec=form&nme=<?php echo urlencode($user_identity)?>&nmekey=<?php echo md5('126lmb67a389eiio'.$user_identity)?>&pic=<?php echo urlencode($avatar_url)?>&lnk=<?php echo urlencode($profile_url)?>&ekey=<?php echo md5("126lmb67a389eiio"."\t".$avatar_url."\t".$profile_url)?>" scrolling="no" allowtransparency="yes" name="cboxform" style="border:#DBE2ED 0px solid;border-top:0px" id="cboxform"></iframe>
</li></ul>
</div></div>
<!-- END CBOX -->

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Oct 16, 2015 - 4:22 am
sp_QuotePost Quote

Perhaps you could describe... 'it doesn't work anymore'?

Please note that this is not a support forum and we may need you to open a support topic - but answer the above question first...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Nate
Member
sp_UserOfflineSmall Offline
Nov 20, 2015 - 2:38 am
sp_QuotePost Quote

Yellow Swordfish said
Perhaps you could describe... 'it doesn't work anymore'?

Please note that this is not a support forum and we may need you to open a support topic - but answer the above question first...

I described the problem in the 2nd paragraph:

Hover over a name in the chat box and the url shows “http://www.rockitpro.com/sf-forum/profile/jc229/” but when the name is actually clicked it takes you to your own profile because it should show the member’s id number instead of his actual screen name, which in this example the screen name is "jc229"

So basically, it's not linking to the member's id number when it should.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Nov 20, 2015 - 4:39 am
sp_QuotePost Quote

This changed a long time ago from using the $user_login to the $user_ID

andy-signature.png
YELLOW
SWORDFISH
Avatar
Nate
Member
sp_UserOfflineSmall Offline
Dec 12, 2015 - 1:09 pm
sp_QuotePost Quote

I tried replacing $user_login with $user_ID but that did nothing. If you can help me with this I'd appreciate it, if not I understand. Below is the code, just need to know what code to change so the usernames in the chat box link to the correct profile url, which would be the member's user id, not display name.

<?php 
 global $user_ID, $user_identity, $user_login; 
 sp_forum_api_support();
 $profile_url = sp_url('profile').$user_login;
 $avatar = sp_UserAvatar('get=1&context=user', $user_ID);
 $avatar_url = $avatar->url;
 ?>
<!-- BEGIN CBOX - www.cbox.ws - v001 -->
<div id="cboxdiv" style="text-align:center; line-height:0">
<ul><li>
<iframe frameborder="0" width="321" height="225" src="http://www5.cbox.ws/box/?boxid=377963&boxtag=6685&sec=main" scrolling="auto" allowtransparency="yes" name="cboxmain" style="border:#DBE2ED 0px solid;" id="cboxmain"></iframe>
<iframe frameborder="0" width="321" height="75" src="http://www5.cbox.ws/box/?boxid=377963&boxtag=6685&sec=form&nme=<?php echo urlencode($user_identity)?>&nmekey=<?php echo md5('126lmb67a389eiio'.$user_identity)?>&pic=<?php echo urlencode($avatar_url)?>&lnk=<?php echo urlencode($profile_url)?>&ekey=<?php echo md5("126lmb67a389eiio"."\t".$avatar_url."\t".$profile_url)?>" scrolling="no" allowtransparency="yes" name="cboxform" style="border:#DBE2ED 0px solid;border-top:0px" id="cboxform"></iframe>
</li></ul>
</div></div>
<!-- END CBOX -->
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Dec 12, 2015 - 1:52 pm
sp_QuotePost Quote

not really sure what the global $user_ID is here...  you want the current user?  then you dont needa  context, and would just want:

$avatar = sp_UserAvatar('get=1');
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 649
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 618
Members: 17348
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10120
Posts: 79607