Log in

View Full Version : vb variable for user's email address?


58sniper
09-23-2004, 07:53 PM
Is there a variable in vb that holds the users email address when viewing the site? I'm working on an "Add To My Yahoo" option, but want to do a conditional to only show it if the user has a @yahoo. in their email address.

Thanks!

Colin F
09-23-2004, 08:15 PM
It's in the $bbuserinfo array for sure, probably $bbuserinfo[email]

Dean C
09-23-2004, 08:38 PM
Moved to General vBulletin Questions - please read the forum descriptions more closely in future :) You can only get the email of a user if they are registered. If so use:


<if condition="strpos($bbuserinfo['email'], '@yahoo') AND $bbuserinfo['userid'] > 0"></if>


Untested but it should work :)

58sniper
09-23-2004, 08:50 PM
Moved to General vBulletin Questions - please read the forum descriptions more closely in future :)

My fault. I figured this was a safe bet, but I guess not. :ermm:


You can only get the email of a user if they are registered. If so use:


<if condition="strpos($bbuserinfo['email'], '@yahoo') AND $bbuserinfo['userid'] > 0"></if>


Untested but it should work :)

Hmmm...okay, my method of putting it into a template isn't going to work, since vB complains about calling a function. I'll have to find a way around that.

But your method makes me wonder if

<if condition="strpos($bbuserinfo['email'], '@yahoo')"></if>

wouldn't do the same thing. If the user isn't logged in, then $bbuserinfo['email'] couldn't possibly pass the strpos check. Correct?

Thanks for the info!