Support Forum

Profile link from chat box stopped working

Nate
Member
Oct 15, 2015 - 12:47 pm

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&amp;boxtag=6685&amp;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&amp;boxtag=6685&amp;sec=form&nme=<?php echo urlencode($user_identity)?>&nmekey=<?php echo md5('126lmb67a389eiio'.$user_identity)?>&amp;pic=<?php echo urlencode($avatar_url)?>&amp;lnk=<?php echo urlencode($profile_url)?>&amp;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 -->

Yellow Swordfish
Glinton, England
Member
Oct 16, 2015 - 4:22 am

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

Nate
Member
Nov 20, 2015 - 2:38 am

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.

Yellow Swordfish
Glinton, England
Member
Nov 20, 2015 - 4:39 am

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

Nate
Member
Dec 12, 2015 - 1:09 pm

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&amp;boxtag=6685&amp;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&amp;boxtag=6685&amp;sec=form&nme=<?php echo urlencode($user_identity)?>&nmekey=<?php echo md5('126lmb67a389eiio'.$user_identity)?>&amp;pic=<?php echo urlencode($avatar_url)?>&amp;lnk=<?php echo urlencode($profile_url)?>&amp;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 -->
Mr Papa
Simi Valley, CA
Member
Free Members
Dec 12, 2015 - 1:52 pm

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