[REQ]Creating vBulletin powered page tutorial

Hoxxy

New Member
I got this page bookmarked...lol

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:
<?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:

PHP:
$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:
case 'bugs.php': 
        $userinfo['activity'] = 'bugs'; 
        break;

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

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

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

Below add:
PHP:
 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:
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!



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


INSTANT TXT/ HTML/ JAVA FILE FORUM INTEGRATION

Version 1.3 for vBulletin 3.x.x by Dr Erwin Loh

As the name suggests, this hack allows you to display any HTML file integrated into your forums automatically.

No file hacking! No template modifying! Just upload 1 file!

There is no need to make a new template or PHP file. Easy way to incorporate rules, messages, web pages etc. into your forums.

All you need to do is to run this URL:
http://www.your-forums/forums/html.php?file=xxx.html

Where xxx.html is the HTML file you want to integrate into your forums. The file extension can be HTML, HTM, SHTML or even TXT (text files). You can add more file extensions by modifying html.php - NOTE: the file name is case-sensitive.

This is also a quick way to integrate java applets into your forum (for example, java chat applets). Just copy and paste the java applet code into a HTML file, and then put the HTML file name into the URL above. Instant java integration!

For HTML files in subdirectories, use this URL:
http://www.your-forums/forums/html.p...ctory/xxx.html

By default, the title is the filename. To make a custom title in your forum page, use this URL:
http://www.your-forums/forums/html.p...tml&title=Your Title

You can have spaces in your custom title.

I have disabled remote file integration - this way other people cannot use this link to integrate offensive pages into your site.

To let only certain usergroups see the page, instructions are in the PHP file on how to do it.


Installation- upload 1 file!

1) Upload html.php into your forum directory.

2) Done!

3) Upload any HTML file or TEXT file into your forums directory, or sub-directory, and run the command line URL as listed above, and you'll see the file integrated into your forums automatically!


Update

Version 1.1 - Made the the title of the forums show up in the page and the heading of the table if no title is set in the URL - if the title is set, the title is now also shown in the table heading.

Version 1.2 - added automatic navbar support.

Version 1.3 - reduce 1 query by caching template.
 

Nanana

New Member
Is the tutorial in that rar? I'm seeing the 'content visible to registered users only' all over the article :(
 

Hoxxy

New Member
This is the third time this has happened...can you see it now?

Is the tutorial in that rar?
No the rar is the html file for INSTANT TXT/ HTML/ JAVA FILE FORUM INTEGRATION mod
 

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>
 
Top