vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   How to create your own vBulletin-powered page! (uses vB templates) (https://vborg.vbsupport.ru/showthread.php?t=62164)

coderphp 01-04-2007 10:48 AM

nice tut thanx..

WhaLberg 01-04-2007 10:52 AM

I was gonna open a thread same as that but it's good to see that it's already opened.

Some months ago, I thought how can I do an own page in the vB forum.. I checked the codes of official files.. It took my 2 month to understand that I need eval('print_output("' . fetch_template('templatename') . '");'); :D

Anyway..

Thanks.. I am sure people like your help. :)

wIrEs 01-05-2007 02:12 PM

awesome, now i can finally move on with my life LOL, i mean, i have no longer limits on what i can do with vBulletin, sort of speak :)

thanks, installed.

Mum 01-13-2007 09:21 PM

i am a complete newbie. How would i make my new page appear in the bar that goes across that says UserCP, FAQ, Members List etc?

ragtek 01-13-2007 09:31 PM

then edit the navbar template and search for memberlist.php then you know where you are ;) and where you have to put in the new link

Mum 01-13-2007 09:34 PM

Thank you, as i said, i am a complete newbie - thanks!

Quote:

Originally Posted by ragtek (Post 1158372)
then edit the navbar template and search for memberlist.php then you know where you are ;) and where you have to put in the new link

I'm a little lost as to what i type in there now. Could you give me more details? My new page is called chatroom.php

stinger2 01-14-2007 12:33 AM

very nice thank you....very easy to do

ragtek 01-14-2007 12:33 PM

Quote:

Originally Posted by Mum (Post 1158374)
Thank you, as i said, i am a complete newbie - thanks!



I'm a little lost as to what i type in there now. Could you give me more details? My new page is called chatroom.php

PHP Code:

<td class="vbmenu_control"><a href="chatroom.php$session[sessionurl_q]">linkname</a></td


Mum 01-14-2007 04:50 PM

Thanks so much for your help!

HPIA 01-15-2007 05:50 PM

I got it to work, thanks!

One question:

About ?do= thing you added at the bottom, I want to make a popup for vbshout. so you have http://url.com/vbshout.php as the main one, but when you type in http://url.com/vbshout.phpdo=popup a new mini window will popup so you can go all around the forum and be able to type in it. How would I be able to do that?

XxBuLLeTz 02-10-2007 12:29 PM

im pretty sure to create a custom page, the link has to be in the root diretory...is there a way to get the custom page on another link like tournaments/index.php?

ZomgStuff 02-14-2007 10:30 PM

Quote:

Originally Posted by XxBuLLeTz (Post 1179093)
im pretty sure to create a custom page, the link has to be in the root diretory...is there a way to get the custom page on another link like tournaments/index.php?

Use http and www headers, I believe.

Warlock40 02-15-2007 07:14 PM

Baahhh.. All I get is a blank page. The names are in Capitals. I still can't get it to work.

Allan 03-05-2007 10:21 PM

I add this, but don't show, always first page:

Quote:

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:

Code:

if ($_REQUEST['do'] == 'disclamer')
{
    eval('print_output("' . fetch_template('disclamer') . '");');
}

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=disclamer to view this template.) Then of course, change TEMPLATE_XXX to your template name, it's that simple!

j_86 03-06-2007 11:59 AM

Any reason why this would work on an install with the default vB skin and *not* with a customised skin (with the TEST template created in each?) As in, it is blank when selecting the custom style. I confirm again the correct templates are there.

ReQueM 03-07-2007 02:30 AM

thanks!!

i want change $navbits[$parent] = 'deneme'; for test.php?do=deneme page :confused:

kpr 03-11-2007 08:22 AM

Hi i am looking to try and use this to set up a directory using vb headers and footer on it is this possible and if so how would i do this? the directory is in the folder called directory and uses smatry templates if that helps.

Littlerocket 03-16-2007 05:31 PM

Great mod. Does anyone have any idea how I'd integrate a PHP script into it though?

I'd like to integrate a php gallery script, but having no joy.

<removed>

Please don't post entire scripts, use an attachment (and check you have permission as well).

BrettMo 03-17-2007 02:57 PM

I need to include a PHP file output in my template, but

Code:

<?PHP include("filename") ?>
does not work in a template. I see this covered over and over in this thread (I did read it) but I don't understand the answer to the problem. It seems to come down to something about making a variable in the "php include start template." Can someone explain how to do that to me in detail? Thanks.

tytyguy 03-21-2007 08:43 PM

im getting a blank page. Im on vb 3.6.5 here are my codes. i want mydomain.com/sms.php


template
Code:

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

$header
$navbar

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%"

align="center">
<tr>
<td class="tcat">My Custom Page Title</td>
</tr>
<tr>
<td class="alt1">Other Bluff...</td>
</tr>
</table>

$footer
</body>
</html>


and page

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', 'sms');

// #################### 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
        'sms',
);

// 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] = 'SMS 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('SMS') . '");');

?>

edit: i got it.

BrettMo 03-23-2007 04:55 AM

Quote:

Originally Posted by BrettMo (Post 1205653)
I need to include a PHP file output in my template, but

Code:

<?PHP include("filename") ?>
does not work in a template. I see this covered over and over in this thread (I did read it) but I don't understand the answer to the problem. It seems to come down to something about making a variable in the "php include start template." Can someone explain how to do that to me in detail? Thanks.

To answer my own question, I ended up using this mod instead which met my needs to include a php file: https://vborg.vbsupport.ru/showthread.php?t=103076

UltimateOreo! 03-27-2007 01:28 AM

Probably outdated PHP, but thanks a lot Brett, your a lifesaver!

Twilkey 04-08-2007 09:54 PM

I cant get anything to work. On this mod, I get Parse errors on line 2. There inst even anything on line 2. And as for Brett, I am having problems with that thing to.

XxBuLLeTz 05-07-2007 12:41 AM

Is there anyway I can create a custom page not in the root directory?

Digbijoy 05-07-2007 10:04 AM

thanx for the tut.

worked cool and fine for me.

i'll be making heaps of custom pages this way, in the near future also.

lukemax 05-14-2007 05:02 PM

me too, I'm trying to create a page like this 1 directory up from the vbulletin one. When I try, I get a blank page, any ideas?

Antivirus 05-21-2007 02:43 AM

Quote:

Originally Posted by lukemax (Post 1247502)
me too, I'm trying to create a page like this 1 directory up from the vbulletin one. When I try, I get a blank page, any ideas?

If you get a blank page, it could be one of several reasons. Usually when i get that, it's because I forgot to put a semicolon at the end of a line somewhere in the script. Also, since you're placing the script 1 directory up from forum directory, make sure that you're calling your required files the correct way like this:

PHP Code:

// ################## REQUIRE BACK-END #### 
chdir('D:\webppliance\conf\domains\site\Inetpub\wwwroot\forum'); // path to forum dir
require_once('./global.php');  
require_once(
'includes/class_bbcode.php'); 


robinhood1995 05-27-2007 10:40 AM

Hi,

I got all of it working.

Lets say that the test.php is called and the linked items that are displayed are links to other php pages which are articles that are written in php format.

So the issue that I have is that I can call the test.php page but when I click on a link I loose vbulletin and only have the new php page up.

Question:
How can I keep the other pages from exiting out of vb and keep the header and footer from vb displayed?

Do I have to create a template for every page?

Thanks

AndyPandy 05-30-2007 04:52 PM

How wud I go about putting a user's avatar on a page like this?

robinhood1995 05-30-2007 06:59 PM

Quote:

Originally Posted by AndyPandy (Post 1257725)
How wud I go about putting a user's avatar on a page like this?

Via the User CP under Avatar section on right hand side

AndyPandy 05-30-2007 07:20 PM

That made no sense what so ever, any other suggestions?

jasonmerchant 06-18-2007 02:49 AM

Hello, I have a page located outside of the vbulletin directory and the script is running smoothly. The page attempts to call cron.php, but it is showing up in my log that it can not find it. Where can I set the path to cron.php? Is there an option in the control panel or must it be done in code?

Thanks

OpalCat 06-21-2007 10:06 PM

I have a weird problem... I'm displaying an embedded swf file and the QuickLinks and Search dropdowns are going behind the swf...?

http://fff.fathom.org/forums/hero.php

J0iN 07-03-2007 07:56 PM

Nice really needed that for my forum, Thanks

This is great i can make my own pages cheers for this mate

T_Richardson 07-06-2007 07:48 PM

Quote:

Originally Posted by SirAdrian (Post 740342)
Put it in the PHP file, instead of using echo/print use variables, then just put the variable in the template. If that is too much work, I think you can use something like this:
PHP Code:

ob_start();

// All your PHP you want in the template here

$above ob_get_contents();
ob_end_clean(); 

Then putting $above in your template would show all the PHP.

Thank you, I've been searching for this solution to include a separate index.php file for 3 hrs. This worked like a dream.

Just to make it clear what I did I'll show it for someone who is also looking:


Code snipet at end of custom page php file.
PHP Code:

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

ob_start();

require_once(
'./bf2_status/index.php');

$above ob_get_contents();
ob_end_clean();

$navbits = array();
$navbits[$parent] = 'BF2 Status';

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


?> 

I put in "require_once('./bf2_status/index.php');" to get the php file. Then in the template where you usually put the html code for the content, I just put $above

rnmcd 07-06-2007 11:09 PM

Anyone want to link me to a site that is using this mod? I would like to see what you can do with it.

Thanks.

ragtek 07-07-2007 08:56 AM

lol
you can make your own sites
and thats no hack;)
thats just the basic code you need in your file if you want to make a extrafile with the vb classes

how it looks:
http://www.ragtek.org/forum/stencil.php or http://www.ragtek.org/forum/linkliste.php or http://www.ragtek.org/forum/spende.php

rnmcd 07-07-2007 10:05 PM

So it adds the header, footer and navbar, etc to the page and you can enter the 'body' of the page?

Ragtek, how did you create the new links in your navbar?

T_Richardson 07-07-2007 10:26 PM

Quote:

Originally Posted by rnmcd (Post 1285404)
So it adds the header, footer and navbar, etc to the page and you can enter the 'body' of the page?

Ragtek, how did you create the new links in your navbar?

Yes, It adds all those. Works great with Ultimate Side Bars

rnmcd 07-08-2007 12:34 AM

What a coincidence. That is the only other hack/modification I am considering doing at this time!


All times are GMT. The time now is 10:17 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.02480 seconds
  • Memory Usage 1,843KB
  • 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
  • (5)bbcode_code_printable
  • (4)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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