');
return false;
}
else
if (!file_exists($path.'/php/db-hit.php'))
{
//if (!$quiet) echo sprintf(__("FireStats was not detected at %s"),"$path")."
";
return false;
}
else
{
return $path;
}
}
else
{
return dirname(__FILE__);
}
}
$GLOBALS['__path'] = fs_get_firestats_path();
global $__path;
if (!$__path) return;
require_once($__path.'/php/db-hit.php');
# Small info on DashBoard-page
function fs_admin_footer()
{
$admin = dirname($_SERVER['SCRIPT_FILENAME']);
$admin = substr($admin, strrpos($admin, '/')+1);
$query = $_SERVER["QUERY_STRING"];
if ($admin == 'wp-admin' && basename($_SERVER['SCRIPT_FILENAME']) == 'index.php' && $query == '')
{
global $__path;
if (!$__path) return;
require_once($__path.'/php/db-sql.php');
$url = fs_get_firestats_url();
$title = "
".fs_r("FireStats"). $url."
".fs_r('Loading...')."";
print
' ';
flush();
$count = fs_get_hit_count();
$unique = fs_get_unique_hit_count();
$last_24h_count= fs_get_hit_count(1);
$last_24h_unique = fs_get_unique_hit_count(1);
echo "";
$content.= sprintf(fs_r("Total : %s hits and %s unique hits"),''.$count.'',''.$unique.'').'
';
$content.= sprintf(fs_r("Last 24 hours : %s hits and %s unique hits"),''.$last_24h_count.'',''.$last_24h_unique.'').'
';
print
' ';
}
}
function fs_get_firestats_url($txt = null)
{
$txt = $txt ? $txt : "»";
if (fs_firestats_installed_in_wordpress())
{
$url = "$txt";
}
else
{
$url = "$txt";
}
return $url;
}
# Do the installation stuff, if the plugin is marked to be activated...
$install = (basename($_SERVER['SCRIPT_NAME']) == 'plugins.php' && isset($_GET['activate']));;
if ($install)
{
require_once($__path.'/php/db-setup.php');
fs_install();
}
function fs_page()
{
$path = fs_get_firestats_path();
if ($path)
{
require_once($path.'/php/tabbed-pane.php');
}
else
{
$href = sprintf("%s",__('Options'));
echo sprintf(__('You need to configure FireStats in the %s menu'),$href);
}
}
function fs_endsWith( $str, $sub ) {
return ( substr( $str, strlen( $str ) - strlen( $sub ) ) === $sub );
}
function fs_output_css()
{
$path = fs_get_firestats_path();
if ($path)
{
$admin = dirname($_SERVER['SCRIPT_FILENAME']);
$admin = substr($admin, strrpos($admin, '/')+1);
$name = $_SERVER["QUERY_STRING"];
if ($admin == 'wp-admin' && fs_endsWith($name,'firestats-wordpress.php'))
{
?>
';
}
if (!empty($url))
{
ob_start();
$file = file($url.'/firestats.info', 'r');
$output = ob_clean();
if ($file !== false)
{?>
$url").'
';
$url_good = true;
?>
$url")?>
'. __("Enter FireStats url").'';
}
if ($path_good && $url_good)
{
echo ''.sprintf(__('Everything is okay, click %s to open FireStats'),''.fs_get_firestats_url('here').'').'
';
}
?>