View Full Version : Stand Alone Custom vBulletin Page
I use php pear Mail, Mail_Mime, and Mail_RFC822. Many servers may not have it though. But most hosts will add it. http://pear.php.net/package/Mail_Mime/
mac27
11-07-2008, 11:55 AM
Is that free to use in a hack I write? Or is that more less for personal use?
That is all free extensions you can put on your server. Some hosts add PEAR, some you have to ask to install it.
However, if you are going to distribute the hack, take into consideration who can use it. If it's just you, run with it.
mac27
11-07-2008, 12:21 PM
Yeah I am trying to get it so anyone can use it. Basically they edit the page I created and then just email it out.
dscurlock
07-19-2009, 10:51 PM
This is a pretty simple hack. The php part of it is the driver to hook into vBulletin where we will store the content for this page.
The template is the content part of the page which is manageable from the style manager in the ACP. You won't need to touch the php page in the future to change content.
First we look at the PHP.
<?php
/*================================================= =================*\
|| ################################################## ############## ||
|| # Stand Alone Custom vBulletin Page - Version .1 # ||
|| # ------------------------------------------------------------ # ||
|| # www.cpurigs.com 2002-2008 # ||
|| ################################################## ############## ||
\*================================================ ==================*/
// Error Reporting
error_reporting(E_ALL & ~E_NOTICE);
// Environment
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'YOUR_CUSTOM_TEMPLATE_NAME');
// init vB arrays
$specialtemplates = array();
$phrasegroups = array();
$actiontemplates = array();
$globaltemplates = array(
'YOUR_CUSTOM_TEMPLATE_NAME'
);
// vb globals
require_once("./global.php");
// NavBar
$navbits = construct_navbits(array('' => 'YOUR_NAVBAR_PAGE_NAME'));
eval('$navbar = "' . fetch_template('navbar') . '";');
// spit out template
eval('print_output("' . fetch_template('YOUR_CUSTOM_TEMPLATE_NAME') . '");');
?>
It's a simple driver file.
1) You name the script something unique so if you need to, you can use the THIS_SCRIPT constant in vBulletin to know what page you are on. (ie. links)
2) You set the template name the script will use. This is a new template we will create next. Name it the same as the script to be consistent. (ie. links)
3) Put the name of the page you want to appear in the breadcrumb of the navbar. (ie. Links)
4) Set the template name again the same as in step 2 for the eval statement.
5) save the file as scriptname.php. For instance, if it's a links page, links.php. (ie. links.php)
6) upload it to your forums folder and make sure it has execute rights. Usually 755, the default on many systems, is ok.
Now we need a template for the content. Here's the shell.
$stylevar[htmldoctype]
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="$stylevar[languagecode]" dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>YOUR_PAGE_TITLE - $vboptions[bbtitle]</title>
</head>
<body>
$header
$navbar
<!- example table with some vBulletin CSS -->
<div class="center">
<table width="100%" class="tableline" cellspacing="1" cellpadding="4" border="2">
<tr>
<td colspan="2" class="tcat"><strong>YOUR_TITLE</strong></td>
</tr>
<tr>
<td valign="top" width="50%" class="alt1">
<!-- Content -->
</td>
</tr>
</table>
</div>
<!- /example table with some vBulletin CSS -->
$footer
</body>
</html>
Let's populate it with unique content.
1) Set the page title you want.
2) Put a title in the example html table header or replace all the example content as needed.
3) Copy and paste the whole template into a new template in the vB ACP style manager under add new template with the name you decided in step 2 of the php for the styles you want the new page to appear in and save it.
Go to your /forums/yourscriptname.php and test it.
You can do this for different topics and needs and you can make the page more dynamic with more php code. But those are different how to discussions.
Good luck. It should work out great for you!
Soon you will notice there needs to be a who's online hook or you get an Unknown Location on WOL. That's another discussion too, but we'll try and get to it.
I am having trouble setting this up...can anyone help...
I created a test links.php (copies the above code) uploaded it to forums...
I added a new style and copied the above over...
when I go to /forum/links.php
all i get is a blank page...
any ideas?
thanks
Did you replace YOUR_CUSTOM_TEMPLATE_NAME with your template name?
dscurlock
07-20-2009, 12:42 PM
Did you replace YOUR_CUSTOM_TEMPLATE_NAME with your template name?
I think I got it now. I placed upper case on the style setup when
I should have used all lower case.
Thanks
David
dscurlock
07-20-2009, 04:31 PM
I got the page working...anyone know how to set it up so that I can place text beside a youtube video from top to bottom...I need to fill all the empty space...
http://www.minnesotacarpetcleaning.com/forum/rotovac360.html
Thanks
David
You just need another table <td>.
<div class="center">
<table width="100%" class="tableline" cellspacing="1" cellpadding="4" border="2">
<tr>
<td colspan="2" class="tcat"><strong> Rotovac 360 in action </strong></td>
</tr>
<tr>
<td valign="top" width="50%" class="alt1">
<div align="left">
<p><span class="smbody"><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/UR4T--_0rxY&rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/UR4T--_0rxY&rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></span>
</td>
<td>
Side text here.
</td>
</tr>
</table>
</div>
dscurlock
07-23-2009, 10:30 AM
Thank-You
why does the text start in the center, and not at the top?
It's inheriting a valign="middle" from somewhere.
Try this...
<div class="center">
<table width="100%" class="tableline" cellspacing="1" cellpadding="4" border="2">
<tr>
<td colspan="2" class="tcat"><strong> Rotovac 360 in action </strong></td>
</tr>
<tr>
<td valign="top" width="50%" class="alt1">
<div align="left">
<p><span class="smbody"><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/UR4T--_0rxY&rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/UR4T--_0rxY&rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></span>
</td>
<td valign="top">
Side text here.
</td>
</tr>
</table>
</div>
BarryW
11-02-2009, 12:42 PM
Sorry for opening an old thread but it seems the most appropriate place for my question...
I have the php file and template working as described earlier. However part of my template 'content' is php calls to query my database. The resulting output ignores the php completely. I am very new to this, is it not possible to place php commands in the template?
Any help appreciated.
Thanks
Barry
BarryW
11-02-2009, 03:54 PM
Sorry for opening an old thread but it seems the most appropriate place for my question...
I have the php file and template working as described earlier. However part of my template 'content' is php calls to query my database. The resulting output ignores the php completely. I am very new to this, is it not possible to place php commands in the template?
Any help appreciated.
Thanks
Barry
After further reading I now understand now why it does not work. I will now read up on Hooks and Plug-ins.
Thanks
Barry
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.