View Full Version : vb3 new php file
Logikos
06-18-2003, 03:07 PM
So on my older version board i had a few extra php files added on such as rules.php and inside rules.php i had this:
<?php
$templatesused.='mytemplate';
require('./global.php');
eval("dooutput(\"".gettemplate("site_rules")."\");");
exit;
?>
But when i try to use that for vb 3.0.0 i get this error
Fatal error: Call to undefined function: gettemplate() in /home/hazelboy/public_html/forums/rules.php on line 4
So how do i get that template to show up?
Dean C
06-18-2003, 03:52 PM
Because vb3 uses a new function to get templates :)
fetch_template?
It's something like that. But practicly all the functions have been renamed :)
- miSt
filburt1
06-18-2003, 04:38 PM
Indeed the core ideas have changed from vB2 to vB3. I suggest looking at index.php (or whatever you have the forumhome script defined as) and modelling yours after that.
Logikos
06-18-2003, 09:12 PM
I got it :)
<?php
error_reporting(E_ALL & ~E_NOTICE);
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'myfile');
// get special phrase groups
$phrasegroups = array();
// get special data templates from the datastore
$specialtemplates = array();
// pre-cache templates used by all actions
$globaltemplates = array(
'my_custom_template'
);
// pre-cache templates used by specific actions
$actiontemplates = array();
require_once('./global.php');
eval('print_output("' . fetch_template('Custom_template') . '");');
?>
Erwin
06-19-2003, 02:03 AM
It's very different, isn't it. :)
Dean C
06-19-2003, 10:59 AM
But so much better ;) ^^
S.Shady
06-19-2003, 04:05 PM
Today at 07:59 AM Mist said this in Post #6 (https://vborg.vbsupport.ru/showthread.php?postid=410679#post410679)
But so much better ;) ^^
not when you only know a little bit of php and your used to vb2.
and dont have the time to learn because your to busy working or going out :(
filburt1
06-19-2003, 04:52 PM
The vB3 way is much better...it has good PHP programming practices (and general programming practices) as compared to vB2. Now you know what error_reporting(7) actually means, for example :)
DrkFusion
06-19-2003, 05:34 PM
I cannot wait til Teck rewrites the microstats hack :) It will be great for vB3. Also does anyone know the query loads, or know how to view the query loads for vb3? I know in vb3 they had the showqueries variable which allows you to see. Not sure for vb3
Dean C
06-19-2003, 05:36 PM
You don't need microstats for vb3 :)! Turn on debug mode whilst your testing and you'll get loads more info :)
- miSt
filburt1
06-19-2003, 06:13 PM
Today at 02:34 PM Keptic said this in Post #9 (https://vborg.vbsupport.ru/showthread.php?postid=410756#post410756)
I cannot wait til Teck rewrites the microstats hack :) It will be great for vB3. Also does anyone know the query loads, or know how to view the query loads for vb3? I know in vb3 they had the showqueries variable which allows you to see. Not sure for vb3
IIRC the query count is about 9 on forumhome and drastically reduced on other pages as well.
Look around in DB_mysql.php, it should be maintaining a counter there.
Logikos
06-19-2003, 09:12 PM
I agree vb3 is much better in the coding i might say. Its just going to take a little getting used to thats all :)
SmEdD
08-10-2003, 10:21 PM
06-19-03 at 02:36 PM Mist said this in Post #10 (https://vborg.vbsupport.ru/showthread.php?postid=410757#post410757)
You don't need microstats for vb3 :)! Turn on debug mode whilst your testing and you'll get loads more info :)
- miSt
Wheres the option for that cause all as I'm doing right now is getting queries.
For Just Queries:
$GLOBALS[query_count] Queries
Put that in the footer and you get your queries
Dean C
08-11-2003, 08:40 AM
Add $debug = 1; into your config.php file :) ^^
SmEdD
08-11-2003, 03:48 PM
Someone should set that up so only the admin can see it.
You don't need microstats for vb3 :)! Turn on debug mode whilst your testing and you'll get loads more info :)
- miSt
I didn't need also microstats in VB2 since it was there the info also...
However, for those who need microstats for VB3, I release it about a month ago... and is better then the VB2 version.
https://vborg.vbsupport.ru/showthread.php?t=62173
Logikos
03-27-2004, 10:08 PM
yikes 7 months later, Well if anyone needs this i would recommend this hack: https://vborg.vbsupport.ru/showthread.php?t=62164 :)
grandma
03-30-2004, 02:28 PM
Can you post how our final script looks like? I can't seem to get mine working.
Thanks
grandma
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.