ich hab die Datei folgendermaßen erweitert, da bei mir unter PHP 4.3.6
Suche in der Datei statistik.php folgendes:
PHP-Code:
$alle_user= $DB_site->query_first("SELECT COUNT(*) as benutzer FROM " . TABLE_PREFIX . "user");
füge danach folgendes ein:
PHP-Code:
$alleuser = $alle_user['benutzer'];
suche
PHP-Code:
$alle_avantars= $DB_site->query_first("SELECT COUNT( * ) as avantar FROM " . TABLE_PREFIX . "customavatar ");
$alle_avantars = number_format($alle_avantars['avantar']); //Alle Benutzer mit Avantar
$kein_avantar = ($alle_user - $alle_avantars); //Anzahl der Benutzer ohne Avantar
$prozent_avantar = @substr(100 *$kein_avantar / $alle_user , 0, 5); //User ohne Avantar in Prozent
$prozent_mit_avantar = (100 - $prozent_avantar); //User mit Avantar in Prozent
$kein_avantarbar = $prozent_avantar * 2; //Avantarbar für User mit Avantar
$mit_avantarbar = $prozent_mit_avantar *2;
ersetzte es durch folgendes;
PHP-Code:
$alle_avantars= $DB_site->query_first("SELECT COUNT(*) as avantar FROM " . TABLE_PREFIX . "customavatar");
$alleavatars = $alle_avantars['avantar'];
$alle_avantars = number_format($alle_avantars[avantar]); //Alle Benutzer mit Avantar
$kein_avantar = $alleuser - $alleavatars;
$prozent_avantar = @substr(100 * $kein_avantar / $alleuser , 0, 5); //User ohne Avantar in Prozent
$prozent_mit_avantar = (100 - $prozent_avantar); //User mit Avantar in Prozent
$kein_avantarbar = $prozent_avantar * 2; //Avantarbar für User mit Avantar
$mit_avantarbar = $prozent_mit_avantar *2; //Avantarbar für User ohne Avantar
suche folgendes:
PHP-Code:
$alle_profilpics= $DB_site->query_first("SELECT COUNT( * ) as profilpic FROM " . TABLE_PREFIX . "customprofilepic ");
$alle_profilpics = number_format($alle_profilpics['profilpic']); //Alle Benutzer mit Profilbild
$kein_profilpic = ($alle_user - $alle_profilpics); //Anzahl der Benutzer ohne Profilbild
$prozent_profilpic = @substr(100 *$kein_profilpic / $alle_user , 0, 5); //User ohne Profilbild in Prozent
$prozent_mit_profilpic = (100 - $prozent_profilpic); //User mit Profilbild in Prozent
$kein_profilpicbar = $prozent_profilpic * 2; //Profilbildbar für User mit Profilbild
$mit_profilpicbar = $prozent_mit_profilpic *2;
ersetze dies durch:
PHP-Code:
$alle_profilpics= $DB_site->query_first("SELECT COUNT(*) as profilpic FROM " . TABLE_PREFIX . "customprofilepic");
$allepics = $alle_profilpics['profilpic'];
$alle_profilpics = number_format($alle_profilpics['profilpic']); //Alle Benutzer mit Profilbild
$kein_profilpic = $alleuser - $allepics; //Anzahl der Benutzer ohne Profilbild
$prozent_profilpic = @substr(100 * $kein_profilpic / $alleuser , 0, 5); //User ohne Profilbild in Prozent
$prozent_mit_profilpic = (100 - $prozent_profilpic); //User mit Profilbild in Prozent
$kein_profilpicbar = $prozent_profilpic * 2; //Profilbildbar für User mit Profilbild
$mit_profilpicbar = $prozent_mit_profilpic *2; //Profilbildbar für User ohne Profilbild
somit sollten die Avatar und Profilbilder Bars und die Zahlen richtig angezeigt werden.
Ich weiß allerdings nicht ob dies nur PHP Version 4.3.6 betrifft, da es ja bei PcFreak's Seite funktioniert. Aber es scheint so als ob PHP mit number_format udn den danach folgenden Berechnungen ein Problem hat.
@PcFreak: danke
für den spiten Hack
Lesezeichen