Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 09-13-2002, 06:58 AM
Odil Odil is offline
 
Join Date: Apr 2002
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Two headers

I have seen a hack for this for parts of the board that I wanted to place a differant hearder. I can't seem to find it here. Can anyone help me?

Odil
Reply With Quote
  #2  
Old 09-13-2002, 07:16 AM
Neo's Avatar
Neo Neo is offline
 
Join Date: Oct 2001
Location: Anywhere
Posts: 1,817
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

in global.php find

PHP Code:
eval("\$header .= \"".gettemplate('header')."\";"); 
and place as many of these under it as you want headers

PHP Code:
eval("\$header02 .= \"".gettemplate('header02')."\";"); 
header02 would be the template you want to put that info in and $header02 would be the variable.
Reply With Quote
  #3  
Old 09-13-2002, 07:19 AM
Hooper's Avatar
Hooper Hooper is offline
 
Join Date: Oct 2001
Location: St. Louis, Mo
Posts: 286
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Odil
I have seen a hack for this for parts of the board that I wanted to place a differant hearder. I can't seem to find it here. Can anyone help me?

Odil

Not sure this really requires a hack. Just a bit of code change is all.


1) Create a new header template for use.
2) Add your components to your global

EX:

// parse PHP include ##################
eval(gettemplate('phpinclude',0,0));

// parse css, header & footer ##################
eval("\$headinclude = \"".gettemplate('headinclude')."\";");
eval("\$header .= \"".gettemplate('header')."\";");
eval("\$header2 .= \"".gettemplate('header2')."\";");
eval("\$footer .= \"".gettemplate('footer')."\";");

Notice the above:
eval("\$header2 .= \"".gettemplate('header2')."\";");

This is an addition to the Global.php file in your home dir (not your /admin/global.php)

Now add $header2 or whatever name you want to give it to the list of global templates within the global.php file.

Ex:

$templatesused.='gobutton,timezone,username_logged out,username_loggedin,phpinclude,headinclude,heade r,header2,footer,forumjumpbit,forumjump,nav_linkof f,nav_linkon,navbar,nav_joiner';
$templatesused.=',pagenav,pagenav_curpage,pagenav_ firstlink,pagenav_lastlink,pagenav_nextlink,pagena v_pagelink,pagenav_prevlink';
unset($templatecache);
cachetemplates($templatesused);

Notice header2 in the above

Should do it for the most part and in my best estimate. But there may be a need to add it to /admin/functions.php depending upon where you place the $header2 include call.

EX: If you wanted to place the $header2 call within the standarderror template for example, it would not work just placing it within the global.php. You will need it in both the global as well as within the functions.php within the /admin dir.

// ###################### Start standarderror( #######################
function standarderror($error="",$headinsert="") {
// print standard error page
global $header,$header2,$footer,$headinclude,$headnewpm,$ toplinks,$forumjump,$timezone,$bbtitle,$hometitle, $bburl,$homeurl,$copyrighttext,$privacyurl,$contac tuslink,$webmasteremail,$technicalemail,$faxnumber ,$address,$companyname,$titleimage,$replyimage,$ne wthreadimage,$closedthreadimage,$lastvisitdate,$ti menow,$session,$logincode;

=====================

Notice that standarderror now contains $header2 include call. Now I can place $header2 within the standarderror template and it will call the the second header template you created as listed within the global.php.

Hope this helps.
Hooper
Reply With Quote
  #4  
Old 09-13-2002, 07:20 AM
Hooper's Avatar
Hooper Hooper is offline
 
Join Date: Oct 2001
Location: St. Louis, Mo
Posts: 286
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Neo,

You posted at the same time.
Reply With Quote
  #5  
Old 09-13-2002, 07:35 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Odil
I have seen a hack for this for parts of the board that I wanted to place a differant hearder. I can't seem to find it here. Can anyone help me?
Odil
Install Advanced Templates, then edit your header template and design it like this:
PHP Code:
[[((your conditional))]]

Your header 1 if this condition applies 

[[/((your conditional))]]
[[(!(
your conditional))]]

Your header 2 if this condition does NOT apply 

[[/(!(your conditional))]] 
You can add other conditionals too if you have more than 2 options..
Reply With Quote
  #6  
Old 09-13-2002, 07:37 AM
Hooper's Avatar
Hooper Hooper is offline
 
Join Date: Oct 2001
Location: St. Louis, Mo
Posts: 286
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's a neat one.
Reply With Quote
  #7  
Old 09-13-2002, 08:07 AM
Neo's Avatar
Neo Neo is offline
 
Join Date: Oct 2001
Location: Anywhere
Posts: 1,817
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Hooper
Hi Neo,

You posted at the same time.
Great Minds
Reply With Quote
  #8  
Old 09-13-2002, 08:09 AM
Hooper's Avatar
Hooper Hooper is offline
 
Join Date: Oct 2001
Location: St. Louis, Mo
Posts: 286
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Reply With Quote
  #9  
Old 09-15-2002, 07:46 AM
Odil Odil is offline
 
Join Date: Apr 2002
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent post. Worked the first time! I appreciate the detail that you provided.

Thanks
Odil

Quote:
Originally posted by Hooper



Not sure this really requires a hack. Just a bit of code change is all.


1) Create a new header template for use.
2) Add your components to your global

EX:

// parse PHP include ##################
eval(gettemplate('phpinclude',0,0));

// parse css, header & footer ##################
eval("\$headinclude = \"".gettemplate('headinclude')."\";");
eval("\$header .= \"".gettemplate('header')."\";");
eval("\$header2 .= \"".gettemplate('header2')."\";");
eval("\$footer .= \"".gettemplate('footer')."\";");

Notice the above:
eval("\$header2 .= \"".gettemplate('header2')."\";");

This is an addition to the Global.php file in your home dir (not your /admin/global.php)

Now add $header2 or whatever name you want to give it to the list of global templates within the global.php file.

Ex:

$templatesused.='gobutton,timezone,username_logged out,username_loggedin,phpinclude,headinclude,heade r,header2,footer,forumjumpbit,forumjump,nav_linkof f,nav_linkon,navbar,nav_joiner';
$templatesused.=',pagenav,pagenav_curpage,pagenav_ firstlink,pagenav_lastlink,pagenav_nextlink,pagena v_pagelink,pagenav_prevlink';
unset($templatecache);
cachetemplates($templatesused);

Notice header2 in the above

Should do it for the most part and in my best estimate. But there may be a need to add it to /admin/functions.php depending upon where you place the $header2 include call.

EX: If you wanted to place the $header2 call within the standarderror template for example, it would not work just placing it within the global.php. You will need it in both the global as well as within the functions.php within the /admin dir.

// ###################### Start standarderror( #######################
function standarderror($error="",$headinsert="") {
// print standard error page
global $header,$header2,$footer,$headinclude,$headnewpm,$ toplinks,$forumjump,$timezone,$bbtitle,$hometitle, $bburl,$homeurl,$copyrighttext,$privacyurl,$contac tuslink,$webmasteremail,$technicalemail,$faxnumber ,$address,$companyname,$titleimage,$replyimage,$ne wthreadimage,$closedthreadimage,$lastvisitdate,$ti menow,$session,$logincode;

=====================

Notice that standarderror now contains $header2 include call. Now I can place $header2 within the standarderror template and it will call the the second header template you created as listed within the global.php.

Hope this helps.
Hooper
Reply With Quote
  #10  
Old 09-15-2002, 08:51 AM
Hooper's Avatar
Hooper Hooper is offline
 
Join Date: Oct 2001
Location: St. Louis, Mo
Posts: 286
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You're welcome Odil,

Best wishes to you.
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 05:07 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.04178 seconds
  • Memory Usage 2,263KB
  • Queries Executed 13 (?)
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
  • (3)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete