Hallöchen,
ich benutze als Statistik Plugin "Site Statistics". Dieses Plugin gibt eine kleine Liste mit Anzahl der Beiträge, Kommentare ... u.a. Zu sehen auf meinem Blog in der Sidebar! http://www.planet-gatze.de/blog/
Mir ist aufgefallen, dass dieses Plugin bei den Artikeln auch die Seiten mitzählt!! Kann man das irgendwie unterbinden und dafür noch einen extra Punkt "Seiten" in die Liste aufnehmen?
Da das Script nicht allzu lang ist ::
PHP
<?php
/*
Plugin Name: Site Statistics
Plugin URI: http://www.cypherhackz.net/plugins-themes/site-statistics/
Description: Show your site statistics. Posts, comments, categories, last post, last commentator and last modified.
Version: 1.4
Author: Fauzi Mohd Darus
Author URI: http://www.cypherhackz.net/
*/
function cypher_sitestats() {
global $wpdb;
//taken from wp-admin/index.php
$numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'publish'");
if (0 < $numposts) $numposts = number_format($numposts);
$numcomms = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'");
if (0 < $numcomms) $numcomms = number_format($numcomms);
$numcats = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->categories");
if (0 < $numcats) $numcats = number_format($numcats);
$output = 'Artikel: ' . $numposts . '<br />Kommentare: ' . $numcomms . '<br />Kategorien: ' . $numcats . '';
//request last modified
$request = "SELECT ID, post_title, post_modified FROM $wpdb->posts WHERE post_status = 'publish' ";
$request .= "ORDER BY post_modified DESC LIMIT 1";
$posts = $wpdb->get_results($request);
if($posts){
foreach ($posts as $post){
$post_title = stripslashes($post->post_title);
$post_link = stripslashes($post->ID);
$post_modified = stripslashes($post->post_modified);
if (empty($format))
$format = get_settings('date_format') . ' @ ' . get_settings('time_format');
$modified_date = mysql2date($format, $post_modified);
$option = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = 'gmt_offset'");
$output .= "<br />Aktualisiert am: $modified_date (GMT $option)<br />";
}
}
echo $output;
}
?>
Alles anzeigen
Und in der Sidebar steht dann ::
PHP
<?php cypher_sitestats(); ?><?php endif; ?>
<!-- PHP-Schnipsel Diese Blog gibt es seit x Tagen -->
<?php $age = $wpdb->get_var("SELECT post_date_gmt FROM $wpdb->posts WHERE
post_status = 'publish' ORDER BY post_date_gmt LIMIT 1"); $age =
strtotime($age); $age = (time() - $age) / (60*60*24); $age = (int)$age; ?>
Seite online seit: <?=$age; ?> Tagen
<!-- / PHP-Schnipsel Diese Blog gibt es seit x Tagen -->
:confused::mrgreen: