View Full Version : How to include header and footer of the forum?
soccerclue
08-14-2003, 03:33 AM
Hi,
I create a php file for my main page and I would like to have the header and footer of the forum to be included in that php file. What variable should I use?
And, what should I add in order to have that php file having access from the username and password from vBulletin forum. What should I include in that file? Somewhere I read that we need to require global.php and verifyusername? Please help me.
g-force2k2
08-14-2003, 03:45 AM
your php file needs to have
require( './global.php' );
then it should eval a tempate ie:
eval( "dooutput( \"" . gettemplate( 'yourtemplatenamehere' ) . "\" );" );
then you have to create a new template ( admin cp > style options > add template ) and that template name needs to go in the eval function as in the code stated above "yourtemplatename"
then in that template for the header its $header
and the footer is $footer
regards,
g-force2k2
soccerclue
08-14-2003, 03:58 AM
Thanks a lot g-force2k2. I have one more question. Do we need to add verifyusername function for the authentication after adding the global.php?
g-force2k2
08-14-2003, 06:29 AM
you don't really need to add any kind of authentication unless you wanted the script to be restricted...
for guest restriction you can use
if( !$bbuserinfo['userid'] )
{
show_nopermission( );
}
regards,
g-force2k2
soccerclue
08-14-2003, 06:36 AM
All right..I am new actually. Let's say if I want to create a php processing form and using the current member's username and password from my forum..I would like to record each username's submission form values. Therefore, I need to make sure when the visitor submitting the form, he is already a member in my site. Can it be achieved with your solution above?
soccerclue
09-03-2003, 09:51 PM
Hi...I have just created a page and the header and the footer can display but without the image. Can you please help me what's wrong? The page is at http://www.asianguild.com/forum/competition.php
And one more question, how can I display number of members, threads, and posts on the page?
And can you let me know what should I include to create the login and logout box on the page?
SVTBlackLight01
09-04-2003, 10:54 AM
Since the page is in the forum directory it would be easier just to create a new template which would start out something like this:
{htmldoctype}
<html>
<head>
<title>$bbtitle - whatever</title>
$headinclude </head> <body> $header
and end with:
$footer
</body>
</html>
The rest is just basic HTML.
You can call the entire template with like file like this:
<?php
error_reporting(7);
require('./global.php');
eval("dooutput(\"".gettemplate("templatename")."\");");
?>
This would be competition.php in your case.
That should work.
As for the other two questions, I believe they have both been released here as hacks.
soccerclue
09-04-2003, 09:24 PM
Thanks a lot for the help. I really appreciate your help. Do you know what is the exact code to display the login/logout box and the number of posts, threads, and members? or do you know what are the name of the hacks? But the pages I want to display is not related with vb pages.
SVTBlackLight01
09-05-2003, 10:59 AM
There are a few of each here: https://vborg.vbsupport.ru/search.php?s=&action=showresults&searchid=650675&sortby=lastpost&sortorder=descending
soccerclue
09-05-2003, 11:17 AM
wow..really thanks a lot for your help..i really appreciate your help...it helps me now..thanks
soccerclue
09-08-2003, 04:44 PM
All right. I have a problem here to make the header and footer. If I call the template which has the html code inside, the header and footer can be displayed but the content of the php page is not displayed. In fact, in my php page, I have also included the html stuff. What I fail is calling the $header, $footer, and $headinclude variable. If I don't want to create template, how should I call these variables in my php page? Hope you understand what I mean.
Is it something like this to call the variable?
eval("\$header = \"".gettemplate('header')."\";");
soccerclue
09-08-2003, 05:00 PM
I am confused here....in the php page..I just put the variable like $header in the place where I want it to be shown..and it works except the button pictures are not displayed..I am still confused how to call the variable. What is require("global.php") for?
assassingod
09-08-2003, 08:14 PM
require("./global"); requires root/global.php which just calls basic things vB needs (header,footer,user stuff etc)
soccerclue
09-08-2003, 08:49 PM
so when i call the variables like $header, $footer, $includeheader, I will need to put require("./global") right? But, after putting require and when I put the variables in my php page, it can be displayed but with some errors (e.g. no button pictures in header)
SVTBlackLight01
09-09-2003, 11:28 AM
Are you still talking about competition.php? It should work as I described above if it is the forum directory. If it is outside the fourm directory, you will have to make the image paths absolute in the admin CP.
soccerclue
09-09-2003, 05:51 PM
Yeah..it's the competition.php. The file is in the forum directory. I don't know why I can't display the picture? But, if like you said creating the template and the template is just the html code inside, and in my competition.php page I also echo the html tag, isn't that would collide with the dooutput of the template content? I am confused right now. Or I should move all the html code in competition.php to the template? I hope you can help me. thank you.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.