The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
How to create your own vBulletin-powered page! (uses vB templates)
Want to create your very own vBulletin powered page which includes the header, footer, and the user permissions system as well? Well now you can Want to know how it will look? Take a look at the attached screenshot below! Now includes the Who's Online modification! Also, instructions included on how to create your own pages that are integrated with current vBulletin files! I'm going to give you a generic page but you can easily modify the contents of the page by changing the template So here we go Instructions: Create a new file, whatever you want to call it (let's say test.php). Open up test.php and add the following (replace TEST with whatever template you want to show): PHP Code:
Now create the template, called TEST with the following content: HTML Code:
$stylevar[htmldoctype] <html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]"> <head> <title>$vboptions[bbtitle]</title> $headinclude </head> <body> $header $navbar <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center"> <tr> <td class="tcat">Title</td> </tr> <tr> <td class="alt1">Text</td> </tr> </table> $footer </body> </html> Now check it out by going to test.php Who's Online Modification Now if you want to show who is browsing this new page of yours, just open up includes/functions_online.php and find: PHP Code:
PHP Code:
Then find: PHP Code:
PHP Code:
---------------------------------- Also if you want to create your own pages 'within' current vBulletin files, do the following: Open the file you want, and then right before the final ?> in the source code, add the following: PHP Code:
edit by Lynne: If running 3.8.4 or above, see this post to take care of the PHP 5.3.0-related problems - https://vborg.vbsupport.ru/showpost....postcount=1171 |
#402
|
|||
|
|||
Quote:
I think this post applies to what we want to do. (This is speaking of images, but I think the same methodology for calling other pages applies) I'd really like to display a separate PHP file in the main window. Seems this isn't like working in frames like HMTL... |
#403
|
|||
|
|||
is there a version of this for vB3.5 series?
|
#404
|
|||
|
|||
It works on 3.5. The only change you should make is to move $headinclude up before <title> in the template.
|
#405
|
|||
|
|||
You mean like this:
Code:
$stylevar[htmldoctype] <html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]"> <head> $headinclude <title>$vboptions[bbtitle]</title> </head> <body> $header $navbar <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center"> <tr> <td class="tcat">Title</td> </tr> <tr> <td class="alt1">Text</td> </tr> </table> $footer </body> </html> |
#406
|
|||
|
|||
Yes, thats right. Nothing in the PHP file needs to be changed.
|
#407
|
||||
|
||||
Quote:
|
#408
|
|||
|
|||
Thanks worked perfect on Vb 3.0.12 :up:
|
#409
|
||||
|
||||
I'm gonna bookmark this page. Not got the time right now, but excellent work nonetheless. Well done.
|
#410
|
|||
|
|||
How do you get the Who's Online to work in 3.5.3?
I did the original edit, but it came back with "Unknown" and a link to a file on my server. I see that when you click on "Currently Active Users" it's online.php that handles it. What do I change in there? Meanwhile, I'll keep trying some things. |
#411
|
|||
|
|||
Great tutorial. Thanks
|
#412
|
|||
|
|||
How can this be made to work from outside your forums folder?
What code changes would have to be made |
#413
|
||||
|
||||
Quote:
Ditto - html shows upe just fine - phrase do not... Any help would be appreciated. |
#414
|
|||
|
|||
Does anybody know how you can get the lastest thread titles displayed on the test template taken from the forum boards, that display the thread title as a link that when clicked leads to the thread itself
|
#415
|
||||
|
||||
Quote:
I added 'register' to special phrase gorups. See below PHP Code:
|
#416
|
|||
|
|||
For some reason, when i do a query to the database within this page i get the following error
"Fatal error: Call to a member function on a non-object in /vservers/lustiesn/htdocs/vbulletin/main.php on line 45" and there is the code that i'm using to query to the database PHP Code:
|
#417
|
|||
|
|||
What version of vB are you running?
If you are using vB3.5, you will need to use $vbulletin->db->query_first instead of $DB_site->query_first. PS I think there is a similar HOW-TO in our 3.5 Tutorial section. |
#418
|
||||
|
||||
Look:
How can I change this so it IS a know location? |
#419
|
||||
|
||||
Quote:
|
#420
|
|||
|
|||
Quote:
|
#421
|
||||
|
||||
3.5 users may be interested in GTCUSTOM PAGES
|
#422
|
|||
|
|||
I need add this code to php file but doesn't work.
$ch = curl_init ("http://www.domain.name?".$QueryString); curl_setopt ($ch, CURLOPT_HEADER, 0); curl_exec ($ch); if(curl_error($ch)) echo "Error processing request"; curl_close ($ch); But if I comment this line it works, but is not a vbulletin page anymore :-( eval('print_output("' . fetch_template('my_template') . '");'); I've solved the problem. |
#423
|
||||
|
||||
loook i made this .... but need ur help .
hi ! i have a little problem in reading and viewing some html from my database which i make it .... acually iam trying to make some differnt hack which can read templates from the database instead to include it to the style templates the idea comes to me when i was trying to add some html templates to the style and i saw that its from the stupidity to add a houndred templates to a styles so it will make the forum style very heavy for me . any way here is the idea .... i create that Code:
CREATE TABLE `testdb` ( `id` int(10) unsigned NOT NULL auto_increment, `name` varchar(50) NOT NULL default '', `descr` varchar(50) NOT NULL default '', `content` text NOT NULL, PRIMARY KEY (`id`) ) TYPE=MyISAM; i have more than 100 id with 100 full html text pages for that . so i make a php file with a name of test.php and include that code inside it : PHP Code:
while browseing the file , a blank page appears to me !!!1 so ........... if i include 'test_h' template to the style it will open it nicely but i need to read from my database by its id so to browse is as its browsed from the style it self:- now if i want to read the templates from my styles i just make that changes // pre-cache templates used by all actions PHP Code:
PHP Code:
and off couse the test_h template is included and it tooks a style like that :- Code:
$stylevar[htmldoctype] <html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]"> <head> <!-- no cache headers --> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Expires" content="-1" /> <meta http-equiv="Cache-Control" content="no-cache" /> <!-- end no cache headers --> <title><phrase 1="$vboptions[bbtitle]">$vbphrase[x_powered_by_vbulletin]</phrase></title> $headinclude </head> <body> $header $navbar <!-- html codes begins here--> <!-- html codes ends here --> $footer </body> </html> |
#424
|
||||
|
||||
Hi Guys!
I read this: https://vborg.vbsupport.ru/showthread.php?t=98009 But I can't get it working. It's about this page: http://www.nucia.nl/forum/donatie.php So what I do is: Quote:
Quote:
|
#425
|
|||
|
|||
Mine does that, but the page looks good and works - that's the important part to me. The location thing is nothing more than an annoyance at the moment.
|
#426
|
|||
|
|||
how can i let only people that are logged in see this page?, and if not logged in it will take them to the log in page, or the page of choice.
*sorry for the newbie question* |
#427
|
|||
|
|||
Guessing some have more constructive things to do than nail others - or some of us don't really grow up huh?
|
#428
|
|||
|
|||
Quote:
|
#429
|
||||
|
||||
blackwidow and Jordan17: Try somehting like this:
Code:
<?php if (!$vbulletin->userinfo['userid']) { header("Location: http://www.redirected_page.com/"); exit; } ?> |
#430
|
||||
|
||||
thanks
|
#431
|
|||
|
|||
I made the php file and the template exactly as you described and when I point my url to test.php I get this
Code:
Warning: Division by zero in /includes/functions.php(4320) : eval()'d code on line 98 |
#432
|
||||
|
||||
Quote:
|
#433
|
|||
|
|||
My PHP file
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <?php // ####################### SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE); // #################### DEFINE IMPORTANT CONSTANTS ####################### define('NO_REGISTER_GLOBALS', 1); define('THIS_SCRIPT', 'test'); // change this depending on your filename // ################### PRE-CACHE TEMPLATES AND DATA ###################### // get special phrase groups $phrasegroups = array( ); // get special data templates from the datastore $specialtemplates = array( ); // pre-cache templates used by all actions $globaltemplates = array( 'TEST', ); // pre-cache templates used by specific actions $actiontemplates = array( ); // ######################### REQUIRE BACK-END ############################ require_once('./global.php'); // ####################################################################### // ######################## START MAIN SCRIPT ############################ // ####################################################################### $navbits = array(); $navbits[$parent] = 'Test Page'; $navbits = construct_navbits($navbits); eval('$navbar = "' . fetch_template('navbar') . '";'); eval('print_output("' . fetch_template('TEST') . '");'); ?> </body> </html> Code:
$stylevar[htmldoctype] <html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]"> <head> <title>$vboptions[bbtitle]</title> $headinclude </head> <body> $header $navbar <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center"> <tr> <td class="tcat">Title</td> </tr> <tr> <td class="alt1">Text</td> </tr> </table> $footer </body> </html> |
#434
|
||||
|
||||
Your PHP file shouldn't have any HTML in it!
PHP Code:
|
#435
|
|||
|
|||
Doh! How stupid am I! It's late and I'm falling asleep, please forgive me
|
#436
|
||||
|
||||
Quote:
Good luck! |
#437
|
|||
|
|||
I want to display thumbnails on my page of all the same size and when they are clicked it opens the image in a new browser (like google image search). How would I go about doing this?
|
#438
|
|||
|
|||
I am novice in php code just know how .html and use dreamweaver
I could make the test.php file but lost after that I mean where to make teplate and how to link them ... So, I would be grateful if someone could explain me step by step what, how and where to do thanks a lot |
#439
|
|||
|
|||
I tried Iframe code in the template but it didn't display the website that I wanted to display in the costume page created.
Can anyone help me how to display through template or how to create a page with just header navbar and footer or say no need to fetch template thanks |
#440
|
|||
|
|||
Edit: I fixed it, I was putting the PHP file into the template instead of the HTML stuff.
|
#441
|
|||
|
|||
this method wont work with 3.5.4
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|