Hi,
I am using an own small .php script to create an extra page using the vbulletin header, navbar, footer etc.
Its called cfn_ircstats.php and looking like this:
Now I create a Template called IRCStats with the content
which is looking like this:
A demo can be found here: http://www.clanforums.com/forum/cfn_ircstats.php
You see that the external file is being called, showing the template and everything is fine.
Now to the problem:
In the template where $ircstatsdata is standing should be text coming from an external page.
I am trying since hours now to get this working.
If I use the from phpinclude_start
everything is fine but means that the file is called everytime the forum loads which is really bad.
I want to tell the file cfn_ircstats.php to read cfn_ircstats.pisg and to write the content to the variable $ircstatsdata.
This will improve the whole thing cause only if the page is called the content is read.
Server load will be very low for this.
I kwow that this is a half a question regarding php and half vb3 but as you know both you maybe have an easy solution for me cause I have now clue regarding php and who the variables are working inside of vb3.
Would be nice if you could help me!
Kind regards
jluerken
I am using an own small .php script to create an extra page using the vbulletin header, navbar, footer etc.
Its called cfn_ircstats.php and looking like this:
PHP Code:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'custom_ircstats.php'); // 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(
'IRCStats',
);
// pre-cache templates used by specific actions
$actiontemplates = array(
);
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
$navbits = array();
$navbits[$parent] = 'IRC Stats';
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('IRCStats') . '");');
?>
which is looking like this:
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="alt1"> <table cellSpacing="0" cellPadding="0" width="100%" border="0" id="table1"> <tr> <td class="alt2"><p align="center"><b><font size="4" face="Verdana">IRC Stats</font></b></p></td></tr> <tr> <td> $ircstatsdata </td> </tr> </table> </td> </tr> </table> $footer </body> </html>
You see that the external file is being called, showing the template and everything is fine.
Now to the problem:
In the template where $ircstatsdata is standing should be text coming from an external page.
I am trying since hours now to get this working.
If I use the from phpinclude_start
PHP Code:
ob_start();
require("http://www.clanforums.com/forum/cfn_ircstats.pisg");
$ircstatsdata = ob_get_contents();
ob_end_clean();
I want to tell the file cfn_ircstats.php to read cfn_ircstats.pisg and to write the content to the variable $ircstatsdata.
This will improve the whole thing cause only if the page is called the content is read.
Server load will be very low for this.
I kwow that this is a half a question regarding php and half vb3 but as you know both you maybe have an easy solution for me cause I have now clue regarding php and who the variables are working inside of vb3.
Would be nice if you could help me!
Kind regards
jluerken
Comment