That's weird try accessing the site again, working fine on my end.
try: http://doink.biz
the script is actualy a mod for my forum called SSI+
It's been working great for many years but now it's just ridiculously slow when it comes to fetching the recent posts. It's wierd when using the direct url above to access the recent posts it's 100% instanteneous. While when I use the include it doesn't work...
The script is in the forum directory and I'm not sure if I can move it without messing it up. I tried running the include like this include("forum/ssi.php?alltheothermishmash"); but it gave me a bunch of errors.
It's really become a huge loading bottleneck so I need to fix something.
here is the ssi+ script.
<?php
/* Notices make IPB puke. */
error_reporting(E_ALL & ~E_NOTICE);
/* You can uncomment the following line if you are using strftime()
for dates and you want it to display dates/times in a language
other then English. Refer to http://php.net/setlocale */
//setlocale (LC_ALL, "de");
/* Require Configuration */
require ("ssi_config.php");
/* Get required files */
require_once (SMARTY_DIR."Smarty.class.php");
require_once (SDK_PATH."ipbsdk_class.inc.php");
require_once (SSIPLUS_PATH."export.php");
require_once (SSIPLUS_PATH."module.php");
require_once (SSIPLUS_PATH."misc.php");
/* Add SSIplus+ to include path */
ini_set('include_path', ini_get('include_path').PATH_SEPARATOR.dirname(__FILE__));
/* SSIplus+ class */
class SSIplus {
/**
* @var array Configuration settings from ssi_config.php given to the Class constructor
*/
var $options = array();
/**
* @var string Language code determined from the runtime attribute 'language' or $option['default_language']
*/
var $language = '';
/**
* @var object Reference to the Export-Type rendering class
*/
var $export = NULL;
/**
* @var array URL attributes passed to ssi.php or to SSIplus() function if in direct mode.
*/
var $input = array();
/**
* Class Constructor. Sets up the class for use.
*
* @param array $options Reference to the runtime options from ssi_config.php
*/
function SSIplus(&$options) {
$this->options =& $options;
}
/**
* If in direct mode (not loaded via URL request), sets the attributes
* usually coming from the URL.
* This requires defined('SSI_LOCAL') to be set by the including script.
*
* @param mixed $attributes List of attributes as URL-formatted string 'm=module&a=action ...', or as array('m'=>'module', 'a'=>'action', ...)
* @return void
*/
function setAttributes($attributes=array()) {
/* Don't do anything if in url mode */
if (!defined("SSI_LOCAL")) {
return;
}
// Is it an array?
if (is_array($attributes)) {
$fparam = $attributes;
}
else {
$fparam = array();
// Parse Query String
$bits = preg_split ("/[&;]/i", $attributes);
foreach ($bits as $i) {
$j = explode ("=", $i);
$fparam[$j['0']] = $j['1'];
}
}
// Set up the input
$this->input = $fparam;
// mimic a pseudo $ibforums object for external calls to SSIplus::getInput()
if (!isset($GLOBALS['ibforums'])) {
$GLOBALS['ibforums'] =& get_info(130);
}
$GLOBALS['ibforums']->input =& $this->input;
}
/**
* Determine the current runtime language and load the
* language files for SSIPlus+ and IPB SDK.
*
* @return void
*/
function setLanguage() {
$language = array();
if (SSIplus::getSetting('runtime_language') AND SSIplus::getInput('language')) {
$this->language = SSIplus::getInput('language');
} else {
$this->language = SSIplus::getSetting('default_language');
}
if (file_exists(SSIPLUS_PATH.'lang/lang_'.$this->language.'.php')) {
require (SSIPLUS_PATH.'lang/lang_'.$this->language.'.php');
} else {
require (SSIPLUS_PATH.'lang/lang_en.php');
}
$GLOBALS['SDK']->sdk_set_language($this->language);
$GLOBALS['language'] = array_merge($language, $GLOBALS['SDK']->lang);
}
/**
* Returns a SSIplus+ setting without needing to global $ssiplus.
*
* Can be called with SSIplus::getSetting("settingname")
*/
function getSetting($setting, $class="ssiplus") {
return $GLOBALS[$class]->options[$setting];
}
/**
* Returns an input variable without needing to global $ibforums.
*
* Can be called with SSIplus::getInput("inputname")
*/
function getInput($var, $class="ibforums") {
if (isset($GLOBALS[$class]->input[$var])) {
return $GLOBALS[$class]->input[$var];
} else {
return FALSE;
}
}
/**
* Returns a language setting without needing to put ugly
* global $language; everywhere and anywhere.
*
* Can be called with SSIplus::getLang("langname")
*/
function getLang($lang, $varname="language") {
return $GLOBALS[$varname][$lang];
}
/**
* Backward Compatibility Mode
*/
function makeCompatible($class="ibforums") {
// Reference Input
$input =& $GLOBALS[$class]->input;
// SSI.php
if (!$input['m'] AND $input['a']) {
switch ($input['a']) {
case 'out':
$input['m'] = "posts";
$input['a'] = "forumtopics";
$input['forum'] = $input['forums'];
break;
case 'news':
$input['m'] = "posts";
break;
case 'active':
$input['m'] = "members";
break;
case 'stats':
$input['m'] = "stats";
break;
}
}
// SSIplus+ 2 - Yes, I really managed to misspell "calendar"
if ($input['m'] == "calender") {
$input['m'] = "calendar";
}
}
/**
* Throws a fatal error.
*/
function fatalError($error="") {
// Unless errors have been disabled in ssi_config.php
// display error
if (!SSIplus::getSetting("hide_errors")) {
$this->output ($this->export->fatalError($error));
}
if (!defined("SSI_LOCAL")) {
exit();
}
}
/**
* Loads determined export type into $this->export for use
* later.
*/
function getExport() {
/* See what output type we need */
if (SSIplus::getInput("export") AND SSIplus::getSetting("runtime_export")) {
$classname = "SSIout_".SSIplus::getInput("export");
}
else {
$classname = "SSIout_html";
}
/* Load desired class */
if (class_exists($classname)) {
$this->export = &new $classname;
} else {
$this->export = &new SSIout_html;
}
$this->export->assign_by_ref('language', $this->language);
}
/**
* SSIplus::output() should be the last thing called in the
* script. This closes the database connection, and sends off
* all the content the script has produced to the client.
*/
function output($text) {
/* Close Connection */
$GLOBALS['SDK']->DB->close_db();
/* See what output type we need */
$this->export->send($text);
/* End script to terminate anything else if in URL mode */
if (!defined("SSI_LOCAL")) {
exit();
}
}
}
/**
* Our main SSIplus() function.
* It's called implicitely when ssi.php is called via the
* default HTTP request method using
* include('http://host/ssi.php?arguments).
*
* If ssi.php is required_once() in a main script, thereby running
* as a PHP module itself, the main script must call this function
* with the former URL attributes as either a string or an
* associative array. The later method was previously known as
* "SSIplus without HTTP includes" and available as a separate class
* file 'ssilocal.php', which is now deprecated.
*
* @param mixed $attributes List of attributes as URL-formatted string 'm=module&a=action ...', or as array('m'=>'module', 'a'=>'action', ...)
* @return void
* @see SSIplus::setAttributes()
*/
function SSIplus($attributes=array()) {
/* Create references */
$ssiplus =& $GLOBALS['ssiplus'];
$SDK =& $GLOBALS['SDK'];
/* Set up Board URL; thanks to the SDK :-) */
$ssiplus->options['board_url'] =& $SDK->ipbsdk_settings['board_url'];
/* Compatibility with SSI+ 2 and SSI.php */
if (SSIplus::getSetting("compatibility")) {
SSIplus::makeCompatible();
}
// Pass attributes for Local mode calls
$ssiplus->setAttributes($attributes);
/* Determine language code and load the Language Packs */
$ssiplus->setLanguage();
/* Load required export class */
$ssiplus->getExport();
/* where do we get our $input from */
$in_class = (!defined('SSI_LOCAL')) ? 'ibforums': 'ssiplus';
/* What module to load? */
$module = str_replace(array('/', '\\', '.'), '', SSIplus::getInput('m', $in_class));
if ($module AND file_exists(SSIPLUS_PATH.'modules/'.$module.'.php')) {
/* Require and Run */
require_once (SSIPLUS_PATH.'modules/'.$module.'.php');
$modulename = 'SSI_'.$module;
$module = &new $modulename;
/* Reference Modules */
$GLOBALS['module'] =& $module;
/* Call class */
$module->call(SSIplus::getInput('a', $in_class));
}
else {
$ssiplus->fatalError(SSIplus::getLang('no_module'));
}
}
/* Initalize SDK & SSIplus objects */
$ssiplus =& new SSIplus($options);
// SDK may already be initalized if running in direct mode. Pointless initalizing it again. */
if (defined('SSI_LOCAL')) {
if (!isset($GLOBALS['SDK'])) {
$GLOBALS['SDK'] =& new IPBSDK( array('path' => dirname(__FILE__) . '/', 'version'=>130, 'language'=>FALSE) );
}
} else {
$GLOBALS['SDK'] =& new IPBSDK();
SSIplus();
}
?>
Thank you for the help, I really appreciate it.