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)

Gary King 03-22-2004 12:03 AM

Put the following, probably best place would be at the very end right before the ?>

PHP Code:

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



AshAbed 03-22-2004 12:42 AM

http://www.maddpc.com/~ashraf/index.php
the index page works fine, I added the extra code you put to the end of index.php but when I put something like http://www.maddpc.com/~ashraf/index.php?page=psdmain I'm not brought to the template index_psdmain, how would this be done?

Grendel 03-22-2004 08:52 AM

Quote:

Originally Posted by Gary W
Well I haven't looked into how the code creates the events data, but I suppose it would require more than index.php then. I will look into it when I have time, or maybe someone else could give it a go :)

That would be great. I'll take a look as well, but I tried various things yesterday and none was working.

SVTBlackLight01 03-23-2004 02:35 AM

Quote:

Originally Posted by AshAbed
http://www.maddpc.com/~ashraf/index.php
the index page works fine, I added the extra code you put to the end of index.php but when I put something like http://www.maddpc.com/~ashraf/index.php?page=psdmain I'm not brought to the template index_psdmain, how would this be done?

Have you gotten this to work? This could be useful for me as well.

AshAbed 03-23-2004 10:14 AM

Quote:

Originally Posted by SVTBlackLight01
Have you gotten this to work? This could be useful for me as well.

unfortunatley I haven't, I'll work on it and tell you how it goes

Osterling 03-23-2004 10:30 AM

is tehre a way to have it seach pages that are not off the forum?

Gary King 03-23-2004 01:14 PM

Quote:

Originally Posted by SVTBlackLight01
Have you gotten this to work? This could be useful for me as well.

I've placed instructions in the first post a few days ago :)

Silverstangs 03-23-2004 05:14 PM

Thank you Gary W for the tutorial, I needed that!

Silver

SVTBlackLight01 03-23-2004 05:54 PM

Quote:

Originally Posted by Gary W
I've placed instructions in the first post a few days ago :)

OK. I have it working now. Thanks.

Gary King 03-23-2004 06:52 PM

No problem glad it worked :)

AshAbed 03-23-2004 08:12 PM

sorry to be a hassle, but can you please tell me what I'm supposed to do here?
my templates are named index_fonts, index_psds...etc like that, what would I change this code to for it to work correctly?
PHP Code:

if ($_REQUEST['do'] == 'xxx'

    eval(
'print_output("' fetch_template('TEMPLATE_XXX') . '");'); 


thanks alot

Gary King 03-23-2004 11:13 PM

Quote:

Originally Posted by AshAbed
sorry to be a hassle, but can you please tell me what I'm supposed to do here?
my templates are named index_fonts, index_psds...etc like that, what would I change this code to for it to work correctly?
PHP Code:

if ($_REQUEST['do'] == 'xxx'

    eval(
'print_output("' fetch_template('TEMPLATE_XXX') . '");'); 


thanks alot

Change TEMPLATE_XXX to index_fonts, etc.

AshAbed 03-23-2004 11:19 PM

ok.. sorry about this, but http://www.maddpc.com/~ashraf/index.php? is the page, I added
PHP Code:

if ($_REQUEST['do'] == 'xxx'

    eval(
'print_output("' fetch_template('index_fonts') . '");'); 


and I don't see index_fonts template when I go to
http://www.maddpc.com/~ashraf/index.php?do=fonts
or
http://www.maddpc.com/~ashraf/index.php?do=index_fonts
thanks

Acido 03-23-2004 11:49 PM

I think you must try this code:

PHP Code:

if ($_REQUEST['do'] == 'fonts'

    eval(
'print_output("' fetch_template('index_fonts') . '");'); 



Gary King 03-24-2004 01:15 AM

Quote:

Originally Posted by AshAbed
ok.. sorry about this, but http://www.maddpc.com/~ashraf/index.php? is the page, I added
PHP Code:

if ($_REQUEST['do'] == 'xxx'

    eval(
'print_output("' fetch_template('index_fonts') . '");'); 


and I don't see index_fonts template when I go to
http://www.maddpc.com/~ashraf/index.php?do=fonts
or
http://www.maddpc.com/~ashraf/index.php?do=index_fonts
thanks

If you use that code, then go to ?do=xxx

Grendel 03-24-2004 11:43 AM

Quote:

Originally Posted by Grendel
I try to put the "whats-going-on"-content of the forumhome-template into a custom template. Works fine - besides the "calender events". Is there any way to put the events on an "vBulletin-powered page"?

Even if I'm the only one who is interested in this problem I post my solution anyway:

If the events should show up:

define('THIS_SCRIPT', 'test'); (where test is the name of the nonvb-page)

should be

define('THIS_SCRIPT', 'index');

SideFX 03-25-2004 03:54 PM

Ok i am having one hell of an issue, I made a index page for a site i am building but when your not logged into the forum the homepage doesnt show up. This page is out side vb and in the home directory. any help would be appreciated.

EDIT: i put it back into vb and still logged out user cant see it how do i give them permissions to veiw this page?

Marulatree 03-25-2004 10:37 PM

linux server files are case sensitive...

it's all lowercase /forum/test.php - still give me a blank page...
Quote:

Originally Posted by Gary W
What's the template name? Use UPPERCASE not lowercase.


Marulatree 03-25-2004 10:40 PM

got it!!!! test at the bottom of test.php is uppercase there your template needs to be "TEST" uppercase

AutomatikStudio 03-26-2004 01:14 AM

Alright gary...thanks for the tips thus far. He's what I'm trying to do. I'm trying to create an article system of sorts. My database table will have the following fields: Author, Date, Article, Title, and ID. Now, what I'd like to do is have something like:

articles.php?do=viewarticles&artid=4

And that would call the article in the database with the ID of 4. At any rate, how would I do that without having to make a new template for every article.

SVTBlackLight01 03-26-2004 01:49 AM

AutomatikStudio,

Just a suggestion. It may be easier to use a variation of one of the portal hacks.

Gary King 03-26-2004 02:00 AM

Quote:

Originally Posted by AutomatikStudio
Alright gary...thanks for the tips thus far. He's what I'm trying to do. I'm trying to create an article system of sorts. My database table will have the following fields: Author, Date, Article, Title, and ID. Now, what I'd like to do is have something like:

articles.php?do=viewarticles&artid=4

And that would call the article in the database with the ID of 4. At any rate, how would I do that without having to make a new template for every article.

Basically just use a generic 'shell' template which has generic stuff that all the pages will have. Then just use variables in the templates, I'm sure you can go from there :)

GoTTi 03-26-2004 02:34 AM

n/m got it.

GoTTi 03-26-2004 02:37 AM

can u make vb code work with this ?

otherwise this is like HTML pages i guess...gotta use HTML tags.

The Wise One 03-27-2004 01:10 AM

is it possible to get the member age (if specified by the user in in his options) to show on the page...and is it possible to get the contact column from memberlist.php to work on this custom page? if so...how?

SVTBlackLight01 03-27-2004 02:22 AM

I have also been wondering if it is possible to include info for a specific user on the page.

AutomatikStudio 03-28-2004 03:11 AM

How would I add the title of the page in to the <title> tags?

SVTBlackLight01 03-28-2004 03:59 AM

This is what I am doing to make it a little more automated.

Between the title tags, use

Code:

$navbits[lastelement]
This will display what ever you use for you navbits here

PHP Code:

$navbits[$parent] = 'Whatever'; (test.php

in the title.

See here:

http://www.modernengineuity.com/specs/ford_gt.html

AutomatikStudio 03-28-2004 04:23 AM

Where can I find the <title> tags to edit? I seriously feel like I've looked everywhere..I'm sure they're right under my nose.

SVTBlackLight01 03-28-2004 04:32 AM

It's in the template.

AutomatikStudio 03-28-2004 04:38 AM

Yeah..that's what I'm saying...I've looked through just about every template. Which specific template did you edit?

SVTBlackLight01 03-28-2004 04:45 AM

If you use the first post as an example, the template would be called TEST.

It should look something like this

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>


AutomatikStudio 03-28-2004 04:46 AM

Doh...I'm an idiot.

PKRWUD 03-28-2004 05:06 AM

Okay, I created the php files and uploaded them, and made the templates and named them in uppercase. But when I enter the addy in my browser, I get this:

Parse error: parse error, expecting `')'' in /home/pkrwud/public_html/vbulletin/decals.php on line 13

BTW, I am rather clueless when it comes to this stuff, but I try.

PKRWUD 03-28-2004 05:08 AM

also, "decals.php" is the "test" file.

Enforcerman 03-28-2004 06:24 AM

Ok. I read all 8 pages so far and i havent seen this question asked. So, I am going to go for it. Lets say that you have two different styles for a forum and you want to specific exactly which style you want a page to display. Can you think of any code that can be included that will load a specific style.

Oh yeah. I dont want to add the styleid variable to the URL either. I want this to be hidden in the php page.

FASherman 03-28-2004 11:28 AM

Quote:

Originally Posted by Gary W

Quote:

Originally Posted by The Watcher
This looks promising gary -> a few questions !!!

1) How can I use this outside my forums directory? Do i just use this?

PHP Code:

chdir('/home/site/public_html/forums/'); 
require(
'./global.php'); 


1) correct

I believe this is incorrect. If yo do it this way, you will display a non-functioning navbar. The pop-up menus will not work. I don't know why, and I don't know how to fix it, but I do know if you create test.php in your forum root dir and the TEST template exactly as given in the first post, it works.

Take that same script and more it to another directory and it breaks on global.php. Add the chdir as above just before your require statement and you will have a non-functioning navbar. No pulldown menus.

Any ideas on how this is resolved?

PKRWUD 03-28-2004 11:54 AM

Well, I just tried all over again from scratch, and did it exactly the way I read it, and this time received this error:

Parse error: parse error, expecting `')'' in /home/pkrwud/public_html/vbulletin/test.php on line 23

What does this mean? On line 23, is 'TEST', the name of the TEST template I made.

Anyone?

AutomatikStudio 03-28-2004 12:49 PM

What is your WHOLE line 23? Copy and paste it here.

PKRWUD 03-28-2004 01:41 PM

PHP Code:

<?php 

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

// #################### DEFINE IMPORTANT CONSTANTS ####################### 
define('NO_REGISTER_GLOBALS'1); 
define('THIS_SCRIPT''test'); // change this depending on your filename 

// ################### 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( 
++++
'TEST'
); 

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

); 

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


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

$navbits = array(); 
$navbits[$parent] = 'Test Page'

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

?>



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

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

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02899 seconds
  • Memory Usage 1,854KB
  • 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
  • (9)bbcode_php_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)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