Member variables

Hi, I'd like to know what the member variables are for capturing member information, particularly their member group i.e. member or guest, or paying member group. I would also like to know a user's sex so that I can show different messages to female and male members. Thanks

Quote · 2 Mar 2011

you most likely would benefit from a customized query script

 

SELECT * FROM 'Profiles' WHERE 'gender' = 'male' would get you some of the information you are seeking, but yes, you get that info from the database, as you most likely dont need that info publically accessible, so you would need a custom module for the admin panel. or use deano's tools to run the sql queries.

 

When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support
Quote · 2 Mar 2011

No you missed the point. I want to capture the variable about a member as they navigate the site, so that I can show them customised content, messages etc based on their sex, membership level etc. Querying the batabase is likely pointless as there should be variables carying most of this info, or at the very least I would need the variable to capture a user's ID so that I could query the database!

Quote · 2 Mar 2011

well in that case, you most likely need to post this in the jobs market and see if you can get somebody to write you a module that would do what you are seeking.

No you missed the point. I want to capture the variable about a member as they navigate the site, so that I can show them customised content, messages etc based on their sex, membership level etc. Querying the batabase is likely pointless as there should be variables carying most of this info, or at the very least I would need the variable to capture a user's ID so that I could query the database!

 

When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support
Quote · 2 Mar 2011

Thanks for your suggestions Dos, but I don't need a mod, I just need a bit of info from someone who knows the answer to my question. If you don't know the answer, can you please give others that may, a chance to reply. Thx Wink

Quote · 2 Mar 2011

well i am going to state this as clearly as i can, and hopefully you dont get your knickers twisted. i provided you an answer based on your question, and yes, you need a mod. there is no way to just get that information. furthermore as many people can answer this post as want, and you see they are not dropping in here by the droves, because there is no 'simple' answer for you.

 

yeah thnx

When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support
Quote · 2 Mar 2011

To help DosDawg answer this question. I'll provide a slightly different answer.

There are no global variables other than the ones defined in inc/header.inc.php that contains config info.

The rest is obtained on demand by quering the database or calling dolphin php functions.

If everything was stored in a globally accessable list of variables then this script would require more memory than a server could provide.

Things are just not done that way for large scripts.



https://www.deanbassett.com
Quote · 2 Mar 2011

Thanks for chipping in Deano. I wasn't suggesting the vars would just be floating in the memory. So I can call the info I want through functions? I saw this in another thread where you responded;

getProfileInfo($this -> oProfileGen -> _iProfileID) function returns array

 The user's username/nick name: $aProfileInfo['NickName']

getMemberMembershipInfo($aProfileInfo['ID']) function returns an array

The user's membership id extracted from array: $sMemberShipInfo['ID'] - guest/not loggedin would be 0 or 1?

Are the above examples fairly universal, at least within classes? And would I get a user's sex with $aProfileInfo['Sex'] ? Or would I have to query the DB with the user's ID to get that? Thanks for your help.

Quote · 2 Mar 2011

That example the array would contain all profile fields in the array, so yes, sex would be there as well.

Members logged in always have a member id above 0. An id of 0 or null would be a guest.

There are number of other quick functions you may find useful. These are globally available on all pages in dolphin without having to import the class containing the function.

Take a look at the *.inc.php in the inc folder. Such as utils.inc.php and profiles.inc.php and admin.inc.php contain some of the most useful ones.

Such as

getLoggedId
isMember
GetMembershipStatus
getNickName

And many others.




https://www.deanbassett.com
Quote · 2 Mar 2011

Thanks very much Deano. That's exactly what I wanted to know!

Quote · 2 Mar 2011

So I managed to do what I was wanting.

 

First of all I wanted to change the standard "Access denied... your member level does not allow...."  messages to link to the my_membership page, and in the case of a registered member they would see the payment options, and in the case of a guest, they would be redirected to the join page. Just used a header location based on isLogged for that.

 

Second, I wanted to display a message just for female members. I used Deano's Tools for that, and in particular the php block system. I used the sex var for that, and made the message personal with the nickName var within the php block, and the great thing is that it seems that if the output from a query is null or false, and there is nothing to display, the whole block will not display. So male members do not see an empty block. I can think of 101 uses for the php blocks!

Quote · 5 Mar 2011

please share the code if you would be so kind. it would be very helpful to the community.

So I managed to do what I was wanting.

 

First of all I wanted to change the standard "Access denied... your member level does not allow...."  messages to link to the my_membership page, and in the case of a registered member they would see the payment options, and in the case of a guest, they would be redirected to the join page. Just used a header location based on isLogged for that.

 

Second, I wanted to display a message just for female members. I used Deano's Tools for that, and in particular the php block system. I used the sex var for that, and made the message personal with the nickName var within the php block, and the great thing is that it seems that if the output from a query is null or false, and there is nothing to display, the whole block will not display. So male members do not see an empty block. I can think of 101 uses for the php blocks!

 

Quote · 6 Mar 2011

Well simply, Dolphin's permission messages stink. Non members and members who aren't on a high enough membership (usually paid) get the same, bland message saying they don't have permission to view the page. This confuses ordinary web surfers who think that they've hacked into a restricted area, might get caught, and so flee rapidly (to your rival's site). There's no marketing or sales device here to capture them! So first of all change all those messages so they have a bit more hype that makes sense to both guests and members. Include a link to ./m/membership/index  Now open up ./modules/membership/index.php. Look around line 47 for check_logged();. Under that put the following;

if(!$GLOBALS['logged']['member']){
 header("Location: ../../join.php");
}

All this does is allow you to send members and guests to the "upgrade membership" page, but while members will stick to that page, guests will be sent on to the join page. It still isn't the ideal, but it enables one link to work for each type. What I'd really like to do is present the member with the upgrade page instead of show them the lame message, and direct guests to the join page instead of show them the lame message, but I haven't explored the "dolphin way" of doing things yet.

 

For showing custom messages based on user's sex, first of all get Deano's Tools mod, and install it. This mod enables you to add custom php blocks to pages, just like html blocks, but php instead. If you lnow a thing or two about coding php you can probably do anything with these php blocks, though I'm not sure how secure it is as haven't dug too deep. But if like me you haven't had time to get your head arround dolphin's coding style and module system yet, this can offer a quick and easy solution. Deano's Tools also have other features built in too!

For displaying the custom message to female members I am just using dolphin's user variables in the php block in a simple "if" stement. This is what goes in my php block;

$userid = getLoggedId(); // this gets the user's id
$userinf = getProfileInfo($userid); // this gets their profile array from their id
$username = $userinf['NickName']; // returns their nickname
$usersex = $userinf['Sex']; // here's their sex!

if($usersex == "female"){
echo '
<b>Hey '.$username.'</b><br />
You're a girl. I'm a guy. How about a quick shag under the apple tree?
Love Admin xxx

';
}

I'd strongly suggest you change the message though Surprised

Quote · 6 Mar 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.