Jump to content


Getting a member id


1 reply to this topic

#1 Eyecu

    Rookie

  • Active Member
  • 1 posts

Posted 23 January 2012 - 10:31 AM

Good day,
I've been trying to integrate a flash irc chat into my ipb boards and I've got most of it working smoothly. There is just one part i can't figure out. In the flash chat I am trying to get it to link the clicked on users name to the ipb profile.

So say I've click on the users nick Eyecu in the nicklist and click on profile. It calls the following function (note this has got the code I'm working on in it aswell.)

function onContextMenuSelect(type, nick) {
  window.open("http://www.chainscriptz.net/index.php?/user/<?php echo $ipbwi->member->displayname2id($member['?> +nick <?php echo ']); ?>-" +nick);
}

the +nick part is what the function uses to pass the clicked on nick in the nicklist. The problem I'm having is actually getting the member id. No matter what i try i get the following:

www.yoursite.com/index.php?/user/-username

where username is the clicked on nick in the nicklist so the +nick does work just not for getting the memberid. Any help would greatly be appreciated.

Thanks
Eyecu

#2 mm21xx

    Rookie

  • Active Member
  • 2 posts

Posted 24 January 2012 - 09:38 PM

I was just coding something similar to this the other day.

First, make sure you perform a trim on your +nick as it might leave empty spaces behind the nickname or such and cause it to return.

Another note:
www.yoursite.com/index.php?/user/userid-username -> If you allow composite usernames (ie: John Smith, and not JohnSmith), then you would definitely want to put in a preg_replace to change spaces to dashes "-".





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users