The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
I want to make a script not run if a profile field is empty, but can't seem to find a conditional for this. I don't want this script to run if my profile field is not filled in:
Code:
if($vbulletin->options['xbl_avatar_system_enable_product'] AND $vbulletin->options['xbl_avatar_system_display_navbar'])
{
$xblavatarfield = $vbulletin->options['xbl_avatar_system_userfield'];
eval('$xblavatarhead = "<td style=\"padding:1px\"><a href=\"member.php?".$vbulletin->session->vars[sessionurl]."u=".$vbulletin->userinfo[userid]."\"><img src=\"http://avatar.xboxlive.com/avatar/".$vbulletin->userinfo[$xblavatarfield]."/avatarpic-l.png\" border=\"0\" /></a></td>";');
}
|
|
#2
|
||||
|
||||
|
You can access profile fields like this:
PHP Code:
|
|
#3
|
|||
|
|||
|
So if($vbulletin->userinfo['field254']) would mean that if it is filled in it would run the script and if it wasn't it wouldn't run the script?
|
|
#4
|
||||
|
||||
|
PHP Code:
|
|
#5
|
|||
|
|||
|
Thanx mate!
|
|
#6
|
||||
|
||||
|
:up:
|
|
#7
|
||||
|
||||
|
Let's apply some vBulletin coding standards there
.PHP Code:
|
|
#8
|
|||
|
|||
|
I don't guess there is to prevent someone from using the same profile field as someone else is there?
|
|
#9
|
||||
|
||||
|
The field ID is the same for all users for a particular field. Each user is assigned their own row in the userfield table, which is fetched along with all the other user data.
|
|
#10
|
|||
|
|||
|
So there is no way to detect if a field is the same as another?
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|