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 :)).

bkbelew 09-12-2004 10:47 PM

I got the hack installed... but for some reason it wont let me remove the banner i set in it.. how do i do this? it doesnt show it when i go into admincp and look under footer.

http://forums.fraghard.com/forumdisplay.php?f=104

Lionel 10-08-2004 09:22 PM

how do I get this to display in postbits?

ChurchMedia 10-09-2004 02:29 AM

Quote:

Originally Posted by Lionel
how do I get this to display in postbits?

That's not what it's for. What do you have in mind?

Lionel 10-09-2004 02:33 AM

I am into saving space. Placing an image above does not look good, and pushes page down. Where as there is a nice empty spot between avatar and ratings. I could place a forum specific image in there.

ChurchMedia 10-09-2004 02:40 AM

Well, you could try putting the $foruminfo[forumheader] (or footer) variable into the postbit template and see what happens. I think it should work just fine. Keep in mind that it will put the image (or whatever) in EVERY post. If you try it, let us know if it worked.

Lionel 10-09-2004 03:11 AM

not necessarily. I am currenly using conditionals to display images in first post only, like CNN.

I tried already and nothing happened. That is why I asked.

ChurchMedia 10-09-2004 03:45 AM

Oh ---

I guess the $foruminfo variable isn't being passed to the postbit template. Somehow the post needs to know which forum it's in and look up the header info for that forum. I'm not sure what would need to be done. Sorry I couldn't be of more help. Feel free to modify my code for a new hack and good luck :)

Lee Wilde 10-15-2004 12:12 AM

Installed and working within minutes. If only every mod was so easy, thank you very much.

Chadi 10-19-2004 04:09 AM

I went in "important and maintenance" and "execute sql query".

I tried:

ALTER TABLE `forum` ADD `forumheader` MEDIUMTEXT NOT NULL AFTER `description`;
ALTER TABLE `forum` ADD `forumfooter` MEDIUMTEXT NOT NULL AFTER `forumheader`;

and got this:

An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ';
ALTER TABLE `forum` ADD `forumfooter` MEDIUMTEXT NOT NULL AF

Why?

ChurchMedia 10-19-2004 06:14 AM

Be sure to put your forum prefix before 'forum' in both lines. So it might look like this:

ALTER TABLE `vb_forum` ADD `forumheader` MEDIUMTEXT NOT NULL AFTER `description`;
ALTER TABLE `vb_forum` ADD `forumfooter` MEDIUMTEXT NOT NULL AFTER `forumheader`;

Mokster 10-24-2004 11:54 PM

very nice! works great!

/me installs!

blueintr 10-25-2004 01:31 AM

OK, I think I am missing a step.

I altered the DB, changes the forums file, and made the two template mods -- and I see nothing. I don't even know where to add the header and footer.

Help!

blueintr

blueintr 11-02-2004 09:17 PM

Cockpit error! I figured out how to make it work.

blueintr

Yevgeny 12-20-2004 12:03 AM

Quote:

Originally Posted by blueintr
OK, I think I am missing a step.

I altered the DB, changes the forums file, and made the two template mods -- and I see nothing. I don't even know where to add the header and footer.

Help!

blueintr

have the same problem! Help

ChurchMedia 12-20-2004 01:03 AM

Quote:

Originally Posted by Yevgeny
have the same problem! Help

In you admin cp where you edit a forum, you'll see the two boxes where you can put the html.

Enjoy,

jbd 01-05-2005 07:05 PM

Does anyone have any idea how to get this thing to parse PHP? I really do need this functionality. Alternatively, can anyone tell me why vbulletin does not parse php naturally without having to do all these workarounds? Not the usual "security issues" line, I am praying... :ermm:

The inability to parse PHP is no minor issue. In my eyes it's a really massive problem.

DarrinM 01-05-2005 07:51 PM

I would guess it can but would appreciate help with how to do it

Cheers

sbryan 01-06-2005 12:57 AM

this sounds great. so effectively i could do the following?

at the moment i have an Xbox gaming website at www.xboxworld.com.au

if i wanted to start up another couple of websites, ps2, gamecube etc i could create subforums for each one. and then apply this hack and have custom graphics at the footer and header of each one so that they appeared to be different forums, unique to each differnt site? ie; the existing xbox one with its existing header and footer, a ps2 one with a new header and footer and a gamecube one with a new header and footer etc etc repeat until dizzy.

i could then effectively have one forum that appeared to be any number of different ones as there's a hack to hide forums from the index of the main forum that they live under right?

SVTOA 01-06-2005 03:32 PM

Very nice. For more functionality use a random image cycler if you have more than one sponsor for a particular forum. (sorry if that has been mentioned)

**installed

swantonio 01-06-2005 07:30 PM

Very nice

installato ok :D

zurih 01-06-2005 10:35 PM

thank! its a great hack!
installed

jesse 01-10-2005 11:33 AM

great
now what code would I use for adding flash?

well my question is after adding flash the dropdown menu apears under the flash banner how to fix this?

SVTOA 01-10-2005 12:49 PM

Quote:

Originally Posted by jesse
great
now what code would I use for adding flash?

Very simple, just place the OBJECT tag and associated code in the editor box. I am using a flash banner that stops upon rollover and resumes upon rollout and is hyperlinked to each sponsor's ad. Works great!

Only thing to keep in mind when using FLASH, is that your drop-down boxes will go "below" the flashmovie and not work properly. (it will appear as if your flash file is covering up the drop-down boxes) I placed the code for this hack ABOVE the navbar, so they are unaffected by the flash file....

MentaL 01-15-2005 10:49 PM

Any idea when i try to add a banner the img source is shown up as

http://forum.ragezone.com/baner/staffbanner.jpg><table%20class=

quite confused tbh...

SVTOA 01-15-2005 11:03 PM

Quote:

Originally Posted by mentalrz
Any idea when i try to add a banner the img source is shown up as

http://forum.ragezone.com/baner/staffbanner.jpg><table%20class=

quite confused tbh...


You clearly don't have a closequote after the image tag... Simple HTML error.

/staffbanner.jpg">

MentaL 01-16-2005 12:22 AM

Wooooooooooopsssssss

SVTOA 01-16-2005 01:08 AM

Quote:

Originally Posted by mentalrz
Wooooooooooopsssssss


I take it this means that was the issue?

MentaL 01-16-2005 01:15 AM

ye thanks

SVTOA 01-16-2005 01:39 AM

no problem sir. :)

turkforum 02-27-2005 11:43 PM

Installed and seems good
But the most confisuing part is Why do i have to Put the code again again for subforums.
Is there a way we can automatically put them for subforums


All times are GMT. The time now is 02:21 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.01336 seconds
  • Memory Usage 1,837KB
  • 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
  • (11)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
  • (40)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