id; $firestats_dir = dirname(dirname(__FILE__)); $hit_me = htmlentities( " "); $res = "

".fs_r('Collect hits from PHP pages')."

"; $res .= fs_r('To allow FireStats to track access to your pages, you need to add the following line inside the head tag of each of the pages you want to monitor (the page must be a php page).'); $res .= '

'; $res .= "
".$hit_me."
"; $res .= '

'; $res .= fs_r('A typical page header will look like this:').'
'; $res .="
"; $res .= ("
<html>
<head>
$hit_me
    ...
</head>
...
</html>
"); $res .= "
"; return $res; } function fs_get_html_help($site) { $id = $site->id; // some dark magic to get the corrent url. $base = fs_get_absolute_url("/"); $firestats_parent = dirname(dirname(dirname(__FILE__))); $firestats_dir_name = substr(dirname(dirname(__FILE__)), strlen($firestats_parent)); $src = $base . $firestats_dir_name . "/js/fs.js.php?site_id=$id"; $base = fs_get_absolute_url($_SERVER['REQUEST_URI']); $firestats_parent = dirname(dirname(dirname(__FILE__))); $firestats_dir_name = substr(dirname(dirname(__FILE__)), strlen($firestats_parent)); $src = substr($base, 0,strrpos($base,$firestats_dir_name)) . $firestats_dir_name . "/js/fs.js.php?site_id=$id"; $link = fs_get_absolute_url("$src"); $hit_me = htmlentities(""); $res = "

".fs_r('Collect hits from any HTML page')."

"; $res .= fs_r('To allow FireStats to track access to your pages, you need to add the following line inside the head or body tag of each of the pages you want to monitor.'); $res .= '
'; $res .= "
".$hit_me."
"; $res .= '
'; $res .= fs_r('A typical page header will look like this:').'
'; $res .="
"; $res .= ("
<html>
<head>
   $hit_me
    ...
</head>
...
</html>
"); $res .= "
"; return $res; } function fs_get_wordpress_help($site) { $res = fs_help_title(fs_r("WordPress")); $res .= fs_r("The WordPress plugin registers itself automatically when it's activated").".
"; return $res; } function fs_get_mediawiki_help($site) { $link = sprintf("%s",FS_WIKI."MediaWiki",fs_r("plugin")); $file = "firestats-mediawiki.php"; $conf = fs_get_basic_conf($site); return fs_get_basic_help($site,$link, $file,$conf); } function fs_get_joomla_help($site) { $link = sprintf("%s",FS_WIKI."Joomla",fs_r("plugin")); return fs_get_advanced_help($site, $link); } function fs_get_drupal_help($site) { $link = sprintf("%s",FS_WIKI."Drupal",fs_r("module")); return fs_get_advanced_help($site, $link); } function fs_get_gallery2_help($site) { $link = sprintf("%s",FS_WIKI."Gallery2",fs_r("module")); return fs_get_advanced_help($site, $link); } function fs_get_gregarius_help($site) { $link = sprintf("%s",FS_WIKI."Gregarius",fs_r("plugin")); return fs_get_advanced_help($site, $link); } function fs_get_django_help($site) { $link = sprintf("%s",FS_WIKI."Django",fs_r("plugin")); $file = "settings.py"; $id = $site->id; $firestats_dir = dirname(dirname(__FILE__)); $conf = "

firestats_directory='$firestats_dir'
firestats_site_id='$id'
"; return fs_get_basic_help($site,$link, $file,$conf); } function fs_get_trac_help($site) { $link = sprintf("%s",FS_WIKI."trac",fs_r("plugin")); $file = "trac.ini"; $id = $site->id; $firestats_dir = dirname(dirname(__FILE__)); $conf = "

[components]
firestats.* = enabled

[firestats]
firestats_directory=$firestats_dir
firestats_site_id=$id
"; return fs_get_basic_help($site,$link, $file,$conf); } function fs_unsupported() { return "Multi site support is currently unavailable for this platform"; } function fs_help_title($name) { return "

".sprintf(fs_r('Collect hits from a %s site'),$name)."

"; } function fs_get_basic_conf($site) { $id = $site->id; $firestats_dir = dirname(dirname(__FILE__)); $dirdef = htmlentities("define('FS_PATH','$firestats_dir');"); $sitedef = htmlentities("define('FS_SITE_ID',$id);"); return "

$dirdef
$sitedef

"; } function fs_get_advanced_help($site, $link) { $id = $site->id; $dir = dirname(dirname(__FILE__)); $type = $site->type; $typeStr = fs_get_site_type_str($type); $res = fs_help_title($typeStr); $res .= fs_get_help_str($typeStr, $link); $res .= ", ".sprintf(fs_r("and then configure it in the administration menu with the path %s and the ID %s"),"$dir","$id"); return $res; } function fs_get_basic_help($site, $link, $file, $conf) { $type = $site->type; $typeStr = fs_get_site_type_str($type); $res = fs_help_title($typeStr); $res .= fs_get_help_str($typeStr, $link); $res .= ", ".sprintf(fs_r("and then edit the lines in %s to contain this:"), $file); $res .= "
".$conf."
"; return $res; } function fs_get_help_str($typeStr,$link) { return sprintf(fs_r("To collect statistics from your %s site your need to install the %s"),$typeStr,$link); } ?>