vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Help The Mentally Challenged (https://vborg.vbsupport.ru/showthread.php?t=46143)

caislander 11-27-2002 03:39 AM

Help The Mentally Challenged
 
Hey guys I am feeling pretty darn challenged :( I need to add a browser check to my forum main page so I can serve a watered down version of our header to viewers using NS 4.xx, so I have this function
PHP Code:

 <?php 
function doriteheader() { 
// serve correct header by browser 
global $HTTP_USER_AGENT

if (
eregi("Mozilla/4.",$HTTP_USER_AGENT)) { // browser is NS4 
return "$footer"

} else { 
// other browsers 
return $header




?>

I tried placing this in the template, but that didn?t work so I am (don?t laugh too hard I new at this) assuming that means I can?t include php directly in the template. So if that is true where do I place this function so that I can control which header is called in the forum_home template? (I used footer in place of my second header name so it was easy to see if this worked or not)

ps; if this isn't where this post should be, someone please move it where it should
go
As always thanks for your time

Velocd 11-27-2002 09:23 PM

Not entirely sure what your intent is, since I briefly skimmed to the problem, but you are correct that PHP code cannot be added directly into the template.

If it is affecting the forum_home template, try placing the code in the index.php file of your forum root directory.

drews 11-27-2002 09:26 PM

you can try puttin that code in the phpinclude template. I think that is the only template that allows PHP.

Erwin 11-28-2002 12:25 AM

drews is correct. Also, the forum global.php file can be used too.

drews 11-28-2002 01:52 PM

Wow...i was right..strike up another tally for the amount of time i have been right....Hey, I am up to.... one ....now... lol.

caislander 12-05-2002 03:32 AM

I still haven't been able to figure this out :( I tried putting my function in each of the places suggested thus far and can't get it to work. So let me try & tell you what I am trying to do maybe someone can suggest a better way.
We have a header that fails (really goes to pieces) in NS 4.xx so somehow we need to determine if the viewer is useing NS 4.xx and if so serve them an alternate header (actualy an alternate set of buttons) is there some other way to do it?


All times are GMT. The time now is 02:26 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.01829 seconds
  • Memory Usage 1,721KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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