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 |
#162
|
|||
|
|||
I've been playing with this and it's a pretty neat thing . Cheers for putting this info together. I do a quick question I'm hoping someone can point me in the right direction on, however.
I'm working on being able to being able to display a list of agreements all from one primary page using the do= thing. So I have agreement.php setup like is described in the tutorial and instead of Code:
eval('print_output("' . fetch_template('AGREEMENT') . '");'); Code:
// Grab template for standard agreement if ($_REQUEST['do'] == 'standard') { eval('print_output("' . fetch_template('agree_standard') . '");'); } // Or grab template for special agreement elseif ($_REQUEST['do'] == 'special') { eval('print_output("' . fetch_template('agree_special') . '");'); } // Template for main agreement page if no 'do' statement else { eval('print_output("' . fetch_template('AGREEMENT') . '");'); } Code:
$stylevar[htmldoctype] <html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]"> <head> <title>$vboptions[bbtitle]</title> $headinclude How do I set it up so the AGREEMENT template contains this primary structure while child templates like agree_standard aren't forced to repeat it within their own structure, and just contain the HTML I need for that page's 'do' statement? |
#163
|
|||
|
|||
I'm on the verge of a nervous breakdown here! lol
I have a nice page working, but I need the "what's going on?" info at the bottom. I've been trying to do this for 4 hours now. I think I've tried everything I'm capable of with no luck. I took the 'What's going on?' box and added it to the template, I then took the what's going on php info and added that to my php file for this hack. I got a few items to work but not all of them. Can someone please help me do this? Thanks |
#164
|
||||
|
||||
welo,
Put the HTML you need for that page's 'do' statement in avariable like this: PHP Code:
|
#165
|
|||
|
|||
That's exactly what I was trying to do. Thanks man. I've been switching off between working on this and writing all kinds of legal crap for the actual agreements, and just couldn't see it. Sure makes sense now . Thanks again.
|
#166
|
|||
|
|||
I'll donate $15 to someone's paypal account if they can help me with my issue in post #163 , I'm desperate!
|
#167
|
|||
|
|||
Quote:
[edit]Okay, I see what you mean. Sorry about that. I'm running into the same issue with trying to add in "Currently Active Users Viewing..."[/edit] |
#168
|
|||
|
|||
Here guys, try this.
Edit the lines at the top of the file so they look like this, be sure to include your own changes if you had made any. PHP Code:
PHP Code:
Now for the template edits, place the following code anywhere you want the Whos online to show. HTML Code:
<!-- what's going on box --> <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center"> <thead> <tr> <td class="tcat" colspan="2">$vbphrase[whats_going_on]</td> </tr> </thead> <if condition="$show['loggedinusers']"> <!-- logged-in users --> <tbody> <tr> <td class="thead" colspan="2"> <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_activeusers')"><img id="collapseimg_forumhome_activeusers" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_activeusers].gif" alt="" border="0" /></a> <a href="online.php?$session[sessionurl]">$vbphrase[currently_active_users]</a>: $totalonline (<phrase 1="$numberregistered" 2="$numberguest">$vbphrase[x_members_and_y_guests]</phrase>) </td> </tr> </tbody> <tbody id="collapseobj_forumhome_activeusers" style="$vbcollapse[collapseobj_forumhome_activeusers]"> <tr> <td class="alt2"><a href="online.php?$session[sessionurl]"><img src="$stylevar[imgdir_misc]/whos_online.gif" alt="$vbphrase[view_whos_online]" border="0" /></a></td> <td class="alt1" width="100%"> <div class="smallfont"> <div style="white-space: nowrap"><phrase 1="$recordusers" 2="$recorddate" 3="$recordtime">$vbphrase[most_users_ever_online_was_x_y_at_z]</phrase></div> <div>$activeusers</div> </div> </td> </tr> </tbody> <!-- end logged-in users --> </if> <tbody> <tr> <td class="thead" colspan="2"> <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_stats')"><img id="collapseimg_forumhome_stats" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_stats].gif" alt="" border="0" /></a> <phrase 1="$vboptions[bbtitle]">$vbphrase[x_statistics]</phrase> </td> </tr> </tbody> <tbody id="collapseobj_forumhome_stats" style="$vbcollapse[collapseobj_forumhome_stats]"> <tr> <td class="alt2"><img src="$stylevar[imgdir_misc]/stats.gif" alt="<phrase 1="$vboptions[bbtitle]">$vbphrase[x_statistics]</phrase>" border="0" /></td> <td class="alt1" width="100%"> <div class="smallfont"> <div>$vbphrase[threads]: $totalthreads, $vbphrase[posts]: $totalposts, $vbphrase[members]: $numbermembers</div> <div><phrase 1="member.php?$session[sessionurl]u=$newuserid" 2="$newusername">$vbphrase[welcome_to_our_newest_member_x]</phrase></div> </div> </td> </tr> </tbody> <if condition="$show['birthdays']"> <!-- today's birthdays --> <tbody> <tr> <td class="thead" colspan="2"> <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_birthdays')"><img id="collapseimg_forumhome_birthdays" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_birthdays].gif" alt="" border="0" /></a> $vbphrase[todays_birthdays] </td> </tr> </tbody> <tbody id="collapseobj_forumhome_birthdays" style="$vbcollapse[collapseobj_forumhome_birthdays]"> <tr> <td class="alt2"><a href="calendar.php?$session[sessionurl]do=getday&day=$today&sb=1"><img src="$stylevar[imgdir_misc]/birthday.gif" alt="$vbphrase[view_birthdays]" border="0" /></a></td> <td class="alt1" width="100%"><div class="smallfont">$birthdays</div></td> </tr> </tbody> <!-- end today's birthdays --> </if> <if condition="$show['upcomingevents']"> <tbody> <tr> <td class="thead" colspan="2"> <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_events')"><img id="collapseimg_forumhome_events" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_events].gif" alt="" border="0" /></a> <if condition="$show['todaysevents']">$vbphrase[todays_events]<else /><phrase 1="$vboptions[showevents]">$vbphrase[upcoming_events_for_the_next_x_days]</phrase></if> </td> </tr> </tbody> <tbody id="collapseobj_forumhome_events" style="$vbcollapse[collapseobj_forumhome_events]"> <tr> <td class="alt2"><a href="calendar.php?$session[sessionurl]"><img src="$stylevar[imgdir_misc]/calendar.gif" alt="$vbphrase[calendar]" border="0" /></a></td> <td class="alt1" width="100%"><div class="smallfont">$upcomingevents</div></td> </tr> </tbody> </if> </table> <br /> <!-- end what's going on box --> |
#169
|
|||
|
|||
Mr. Hillbilly, thanks for the help so far! Still not working though. I'm not sure what I'm doing wrong. I have attachment my php code and template code. The following code shows the what's going on box as:
APUG Forums Statistics Threads: , Posts: , Members: Welcome to our newest member, It only shows a few stats and they are blank. Hope you can help, thanks again! |
#170
|
|||
|
|||
Forgot to add a couple of lines, this one should work.
|
#171
|
|||
|
|||
Quote:
|
#172
|
|||
|
|||
Well, here's a question for you guys.
I'd be forever grateful if somebody could get this to even semi-work. I've chosen to use this method of creating pages since the thought of customizing a portal to get rid of all the blocks is beyond me. Pretty much all I need to do what a lot of the portals do, display threads from a "news" forum with simple comment links. That's it, I just need to know how to get the title, date, author and comment links on there and I'd be all good - from there I can customize the template normally. ^_^ Thank you for all your help in advance, and I really hope somebody can solve this for me. BTW: Does anybody find it odd that Greg hasn't visited this thread in a while? |
#173
|
|||
|
|||
Ok I got the extra page to display, thank all of you for the information I have this code in my template
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"><h2>City Ordinances (the Rules)</h2> This forum is a great place to post questions, answers, or have a productive discussion on web development. While we may delete anything we find inappropriate, it is rare that such a post is made as the members here have been very helpful to each other. The following are guidelines to follow when posting a message or reply:</td> </tr> <tr> <td class="alt1">$vbphrase[insult_flame]</td> </tr> <tr> <td class="alt2">$vbphrase[no_spam]</td> </tr> <tr> <td class="alt1">$vbphrase[illegal_material]</td> </tr> <tr> <td class="alt2">$vbphrase[cross_posting]</td> </tr> <tr> <td class="alt1">$vbphrase[homework]</td> </tr> <tr> <td class="alt2">$vbphrase[flooding]</td> </tr> <tr> <td class="alt1">$vbphrase[all_caps]</td> </tr> <tr> <td class="alt2">$vbphrase[no_politics]</td> </tr> <td class="alt1">$vbphrase[mod_time]</td> </tr> <tr> <td class="alt2">$vbphrase[read_faq_first]</td> </tr> </table> $footer </body> </html> Thanks for any assistance |
#174
|
|||
|
|||
So can anybody help me with my little problem? :]
|
#175
|
|||
|
|||
I apologize for posting a 3rd time, but is there nobody that can help with this? It's been 2 days! o_O
|
#176
|
||||
|
||||
Quote:
IMHO, it would be easier to modify one of the portals to do this than to add everything to this hack to accomplish what you need. |
#177
|
|||
|
|||
i fixed my issue a few lines up, eval stuff was in the wrong place. mine works like I want now.
|
#178
|
|||
|
|||
Quote:
|
#179
|
||||
|
||||
Take a look at vBadvanced. You could propably get by with a simple template mod once you get it installed (unless you are already running one instance of it). All the blocks are contained in the index template, so you could either remove them from the template or comment them out.
|
#180
|
||||
|
||||
I have a statement then one question:
Ive placed this in the websites root directory as the main page of my site: http://www.joeygowdy.com My forums are in a different directory: http://www.joeygowdy.com/forum Ive already made all the required changes, now for the question: If I ever choose the have the vbboard switched offline for updates, will the main site also be unavailable due to the fact that Im useing vbtemplates to power my main site? |
#181
|
|||
|
|||
Is there a way that you can add new pages on your index directory rather than the forum directory?
Meaning, the new template works only if the file is added within the forum directory but would like to know if you can make these page work outside of a forum page. BTW: Great hack! Clicks Install. Edit: Sorry, I just realized you can not ask questions in here. |
#182
|
||||
|
||||
Quote:
https://vborg.vbsupport.ru/showpost....2&postcount=23 All your menu links will need to be absolute instead of relative too. |
#183
|
||||
|
||||
I used your code :
PHP Code:
I have this .php file outside my forum directory too. any help ? |
#185
|
|||
|
|||
I am trying to make a rather large template (950 lines of code), for a page using this "hack" and when I try to save and reload the template in the Control Panel it won't refresh like it saved and the changes don't load when I go to the page. Is there a maximum template size limit that I am bumping into?
|
#186
|
|||
|
|||
bump
|
#187
|
|||
|
|||
great
love it |
#188
|
||||
|
||||
Quote:
Code:
<script type="text/javascript" src="$vboptions[bburl]/clientscript/vbulletin_global.js"></script> <if condition="$show['popups']"><script type="text/javascript" src="$vboptions[bburl]/clientscript/vbulletin_menu.js"></script></if> |
#189
|
||||
|
||||
I'd like to do something a little different with this:
I have a PHP file as instructed, but I only want to include a header and footer (I've already set up templates for those). For the main page I want to include another page. This is what I tried in the PHP file: Code:
<snip> $navbits = construct_navbits($navbits); eval('$navbar = "' . fetch_template('navbar') . '";'); eval('print_output("' . fetch_template('extrapage_top') . '");'); include("extrapage_contents.html"); eval('print_output("' . fetch_template('extrapage_bottom') . '");'); ?> It doesn't show extrapage_contents.html, nor does it show the code from the template extrapage_bottom. What am I doing wrong? |
#190
|
||||
|
||||
Includes have to go in the phpinclude_start template. Use the example as a guide:
Code:
// Example of how to include a seperate file: // ob_start(); // require("yourheader.html"); // $header = ob_get_contents(); // ob_end_clean(); |
#191
|
||||
|
||||
Excellent - worked like a charm. Thanks!
|
#192
|
||||
|
||||
Great. Glad to help.
|
#193
|
||||
|
||||
Can cany one please tell my how i can add login,latest treads and that sort of things to the vb powerd page.
|
#194
|
|||
|
|||
Hi
Is it possible for this to work when the forums in a subdomain on the same server? I have tried it using PHP includes (storing the root php file in the forums dir) and that works, however permissions dont seem to work and when i use permissions via the templates(<if> statments) it doesnt recognise that Im logged in... thanks in advance for any help |
#195
|
|||
|
|||
great hack
however i am having a few issues when i try to align the tables in the body. if i try to align the table on the left the time stamp will appear on the right in stead of the bottom of where it should be. in the attached image you can see how i made two tables side by side and the time stamp appears in between the two tables. no matter what i try in the code nothing seems to move it. i will attach the code too. Any help will be appreciated thanks. HTML Code:
$stylevar[htmldoctype] <html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]"> <head> <title>$vboptions[bbtitle] :: Links</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">Links</td> </tr> <tr> <td class="alt1"><p>Great links and friends of Mysite.org.<br> </td> </tr> </table> <br> <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="48%" align="left"> <tr> <td class="tcat">Discussion Boards</td> </tr> <tr valign="center"> <td class="alt1"><br><a href="http://www.site1.org/" target="_blank">Description</a><br><br><a href="http://www.site2.com/" target="_blank">Description2</a><br><br><a href="http://www.site3.com/" target="_blank">Description3</a><br><br><i>more to come...</i><br> </td> </tr> </table> <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="48%" align="right"> <tr> <td class="tcat">Other Sites</td> </tr> <tr> <td class="alt1"><br><a href="http://www.site1.org/" target="_blank">Description1</a><br><br><a href="http://www.site2.com/" target="_blank">Description2</a><br><br><a href="http://www.site3.com/" target="_blank">Description3</a><br><br><i>more to come...</i><br> </td> </tr> </table> <br> <br> <br> $footer </html> |
#196
|
||||
|
||||
Installed the test pages "Test"
Its all white and nothing shows? Whats up, anyone? |
#197
|
||||
|
||||
Make sure you added the template and also added it to the template cache at the top of the page
|
#198
|
||||
|
||||
I want to call this hack from the control panel but right now I'm just getting a blank screen. The template is called MAILLIST and is unchanged from page 1 of this thread.
here's my file called maillist.php which is stored at /forum/ (comments removed for brevity) PHP Code:
Plus, how do I ensure that I get the control panel nav rather than the normal nav? Sarah |
#199
|
||||
|
||||
You can't call templates from within the admincp
|
#200
|
||||
|
||||
Thanks Dean
I'm trying to run this from within the user CP. Found my mistake: Code:
eval('print_output("' . fetch_template('MAILLIST') . '");'); Code:
eval('print_output("' . fetch_template('MAIL LIST MAINTENANCE') . '");'); |
#201
|
||||
|
||||
No problem Sarah. Good luck with whatever you're coding !
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|