vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   How to hide FB Connect button on certain pages? (https://vborg.vbsupport.ru/showthread.php?t=288274)

Superorb 09-25-2012 03:37 AM

How to hide FB Connect button on certain pages?
 
1 Attachment(s)
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.

Lynne 09-25-2012 02:47 PM

You can add to your condition something like THIS_SCRIPT == 'login'

Superorb 09-25-2012 04:26 PM

Would this work? I'm still new to PHP conditionals. <vb:if "THIS_SCRIPT == 'login'">Content here</vb:if>

Lynne 09-25-2012 11:26 PM

That should work. Just try it on your test site and you will see.

Superorb 09-26-2012 12:11 AM

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 :)


All times are GMT. The time now is 08:30 AM.

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.01003 seconds
  • Memory Usage 1,724KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete