vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Hidden register button Trouble (https://vborg.vbsupport.ru/showthread.php?t=85936)

SsJ8Darkness 01-07-2003 07:28 AM

Hidden register button Trouble
 
I am having trouble with this mod I am making and I dont understand why it is happening..

this is what I am doing:

add to phpinclude:

//regbutton
$regbutton="";
if ($bbuserinfo['userid']<"1") {
$regbutton="<a href="register.php?s=$session[sessionhash]&action=signup"><img src="darkblue/top_register.gif" alt="Registration is free!" border="0"></a>";
}
//end

and adding $regbutton to the header instead of:

<a href="register.php?s=$session[sessionhash]&action=signup"><img src="darkblue/top_register.gif" alt="Registration is free!" border="0"></a>

and I am getting Parse error: parse error in global.php(274) : eval()'d code on line 10

Brad 01-07-2003 07:44 AM

what are you attempting to do, hide it from everyone but the admin or hide it to anyone thats registerd?.

Tony G 01-07-2003 08:10 AM

If your trying to hide it from anyone who's registered, it's been done by SaintDog:

http://www.vbulletintemplates.com/mo...light=register

filburt1 01-07-2003 12:25 PM

FWIW you have to escape your quotes. Rather than making it more complicated by explaining that, just include the HTML in single quotes, not double quotes.

Brad 01-07-2003 12:33 PM

Quote:

Originally posted by filburt1
FWIW you have to escape your quotes. Rather than making it more complicated by explaining that, just include the HTML in single quotes, not double quotes.
If you do know know what hes talking about, use this:

//regbutton
$regbutton="";
if ($bbuserinfo['userid']<"1") {
$regbutton="<a href=\"register.php?s=$session[sessionhash]&action=signup\"><img src=\"darkblue/top_register.gif\" alt=\"Registration is free!\" border=\"0\"></a>";
}
//end

SsJ8Darkness 01-07-2003 06:23 PM

well I was looking for one and never found on so good.. but if I can get mine working it is a diff mod.. slitly.. and I am doing this for a friend so I am not going to release it here

Tony G 01-07-2003 10:01 PM

So are you trying to do what the mod I posted is doing? Or something different?

SsJ8Darkness 01-08-2003 05:39 AM

it is almost the same.. i am designing a style for someone and I didnt know about the mod you posted until now but I am gonna use mine..

Brad 01-08-2003 06:24 AM

try this:

//regbutton
if ($bbuserinfo['userid']=="0") {
$regbutton="<a href=\"register.php?s=$session[sessionhash]&action=signup\"><img src=\"darkblue/top_register.gif\" alt=\"Registration is free!\" border=\"0\"></a>";
} else {
$regbutton="";
}
//end

Nairb 01-08-2003 12:09 PM

You should use usergroups tho...

filburt1 01-08-2003 12:14 PM

Not necessarily, a user with an id 0 is by definition unregistered. A guest goes in the appropriate usergroup but they still have a userid of 0.

SsJ8Darkness 01-08-2003 04:59 PM

well he decided he wanted the usercp to hide so I moded my working script to this:

//regbutton
$regbutton="<a href=\"usercp.php?s=$session[sessionhash]\"><img src=\"{imagesfolder}/top_profile.gif\" alt=\"Here you can view your subscribed threads, work with private messages and edit your profile and preferences\" border=\"0\"></a>";
if ($bbuserinfo['userid']<"1") {
$regbutton="<a href=\"register.php?s=$session[sessionhash]&action=signup\"><img src=\"darkblue/top_register.gif\" alt=\"Registration is free!\" border=\"0\"></a>";
}
//end

I might use your else.. code thx for your guys help

Brad 01-08-2003 05:16 PM

The else is just my style of coding, ive always done it like that. And no problem :)


All times are GMT. The time now is 12:59 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.01095 seconds
  • Memory Usage 1,732KB
  • 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_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (13)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