Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
In or Out? Hack-Version 1.1 Details »»
In or Out? Hack-Version 1.1
Version: 1.00, by ladyfyre ladyfyre is offline
Developer Last Online: Apr 2007 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 08-05-2002 Last Update: Never Installs: 13
 
No support by the author.

Ok all...this is my VERY first hack written all by myself...so if it sucks, don't pick on me!!!!!

What it does: Well, the primary purpose is to give you separate user navigation/button bar for users who are logged in vs. users who have not registered or are not logged in.
**hint** this could also be used to encourage users to register. You can also add banners at the bottom of the unreg_navbar template which will appear to non-members, but will not appear to members. As they say...membership has it's priviledges

Now...my own site is EXTENSIVELY hacked. Many template changes and a few VERY minor hacks here and there of my own invention, along with 35+ hacks from here. If the code in the templates doesn't work perfectly for your site, feel free to change it around. You can also choose to simply copy the code you are currently using in your header file, and delete whatever doesn't apply to each group for that template.
In my version, I have prefixed each image with the imagesfolder replacement code. This is because I offer my users several styles to choose from, and this allows me to easily implement new styles without having things get wonky. Feel free to remove that part if you wish.

Time to implement: about 5 minutes.
Files edited: global.php (1 addition, 1 insertion)
templates edited: header
templates added: loggedin_navbar and unreg_navbar


Ok...here are the steps we need to take:

1. create a new template called loggedin_navbar and paste the contents of the .txt file by that name inside it.
2. create a new template called unreg_navbar and paste the contents of the .txt file by that name inside it.
3. BACKUP YOUR ORIGINAL FIRST, then open global.php and do the following:

Find this section:

PHP Code:
// ###################### Start templates #######################
//prepare default templates **********************
if ($templatesused!='') {
  
$templatesused.=',';

Just after it, the line begins like this:

PHP Code:
$templatesused.='gobutton,timezone,username_loggedout,username_loggedin,phpinclude,headinclude,header,footer 
Insert this:

loggedin_navbar,unreg_navbar,

after header, but before footer in that line.

Still in global.php

Find This:

PHP Code:
// parse PHP include ##################
eval(gettemplate('phpinclude',0,0)); 
Add After it:

PHP Code:
//In or Out Hack
if ($bbuserinfo['userid']<1) {
eval(
"\$menu_navbar = \"".gettemplate("unreg_navbar")."\";");
} else {
eval(
"\$menu_navbar = \"".gettemplate("loggedin_navbar")."\";");
}
//In or Out Hack 

4. Last but not least...

Edit your header template.

You can remove everything between these lines:

PHP Code:
<!-- logo and buttons -->
<!-- 
logo and buttons --> 
and replace them with this:

PHP Code:
$menu_navbar 
and that is all there was to it.

yeah...i know....kid stuff here...but everyone has to start somewhere..and since most of what i have hacked into our boards is only really applicable there, I am glad to finally have something to share here, since the folks here have given so much to me and my site!!!

If support or help is needed, post it here, and I will happily help if I can
Zip and instructions update to include merge the two variables into one.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 08-09-2002, 06:46 PM
ladyfyre's Avatar
ladyfyre ladyfyre is offline
 
Join Date: Nov 2001
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks Sparkz

Just for the record, in case you want to edit your post above to prevent any confusion from those who might not read down the thread further.....

i got a pm saying that the $navbar variable would cause problems as that is a variable used by the vb software. Just thought i would let you know.
Reply With Quote
  #23  
Old 08-09-2002, 06:54 PM
Sparkz's Avatar
Sparkz Sparkz is offline
 
Join Date: Nov 2001
Posts: 544
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When you mention it, you're right... I just took the first thing I could think of.
Reply With Quote
  #24  
Old 08-09-2002, 06:58 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

And here I was thinking that we had cured Sparkz of that thinking stuff.

Quote:
Originally posted by Sparkz
When you mention it, you're right... I just took the first thing I could think of.
Reply With Quote
  #25  
Old 08-09-2002, 07:03 PM
Sparkz's Avatar
Sparkz Sparkz is offline
 
Join Date: Nov 2001
Posts: 544
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hehehe

No comment on that one
Reply With Quote
  #26  
Old 01-02-2003, 08:11 PM
Zombie-F's Avatar
Zombie-F Zombie-F is offline
 
Join Date: Mar 2002
Location: Spook City, USA
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by ladyfyre
PHP Code:
// parse PHP include ##################
eval(gettemplate('phpinclude',0,0)); 
Add After it:

PHP Code:
//In or Out Hack
if_($bbuserinfo['userid']<1) {
eval(
"\$menu_navbar = \"".gettemplate("unreg_navbar")."\";");
} else {
eval(
"\$menu_navbar = \"".gettemplate("loggedin_navbar")."\";");
}
//In or Out Hack 
There's an error in your instructions. The line that says:
PHP Code:
if_($bbuserinfo['userid']<1) { 
Should say:
PHP Code:
if ($bbuserinfo['userid']<1) { 
The underscore causes a fatal error. You may probably want to fix it in the first post here as well as the instructions. Thanks for the useful hack.
Reply With Quote
  #27  
Old 01-02-2003, 08:57 PM
ladyfyre's Avatar
ladyfyre ladyfyre is offline
 
Join Date: Nov 2001
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually, the underscore i think somehow got added here on the forums, because it doesn't exist in the zip file instructions.....and none of my other copies have it there either.
Reply With Quote
  #28  
Old 01-31-2004, 11:19 AM
Zombie-F's Avatar
Zombie-F Zombie-F is offline
 
Join Date: Mar 2002
Location: Spook City, USA
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Argh! I can't get this to work with version 2.3.4. I get the following Error Message:

Parse error: parse error in /home2/www/badassuniverse/forums/global.php on line 347

Fatal error: Call to undefined function: getpermissions() in /home2/www/badassuniverse/forums/index.php on line 10
Reply With Quote
  #29  
Old 02-02-2004, 10:21 PM
Zombie-F's Avatar
Zombie-F Zombie-F is offline
 
Join Date: Mar 2002
Location: Spook City, USA
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone have any ideas as to why this doesn't seem to work with vBulletin 2.3.4? :ermm:
Reply With Quote
  #30  
Old 06-20-2004, 06:54 AM
vdich vdich is offline
 
Join Date: Jul 2003
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Zombie-F
Anyone have any ideas as to why this doesn't seem to work with vBulletin 2.3.4? :ermm:

u have to insert the folow code in php-include not in the global.php:

PHP Code:
if ($bbuserinfo['userid']<1

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

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

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 12:45 AM.


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.16496 seconds
  • Memory Usage 2,323KB
  • Queries Executed 24 (?)
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
  • (11)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete