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 |
#842
|
|||
|
|||
If you have more than one style, is it possible to use this on a style other than the predomanant style?
I can get it working hith the main style of my forum but if I create a new style and make a new template in the new style, all I get is a blank page. Interestingly if I go to /forums/test/php?style=........whatever that style ID# is, I will get the page, HOWEVER, it changes the style of the forum to that ID style...... |
#843
|
|||
|
|||
Quote:
|
#844
|
||||
|
||||
Quote:
|
#845
|
|||
|
|||
Quote:
This is one of the pages I got all the info to do the conditional. But everybody seems to have their own ideas and nothing worked for me. https://vborg.vbsupport.ru/showthrea...=62164&page=37 Code:
<?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') . '");'); ?> |
#846
|
||||
|
||||
Quote:
PHP Code:
PHP Code:
|
#847
|
|||
|
|||
Hi Lynne,
Thank you for responding. After 'literally' going through every single thread and carefully re-reading @ Digital Jedi's responses, I have figured it out. Although my links were working this way: http://www.mywebsite.com/misc.php?do...te=downloads_1 As DJ said, I had created my templates wrong. I went back and re-config'd my templates as just "downloads_1" and added this right below "Start Main Script" Code:
if ($show['guest']) { print_no_permission(); } Whoooo! Thanks everybody for your expert help and for straightening me out |
#848
|
|||
|
|||
i got this error :
Unable to add cookies, header already sent. Line: 1 and this is my page php code : Code:
<?php // ####################### SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE); // #################### DEFINE IMPORTANT CONSTANTS ####################### define('NO_REGISTER_GLOBALS', 1); define('THIS_SCRIPT', 'chatbox'); // 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( 'chatbox', ); // pre-cache templates used by specific actions $actiontemplates = array( ); // ######################### REQUIRE BACK-END ############################ require_once('./global.php'); // ####################################################################### // ######################## START MAIN SCRIPT ############################ // ####################################################################### $navbits = array(); $navbits[$parent] = 'chatbox'; $navbits = construct_navbits($navbits); eval('$navbar = "' . fetch_template('navbar') . '";'); eval('print_output("' . fetch_template('chatbox') . '");'); ?> |
#849
|
||||
|
||||
I notice your template is named chatbox. Are you trying to use combine this with another modification?
|
#850
|
|||
|
|||
Quote:
============ Edited : My Problem Solved but new problem appear! now it cache a bit more ! for example i have to press Ctrl+F5 to see something new on it ! why it cached ? |
#851
|
||||
|
||||
hey all, after reading through this thread i am a little lost, i need to create a page with php code from linkmarket embedded into it .
I was able to the the page running, having trouble addign PHP code to it. anyone can help? This is what i got for my template: Code:
$stylevar[htmldoctype] <html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]"> <head> <title>$vboptions[bbtitle] - $pagetitle</title> $headinclude </head> <body> $header $navbar <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center"> <tr class="tcat"> <td><strong>Resouces</strong></td> </tr> <tr> <td class="alt1"> <?php ../mylinks.php ?> </td> </tr> </table> $footer </body> </html> here is the code i need to add: Code:
<?php /* Link Market Link Page Module Copyright 2003 Link Market, All Rights Reserved. WARNING: Do not changecode below or your link page will not work! */ $user_id = ""; $url = "http://api.linkmarket.com/mng_dir/get_links.php?user_id=" .$user_id."&cid=".$_GET['cid']."&start=".$_GET['start'].""; echo GetLMDSContent($url); function GetLMDSContent($url) { $buffer = ""; $urlArr = parse_url($url); if($urlArr[query]) { $urlArr[query] = "?".$urlArr[query]; } $fp = fsockopen($urlArr[host], 80, $errno, $errstr, 30); if (!$fp){echo "$errstr ($errno)<br />\n";} else { $out = "GET /".substr($urlArr[path], 1).$urlArr[query]." HTTP/1.0\r\n"; $out .= "Host: ".$urlArr[host]."\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); while (!feof($fp)) { $buffer .= fgets($fp, 128); } fclose($fp); } $buffer = strstr($buffer,"\r\n\r\n"); return $buffer; } ?> |
#852
|
||||
|
||||
You cannot add php code to a template. You add all the php into the page script (your whatever.php page) and then spit the variables out in the template.
|
#853
|
||||
|
||||
looking at that code, can you help me?
|
#854
|
|||
|
|||
A good start would be to read the article on the first page of this thread (No offense but it seems quite obvious to me that you haven't )
|
#855
|
|||
|
|||
Hi, I cant get this to work.
This is the code I have: HTML Code:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'googlesearch.php'); // 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(
'googlesearch',
);
// pre-cache templates used by specific actions
$actiontemplates = array(
);
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
$navbits = array();
$navbits[$parent] = 'Searching google';
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('TEST') . '");');
?>
What am I doing wrong? |
#856
|
||||
|
||||
Quote:
PHP Code:
|
#857
|
|||
|
|||
PHP Code:
|
#858
|
|||
|
|||
u are not using the googlesearch template
PHP Code:
PHP Code:
|
#859
|
|||
|
|||
Oh thanks very much guys I fixed the problem now Thanks once again!
|
#860
|
|||
|
|||
Maybe I've missed the answer to this in the previous 58(!) pages, but how do I get the footer to work in the new page?
The footer is there, but the usual 'whos online' etc info isn't. This would be nice to see. Cheers in advance. |
#861
|
|||
|
|||
who's online is not part of the footer.
|
#862
|
||||
|
||||
Quote:
|
#863
|
|||
|
|||
I am trying to integrate coppermine gallery into vbulletin. Coppermine allows to include a custom header and footer. You can use html or php files for your custom header and footer.
I already tried it, but it does not seem to work. One problem is that the gallery is called from a sub directory (/forumroot/gallery). If I copy the needed vb files to the gallery directory, I get this error: Quote:
|
#864
|
||||
|
||||
Do not copy the vb files to another folder because very often they call other vb files and won't be able to find them. Do a chdir, as mentioned already, in order to change to the vb forums directory and include them.
|
#865
|
|||
|
|||
Thanks, now I can run the file from within the gallery file without copying vb files to the gallery directory. But I still get the error I posted above, when I try to include the file in coppermine. The file executes fine when I run it stand alone.
|
#866
|
|||
|
|||
OK, I have it working but the page comes up completly white.
I replaced TEST with my style name, and test with my navbar display, and test page with Home.php My template is called Home I copied and pasted everything that was said to be coppied into everything but it still comes up white, Any suggestions? --------------- Added [DATE]1225161376[/DATE] at [TIME]1225161376[/TIME] --------------- Found my issue, Sorry |
#867
|
||||
|
||||
Hi,
With regular forums, the breadcrumbs look like this: Quote:
Code:
$navbits[$parent] = 'My custom page'; Quote:
Quote:
That is, how can I add a "breadcrumb" to that first row? How would I add two, if necessary? Quote:
|
#868
|
|||
|
|||
I figure it out. For anyone interested, you simply add items to the navbits array in the order you want them to appear, specifying the url of any link as the array key and the text to display as the value.
Another question I have, though, is how to pass a meta description tag that is dynamically generated via the php script? Right now it appears to be using the forum's default meta description tag. Thanks! |
#869
|
|||
|
|||
Would a custom page still get displayed correctly if the forums are turned off?
I'm thinking of using this method to create a custom 404 error page that would perfectly match our forum's design, but I would need the page to work when the forums are both on & off. Thanks, James |
#870
|
||||
|
||||
Quote:
|
#871
|
|||
|
|||
Not if you make this:
PHP Code:
|
#872
|
|||
|
|||
where do you create the template and where do you put the html code
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> |
#873
|
||||
|
||||
Quote:
|
#874
|
|||
|
|||
nice but when i go back to forum or memberlist the pagina is going everytime to the added page ?
whats wrong? all the links that i click are going to the new page but if a delete the link in the navbar and going to the url then the links are good ! thx |
#875
|
||||
|
||||
I don't really understand what the problem is except it revolves around a link you added in the navbar? Perhaps you have it coded wrong. You might want to post what you did.
|
#876
|
|||
|
|||
Quote:
Code:
<td class="vbmenu_control"><a href="http://www.xx.eu/forum/Chat.php/">Chat</a></td> |
#877
|
||||
|
||||
Quote:
Code:
<td class="vbmenu_control"><a href="http://www.xx.eu/forum/Chat.php">Chat</a></td> |
#878
|
|||
|
|||
Quote:
--------------- Added [DATE]1227225877[/DATE] at [TIME]1227225877[/TIME] --------------- --------------- Added [DATE]1227225965[/DATE] at [TIME]1227225965[/TIME] --------------- --------------- Added [DATE]1227244261[/DATE] at [TIME]1227244261[/TIME] --------------- i have now an dating script but its not working to login (i know its not working with vbulletin username) if i open the script in a new window its working ! if i open it in vbforum cant login the script iframe not working cookies? any idea? thx |
#879
|
|||
|
|||
Hi,
I have a serious problem. I made the following chat page; it is called parachat.php and this is the code: Quote:
Quote:
Is this a problem with the php page, or with the use of conditionals? Could anybody help me? Thanky you in advance. |
#880
|
|||
|
|||
Quote:
its not working the php script in a vbulletin page , the users cant login i have the same problem with a dating inlog program |
#881
|
|||
|
|||
In my case, the page IS working for all users, with only one excepcion: there is ONE user that is entering the page, although she belongs to a usergroup which is not authorized to enter it.
That user is the only exception... the page is working fine for all other users. Some days ago, this user belonged to another usergroup (a usergroup allowed to enter the page), and, after i moved her to usergroup #21, she continued entering the page. Perhaps her browser is showing her a cached version? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|