Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-06-2012, 07:21 PM
demo7up demo7up is offline
 
Join Date: Apr 2007
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Need help with an if statement in my plugin please help

I need to hide a plugin if user is not registered. how can i go about doing that in the plugin?

--------------- Added [DATE]1346964086[/DATE] at [TIME]1346964086[/TIME] ---------------

i figured it out

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

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

your code here

}
Reply With Quote
  #2  
Old 09-06-2012, 10:03 PM
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Posts: 829
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Or just this
PHP Code:
If ($show['guest']) {
Your code here

Reply With Quote
  #3  
Old 09-06-2012, 10:22 PM
demo7up demo7up is offline
 
Join Date: Apr 2007
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...

Code:
".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 [DATE]1346973807[/DATE] at [TIME]1346973807[/TIME] ---------------

Thats being spit out with

Code:
$template_hook['forumhome_above_forums'] .= ""
Reply With Quote
  #4  
Old 09-06-2012, 11:28 PM
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Posts: 829
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry i didn't really get you
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:21 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04694 seconds
  • Memory Usage 2,200KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete