3rd
MODIFICA FIRESTATS plugin for WordPress ma anche fornito come software per altre piattaforme e sistemi operativi.
IN PROVA 5 giorni : ero soddisfatto, a me bastava per aver un’idea del traffico e di cosa leggevano di piu’ i visitatori.
Anche per correggere gli errori di sintassi venuti fuori dopo l’aggiornamento alla versione 2.2.2 di WP!
sotto ho incollato + log che mi è stato possibile.
Per mio riferimento ma anche per chi fosse interessato.
Se capisci il mio problema o errore puoi contattarmi, se ti va a zonex.it [at]gmail[dot]com
la modifica = E’ SBAGLIATA = FATAL ERROR !!!!!
aiuto x php!!!! SEMPLICI MODIFICHE!
Ma poi i programmatori [es.PHP] sanno solo la sintassi in .PHP, Delphi, java, DHTML?????
Se crei una cosa per wordpress pensa che ci sono moltissimi che non sanno nulla nemmeno di HTMl..QUINDI se tutte le istruzioni ECHO producono un’uscita per me insopportabile, dammi almeno un’indicazione su dove posso intervenire!!!!
Si lo so che funziona tutto lo stesso: ma cosi si tende a dar potenza a chi dice: perchè devo validare il mio HTML o XHTML????
Mi sono SCUCCIATO!!!!
Dico una scemenza???
$powered = “Powered by FireStats’;
segue ORIGINALE GIà MODIFICATO MA ANCORA ERA VALIDO!!!
ERRORI RIMASTI : 2
- b (bold) element used on line 568:
-
-
- Visitatori unici nelle ultime 24 ore :159
-
-
Powered by FireStats - PER METTERE IL TIOTLO…DOVEVO FARE COME SAPEVO: SBAGLIO MIO!
-
INIZIO LISTATO PRIMA DEL MIO INTERVENTO!
’);
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’);
// in a transition stage beween old and new version, this might blow up if the api file does not exist.
// hence, the check.
if (file_exists($__path.’/php/api.php’)) require_once($__path.’/php/api.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 page views and %s visits”),’’.$count.’’,’’.$unique.’’).’
’;
$content.= sprintf(fs_r(“Last 24 hours : %s page views and %s visits”),’’.$last_24h_count.’’,’’.$last_24h_unique.’’).’
’;
print
‘ ‘;
}
}
function fs_get_firestats_url($txt = null)
{
$txt = $txt ? $txt : “»”;
if (fs_full_installation())
{
// hack around stupid wp bug under windows
if (fs_is_windows())
{
$link = “index.php?page=firestats%5Cfirestats-wordpress.php”;
}
else
{
$link = “index.php?page=firestats/firestats-wordpress.php”;
}
$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();
fs_register_wordpress();
}
function fs_page()
{
$path = fs_get_firestats_path();
if ($path)
{
require_once($path.’/php/utils.php’);
if (current_user_can(‘manage_options’) || defined(‘DEMO’))
{
require_once($path.’/php/tabbed-pane.php’);
}
else
{
fs_e(“Only blog administrators can access FireStats”);
}
}
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)
{
$name = $_SERVER[“QUERY_STRING”];
if (fs_endsWith($name,’firestats-wordpress.php’))
{
?>
$path”).’
’;
$path_good = true;
$info = file($path.’firestats.info’);
$path_version = $info[0];
?>
$path”)?>
‘.__(“Enter the directory that contains FireStats”).”;
}
if (!empty($url))
{
ob_start();
$file = file($url.’/firestats.info’);
$output = ob_clean();
if ($file !== false)
{?>
$url”).’
’;
$url_good = true;
$url_version = $file[0];
?>
$url”)?>
‘. __(“Enter FireStats url”).”;
}
if ($path_good && $url_good)
{
if ($url_version == $path_version)
{
fs_register_wordpress();
echo ”.sprintf(__(‘Everything is okay, click %s to open FireStats’),’‘.fs_get_firestats_url(‘here’).’’).”; } else
{
?>
/var/www/firestats/’)?>
http://your_site.com/firestats’)?>
”);
if ( $_POST[‘firestats-submit’])
{
// Remember to sanitize and format use input appropriately.
$options[‘title’] = strip_tags(stripslashes($_POST[‘firestats-title’]));
update_option(‘widget_firestats’, $options);
}
// Be sure you format your options to be valid HTML attributes.
$title = htmlspecialchars($options[‘title’], ENT_QUOTES);
$buttontext = htmlspecialchars($options[‘buttontext’], ENT_QUOTES);
// Here is our little form segment. Notice that we don’t need a
// complete form. This will be embedded into the existing form.
?>
FireStats”;
}
else
{
$name = “FireStats (Not configured)”;
}
// This registers our widget so it appears with the other available
// widgets and can be dragged and dropped into any active sidebars.
register_sidebar_widget(array($name, ‘widgets’), ‘fs_widget’);
»> interessante no???// This registers our optional widget control form. Because of this
// our widget will have a button that reveals a 300x100 pixel form.
register_widget_control(array($name, ‘widgets’), ‘fs_widget_control’, 300, 100);
}
function fs_get_stats_box()
{
global $__path;
if (!$__path) return “FireStats is not configured yet”;
require_once($__path.’/php/db-sql.php’);
$powered = fs_get_powered_by(‘fs_footer’);
$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);
$total_visits = fs_r(“Pages displayed : “).”$count”;
$total_uniques = fs_r(“Unique visitors : “).”$unique”;
$visits_today = fs_r(“Pages displayed in last 24 hours : “).”$last_24h_count”;
$uniques_today = fs_r(“Unique visitors in last 24 hours : “).”$last_24h_unique”;
$res = “- $total_visits
- $total_uniques
- $visits_today
- $uniques_today
$powered
”;
return $res;
}
function fs_add_comment_flag($link)
{
global $__path;
if (!$__path) return;
require_once($__path.’/php/ip2country.php’);
$ip = get_comment_author_IP();
$code = fs_ip2c($ip);
if (!$code) return $link;
return $link .’ ‘. fs_get_country_flag_url($code);
}
function fs_add_comment_browser_os($link)
{
global $comment;
$ua = $comment->comment_agent;
if (!$ua) return $link;
global $__path;
if (!$__path) return;
require_once($__path.’/php/browsniff.php’);
return $link . ’ ‘.fs_pri_browser_images($ua);
}
function fs_echo_footer()
{
global $__path;
if (!$__path) return;
require_once($__path.’/php/db-sql.php’);
$stats = get_option(‘firestats_show_footer_stats’) == ‘true’;
if ($stats)
{
$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 $count .’ ‘.fs_r(‘pages viewed’) . “, $last_24h_count ” . fs_r(‘today’).”
”;
echo $unique .’ ‘.fs_r(‘visits’) . “, $last_24h_unique ” . fs_r(‘today’).”
”;
}
echo fs_get_powered_by(‘fs_footer’);
}
function fs_get_powered_by($css_class)
{
$img = fs_url(“img/firestats-icon.png”);
$firestats_url = FS_HOMEPAGE;
$powered = ““.fs_r(“Powered by FireStats”).’’; li mancava il titolo!!!! ROVINARMI L’ACCESSIBILITà MINIMA DI AVER ALMENO TUTTE LE ANCORE COL LORO INDIRIZZO CHE NON CREINO CONFUSIONE LO VOGLIO A QUESTO PUNTO!!!!
- e CHI PROIGRAMMA NON GLI CI VUOLE NULLA A DARCI UN PRODOTTO DECENTE, PER TUTTI!!! return “$powered”;
}
function fs_get_wp_config_path()
{
$base = dirname(__FILE__);
$path = false;
if (file_exists($base.”/../../../wp-config.php”))
$path = dirname(dirname(dirname($base))).”/wp-config.php”;
else
if (file_exists($base.”/../../wp-config.php”))
$path = dirname(dirname($base)).”/wp-config.php”;
else
$path = false;
if ($path != false)
{
$path = str_replace(“\”, “/”, $path);
}
return $path;
}
/**
* Registers this instance of wordpress with FireStats.
* This is requires so that if there is more than one blog/system that works with
* the same FireStats instance it will be possible to filter the stats per site.
*/
function fs_register_wordpress()
{
global $__path;
if (!$__path) return;
require_once($__path.’/php/db-sql.php’);
$firestats_site_id = get_option(‘firestats_site_id’);
if ($firestats_site_id == null)
{
// the function may not exist in a transition stage between 1.1 to 1.2
if (!function_exists(‘fs_register_site’)) return;
$firestats_site_id = fs_register_site();
if (firestats_site_id === false)
{
return;
}
update_option(‘firestats_site_id’,$firestats_site_id);
}
$name = get_settings(‘blogname’);
$type = FS_SITE_TYPE_WORDPRESS;
$res = fs_update_site_params($firestats_site_id,$firestats_site_id, $name,$type);
if ($res != true)
{
echo $res;
}
// update the filter to show us this blog by default after the installation
update_option(‘firestats_sites_filter’,$firestats_site_id);
}
/*
Local option storage for wordpress, used by fs_update_local_option to update wordpress value in a generic way.
*/
function fs_update_local_option_impl($key, $value)
{
update_option($key,$value);
}
/*
Local option storage for wordpress, used by fs_get_local_option to get wordpress value in a generic way.
*/
function fs_get_local_option_impl($key)
{
return get_option($key);
}
function fs_is_windows()
{
if (!isset($_ENV[‘OS’])) return false; // assume not windows.
if (strpos(strtolower($_ENV[‘OS’]), “windows”) === false) return false;
return true;
}
?>
su questo blog uso da 5 giorni il plugin FIRESTATDS con soddisfazione.
Volevo inserirlo come widget in sidebar ma non era valido.
Alcuni tag tipo B per strong ci sono riuscito a correggerli.
Problema : adesso è rotto.
Ultimo errore era inserire un link con titolo al posto di un’istruzione in PHP
Ebbene nada!!!!
Ma tanto chi ti da davvero una mano????