![]() |
How to include header and footer of the forum?
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. |
your php file needs to have
Code:
require( './global.php' ); Code:
eval( "dooutput( \"" . gettemplate( 'yourtemplatenamehere' ) . "\" );" ); then in that template for the header its Code:
$header Code:
$footer g-force2k2 |
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?
|
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 Code:
if( !$bbuserinfo['userid'] ) g-force2k2 |
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?
|
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? |
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: Code:
<?php That should work. As for the other two questions, I believe they have both been released here as hacks. |
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.
|
There are a few of each here: https://vborg.vbsupport.ru/search.ph...der=descending
|
wow..really thanks a lot for your help..i really appreciate your help...it helps me now..thanks
|
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')."\";"); |
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?
|
require("./global"); requires root/global.php which just calls basic things vB needs (header,footer,user stuff etc)
|
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)
|
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.
|
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.
|
All times are GMT. The time now is 04:44 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|