Support Forum

Profile link from chat box stopped working

NA Nate
Nate
Member

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 -->

5 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

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…

NA Nate
Nate
Member

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.

YS Yellow Swordfish
Yellow Swordfish
Member

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

NA Nate
Nate
Member

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 -->
MP Mr Papa
Mr Papa
Member

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');