Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 3 Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
How to create your own vBulletin-powered page! (uses vB templates)
Gary King's Avatar
Gary King
Join Date: Jan 2002
Posts: 2,046

 

Show Printable Version Email this Page Subscription
Gary King Gary King is offline 03-03-2004, 10:00 PM

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:
<?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') . '");');

?>
Be sure to change 'TEST' to the actual template name, and change 'test' to the filename. Also, change 'Test Page' to whatever you want to show in the navbar, such as 'Viewing Member Profile' (just an example).

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>
All done
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:
    case 'bugs.php':
        
$userinfo['activity'] = 'bugs';
        break; 
Below, add:
PHP Code:
    case 'test.php':
        
$userinfo['activity'] = 'test';
        break; 
(Be sure to change the values to your own!)

Then find:
PHP Code:
        case 'modcplogin':
            
$userinfo['action'] = $vbphrase['moderator_control_panel_login'];
            break; 
Below add:
PHP Code:
        case 'test':
            
$userinfo['action'] = 'Viewing Test Page';
            break; 
All done!

----------------------------------

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:
if ($_REQUEST['do'] == 'xxx')
{
    eval(
'print_output("' fetch_template('TEMPLATE_XXX') . '");');

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


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
Attached Images
File Type: jpg template_test.jpg (62.5 KB, 0 views)
Reply With Quote
  #402  
Old 12-22-2005, 01:56 AM
Cebby Cebby is offline
 
Join Date: Aug 2005
Location: Pittsburgh, PA
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ncangler
I don't know if this is possbile or not but I'm trying to create a stand alone index.php file that contains some code for a Beach Tide Table. The trick is getting the vBulletin header, footer and navbar on the page so it looks consistent with the rest of my site. The Tide Table code has to be in the index.php file as it contains information for multiple locations that is refreshed when you click on the location you want. Here is the Tide Table link:

http://www.ncangler.com/tides/wilmington/index.php

My forums are located here: http://www.ncangler.com/forums/

Can anyone tell me if this can be implemented with this hack? Thanks for your help!
I have this hack pretty much done, except I want to do the same thing you do.

I think this post applies to what we want to do. (This is speaking of images, but I think the same methodology for calling other pages applies) I'd really like to display a separate PHP file in the main window. Seems this isn't like working in frames like HMTL...
Reply With Quote
  #403  
Old 12-26-2005, 10:09 AM
MRGTB MRGTB is offline
 
Join Date: Dec 2004
Posts: 548
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is there a version of this for vB3.5 series?
Reply With Quote
  #404  
Old 12-26-2005, 02:19 PM
derekivey derekivey is offline
 
Join Date: Apr 2005
Location: Pennsylvania, USA
Posts: 1,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It works on 3.5. The only change you should make is to move $headinclude up before <title> in the template.
Reply With Quote
  #405  
Old 12-26-2005, 03:03 PM
MRGTB MRGTB is offline
 
Join Date: Dec 2004
Posts: 548
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You mean like this:

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">Title</td>
</tr>
<tr>
	<td class="alt1">Text</td>
</tr>
</table>

$footer
</body>
</html>
If thats right, does nothing need to be changed in the PHP file?
Reply With Quote
  #406  
Old 12-27-2005, 06:50 PM
derekivey derekivey is offline
 
Join Date: Apr 2005
Location: Pennsylvania, USA
Posts: 1,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, thats right. Nothing in the PHP file needs to be changed.
Reply With Quote
  #407  
Old 01-12-2006, 09:50 PM
Eagle Creek's Avatar
Eagle Creek Eagle Creek is offline
 
Join Date: Jan 2004
Location: Netherlands
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Gary Bolton
You mean like this:

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">Title</td>
</tr>
<tr>
	<td class="alt1">Text</td>
</tr>
</table>

$footer
</body>
</html>
If thats right, does nothing need to be changed in the PHP file?
Is there an edit to the file so I won't to change it (I mean, the 3.5.x version).
Reply With Quote
  #408  
Old 01-13-2006, 02:21 AM
demojames demojames is offline
 
Join Date: Sep 2005
Location: Kent, WA.
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks worked perfect on Vb 3.0.12 :up:
Reply With Quote
  #409  
Old 01-13-2006, 02:53 PM
Asi9ine's Avatar
Asi9ine Asi9ine is offline
 
Join Date: Aug 2005
Location: Berkshire, England
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm gonna bookmark this page. Not got the time right now, but excellent work nonetheless. Well done.
Reply With Quote
  #410  
Old 01-24-2006, 08:14 PM
cyberhypnotic cyberhypnotic is offline
 
Join Date: Nov 2005
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How do you get the Who's Online to work in 3.5.3?

I did the original edit, but it came back with "Unknown" and a link to a file on my server.

I see that when you click on "Currently Active Users" it's online.php that handles it. What do I change in there?

Meanwhile, I'll keep trying some things.
Reply With Quote
  #411  
Old 01-29-2006, 08:00 AM
matttiger matttiger is offline
 
Join Date: Jan 2006
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great tutorial. Thanks
Reply With Quote
  #412  
Old 01-30-2006, 11:49 PM
MRGTB MRGTB is offline
 
Join Date: Dec 2004
Posts: 548
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How can this be made to work from outside your forums folder?

What code changes would have to be made
Reply With Quote
  #413  
Old 02-09-2006, 03:52 AM
UManiac's Avatar
UManiac UManiac is offline
 
Join Date: May 2002
Location: DC
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by caislander
Anybody,

I can't get phrases created via the phrase manager to show up? Any ideas what i might have done wrong ? here is the info in my template if it helps

As always Thanks for any assistance :0

Ditto - html shows upe just fine - phrase do not...

Any help would be appreciated.
Reply With Quote
  #414  
Old 02-12-2006, 12:49 AM
MRGTB MRGTB is offline
 
Join Date: Dec 2004
Posts: 548
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does anybody know how you can get the lastest thread titles displayed on the test template taken from the forum boards, that display the thread title as a link that when clicked leads to the thread itself
Reply With Quote
  #415  
Old 02-12-2006, 12:56 AM
UManiac's Avatar
UManiac UManiac is offline
 
Join Date: May 2002
Location: DC
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by UManiac
Ditto - html shows upe just fine - phrase do not...

Any help would be appreciated.
Got it to work

I added 'register' to special phrase gorups. See below

PHP Code:
// get special phrase groups 
$phrasegroups = array(
    
'register',
); 
Reply With Quote
  #416  
Old 02-18-2006, 01:05 PM
Eddymvp Eddymvp is offline
 
Join Date: Jun 2004
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For some reason, when i do a query to the database within this page i get the following error
"Fatal error: Call to a member function on a non-object in /vservers/lustiesn/htdocs/vbulletin/main.php on line 45"
and there is the code that i'm using to query to the database

PHP Code:
 $getnews $DB_site->query_first("SELECT * FROM thread left join post  on (post.postid=thread.firstpostid) where thread.forumid=18  order by thread.threadid desc limit 1"); 
Reply With Quote
  #417  
Old 02-20-2006, 10:34 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What version of vB are you running?

If you are using vB3.5, you will need to use $vbulletin->db->query_first instead of $DB_site->query_first.

PS I think there is a similar HOW-TO in our 3.5 Tutorial section.
Reply With Quote
  #418  
Old 02-20-2006, 06:51 PM
Eagle Creek's Avatar
Eagle Creek Eagle Creek is offline
 
Join Date: Jan 2004
Location: Netherlands
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Look:

How can I change this so it IS a know location?
Attached Images
File Type: png whereishe.PNG (3.5 KB, 0 views)
Reply With Quote
  #419  
Old 02-20-2006, 06:58 PM
Smiry Kin's's Avatar
Smiry Kin's Smiry Kin's is offline
 
Join Date: Dec 2005
Location: United Kingdom!
Posts: 954
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Eagle Creek
Look:

How can I change this so it IS a know location?
i get this aswell, i think every one else does also:S if a fix can be made, then nice, if not no worries..
Reply With Quote
  #420  
Old 02-20-2006, 07:20 PM
MRGTB MRGTB is offline
 
Join Date: Dec 2004
Posts: 548
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Smiry Kin's
i get this aswell, i think every one else does also:S if a fix can be made, then nice, if not no worries..
you obviously have not followed the instructions proper, as it tell you how to sort that out on the first page of this thread by the hack poster, who has also posted the code fix for Who's Online
Reply With Quote
  #421  
Old 02-22-2006, 12:19 PM
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Location: Vineland, NJ
Posts: 6,693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

3.5 users may be interested in GTCUSTOM PAGES
Reply With Quote
  #422  
Old 02-23-2006, 02:09 AM
paulomt1 paulomt1 is offline
 
Join Date: Nov 2001
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I need add this code to php file but doesn't work.

$ch = curl_init ("http://www.domain.name?".$QueryString);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_exec ($ch);

if(curl_error($ch))
echo "Error processing request";

curl_close ($ch);

But if I comment this line it works, but is not a vbulletin page anymore :-(
eval('print_output("' . fetch_template('my_template') . '");');

I've solved the problem.
Reply With Quote
  #423  
Old 03-24-2006, 08:54 PM
Barakat's Avatar
Barakat Barakat is offline
 
Join Date: Nov 2004
Location: Jerusalem
Posts: 571
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

loook i made this .... but need ur help .
hi !

i have a little problem in reading and viewing some html from my database which i make it .... acually iam trying to make some differnt hack which can read templates from the database instead to include it to the style templates

the idea comes to me when i was trying to add some html templates to the style and i saw that its from the stupidity to add a houndred templates to a styles so it will make the forum style very heavy for me . any way here is the idea ....

i create that

Code:
CREATE TABLE `testdb` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(50) NOT NULL default '',
  `descr` varchar(50) NOT NULL default '',
  `content` text NOT NULL,
  PRIMARY KEY  (`id`)
) TYPE=MyISAM;
and add for every id and content a unique number with a full html template.

i have more than 100 id with 100 full html text pages for that .
so i make a php file with a name of test.php and include that code inside it :

PHP Code:
<?php
/*======================================================================*\
|| #################################################################### ||
|| # test v6.0.1                                                                                                                  # ||
|| # Copyright ?2005- 2006 Barakat. All Rights Reserved.                                               # ||
|| #                                                                                                                                    # ||
|| #################################################################### ||
\*======================================================================*/

//-----------------------------------------
// By: Barakat Barakat

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

// ##################### DEFINE IMPORTANT CONSTANTS ####################### 
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(''); 

// 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 ############################ 
// ######################################################################## 

if ($id) {
function 
getcontent($contentid) {
$contents  =$vbulletin->db->query_read("SELECT content FROM " TABLE_PREFIX "testdb" "WHERE id=$contentid");
$content   $vbulletin->db->fetch_Array($contents);
$contentid =$content[content];
$html=str_replace("\"","\\\"",$contentid);
return 
$html;
}
$que =$vbulletin->db->query_read("SELECT * FROM " TABLE_PREFIX "testdb" "WHERE id=$id");
$result =$vbulletin->db->query_read($que)
  or die (
"Error reaching the file.... ");
$page $vbulletin->db->fetch_Array($result);
$navbits construct_navbits(array('' => $page[name]));
eval(
'$navbar .= "' fetch_template('navbar') . '";');
eval(
"print_output(\"".getcontent("$id")."\");");
}
/*======================================================================*\
|| ####################################################################
|| # CVS: $RCSfile: test.php,v $ - $Version: 6.0.1 $
|| ####################################################################
\*======================================================================*/
?>
www.forum/test.php?id=1
while browseing the file , a blank page appears to me !!!1

so ...........

if i include 'test_h' template to the style it will open it nicely but i need to read from my database by its id so to browse is as its browsed from the style it self:-

now if i want to read the templates from my styles i just make that changes

// pre-cache templates used by all actions

PHP Code:
$globaltemplates = array('test_h'); 
and add that code instead of the main script corner

PHP Code:
$navbits = array();  
$navbits[$parent] = 'testss'
$navbits construct_navbits($navbits); 
eval(
'$navbar = "' fetch_template('navbar') . '";'); 
eval(
'print_output("' fetch_template('test_h') . '");'); 

and off couse the test_h template is included and it tooks a style like that :-



Code:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
	<!-- no cache headers -->
	<meta http-equiv="Pragma" content="no-cache" />
	<meta http-equiv="Expires" content="-1" />
	<meta http-equiv="Cache-Control" content="no-cache" />
	<!-- end no cache headers -->
	<title><phrase 1="$vboptions[bbtitle]">$vbphrase[x_powered_by_vbulletin]</phrase></title>
	$headinclude
</head>
<body>
$header
$navbar

<!-- html codes begins here-->
<!-- html codes ends here  -->

$footer
</body>
</html>
P.S i tried also to include the functions in a function_test file and upload it to the includes but it did not works .......
Reply With Quote
  #424  
Old 03-24-2006, 08:59 PM
Eagle Creek's Avatar
Eagle Creek Eagle Creek is offline
 
Join Date: Jan 2004
Location: Netherlands
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Guys!

I read this:
https://vborg.vbsupport.ru/showthread.php?t=98009

But I can't get it working.

It's about this page:
http://www.nucia.nl/forum/donatie.php

So what I do is:
Quote:
Plugin:
Product: vBulletin
Hook Location: online_location_process
Title: My Custom Location (Part1)
Plugin PHP Code:
PHP Code:
 if ($filename == 'donatie.php')
{
        
$userinfo['activity'] = 'donatie';

[b]Plugin is Active: Yes
Quote:
Plugin:
Product: vBulletin
Hook Location: online_location_unknown
Title: My Custom Location (Part2)
Plugin PHP Code:
PHP Code:
 if ($userinfo['activity'] == 'donatie')
{
        
$userinfo['action'] = 'TEST message donation'// you might wanna use a $vbphrase here...
        
$userinfo['where'] = '<a href="./donatie.php?' $vbulletin->session->vars['sessionurl'] . '">THIS IS TEST MESSAGE</a>'// you might wanna use a $vbphrase here...
        
$handled true;

Plugin is Active: Yes
But it keeps saying 'unknow location'. Can somebody tell me what I'm doing wrong?
Reply With Quote
  #425  
Old 03-24-2006, 09:27 PM
Cebby Cebby is offline
 
Join Date: Aug 2005
Location: Pittsburgh, PA
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Mine does that, but the page looks good and works - that's the important part to me. The location thing is nothing more than an annoyance at the moment.
Reply With Quote
  #426  
Old 04-06-2006, 06:17 AM
ztempuser ztempuser is offline
 
Join Date: Nov 2005
Posts: 143
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how can i let only people that are logged in see this page?, and if not logged in it will take them to the log in page, or the page of choice.
*sorry for the newbie question*
Reply With Quote
  #427  
Old 04-09-2006, 04:03 AM
captainandy captainandy is offline
 
Join Date: Apr 2006
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Guessing some have more constructive things to do than nail others - or some of us don't really grow up huh?
Reply With Quote
  #428  
Old 04-10-2006, 06:08 PM
Jordan17 Jordan17 is offline
 
Join Date: Mar 2006
Location: Teesside, UK
Posts: 73
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by blackwidow
how can i let only people that are logged in see this page?, and if not logged in it will take them to the log in page, or the page of choice.
*sorry for the newbie question*
I would like this too. At the moment anyone can view the page, but I would like to restrict it to members only.
Reply With Quote
  #429  
Old 04-11-2006, 01:50 AM
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Posts: 1,552
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

blackwidow and Jordan17: Try somehting like this:

Code:
<?php
    if (!$vbulletin->userinfo['userid'])
    {
          header("Location: http://www.redirected_page.com/");
          exit;
    }
?>
Reply With Quote
  #430  
Old 04-18-2006, 03:45 PM
egyptsons's Avatar
egyptsons egyptsons is offline
 
Join Date: Jan 2004
Location: Egypt
Posts: 250
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks
Reply With Quote
  #431  
Old 05-13-2006, 11:02 PM
funinthesun funinthesun is offline
 
Join Date: Oct 2005
Posts: 460
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I made the php file and the template exactly as you described and when I point my url to test.php I get this
Code:
Warning: Division by zero in /includes/functions.php(4320) : eval()'d code on line 98
What have I done wrong?
Reply With Quote
  #432  
Old 05-13-2006, 11:11 PM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by funinthesun
I made the php file and the template exactly as you described and when I point my url to test.php I get this
Code:
Warning: Division by zero in /includes/functions.php(4320) : eval()'d code on line 98
What have I done wrong?
Post your PHP file and your template.
Reply With Quote
  #433  
Old 05-14-2006, 12:07 AM
funinthesun funinthesun is offline
 
Join Date: Oct 2005
Posts: 460
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

My PHP file
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<?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') . '");'); 

?> 


</body>
</html>
And 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">Title</td>
</tr>
<tr>
	<td class="alt1">Text</td>
</tr>
</table>

$footer
</body>
</html>
Reply With Quote
  #434  
Old 05-14-2006, 12:20 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Your PHP file shouldn't have any HTML in it!
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') . '");'); 

?>
Reply With Quote
  #435  
Old 05-14-2006, 12:57 AM
funinthesun funinthesun is offline
 
Join Date: Oct 2005
Posts: 460
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Doh! How stupid am I! It's late and I'm falling asleep, please forgive me
Reply With Quote
  #436  
Old 05-14-2006, 01:46 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by funinthesun
Doh! How stupid am I! It's late and I'm falling asleep, please forgive me
lol

Good luck!
Reply With Quote
  #437  
Old 05-14-2006, 01:58 PM
funinthesun funinthesun is offline
 
Join Date: Oct 2005
Posts: 460
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I want to display thumbnails on my page of all the same size and when they are clicked it opens the image in a new browser (like google image search). How would I go about doing this?
Reply With Quote
  #438  
Old 05-18-2006, 05:37 PM
ang2el ang2el is offline
 
Join Date: Oct 2005
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am novice in php code just know how .html and use dreamweaver

I could make the test.php file but lost after that I mean where to make teplate and how to link them ...

So, I would be grateful if someone could explain me step by step what, how and where to do

thanks a lot
Reply With Quote
  #439  
Old 05-20-2006, 02:25 AM
ang2el ang2el is offline
 
Join Date: Oct 2005
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried Iframe code in the template but it didn't display the website that I wanted to display in the costume page created.

Can anyone help me how to display through template

or

how to create a page with just header navbar and footer or say no need to fetch template

thanks
Reply With Quote
  #440  
Old 06-09-2006, 08:19 PM
ZrH ZrH is offline
 
Join Date: May 2006
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Edit: I fixed it, I was putting the PHP file into the template instead of the HTML stuff.
Reply With Quote
  #441  
Old 06-23-2006, 06:17 PM
futureye futureye is offline
 
Join Date: Jan 2004
Location: oman
Posts: 97
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this method wont work with 3.5.4
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:35 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.13954 seconds
  • Memory Usage 2,735KB
  • Queries Executed 56 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (9)bbcode_code
  • (1)bbcode_html
  • (14)bbcode_php
  • (11)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (41)post_thanks_box
  • (5)post_thanks_box_bit
  • (41)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (41)post_thanks_postbit_info
  • (40)postbit
  • (2)postbit_attachment
  • (41)postbit_onlinestatus
  • (41)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete