vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Header/Footer For Each Forum and Threads in that Forum (https://vborg.vbsupport.ru/showthread.php?t=65890)

Spinball 07-29-2004 08:00 AM

No, the php in the CODE does not work - the PHP bit is not run.
The image I showed you is an example of what it SHOULD look like if the PHP worked.
I suspect what I need to do is alter the hack itself to process the header and footer so that php script is run.
I'm confidant with PHP but hacking vBulletin is something entirely different.

sv1cec 07-29-2004 09:44 AM

Quote:

Originally Posted by Spinball
No, the php in the CODE does not work - the PHP bit is not run.
The image I showed you is an example of what it SHOULD look like if the PHP worked.
I suspect what I need to do is alter the hack itself to process the header and footer so that php script is run.
I'm confidant with PHP but hacking vBulletin is something entirely different.

OK, so you have an HTML file you want to include in your Forum Home page?

Here is what I tried (and IT WORKED!!!)

Edit your index.php file and find:

PHP Code:

require_once('./includes/functions_forumlist.php'); 

Below that, add:

PHP Code:

// effort to help

globalize($_REQUEST, array(
'file' => STR,
'title' => STR
));

$file="announcement.htm";

$exts "html, htm, txt, shtml";
$formats explode(",",str_replace(" """strtolower($exts)));
function 
checkfile($file$formats) {
  
$ext strtolower(substr($file,-strpos(strrev($file),'.')));
  if(!
in_array($ext$formats)) return FALSE;
  if(!
file_exists($file)) return FALSE;
  if( 
substr($file,0,5) != "./../" && substr($file,0,7) != "http://" ) return TRUE
  return 
FALSE;
}

if (
checkfile($file$formats)) {
$fd fopen ($file,"r");
$buffer fread($fd,filesize($file));
fclose ($fd);
$buffer str_replace('"',"'",$buffer);
} else {
$errormessage "There is an error with this link: $file";
}
// $navbits[""] = $pagetitle;
// $navbits = construct_navbits($navbits);

eval("\$HTML = \"$buffer\";");

// end of effort to help 

Remember to change $file="announcement.htm" in the code above, to whatever your file name is.

Then, go into your FORUMHOME template and find :

HTML Code:

$navbar
Below that, add:

HTML Code:

$HTML
It worked on my forum, but you might have to play a bit with it, I am not sure if errors are handled etc.

Rgds

Spinball 07-29-2004 11:30 AM

That's a nice, bit of code, but no, I want to include an HTML file at the top of one specific forum.

sv1cec 07-30-2004 04:32 AM

Quote:

Originally Posted by Spinball
That's a nice, bit of code, but no, I want to include an HTML file at the top of one specific forum.

OK, then instead of FORUMHOME, go to FORUMDISPLAY and right below the navbar enter the following code:

[html]
<if condition="$forumid=XYZ">
$HTML
</if>

Remember to change XYZ with the forum id of the forum you want the external HTML file to show. Let me know if it works.

Rgds

Spinball 07-31-2004 07:42 AM

Again, that's great but it's a whole chunk of code for the header for ONE forum. That's a lot of code to include if you have 30 forums.
Might it not be easier to allow the hack to work on a bit of PHP code?

sv1cec 07-31-2004 01:22 PM

Quote:

Originally Posted by Spinball
Again, that's great but it's a whole chunk of code for the header for ONE forum. That's a lot of code to include if you have 30 forums.
Might it not be easier to allow the hack to work on a bit of PHP code?

Sorry, that's all I can do. Maybe the hack author can help you more.

Rgds

Spinball 07-31-2004 01:34 PM

Your help is appreciated.

roundhost 08-30-2004 06:21 AM

Fantastic! Installed!

ChurchMedia 09-02-2004 02:25 AM

Quote:

Originally Posted by mrlb.com
ChurchMedia - working well for forum homepages but not forum threads in that forum...

Make sure you follow this instruction:

PHP Code:

-----------------------STEP 4-----------------------------
This will put the header/footer on every thread in the forum

In Template SHOWTHREAD FIND
:
<------------------------------------------->
$navbar
<------------------------------------------->
BELOW ADD:
<------------------------------------------->
$foruminfo[forumheader]
<------------------------------------------->

FIND:
<------------------------------------------->
$footer
<------------------------------------------->
ABOVE ADD:
<------------------------------------------->
$foruminfo[forumfooter


ChurchMedia 09-02-2004 02:30 AM

Quote:

Originally Posted by sv1cec
Sorry, that's all I can do. Maybe the hack author can help you more.

Rgds


Thanks to sv1cec for trying to get this to work for Spinball. Unfortunately, vBulletin won't parse PHP in ANY template. I think what you are looking for is a completely different hack. I'm not sure how it would work. Sorry :(


(P.S. New hip is healing nicely. Thanks for the nice notes :)).


All times are GMT. The time now is 02:18 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.01727 seconds
  • Memory Usage 1,762KB
  • 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
  • (2)bbcode_html_printable
  • (3)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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