OK thanks for the help...
The plugin to allow PHP is called 'Product : Let PHP Live!' and looks like this:
Code:
if (!function_exists('let_php_live')) {
function let_php_live($matches) {
$starter = $matches[1] ;
$code = str_replace(array('\'', '\"'), array('\\\'', '"'), $matches[2]) ;
return $starter == '<?=' ? "\".eval('return $code;').\"" : "\".eval('ob_start();$code;return ob_get_clean();').\"" ;
}
}
$template = preg_replace_callback('/(<\?=|<\?php|<\?)(.*)\?>/Us', 'let_php_live', $template);
Seems to work OK or did...
The template I'm using is a custom one, see below:
Code:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle]</title>
$headinclude
</head>
<body>
$header
$navbar
<table cellpadding="2" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<td width="100%"><img style="float:left" src="images/7ox10header.gif" border="0" /></td>
</table><br />
<div class="rounded-corners-forum">
<?
$cacheFile = 'top10.txt';
if ( (file_exists($cacheFile)) && ((fileatime($cacheFile) + 86400) > time()) )
{
$content = file_get_contents($cacheFile);
} else
{
ob_start();
// write top10.txt file
$record = 1;
if (($handle = fopen("ftp://***", "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
echo "<div class=\"cheatpagenation\"> </div><br /><div class=\"top10list\"><font color=grey>#0".$record." : </font><font color=white>".str_replace ("Umbra.PermaScore:Add(", " ", $data[0])."</font>_<font color=grey>KILLS-( <font color=CadetBlue>{$data[2]}</font><font color=grey> )_DEATHS-( <font color=FireBrick>{$data[3]}</font> <font color=grey>)_SUICIDES-( <font color=FireBrick>{$data[6]}</font> <font color=grey>)_HEADSHOTS-( <font color=CadetBlue>{$data[4]}</font> <font color=grey>)_DUELWINS-( <font color=Tomato>{$data[7]}</font> <font color=grey>)_LEVEL-( <font color=GoldenRod>{$data[9]}</font> <font color=grey>)</font></div>\n";
$record++;
if ($record > 100) { break; }
}
fclose($handle);
}
$content = ob_get_contents();
ob_end_clean();
file_put_contents($cacheFile,$content);
}
// require_once('top10pagenation.php');
$safe_functions[] = 'paginateRecords';
$page=$_GET['page'];
echo paginateRecords('top10.txt',$page);
echo "<div class=\"cheatfooter\">TOP 100 UPDATED AUTOMATICALLY EVERY DAY</div>";
?>
</div><br />
<table cellpadding="2" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<td width="100%" align="left"><img src="images/top10.png" border="0" /></td>
<tr>
<td class="shameheader"><font face="customfont4"> ? 7OX-10 PLAYERS - ( TOP 100 LISTED )</font></td>
</tr>
</table>
$footer
</body>
</html>
On my forum I just link to my php file which calls up my template:
Code:
<?php
error_reporting(E_ALL & ~E_NOTICE);
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'top10');
$phrasegroups = array();
$specialtemplates = array();
$globaltemplates = array('top10',);
$actiontemplates = array();
require('global.php');
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('top10') . '");');
?>
I've got that plugin with the custom-functions I want installed and there's no errors there, but my php top10 page is pure white at the moment, nothing shown... so dunno what to try next actually, but thanks for the help thus far.
--------------- Added [DATE]1406390365[/DATE] at [TIME]1406390365[/TIME] ---------------
Adding the hooks etc seems to work... just blank output
Code:
// require_once('top10pagenation.php');
// $page=$_GET['page'];
// echo paginateRecords('top10.txt',$page);
That function when included from that file seemed relative to that $page variable on the next line down and so the echo was easy, but because the now safe function is running all the time for some reason the $page line isn't relative to that function anymore... and so balks and echos nothing... not sure.