vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=192)
-   -   [How to] Add custompages to your forum (https://vborg.vbsupport.ru/showthread.php?t=124749)

utw-Mephisto 08-24-2006 03:18 PM

Quote:

Originally Posted by Selene
Ok i wanted guests not to view that page.

So i did:



For the msg that i wanted to show the "guests" i just used IF code again and specified the Guest usergroup and wrote the msg so it works now :)

Cool!

Nice "think outside the box" - solution - cool ..

utw-Mephisto 08-24-2006 04:30 PM

Ok, I was playing around a bit..

If your template would look like

Code:

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$vboptions[bbtitle]</title>
</head>
<body>

$header
$navbar
<if condition="$bbuserinfo[userid]">
<center>
<iframe src="http://www.google.com" width="80%" height="400"></iframe></center>
<else />               
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="70%" align="center">
<tr>
        <td class="tcat">vBulletin Message</td>

</tr>
<tr>
        <td class="panelsurround" align="center">
        <div class="panel">
                <div align="left">
       
                               
                        <!-- main error message -->
                       
                       
                        <blockquote><p><p><strong>$bbuserinfo[username]</strong>, you do not have permission to access this page. This could be due to one of several reasons:</p>

<ol>
        <li>Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?</li>

        <li>If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.</li>
</ol>

<div align="right">
        <a href="login.php?do=logout&amp;logouthash=b79dddc3a894bac9fea040e270f00ee7">Log Out</a>
        <a href="index.php?">Home</a>
</div></p></blockquote>
                       
                               
                        <!-- / main error message -->                       
               
               
                </div>
        </div>

        <!--
        <div style="margin-top:6px">
                <input type="submit" class="button" value="Go Back" accesskey="s" onclick="history.back(1); return false" />
        </div>
        -->
        </td>
</tr>
</table>               
                </if>
$footer
</body>
</html>

Which would look like

http://img20.imageshack.us/img20/4681/untitledhw6.jpg

You can also remove the $bbuserinfo[username] and replace it with something you like or whatever ...

Since I am using in the example above <if condition="$bbuserinfo[userid]"> - it will give out an error regardless of the usergoupid

Selene 08-24-2006 05:07 PM

utw, nice one!

thanks a lot for this one. I am going to use this custom page thing on my vbulletin site.

Kirk Y 08-24-2006 07:09 PM

Why doesn't vBulletin document things like this -- it's a huge time-saver.

LanciaStratos 08-24-2006 09:26 PM

I've got to echo what others have said here - this is an outstanding integrated feature of vBulletin that deserves a LOT more attention. Finding this thread has saved me a few hours of coding and testing, and like they say, time is money. Spread the word on this great feature, guys, and many thanks to utw for bringing this up!!! :)

Jeordie015 08-24-2006 09:29 PM

How would you change it so in the little nested directory thing showing where you are has a different name than just the template name. Using the example in the first post. It would just say that you were in test2. And that looks a little weird.

Edit: The reason why I am asking is that I want the name to be two separate words, and you can't have spaces...so yeah.

utw-Mephisto 08-24-2006 10:06 PM

Added to vbulletin.com too :)

http://www.vbulletin.com/forum/showthread.php?t=197563

Thanks guys for the great responses :) :D

utw-Mephisto 08-24-2006 10:10 PM

Quote:

Originally Posted by Jeordie015
How would you change it so in the little nested directory thing showing where you are has a different name than just the template name. Using the example in the first post. It would just say that you were in test2. And that looks a little weird.

Edit: The reason why I am asking is that I want the name to be two separate words, and you can't have spaces...so yeah.

Don't quite understand what you mean tbh .. You can give the template any name, example :

Lets call the template custom_Jeordie015

Here the result :

http://www.ut2007world.com/misc.php?...ate=Jeordie015

utw-Mephisto 08-24-2006 10:25 PM

Added instructions (on request) how to use vbadavanced for custom pages and also how to use permissions.

utw-Mephisto 08-24-2006 10:40 PM

Quote:

Originally Posted by Jeordie015
How would you change it so in the little nested directory thing showing where you are has a different name than just the template name. Using the example in the first post. It would just say that you were in test2. And that looks a little weird.

Edit: The reason why I am asking is that I want the name to be two separate words, and you can't have spaces...so yeah.

Good question. Try this :

Create an empty file and use the following code :

Code:

<?php

// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// ##################### DEFINE IMPORTANT CONSTANTS #######################
// change the line below to the actual filename without ".php" extention.
// the reason for using actual filename without extention as a value of this constant is to ensure uniqueness of the value throughout every PHP file of any given vBulletin installation.

define('THIS_SCRIPT', 'test'); 

// #################### 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(
        // change the lines below to the list of actual templates used in the script
        'test',
);

// pre-cache templates used by specific actions
$actiontemplates = array();

// ########################## REQUIRE BACK-END ############################
require_once('./global.php');

// #################### HARD CODE JAVASCRIPT PATHS ########################
$headinclude = str_replace('"clientscript', '"' . $vbulletin->options['bburl'] . '/clientscript', $headinclude);

// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################

$navbits = array(); 
// change the line below to contain whatever you want to show in the navbar (title of your custom page)
$navbits[$parent] = 'Test Page';

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');

// change the line below to contain the name of the actual main output template used in your script
eval('print_output("' . fetch_template('test') . '");');

?>

Check the comments within the code to see what you need to change ..

Basicially the colored code.

Here you can specify the title using more than one word.

Now simply call the php file, like http://<domain>/<php file>


All times are GMT. The time now is 02:09 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01329 seconds
  • Memory Usage 1,755KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete