vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   In or Out? Hack-Version 1.1 (https://vborg.vbsupport.ru/showthread.php?t=41967)

[D]Vincent 08-06-2002 01:34 PM

Vincent]Just wondering but wouldn't it make more sense to use
PHP Code:

if ($bbuserinfo['groupid']!=1

eval(
"\$unreg_navbar = \"".gettemplate("unreg_navbar")."\";");  

else {  
eval(
"\$loggedin_navbar = \"".gettemplate("loggedin_navbar")."\";");  


than

PHP Code:

if ($bbuserinfo['userid']<1

eval(
"\$unreg_navbar = \"".gettemplate("unreg_navbar")."\";");  

else {  
eval(
"\$loggedin_navbar = \"".gettemplate("loggedin_navbar")."\";");  


Works both way but most people would have used the first one, I wouldn't have even thought about using it that way lol btw nice hack

ladyfyre 08-06-2002 02:42 PM

[D]Vincent: first of all, i must be losing my mind, because the two blocks of code you just posted appear to be identifcal. unless of course you were trying to be facetious :)
second: while this would have been about a forty second project for many on these boards....it actually took me a couple of hours to get it all done and together...much of that spent looking through php sites and the online manual for the exact thing i was trying to find. My brain has always been wired a little backwards i guess...so i suppose i honestly would not be surprised to find out that i had done different than the norm. Before my site went to vb, i had actually mastered the art of making cgi changes to UBB....and made at least two i am aware of that the tech staff at infopop said wasn't even possible to do without corrupting the db. Unfortunately, my talent has always been having the ideas for things that would make things better....knowing just enough to know what mechanics would work behind it......and having no clue how to write the code to make those mechanics a reality.

Sorry...i will shut up....i guess i am a bit like a mom defending her first born!

g-force2k2 08-06-2002 03:00 PM

[D]Vincent your's imo would not work... because if you're a guest you don't have a usergroup so it would not equal one but zero...

ladyfyre nice work... but you can change it too...

PHP Code:

if ($bbuserinfo[userid]==0

eval(
"\$unreg_navbar = \"".gettemplate("unreg_navbar")."\";");  

else {  
eval(
"\$loggedin_navbar = \"".gettemplate("loggedin_navbar")."\";");  


g-force2k2

Boofo 08-09-2002 11:19 AM

Great hack there, young lady. :)

I'm using a javascript menu so this is exactly what I need. I can make two menus and call whichever one I need.

Keep up the great work! ;)

Sparkz 08-09-2002 11:36 AM

Hmm - why not just do like this?

EDIT: Should have chosen a variable that's not used by vB from the start :)
Thanks ladyfyre for reminding me :)

PHP Code:

if ($bbuserinfo['userid']<1) { 
     eval(
"\$mynavbar = \"".gettemplate("unreg_navbar")."\";");  
} else {  
     eval(
"\$mynavbar = \"".gettemplate("loggedin_navbar")."\";");  


And then just use that one variable...
No point in having two different variables for the navbar :)

Boofo 08-09-2002 12:07 PM

I was going to suggest the same thing earlier, but I think she did a great job with her first hack. It will work either way. ;)

Quote:

Originally posted by Sparkz
Hmm - why not just do like this?
PHP Code:

if ($bbuserinfo['userid']<1) { 
     eval(
"\$navbar = \"".gettemplate("unreg_navbar")."\";");  
} else {  
     eval(
"\$navbar = \"".gettemplate("loggedin_navbar")."\";");  


And then just use that one variable...
No point in having two different variables for the navbar :)


Webmasta XT 08-09-2002 01:56 PM

very nice hack...

ladyfyre 08-09-2002 03:07 PM

Thanks bunches guys...and Sparkz, that is a great idea....i guess sometimes i miss the forest for all the trees!!

Also, special thanks to Boofo :)

You are truly a born diplomat :)

Updating the original file and instructions to include the change.

Boofo 08-09-2002 03:22 PM

I believe in giving credit where it is due. You did a great job and, in time you'll learn, as we all do, easier ways to do things that can acclomplish the same task in about a hundred different ways. :) I'm still learning and I still have a long way to go.

I just wish my hack was even close to being as useful as yours. Maybe your brain isn't as backwards as you think it is. Looks like it is functioning 110 % to me. :)

Keep up the great work. ;)

Quote:

Originally posted by ladyfyre
Thanks bunches guys...and Sparkz, that is a great idea....i guess sometimes i miss the forest for all the trees!!

Also, special thanks to Boofo :)

You are truly a born diplomat :)

Updating the original file and instructions to include the change.


Sparkz 08-09-2002 06:40 PM

Not having an option to show different navbars to logged in and not logged in users as default always annoyed me. I have something similar on my own board.

Good luck with your future hacks :)


All times are GMT. The time now is 01:12 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.00996 seconds
  • Memory Usage 1,757KB
  • 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
  • (5)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete