req. How to create your own vBulletin-powered page! (uses vB templates)

xorton

New Member
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:
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') . '");'); 

?>
Be sure to change 'TEST' to the actual template name, and change 'test' to the filename. Also, change 'Test Page' to whatever you want to show in the navbar, such as 'Viewing Member Profile' (just an example).

Now create the template, called TEST with the following content:
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>
All done
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:
Code:
case 'bugs.php': 
        $userinfo['activity'] = 'bugs'; 
        break;  

Below, add:
PHP Code:
    case 'test.php': 
        $userinfo['activity'] = 'test'; 
        break;  

(Be sure to change the values to your own!)

Then find:
PHP Code:
        case 'modcplogin': 
            $userinfo['action'] = $vbphrase['moderator_control_panel_login']; 
            break;  

Below add:
PHP Code:
        case 'test': 
            $userinfo['action'] = 'Viewing Test Page'; 
            break;
All done!

----------------------------------

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:
Code:
if ($_REQUEST['do'] == 'xxx') 
{ 
    eval('print_output("' . fetch_template('TEMPLATE_XXX') . '");'); 
}
Replace 'xxx' with whatever you want ?do= in the query string to be (for example, replace 'xxx' with 'showprofile' so then someone would type in example.php?do=showprofile to view this template.) Then of course, change TEMPLATE_XXX to your template name, it's that simple!
 

devilinearth

New Member
I've Post generator script..how i can emebeded with this page..???

php code is below..

PHP:
<!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" dir="ltr" lang="en-gb" xml:lang="en-gb"> 
<head> 
<LINK REL="SHORTCUT ICON" HREF="favicon.ico"> 
 
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> 
<meta http-equiv="content-language" content="en-gb" /> 
<meta http-equiv="content-style-type" content="text/css" /> 
<meta http-equiv="imagetoolbar" content="no" /> 
<meta name="resource-type" content="document" /> 
<meta name="distribution" content="global" /> 
<meta name="copyright" content="2000, 2002, 2005, 2007 phpBB Group" /> 
<meta name="keywords" content="" /> 
<meta name="description" content="" /> 
<title>Megarapidshare Post Generator</title> 
 
<link rel="stylesheet" href="http://megarapidshare.com/forum/css_25.css" type="text/css" /> 
 
<script type="text/javascript" src="http://megarapidshare.com/forum/style.js"></script> 
<script type="text/javascript"> 
// <![CDATA[  function popup(url, width, height, name) { 	if (!name) 	{ 		name = '_popup'; 	}  	window.open(url.replace(/&/g, '&'), name, 'height=' + height + ',resizable=yes,scrollbars=yes,width=' + width); 	return false; }  function jumpto() { 	var page = prompt('Enter the page number you wish to go to.:', ''); 	var perpage = ''; 	var base_url = '';  	if (page !== null && !isNaN(page) && page > 0)
	{
		document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * perpage);
	}
}
 
/**
* Find a member
*/
function find_username(url)
{
	popup(url, 760, 570, '_usersearch');
	return false;
}
 
/**
* Mark/unmark checklist
* id = ID of parent container, name = name prefix, state = state [true/false]
*/
function marklist(id, name, state)
{
	var parent = document.getElementById(id);
	if (!parent)
	{
		eval('parent = document.' + id);
	}
 
	if (!parent)
	{
		return;
	}
 
	var rb = parent.getElementsByTagName('input');
	
	for (var r = 0; r < rb.length; r++)
	{
		if (rb[r].name.substr(0, name.length) == name)
		{
			rb[r].checked = state;
		}
	}
}
 
 
// ]]>
</script> 
<!--[if lt IE 7]>
<script type="text/javascript" src="http://ssl-bin.t35.com/pngfix.js"></script>
<![endif]--> 
</head> 
<body class="ltr"> 
 
<a name="top"></a> 
 
<div style="width:960px;clear:both;margin: 0 auto;"> 
<table width="100%" align="center" cellspacing="0" cellpadding="0" border="0"> 
	<tr> 
		<td class="leftshadow" width="9" valign="top"><img src="./styles/milky_way/theme/images/spacer.gif" alt="" width="9" height="1" /></td> 
 
		<td class="np-body" width="100%" valign="top"> 
 
<div id="top_logo"> 
<table width="100%" cellspacing="0" cellpadding="0" border="0"> 
<tr> 
<td align="center" valign="middle"><h1><span style="color:#FF3333;"><b>MegaRapidshare Post Generator</b></span></h1><span class="gen"></span></td> 
<td align="right" valign="top">&nbsp;</td> 
</tr> 
</table> 
</div> 
 
<center><span style="color:YellowGreen;"><b>This is very easy to use.If you are new to this scene then this is for you.Just put all the details required and it will make you a well furnished and good looking post!</b></span></center> 
<div id="wrapcentre"> 
 
<br /><div class="bc-tbl bc-div"> 

</div><script type="text/javascript"> 
			function doStuff()
			{
			var txt = "";
			document.getElementById("gen").value = "";
 
			if (document.getElementById("title").value != ""){
			txt += "[CENTER][b][u][color=#FF8000][SIZE=5]";
			txt += document.getElementById("title").value; //Add title
			txt += "[/SIZE][/COLOR][/u][/b]";
			document.getElementById("gen").value += txt;
			}

                        if (document.getElementById("boxart").value != ""){
			txt = "\n\n[IMG\]";
			txt += document.getElementById("boxart").value; //Add boxart
			txt += "[/img]";
			document.getElementById("gen").value += txt
                        }
                        
                        if (document.getElementById("boxart1").value != ""){
			txt = "\n\n[IMG\]";
			txt += document.getElementById("boxart1").value;
			txt += "[/img]";
			document.getElementById("gen").value += txt
                        }

			if (document.getElementById("info").value != ""){
			txt = "";
                        txt += "\n\n[img]http://megarapidshare.com/forum/info.jpg[/img]\n";
			txt += "[size=3]"
                        txt += document.getElementById("info").value; //Add info
                        txt += "[/size]"
			document.getElementById("gen").value += txt;
			}
 
			if (document.getElementById("sshot1").value != ""){
			txt = "";
			txt += "\n\n[img]http://megarapidshare.com/forum/screen.jpg[/img]";
			txt += "\n[img]";
			txt += document.getElementById("sshot1").value;
			txt += "[/img]";
			document.getElementById("gen").value += txt;
			}
 
			if (document.getElementById("sshot2").value != ""){
			txt = "";
			txt += "\n[img]";
			txt += document.getElementById("sshot2").value;
			txt += "[/img]";
			document.getElementById("gen").value += txt;
			}
 
 
			if (document.getElementById("sshot3").value != ""){
			txt = "";
			txt += "\n[img]";
			txt += document.getElementById("sshot3").value;
			txt += "[/img]";
			document.getElementById("gen").value += txt;
			}
 
 
			if (document.getElementById("sshot4").value != ""){
			txt = "";
                        txt += "\n[img]";
			txt += document.getElementById("sshot4").value;
			txt += "[/img]";
			document.getElementById("gen").value += txt;
			}
 
 
			if (document.getElementById("sshot5").value != ""){
			txt = "";
			txt += "\n[img]";
			txt += document.getElementById("sshot5").value;
			txt += "[/img]";
			document.getElementById("gen").value += txt;
			}
 
                        
                        if (document.getElementById("sshot6").value != ""){
			txt = "";
			txt += "\n[img]";
			txt += document.getElementById("sshot6").value;
			txt += "[/img]";
			document.getElementById("gen").value += txt;
			}


                        if (document.getElementById("sshot7").value != ""){
			txt = "";
			txt += "\n[img]";
			txt += document.getElementById("sshot7").value;
			txt += "[/img]";
			document.getElementById("gen").value += txt;
			}


			if (document.getElementById("sshot8").value != ""){
			txt = "";
			txt += "\n[img]";
			txt += document.getElementById("sshot8").value;
			txt += "[/img]";
			document.getElementById("gen").value += txt;
			}


			document.getElementById("gen").value += "\n";
 
			if (document.getElementById("downlinks").value != ""){
			txt = "";
			txt += "\n\n[img]http://megarapidshare.com/forum/download.jpg[/img]";
			txt += "\n[HIDE][CODE]";
			txt += document.getElementById("downlinks").value;
			txt += "[/CODE][/HIDE][/CENTER]";
			document.getElementById("gen").value += txt;
			}
 
			if (document.getElementById("pass").value != ""){
			txt = "";
			txt += "\n\n[CENTER][img]http://megarapidshare.com/forum/password.jpg[/img]";
			txt += "\n[HIDE][CODE]";
			txt += document.getElementById("pass").value;
			txt += "[/CODE][/HIDE][/CENTER]";
			document.getElementById("gen").value += txt;
			}
 
			txt = "";
			txt += "\n\nThis post is generated by MegaRapidshare Post Generator."
			document.getElementById("gen").value += txt;
			}
		</script> 
 
<br /> 
 
<div class="panel"> 
<div class="inner"><span class="corners-top"><span></span></span> 
 
<div class="content"> 
<br /> 
<p align="center"> 
 
  <FORM name="frm"> 
        <div class="tbl-h-l"><div class="tbl-h-r"><div class="tbl-h-c"><div class="tbl-title"><h4><span style="color:#FF00FF;"><b>Megarapidshare Post Generator</b></span></h4></div></div></div></div> 
        <table class="tablebg" align="center" width="100%" cellpadding="0" cellspacing="4"> 
        <tr> 
 
		    <td class="row1"><div align="center"><b>Topic Title:</b></div></td> 
			<td class="row2"><div align="center"><INPUT type="text" id="title" maxlength="60" size="65"></div></td> 
		</tr>
         <tr> 
		    <td class="row1"><div align="center"><b>Cover:</b></div></td> 
            <td class="row2"><div align="center"><INPUT type="text" id="boxart" value="" maxlength="200" size="65"><br /> 
		<INPUT type="text" id="boxart1" maxlength="200" size="65"><br /></div></td>
</tr> 

        <tr> 
 
		    <td class="row1"><div align="center"><b>Topic Description:</b></div></td> 
            <td class="row2"><div align="center"><TEXTAREA id="info" cols="53" rows="10"></TEXTAREA></div></td> 
		</tr> 
        <tr> 
		    <td class="row1"><div align="center"><b>Screenshots:</b></div></td> 
			<td class="row2"><div align="center"><INPUT type="text" id="sshot1" maxlength="200" size="65"><br /> 
			    <INPUT type="text" id="sshot2" maxlength="200" size="65"><br /> 
 
				<INPUT type="text" id="sshot3" maxlength="200" size="65"><br /> 
				<INPUT type="text" id="sshot4" maxlength="200" size="65"><br /> 
			        <INPUT type="text" id="sshot5" maxlength="200" size="65"><br /> 
 			        <INPUT type="text" id="sshot6" maxlength="200" size="65"><br />
			        <INPUT type="text" id="sshot7" maxlength="200" size="65"><br />
			        <INPUT type="text" id="sshot8" maxlength="200" size="65"><br /></div></td>
		</tr> 
        <tr> 
		    <td class="row1"><div align="center"><b>Download Links:</b></div></td> 
			<td class="row2"><div align="center"><TEXTAREA id="downlinks" cols="53" rows="10"></TEXTAREA></div></td> 
 
		</tr> 
        <tr> 
		    <td class="row1"><div align="center"><b>Password:</b></div></td> 
			<td class="row2"><div align="center"><INPUT type="text" id="pass" value="" maxlength="100" size="65"></div></td> 
		</tr> 
        <tr> 
            <td class="cat" colspan="2"><div align="center"> 
 
            <INPUT type="reset" value="Reset">&nbsp;&nbsp;
			<INPUT type="button" class="btnmain" onclick="doStuff()" value="Generate"></div></td> 
		</tr> 
        <tr> 
            <th colspan="2"><div align="center"><b><span style="color:DarkOrange"><b>Generated Post:</b></span></b></div></th> 
		</tr> 
        <tr> 
		    <td class="row2" colspan="2"><div align="center"><textarea name="gen" cols="62" rows="10" id="gen" onClick="javascript:frm.gen.focus();frm.gen.select();"></textarea></div></td> 
 
		</tr> 
        <tr> 
            <td class="cat-bottom" colspan="2">&nbsp;</td> 
        </tr> 
        </table> 
        <div class="tbl-f-l"><div class="tbl-f-r"><div class="tbl-f-c">&nbsp;</div></div></div> 
  </FORM> 

<tr> 
            <th colspan="2"><div align="center"><span style="color:#FF3333;"><b>For Megarapidshare by CyberRockr</b></span></div></th> 
		</tr>
 

Xero852

New Member
All you do is add your own code in the "HTML Mode" section and it should work if I understand this correctly.
 

prince13

New Member
can someone plz help here?

i manage to get the header showing but the problem is dat now it doesnt load the script style comes.

and if i remove the header to include in my script and only footer to show dat works aswell

so

<header>

<myscript>

<footer>

^^ only the header is shown

//<header>

<myscript>

<footer>

^^ now my script and footer is visiable

anyclue wuts wrong?
 

prince13

New Member
i created two files called

test-header.php and test-footer.php

in test-header.php i called to give me the header only
and in test-footer.php i called to give me the footer only

and now on my script.php file

i inclued test-header.php on da top

and test-footer.php at the bottom

so now wen i go to www.example.com/myscript.php

it shows me the header from vb but after loading the navbar (which is the last bit in my template TESTHEADER in vb templates) it jus stops rite dere without continuing to load my script or te footer from vb.

can anyone expert help me plz. i am almost done with my project now.

thanks
 
Top