Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
  #1  
Old 09-25-2012, 03:37 AM
Superorb Superorb is offline
 
Join Date: Feb 2012
Posts: 195
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to hide FB Connect button on certain pages?

I hide the FB Connect button to non-members and only display it to logged in members. But, when I log out it shows up on the page that displays the cleared cookies. How can I hide the FB Connect button from this page only? Specifically, all iterations of login.php? Can I run CSS code only when the page was loaded and I'll just do "display:none" and be done with it? Or do I have to do a conditional statement like I had to do to hide the button from non-members? It breaks my style and looks wrong too.
Attached Images
File Type: jpg FB-button-cookies-cleared.jpg (32.5 KB, 0 views)
Reply With Quote
  #2  
Old 09-25-2012, 02:47 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can add to your condition something like THIS_SCRIPT == 'login'
Reply With Quote
Благодарность от:
Superorb
  #3  
Old 09-25-2012, 04:26 PM
Superorb Superorb is offline
 
Join Date: Feb 2012
Posts: 195
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Would this work? I'm still new to PHP conditionals. <vb:if "THIS_SCRIPT == 'login'">Content here</vb:if>
Reply With Quote
  #4  
Old 09-25-2012, 11:26 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That should work. Just try it on your test site and you will see.
Reply With Quote
  #5  
Old 09-26-2012, 12:11 AM
Superorb Superorb is offline
 
Join Date: Feb 2012
Posts: 195
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Tried it and it threw out an error. I used exactly what I wrote in the post above yours.

The following error occurred when attempting to evaluate this template:
An empty or invalid 'if' condition was found.

EDIT: Tried <vb:if condition="THIS_SCRIPT == 'album'">Content here</vb:if> and it worked, but I've run into another problem. Apparently you can't nest if/else conditionals or I did it incorrectly. Is there another way to accomplish this? I only want the FB connect button to show up to logged in users, but for some reason when you log out it still thinks you're a logged in user and shows the Connect button anyways. This is what I tried:

Code:
<!-- If Template=Login then hide FB Connect Button -->
<vb:if condition="THIS_SCRIPT == 'login'">&nbsp;<vb:else>

<!-- Only show the FB Connect button to logged in users -->
<vb:if condition="$bbuserinfo['userid'] == 0">
<span style="display:none">&nbsp;</span>
<vb:else />

<li id="fb_headerbox" class="hidden">

<vb:if condition="$show['facebookuser']">

	<a id="fb_link" href="{vb:raw profileurl}">
		<img id="fb_squarepic" width="16" height="16" alt="{vb:rawphrase facebook_connect}" src="{vb:raw squarepicurl}" />
		<img id="fb_icon" width="14" height="14" alt="{vb:rawphrase facebook_connect}" src="{vb:stylevar imgdir_misc}/facebook.gif" />
	</a>
<vb:else />
	<a id="fb_loginbtn" href="#"><img src="{vb:stylevar imgdir_misc}/facebook_login.gif" alt="{vb:rawphrase facebook_connect}" /></a>
</vb:if>

</li>

<!-- Closing IF from FB Connect above for logged in users -->
</vb:if>

<!-- Closing IF from FB Connect Template Hide -->
</vb:if>
EDIT@: Can I dd an AND or an OR to this conditional to exclude this template?

<vb:if condition="$bbuserinfo['userid'] == 0">

EDIT3: I tried <vb:if condition="$show['member']"> instead of <vb:if condition="$bbuserinfo['userid'] == 0">
and it's working now Thanks Lynne for working me through it.

Could you please take a look at another problem I'm having in regards to none of the human verification questions working? Also please mark this thread Solved
Reply With Quote
Reply

Thread Tools
Display Modes

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 04:05 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08681 seconds
  • Memory Usage 2,215KB
  • Queries Executed 12 (?)
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
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (1)post_thanks_box_bit
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (1)postbit_attachment
  • (5)postbit_onlinestatus
  • (5)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_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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete