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 |
#1242
|
|||
|
|||
Is there a way to block custom pages like these from guests being able to view them unless they log in? with having the link to the pages in the navbar as well?
|
#1243
|
||||
|
||||
Quote:
HTML Code:
<if condition="$show['member']"> ALL YOUR CONTENT HERE <else /> <tr> <td> <h2>You need to be registered or logged in to view this page</h2> </td> </tr> </if> |
#1244
|
||||
|
||||
It's not a good idea to do this on the template level. Just add this at the top of your custom code in the php file:
PHP Code:
|
#1245
|
|||
|
|||
ahh excellent thank you very much ^_^
|
#1246
|
||||
|
||||
Cellarius, why is it not a good idea to manage it at template level?, doing it with a template conditional means that it's easily manipulated later by admins...etc rather than having to access server files, unless i'm missing a security flaw or something?
|
#1247
|
||||
|
||||
First and foremost: Performance. Why run the whole file, go through the whole variable/template registering and rendering process etc. just to show nothing in the end?
Next, you break UI consistency by not using the usual way of handling such errors: You need to code your error message yourself instead of using the standard no permissions message, which is phrased and thus works with multi language environments. Last, but not least: There is a standard procedure in vB to do this, and that's the way I did it. Just look at the original files. And if there is a standard way, it should be used. Anyway, I really don't follow your argumentation - how often do your Admins need to change which usergroups get access to a custom page? This does not seem like a weekly operation to me, does it? This is a set it and forget it decision, is it not? |
#1248
|
|||
|
|||
Dont work for me
|
#1249
|
||||
|
||||
Your php code does not get parsed. Make sure your file has the .php extension and starts with <?php.
|
#1250
|
||||
|
||||
Quote:
--------------- Added [DATE]1274003452[/DATE] at [TIME]1274003452[/TIME] --------------- Could it be incorporated in a pluggin where you can state which templates cannot be accessed? Could you also tell me how to do this in a php statement? <if condition="is_member_of($vbulletin->userinfo, array(1, 2, 3))">. |
#1251
|
||||
|
||||
Quote:
Quote:
Quote:
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|