Calling member ID or member nickname

Hello everyone!  I'm working on a PHP Block in which I would like to call the ID of a member (i.e.: Member 1, 2, 3 or 55).  The function I want executed has to change depending on the members' ID number and not nickname.  What "language" should I use?


On another hand if I want to execute something that calls up the members nickname what language do I use.  Is there a PHP string to call up Member ID and Member Nickname?


Please help, thanks!

Quote · 22 Feb 2010

PHP is the language.

The member id of the member currently logged in can be pulled from the cookie.

$memID = $_COOKIE['memberID'];


The members nickname can be obtained by passing the member id to the dolphin function getNickName

$nick = getNickName($memID);



But if you have to ask the question "What language do i use" then i have a feeling your not going to find this easy to do.

https://www.deanbassett.com
Quote · 22 Feb 2010

Thank you Deano!  I have one final question what PHP code would I need to get the Member ID of someone irrespective of whether they are logged in or not.  How can I get that data without getting it from the cookie?


When I wrote what "language" I meant, what's the piece of code, sorry.

BTW if you are the same Deano who created the Deanos Tools, thanks a million for a very time saving mod.  It rocks!

Quote · 23 Feb 2010

Yes, i am the Deanos Tools Deano.

Now. You will need to explain what your trying to do. Unless a member is logged in, you can't get their member id as you would not know who it is until they login.

The function getLoggedId() will also return the ID of a member logged in. It's like pulling it from the cookie.

There is also getIdByNickname($nickname) which returns the member id of the passed nickname.

Also be aware that some of these function calls will not work on every page. It all depends on what php classes are included on that page.

So you really should be looking at the php classes for dolphin located in the inc and inc\classes folders. This is where you will find all this stuff.

https://www.deanbassett.com
Quote · 23 Feb 2010

Ahh, you are THE MAN indeed. Thanks for the advice and the great mods.

I hear ya!  I was trying to save some money by attempting to create a PHP Block, similar to the Profile Map Block that would add the profile Map to a classified ad page.  Here is the code I've been tinkering around with.  I'm not very knowledgeable in PHP but I learn fast:

return BxDolService::call('map_profiles', 'profile_block', array($this->oProfileGen->_iProfileID));

I created a PHP Block in Ad Page Builder (using your mod to add the PHP Block feature) and copied the PHP Content of Profile Map, modified it and this is the extent of what I can get it to do.  I get a Map in the Ad that pinpoints the location of Member 2 irrespective of the fact that the Ad author is Member 21 or 76.  This is the code:

return BxDolService::call('map_profiles', 'profile_block', array(2));

Obviously I would like to get the Map of the Ad's author to appear and not a specific number.  I'm quite resigned to purchase the Mod from someone -if I have to- but I like a challenge.  :)

Thanks!

Quote · 23 Feb 2010

I am trying to do something similar. See my client wants a page jus like the wall owner page. I have tried to copy and modify the wall mod but thats not working. Then I tried to create a custom page with code that I think will some what resemble the wall owner page. I tried to use service calls. I swear I tried everything ... anyways ... I finally jus decided to go with a rss block. Ofcourse I thought about it .... I would need to have the current profile nickname in order to properly display the content I'm looking for.

So the url for the rss feed would be as follows ....

http://gospitter.com/m/wall/rss/{current_profile_nickname}

The question is how do I get {current_profile_nickname}.

**{current_profile_nickname} meaning the profile in view .... no matter the member or guest.

 

Quote · 24 Feb 2011

I am assuming your putting this on the profile page. Thats the only place you can get that anyway.

The profile ID is passed to the script when the profile is viewed.

So there are two things you can try to get it.

1) You can just try using the variable this is assigned to when viewing the profile. The ID of the current profile is in $profileID

2) If that does not get your the id, the try reading it from the passed URL value. getID( $_GET['ID'] )

Once you have the ID. you can get the nickname with this function. getNickName($ID)

So you can try.

getNickName($profileID)

Or

getNickName(getID( $_GET['ID'] ))



https://www.deanbassett.com
Quote · 25 Feb 2011

Thanks Deano ... will give it a try and keep you posted ... thanks for always being here in forums when we need you.

Quote · 25 Feb 2011

Yes that worked and I was able to do somewhat of what I wanted to do but how do I but this block on its own page under the profile or does this block have to stay on the main profile page in order to work?

Quote · 27 Feb 2011

how would you get the username from the dolphin site to another site?

would "$memID = $_COOKIE['memberID'];" have to be point towards the dolphin site?

Quote · 23 Dec 2011

to get names from dolphin you have to create a new script which query the database for the names you want.

so much to do....
Quote · 24 Dec 2011

want all usernames

what would this script look like? where would you upload it?

Quote · 24 Dec 2011

check these files to get some idea  :-

inc/classes/BxDolProfileQuery.php

inc/classes/BxDolProfile.php

inc/profile.inc.php

these files have the functions to get the nickname from database, you can check these files and use it for what you want?

so much to do....
Quote · 25 Dec 2011
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.