PDA

View Full Version : Need help with an if statement in my plugin please help


demo7up
09-06-2012, 07:21 PM
I need to hide a plugin if user is not registered. how can i go about doing that in the plugin?

--------------- Added 1346964086 at 1346964086 ---------------

i figured it out

for those who may need this try this in you php code


if($vbulletin->userinfo['usergroupid'] == 5 OR $vbulletin->userinfo['usergroupid'] == 6 OR $vbulletin->userinfo['usergroupid'] == 7) OR $vbulletin->userinfo['usergroupid'] == 10)
{

your code here

}

Scanu
09-06-2012, 10:03 PM
Or just this

If ($show['guest']) {
Your code here
}

demo7up
09-06-2012, 10:22 PM
i see can u help me with one thing please!!!!!

I need to add an if !empty conditional to the following code
Which is being echo'd out fine but some of these variables sometimes return null so i need to not display it if the id variables are null ie: $headid $shirtid etc...


".if(!(empty($shirtid) && empty($headid) && empty($backid))) :."
<div class=\"wowequip\"><br>Equipped Gear<br><br>
<a href=\"http://www.wowhead.com/item=".$headid."\" rel=\"item=".$headid."\"><img class=\"wowequipimg\" src=\"".$bliziconurl."/".$headicon.".jpg\"></a>
<a href=\"http://www.wowhead.com/item=".$neckid."\" rel=\"item=".$neckid."\"><img class=\"wowequipimg\" src=\"".$bliziconurl."/".$neckicon.".jpg\"></a>
<a href=\"http://www.wowhead.com/item=".$shoulderid."\" rel=\"item=".$shoulderid."\"><img class=\"wowequipimg\" src=\"".$bliziconurl."/".$shouldericon.".jpg\"></a>
<a href=\"http://www.wowhead.com/item=".$backid."\" rel=\"item=".$backid."\"><img class=\"wowequipimg\" src=\"".$bliziconurl."/".$backicon.".jpg\"></a>
<a href=\"http://www.wowhead.com/item=".$chestid."\" rel=\"item=".$chestid."\"><img class=\"wowequipimg\" src=\"".$bliziconurl."/".$chesticon.".jpg\"></a>
:. if(!empty($shirtid)) { ."<a href=\"http://www.wowhead.com/item=".$shirtid."\" rel=\"item=".$shirtid."\"><img class=\"wowequipimg\" src=\"".$bliziconurl."/".$shirticon.".jpg\"></a>".}."
<a href=\"http://www.wowhead.com/item=".$tabardid."\" rel=\"item=".$tabardid."\"><img class=\"wowequipimg\" src=\"".$bliziconurl."/".$tabardicon.".jpg\"></a>
<a href=\"http://www.wowhead.com/item=".$wristid."\" rel=\"item=".$wristid."\"><img class=\"wowequipimg\" src=\"".$bliziconurl."/".$wristicon.".jpg\"></a>
<a href=\"http://www.wowhead.com/item=".$handsid."\" rel=\"item=".$handsid."\"><img class=\"wowequipimg\" src=\"".$bliziconurl."/".$handsicon.".jpg\"></a>
<a href=\"http://www.wowhead.com/item=".$waistid."\" rel=\"item=".$waistid."\"><img class=\"wowequipimg\" src=\"".$bliziconurl."/".$waisticon.".jpg\"></a>
<a href=\"http://www.wowhead.com/item=".$legsid."\" rel=\"item=".$legsid."\"><img class=\"wowequipimg\" src=\"".$bliziconurl."/".$legsicon.".jpg\"></a>
<a href=\"http://www.wowhead.com/item=".$feetid."\" rel=\"item=".$feetid."\"><img class=\"wowequipimg\" src=\"".$bliziconurl."/".$feeticon.".jpg\"></a>
<a href=\"http://www.wowhead.com/item=".$finger1id."\" rel=\"item=".$finger1id."\"><img class=\"wowequipimg\" src=\"".$bliziconurl."/".$finger1icon.".jpg\"></a>
<a href=\"http://www.wowhead.com/item=".$finger2id."\" rel=\"item=".$finger2id."\"><img class=\"wowequipimg\" src=\"".$bliziconurl."/".$finger2icon.".jpg\"></a>
<a href=\"http://www.wowhead.com/item=".$trinket1id."\" rel=\"item=".$trinket1id."\"><img class=\"wowequipimg\" src=\"".$bliziconurl."/".$trinket1icon.".jpg\"></a>
<a href=\"http://www.wowhead.com/item=".$trinket2id."\" rel=\"item=".$trinket2id."\"><img class=\"wowequipimg\" src=\"".$bliziconurl."/".$trinket2icon.".jpg\"></a>
<a href=\"http://www.wowhead.com/item=".$mainHandid."\" rel=\"item=".$mainHandid."\"><img class=\"wowequipimg\" src=\"".$bliziconurl."/".$mainHandicon.".jpg\"></a>
</div>

".endif;."



--------------- Added 1346973807 at 1346973807 ---------------

Thats being spit out with

$template_hook['forumhome_above_forums'] .= ""

Scanu
09-06-2012, 11:28 PM
Sorry i didn't really get you