RSS 2.0 Feed
RSS ist ein elektronisches Nachrichtenformat, das es dem Nutzer ermöglicht, die Inhalte einer Webseite – oder Teile davon – als sogenannte RSS-Feeds zu abonnieren oder in andere Webseiten zu integrieren.
Mehr Infos:
hier klicken!
Auf die Schnelle einen neuen PC
Frühlings-Gewinnspiel bei "derGutscheinblog.de"
Käufliche Erotik bei Ebay gefunden
Buch "Feuchtgebiete von Charlotte Roche"
Ich habe schon wieder gewonnen
Video - Wie schnell verändert sich die Welt?
Meine Homepage im Radio in der Sendung DBS "Die bessere Seite"
AWStats und nette Blog-Statistik für Typo3
In der Grundausstattung von Typo3 ist keine eigene Statistik Extension enthalten. Im Netzt findet man aber zahlreiche Anleitungen, wie man z.B. AWStats in Typo3 einbinden kann und diese sogar im Frontend ausgeben kann. Ich habe AWStats im Frontend auf folgender
Seite eingebunden. Mit Hilfe der Erweiterung Page PHP Content (page_php_content) ist dies in wenigen Minuten möglich. Dazu muss man nur folgenden PHP-Code als Content Element auf der dafür bestimmten Seite einbauen:
putenv ('TYPO3_MAGIC=1');
$perl= "/usr/bin/perl";
passthru($perl.' '.'/absoluter Pfad zum awstats Script/ext/ics_awstats/awstats/awstats.pl
?config=awstats_config_file&update=1');
$this->content.= $content;
echo $this->content;
?>
AWStats ist nur ein Beispiel, im Netzt findet man vielfältige weitere Möglichkeiten andere Statistiken in Typo3 einzubinden. Für meinen Blog habe ich das
Wordpress-Plugin "Useless Stats" auf Typo3 angepasst und mit der Erweiterung Page PHP Content in das Frontend von Typo3 eingebunden. Auf folgender
Seite sieht man das Ergebnis. Weiter unten befindet sich der Quellcode.

include_once(PATH_site.'typo3/sysext/cms/tslib/class.tslib_content.php');
require_once(PATH_tslib."class.tslib_pibase.php");
class ustats {
var $start_day;
var $age;
var $age_years;
var $age_days;
var $posts_month;
var $posts_day;
var $posts_all_time;
var $posts_this_week;
var $posts_this_month;
var $comms_month;
var $comms_day;
var $comms_all_time;
var $comms_this_week;
var $comms_this_month;
var $cats_name;
var $cpp_day;
var $cpp_cat;
function get_one ($field,$from,$where,$order,$limit) {
$return = '';
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($field,$from,$where,'',$order,$limit);
$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
if(isset($row[$field]))
{
$return = $row[$field];
}
return $return;
}
function get_count ($field,$from,$where,$order,$limit) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($field,$from,$where,'',$order,$limit);
return $GLOBALS['TYPO3_DB']->sql_num_rows($res) ;
}
function ustats ($full_stats) {
global $dayname, $monthname;
$dayname = array(
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday"
);
$monthname = array(
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
);
$one_day = (60 * 60 * 24);
$one_week = $one_day * 7;
$one_month = $one_day * 30;
$one_week_ago = time () - $one_week;
$one_month_ago = time () - $one_month;
$this->firstpostdate = $this->get_one('datetime','tt_news','DELETED=0 AND HIDDEN=0 AND category=1','crdate','1');
$first_timestamp = $this->firstpostdate;
$this->start_day = date ("d. F Y", $first_timestamp);
$this->age = (time () - $first_timestamp) / $one_day; // convert to days
$this->age_years = 0;
if ($this->age >= 365) {
$this->age_years = intval ($this->age / 365);
}
if ($this->age_years > 1)
$this->age_years = "$this->age_years years,";
else if ($this->age_years == 1)
$this->age_years = "1 Jahr,";
else
$this->age_years = "";
$this->age_days = $this->age % 365;
$this->age_days .= " Tage";
$this->posts_all_time = $this->get_count('crdate','tt_news','DELETED=0 AND HIDDEN=0 AND category=1','','');
$this->posts_this_week = $this->get_count('crdate','tt_news',"DELETED=0 AND HIDDEN=0 AND category=1 AND DATETIME >'$one_week_ago'",'','');
$this->posts_this_month = $this->get_count('crdate','tt_news',"DELETED=0 AND HIDDEN=0 AND category=1 AND DATETIME >'$one_month_ago'",'','');
$this->posts_day = array ();
for ($i = 0; $i < 7; $i++)
$this->posts_day[$i] = $this->get_count('crdate','tt_news',"DELETED=0 AND HIDDEN=0 AND category=1 AND DAYNAME(FROM_UNIXTIME(crdate)) = '$dayname[$i]'",'','');
$this->posts_month = array ();
for ($i = 0; $i < 12; $i++)
$this->posts_month[$i] = $this->get_count('crdate','tt_news',"DELETED=0 AND HIDDEN=0 AND category=1 AND MONTHNAME(FROM_UNIXTIME(crdate)) = '$monthname[$i]'",'','');
$this->comms_all_time = $this->get_count('crdate','tx_veguestbook_entries',"DELETED=0 AND HIDDEN=0 AND uid_tt_news>0 ",'','');
$this->comms_this_week = $this->get_count('crdate','tx_veguestbook_entries',"DELETED=0 AND HIDDEN=0 AND uid_tt_news>0 AND crdate>'$one_week_ago'",'','');
$this->comms_this_month = $this->get_count('crdate','tx_veguestbook_entries',"DELETED=0 AND HIDDEN=0 AND uid_tt_news>0 AND crdate>'$one_month_ago'",'','');
if (!$full_stats)
return;
$this->comms_day = array ();
for ($i = 0; $i < 7; $i++)
$this->comms_day[$i] = $this->get_count('crdate','tx_veguestbook_entries',"DELETED=0 AND HIDDEN=0 AND uid_tt_news>0 AND DAYNAME(FROM_UNIXTIME(crdate)) = '$dayname[$i]'",'','');
$this->cpp_day = array ();
for ($i = 0; $i < 7; $i++) {
if ($this->posts_day[$i] > 0)
$this->cpp_day[$i] = $this->comms_day[$i] / $this->posts_day[$i];
else
$this->cpp_day[$i] = "0.0";
}
$comms_month = array ();
for ($i = 0; $i < 12; $i++)
$this->comms_month[$i] = $this->get_count('crdate','tx_veguestbook_entries',"DELETED=0 AND HIDDEN=0 AND uid_tt_news>0 AND MONTHNAME(FROM_UNIXTIME(crdate)) = '$monthname[$i]'",'','');
$x=0;
$this->cats_name = array ();
$this->cpp_cat = array ();
$this->cats_names = array ();
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('title,uid','tt_news_cat','','','title','');
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$this->cats_names[$x] = $row['title'];
$this->cats_name[$x] [1] = $row['title'];
$this->cats_name[$x] [2] = $row['uid'];
$x=$x+1;
}
for($i=0; $i < count($this->cats_name); $i++)
{
$post_list = array ();
$id_local = $this->cats_name[$i] [2];
$comms = 0;
$posts = 0;
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid_local,uid_foreign','tt_news_cat_mm',"uid_foreign='$id_local'",'','','');
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$loc_uid = $row['uid_local'].'<br>';
$posts = $posts + 1;
$comms += $this->get_count('crdate','tx_veguestbook_entries',"DELETED=0 AND HIDDEN=0 AND uid_tt_news = '$loc_uid'",'','').'<br>';
}
$this->cpp_cat[$i] = $comms / $posts;
}
}
function useless_stats_table ($title, $description, &$labels, $info, $highval, $entries, $percentage)
{
$bar = '<table width="%d" cellpadding="0" callspacing="0" height="1" bgcolor="#448ABD" bordercolor="#6DA6D1" border=2 align="left"><tr><td></td></tr></table>';
$o = '';
if ($highval == 0)
return $o;
$o .= "\n\n";
$o .= '<table class="aws_data" cellpadding="3" cellspacing="0" style="margin-left:10px;border:1px solid black;" width="450">';
$o .= "<tr><td class='aws_title' style='border-bottom:1px solid black;' colspan='3'>$title</td></tr>";
$o .= "<tr><td colspan='3'><p align='left'><i>$description</i></p></td></tr>";
for ($i = 0; $i < $entries; $i++) {
if ($percentage)
$num = intval ($info[$i]);
else
$num = sprintf ("%1.2f", $info[$i]);
if ($info[$i] == 0 && !$percentage)
continue;
$o .= '<tr style="border:1px solid black;" >';
$o .= "<td width='90px' style='border-right:1px solid black;'>$labels[$i]:</td>";
$o .= "<td style='border-right:1px solid black;'>$num</td>";
$o .= '<td width="320px" style="border-right:1px solid black;>"';
$percent = ($info[$i] / $highval) * 100;
$bar_size = ($info[$i] / $highval) * 290;
if ($percentage)
$o .= sprintf($bar . '(%d%%)', $bar_size, $percent);
else
$o .= sprintf($bar, $bar_size);
$o .= '</td></tr>';
}
$o .= '</table>';
$o .= '<br/>';
$o .= "\n\n";
return $o;
}
}
global $dayname, $monthname;
$s = new ustats(true);
$o .= '<h1>Blog-Statistik</h1><ul>';
$o .= '<li>Der erste Beitrag wurde verfasst am '. $s->start_day.'.</li>';
$o .= '<li>Dieser Blog ist '.$s->age_years. $s->age_days.' alt.</li>';
$o .= '<li>Ingesamt wurden '.$s->posts_all_time.' Beiträge veröffentlicht.</li>';
$o .= '<li>Ingesamt wurden '.$s->comms_all_time.' Kommentare verfasst.</li>';
if ($s->age > 7)
$o .= '<li>Durchschnittlich '.sprintf ("%.2f",($s->posts_this_week / 7)).' Beiträge pro Tag in der letzten Woche.</li>';
if ($s->age > 30)
$o .= '<li>Durchschnittlich '.sprintf ("%.2f",($s->posts_this_month / 30)).' Beiträge pro Tag im letzten Monat.</li>';
$o .= '<li>Durchschnittlich '.sprintf ("%.2f",($s->posts_all_time / $s->age)).' Beiträge pro Tag seit Beginn des Blogs.</li>';
if ($s->posts_this_week > 0)
$o .= '<li>Durchschnittlich '.sprintf("%.2f",($s->comms_this_week / $s->posts_this_week)).' Kommentare pro Beitrag in der letzten Woche.</li>';
if ($s->posts_this_month > 0)
$o .= '<li>Durchschnittlich '.sprintf ("%.2f",($s->comms_this_month / $s->posts_this_month)).' Kommentare pro Beitrag im letzten Monat.</li>';
$o .= '<li>Durchschnittlich '.sprintf ("%.2f",($s->comms_all_time / $s->posts_all_time)).' Kommentare pro Beitrag seit Beginn des Blogs.</li>';
$o .= '</ul>';
$d = 'Die Tabelle zeigt, wieviele Beiträge jeden Tag veröffentlicht werden. Außerdem lässt sich ablesen, welche Wochentage am produktivsten sind.';
$o .= $s->useless_stats_table ("Beiträge nach Tag der Woche",$d, $dayname, $s->posts_day, $s->posts_all_time, 7, true);
$d = 'Hier sieht man, wieviele Beiträge jeden Monat veröffentlicht werden.';
$o .= $s->useless_stats_table ("Beiträge nach Monat",$d, $monthname, $s->posts_month, $s->posts_all_time, 12, true);
$d = 'Diese Tabelle zeigt, wieviele Kommentare im Durchschnitt pro Beitrag an den jeweiligen Wochentage verfasst werden.';
$o .= $s->useless_stats_table ("Kommentare pro Beitrag nach Tag der Woche", $d, $dayname, $s->cpp_day, max($s->cpp_day), 7, false);
$d = 'Hier sieht man, wieviele Kommentare im Durchschnitt pro Beitrag in den jeweiligen Kategorien veröffentlich werden.';
$o .= $s->useless_stats_table ("Kommentare pro Beitrag nach Kategorie", $d, $s->cats_names, $s->cpp_cat, max($s->cpp_cat), count ($s->cpp_cat), false);
echo $o;
?>
