vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   vb3 new php file (https://vborg.vbsupport.ru/showthread.php?t=54489)

Logikos 06-18-2003 03:07 PM

vb3 new php file
 
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 Code:

<?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
Quote:

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 Code:

<?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

Quote:

Today at 07:59 AM Mist said this in Post #6
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


All times are GMT. The time now is 04:20 AM.

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.01170 seconds
  • Memory Usage 1,738KB
  • 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_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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