Author Topic: [MOD]More than more statistics  (Read 113665 times)

0 Members and 1 Guest are viewing this topic.

Offline effemmess

  • Sr. Member
  • ****
  • Posts: 304
    • View Profile
[MOD]More than more statistics
« on: June 27, 2003, 03:59:07 PM »
Hallo an alle Statistik-Fetischisten!

ich bin dabei eine neue stats.php zu programmieren, die erstens viele Auswertungsmöglichkeiten bietet und zweitens sehr flexibel einsetzbar ist.
Die Idee dazu war geboren nach der Implementation von Vraxor´s stats.php. :D

Bisher (V1.0) habe ich verschiedene Funktionalitäten zur Auswertung der user und der votes eingebaut. Weitere werden folgen... :)
Als Beispiel schaut euch folgende Site an:http://www.auf-einem-blick.de/4images/index.php

Mindestvoraussetzungen:
- 4images 1.7  :wink:
erweiterte Voraussetzungen (nicht zwingend erforderlich aber sehr hilfreich!):
- v@no´s Votes saved in DB
- effemmess´s Extension for Votes saved in DB
- effemmess´s Old votes 2 DB


1. neue .../includes/stats.php anlegen
 (vorher natürlich evtl. existierende sichern!)
einfügen:
Code: [Select]
<?PHP
//-----------------------------------------------------
//--- stats.php V1.1 by effemmess ---------------------
//--- based on Vraxor´s stats.php ---------------------
//--- for 4images V1.7 by Jan -------------------------
//-----------------------------------------------------

//-----------------------------------------------------
//--- Variableninitialisierung-------------------------
//-----------------------------------------------------
$time=time();
$m1 =60;
$h1 =$m1*60;
$T1 =$h1*24;
$T7 =$T1*7;
$T30=$T1*30;
(date("w",$time)==0) ? $date_w = 7 : $date_w = date("w",$time);


$ts_today_at_0           =mktime(0,0,0,date("m",$time),date("d",$time),date("Y",$time));
$ts_yesterday_at_0       =$ts_today_at_0-$T1;
$ts_1st_of_month         =mktime(0,0,0,date("m",$time),1,date("Y",$time));
$ts_1st_of_month_before  =mktime(0,0,0,date("m",$ts_1st_of_month-1),1,date("Y",$ts_1st_of_month-1));
$ts_this_monday          =$ts_today_at_0-$T1*($date_w-1);
$ts_last_monday          =$ts_this_monday-$T7;
$ts_24h_before           =$time-$T1;
$ts_7days_before         =$time-$T7;
$ts_30days_before        =$time-$T30;

//-----------------------------------------------------
//--- Funktionen --------------------------------------
//-----------------------------------------------------
function sql_add($from=0,$to=0,$field){
  $sql_add_from=$field." >= ".$from;
  $sql_add_to  =$field." <= ".$to;
  $sql_add = "";
  if ($from != 0 ||$to != 0){
    if ($from != 0) $sql_add .=$sql_add_from;
    if ($from != 0 && $to != 0) $sql_add .=" AND ";
    if ($to   != 0) $sql_add .=$sql_add_to;
  }
  return $sql_add;
}

function num_users($from=0,$to=0,$field="user_joindate"){
  global $site_db, $select_mode;

  if ($from != 0 ||$to != 0){
    $sql_where=" AND ";
  }
  $sql = "SELECT COUNT(*) as users
          FROM ".USERS_TABLE."
          WHERE user_id <> ".GUEST.$sql_where.sql_add($from,$to,$field);
  $row = $site_db->query_firstrow($sql);
  $num_users = $row['users'];
  return $num_users;
}
function num_votes_itable($from=0,$to=0,$field="image_date"){
  global $site_db, $select_mode;

  if ($from != 0 ||$to != 0){
    $sql_where=" WHERE ";
  }
  $sql = "SELECT SUM(image_votes) AS votes
          FROM ".IMAGES_TABLE.$sql_where.sql_add($from,$to,$field);  
  $row = $site_db->query_firstrow($sql);
  $num_votes = (isset($row['votes'])) ? $row['votes'] : 0;
  return $num_votes;
}

function num_votes_vtable($from=0,$to=0,$field="vote_date"){
  global $site_db, $select_mode;
  if ($from != 0 ||$to != 0){
    $sql_where=" WHERE ";
  }
  $sql = "SELECT count(*) AS votes
          FROM ".VOTED_TABLE.$sql_where.sql_add($from,$to,$field);  
  $row = $site_db->query_firstrow($sql);
  $num_votes = (isset($row['votes'])) ? $row['votes'] : 0;
  return $num_votes;
}
//-----------------------------------------------------
//--- Show number of Users ----------------------------
//-----------------------------------------------------
//total
  $total_users = num_users();
  $lang_total_users = $lang['users'];
  $lang_since_begin_new_users = $lang['since_begin_new_users'];
  $site_template->register_vars("total_users", $total_users);
  $site_template->register_vars("lang_total_users", $lang_total_users);
  $site_template->register_vars("lang_since_begin_new_users", $lang_since_begin_new_users);
  unset($total_users);
  unset($lang_total_users);
//today new
  $today_new_users = num_users($ts_today_at_0,0);
  $lang_today_new_users = $lang['today_new_users'];
  $site_template->register_vars("today_new_users", $today_new_users);
  $site_template->register_vars("lang_today_new_users", $lang_today_new_users);
  unset($today_new_users);
  unset($lang_today_new_users);
//yesterday new
  $yesterday_new_users = num_users($ts_yesterday_at_0,$ts_today_at_0);
  $lang_yesterday_new_users = $lang['yesterday_new_users'];
  $site_template->register_vars("yesterday_new_users", $yesterday_new_users);
  $site_template->register_vars("lang_yesterday_new_users", $lang_yesterday_new_users);
  unset($yesterday_new_users);
  unset($lang_yesterday_new_users);
//this week new
  $this_week_new_users = num_users($ts_this_monday,0);
  $lang_this_week_new_users = $lang['this_week_new_users'];
  $site_template->register_vars("this_week_new_users", $this_week_new_users);
  $site_template->register_vars("lang_this_week_new_users", $lang_this_week_new_users);
  unset($this_week_new_users);
  unset($lang_this_week_new_users);
//last week new
  $last_week_new_users = num_users($ts_last_monday,$ts_this_monday);
  $lang_last_week_new_users = $lang['last_week_new_users'];
  $site_template->register_vars("last_week_new_users", $last_week_new_users);
  $site_template->register_vars("lang_last_week_new_users", $lang_last_week_new_users);
  unset($last_week_new_users);
  unset($lang_last_week_new_users);
//this month new
  $this_month_new_users = num_users($ts_1st_of_month,0);
  $lang_this_month_new_users = $lang['this_month_new_users'];
  $site_template->register_vars("this_month_new_users", $this_month_new_users);
  $site_template->register_vars("lang_this_month_new_users", $lang_this_month_new_users);
  unset($this_month_new_users);
  unset($lang_this_month_new_users);
//last month new
  $last_month_new_users = num_users($ts_1st_of_month_before,$ts_1st_of_month);
  $lang_last_month_new_users = $lang['last_month_new_users'];
  $site_template->register_vars("last_month_new_users", $last_month_new_users);
  $site_template->register_vars("lang_last_month_new_users", $lang_last_month_new_users);
  unset($last_month_new_users);
  unset($lang_last_month_new_users);

//-----------------------------------------------------
//--- Votes -------------------------------------------
//-----------------------------------------------------
//total
  $total_votes = num_votes_vtable();
  $lang_total_votes = $lang['votes'];
  $lang_since_begin_new_votes = $lang['since_begin_new_votes'];
  $site_template->register_vars("total_votes", $total_votes);
  $site_template->register_vars("lang_total_votes", $lang_total_votes);
  $site_template->register_vars("lang_since_begin_new_votes", $lang_since_begin_new_votes);
  unset($total_votes);
  unset($lang_total_votes);
//today new
  $today_new_votes = num_votes_vtable($ts_today_at_0,0);
  $lang_today_new_votes = $lang['today_new_votes'];
  $site_template->register_vars("today_new_votes", $today_new_votes);
  $site_template->register_vars("lang_today_new_votes", $lang_today_new_votes);
  unset($today_new_votes);
  unset($lang_today_new_votes);
//yesterday new
  $yesterday_new_votes = num_votes_vtable($ts_yesterday_at_0,$ts_today_at_0);
  $lang_yesterday_new_votes = $lang['yesterday_new_votes'];
  $site_template->register_vars("yesterday_new_votes", $yesterday_new_votes);
  $site_template->register_vars("lang_yesterday_new_votes", $lang_yesterday_new_votes);
  unset($yesterday_new_votes);
  unset($lang_yesterday_new_votes);
//this week new
  $this_week_new_votes = num_votes_vtable($ts_this_monday,0);
  $lang_this_week_new_votes = $lang['this_week_new_votes'];
  $site_template->register_vars("this_week_new_votes", $this_week_new_votes);
  $site_template->register_vars("lang_this_week_new_votes", $lang_this_week_new_votes);
  unset($this_week_new_votes);
  unset($lang_this_week_new_votes);
//last week new
  $last_week_new_votes = num_votes_vtable($ts_last_monday,$ts_this_monday);
  $lang_last_week_new_votes = $lang['last_week_new_votes'];
  $site_template->register_vars("last_week_new_votes", $last_week_new_votes);
  $site_template->register_vars("lang_last_week_new_votes", $lang_last_week_new_votes);
  unset($last_week_new_votes);
  unset($lang_last_week_new_votes);
//this month new
  $this_month_new_votes = num_votes_vtable($ts_1st_of_month,0);
  $lang_this_month_new_votes = $lang['this_month_new_votes'];
  $site_template->register_vars("this_month_new_votes", $this_month_new_votes);
  $site_template->register_vars("lang_this_month_new_votes", $lang_this_month_new_votes);
  unset($this_month_new_votes);
  unset($lang_this_month_new_votes);
//last month new
  $last_month_new_votes = num_votes_vtable($ts_1st_of_month_before,$ts_1st_of_month);
  $lang_last_month_new_votes = $lang['last_month_new_votes'];
  $site_template->register_vars("last_month_new_votes", $last_month_new_votes);
  $site_template->register_vars("lang_last_month_new_votes", $lang_last_month_new_votes);
  unset($last_month_new_votes);
  unset($lang_last_month_new_votes);
//by 10<=user_id<=20 (example!)
  $from =18;
  $to   =18;
  $field="user_id";
  $user_id_votes = num_votes_vtable($from,$to,$field);
  $lang_user_id_votes = $lang['user_id_votes'];
  $site_template->register_vars("user_id_votes", $user_id_votes);
  $site_template->register_vars("lang_user_id_votes", $lang_user_id_votes);
  unset($user_id_votes);
  unset($lang_user_id_votes);
//by 1000<=image_id<=2000 (example!)
  $from =1000;
  $to   =2000;
  $field="image_id";
  $image_id_votes = num_votes_itable($from,$to,$field);
  $lang_image_id_votes = $lang['image_id_votes'];
  $site_template->register_vars("image_id_votes", $image_id_votes);
  $site_template->register_vars("lang_image_id_votes", $lang_image_id_votes);
  unset($image_id_votes);
  unset($lang_image_id_votes);

//-----------------------------------------------------
//--- Hits --------------------------------------------
//-----------------------------------------------------
  $sql = "SELECT SUM(image_hits) AS sum
          FROM ".IMAGES_TABLE;
  $row = $site_db->query_firstrow($sql);

  $sum = (isset($row['sum'])) ? $row['sum'] : 0;
  $total_hits = $row['sum'];
  $lang_total_hits = $lang['total_hits'];
 
  $site_template->register_vars("total_hits", $total_hits);
  $site_template->register_vars("lang_total_hits", $lang_total_hits);
  unset($total_hits);
  unset($lang_total_hits);

//-----------------------------------------------------
//--- Downloads ---------------------------------------
//-----------------------------------------------------
  $sql = "SELECT SUM(image_downloads) AS sum
          FROM ".IMAGES_TABLE;
  $row = $site_db->query_firstrow($sql);

  $sum = (isset($row['sum'])) ? $row['sum'] : 0;
  $total_downloads = $row['sum'];
  $lang_total_downloads = $lang['total_downloads'];
 
  $site_template->register_vars("total_downloads", $total_downloads);
  $site_template->register_vars("lang_total_downloads", $lang_total_downloads);
  unset($total_downloads);
  unset($lang_total_downloads);

//-----------------------------------------------------
//--- Comments ----------------------------------------
//-----------------------------------------------------
  $sql = "SELECT SUM(image_comments) AS sum
          FROM ".IMAGES_TABLE;
  $row = $site_db->query_firstrow($sql);

  $sum = (isset($row['sum'])) ? $row['sum'] : 0;
  $total_comments = $row['sum'];
  $lang_total_comments = $lang['total_comments'];
 
  $site_template->register_vars("total_comments", $total_comments);
  $site_template->register_vars("lang_total_comments", $lang_total_comments);
  unset($total_comments);
  unset($lang_total_comments);

  $lang_total_images = $lang['total_images'];
  $site_template->register_vars("lang_total_images", $lang_total_images);
  unset($lang_total_comments);
  $lang_total_categories = $lang['total_categories'];
  $site_template->register_vars("lang_total_categories", $lang_total_categories);
  unset($lang_total_categories);

//-----------------------------------------------------
//--- Templates ---------------------------------------
//-----------------------------------------------------
  $stats = $site_template->parse_template("stats_box");
  $site_template->register_vars("stats", $stats);
  unset($stats);
?>

2. Sprachdatei ergänzen - .../lang/xxx/main.php:
Code: [Select]
//-----------------------------------------------------
//--- Statistics --------------------------------------
//-----------------------------------------------------
$lang['total_images']          = "Bilder:";
$lang['total_categories']      = "Kategorien:";
$lang['users']                 = "Mitglieder:";
$lang['total_hits']            = "Hits:";
$lang['total_votes']           = "Votes:";
$lang['total_downloads']       = "Downloads:";
$lang['total_comments']        = "Kommentare:";

$lang['today_new_users']       = "heute:";
$lang['yesterday_new_users']   = "gestern:";
$lang['this_week_new_users']   = "diese Woche:";
$lang['last_week_new_users']   = "letzte Woche:";
$lang['this_month_new_users']  = "diesen Monat:";
$lang['last_month_new_users']  = "letzten Monat:";
$lang['since_begin_new_users'] = "seit Anfang:";
                                                                 
$lang['today_new_votes']       = $lang['today_new_users'];      
$lang['yesterday_new_votes']   = $lang['yesterday_new_users'];  
$lang['this_week_new_votes']   = $lang['this_week_new_users'];
$lang['last_week_new_votes']   = $lang['last_week_new_users'];
$lang['this_month_new_votes']  = $lang['this_month_new_users'];
$lang['last_month_new_votes']  = $lang['last_month_new_users'];
$lang['since_begin_new_votes'] = $lang['since_begin_new_users'];

für die beiden enthaltenen Beispiele sind hier noch keine Einträge vorhanden...
 3. .../templates/xxx/style.css ergänzen:
Code: [Select]
.head3 {

  background-color: #e1e1e1;

  color: #ffffff;

  font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;

  font-size: 11px;

  font-weight: bold;

}

4. Templates erstellen - hier: .../templates/xxx/stats_box.html
Code: [Select]
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="head2" height="20" align="center">S i t e - S t a t i s t i k</td>
  </tr>
  <tr>
    <td class="head3" height="20" align="center">Gesamt-Statistik</td>
  </tr>
  <tr>
    <td class="row2">
      <table width="100%" border="0">
        <tr class="row1">
          <td align="left" width=60%>
            {lang_total_images}<br>
            {lang_total_categories}<br>
            {lang_total_users}<br>
            {lang_total_hits}<br>
            {lang_total_downloads}
            {lang_total_votes}<br>
            {lang_total_comments}<br>
          </td>
          <td align="right" width="40%">
            <B>{total_images}</B><br>
            <B>{total_categories}</B><br>
            <B>{total_users}</B><br>
            <B>{total_hits}</B><br>
            <B>{total_downloads}</B><br>
            <B>{total_votes}</B><br>
            <B>{total_comments}</B><br>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="head3" height="20" align="center">neue Mitglieder</td>
  </tr>
  <tr>
    <td class="row2">
      <table width="100%" border="0">
        <tr class="row1">
          <td align="left" width=60%>
            {lang_today_new_users}<br>
            {lang_yesterday_new_users}<br>
            {lang_this_week_new_users}<br>
            {lang_last_week_new_users}<br>
            {lang_this_month_new_users}<br>
            {lang_last_month_new_users}<br>
            {lang_since_begin_new_users}<br>
          </td>
          <td align="right" width="40%">
            <B>{today_new_users}</B><br>
            <B>{yesterday_new_users}</B><br>
            <B>{this_week_new_users}</B><br>
            <B>{last_week_new_users}</B><br>
            <B>{this_month_new_users}</B><br>
            <B>{last_month_new_users}</B><br>
            <B>{total_users}</B><br>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="head3" height="20" align="center">neue Stimmen</td>
  </tr>
  <tr>
    <td class="row2">
      <table width="100%" border="0">
        <tr class="row1">
          <td align="left" width=60%>
            {lang_today_new_votes}<br>
            {lang_yesterday_new_votes}<br>
            {lang_this_week_new_votes}<br>
<!--
            {lang_last_week_new_votes}<br>
            {lang_this_month_new_votes}<br>
            {lang_last_month_new_votes}<br>
-->
            {lang_since_begin_new_votes}<br>
          </td>
          <td align="right" width="40%">
            <B>{today_new_votes}</B><br>
            <B>{yesterday_new_votes}</B><br>
            <B>{this_week_new_votes}</B><br>
<!--
            <B>{last_week_new_votes}</B><br>
            <B>{this_month_new_votes}</B><br>
            <B>{last_month_new_votes}</B><br>
-->
            <B>{total_votes}</B><br>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
</table>

5.Eintrag {stats} an beliebiger Position in einem Haupt-Template platzieren - hier als Bsp. in .../template/xxx/home.html
Code: [Select]
...
<!--rechts-->
 {if random_image}
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head2" height="20" align="center"> <img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{lang_random_image}</td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                    <tr>
                      <td align="center" class="row1">
   <br />
                        {random_image}
<br />
                        <br />
                      </td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                  </table>
 {endif random_image}
 {potd_image}
                  {stats}
<!--rechts Ende-->
...


Wie schon oben gesagt, werde ich das ganze weiter ausbauen. Es wird weitere Auswertungen für Kommentare, Downloads, Postcards und evtl. auch Hits geben. Die in der stats.php enthaltenen Funktionen werden zukünftig evtl. in die functions.php oder eine functions-stats.php ausgelagert.

Viel Spaß!  :)
effemmess

PS: wenn ihr die erweiterten Voraussetzungen nicht erfüllt, müsst ihr natürlich einige Funktionalitäten aus der stats.php entfernen!!! Man sollte aber leicht erkennen, was dort raus muß... :wink:

V1.0
- first release
V1.1
- bug fixed date(w)

Offline glitzer

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • over 7000 E-Cards
Re: [MOD]More than more statistics
« Reply #1 on: March 20, 2005, 10:47:57 PM »
Can somebody help me, i get always the fault:

Code: [Select]
DB Error: Bad SQL Query: SELECT count(*) AS votes FROM VOTED_TABLE
Table 'xxxx.VOTED_TABLE' doesn't exist

DB Error: Bad SQL Query: SELECT count(*) AS votes FROM VOTED_TABLE WHERE vote_date >= 1111273200
Table 'xxxxx.VOTED_TABLE' doesn't exist

DB Error: Bad SQL Query: SELECT count(*) AS votes FROM VOTED_TABLE WHERE vote_date >= 1111186800 AND vote_date <= 1111273200
Table 'xxxx.VOTED_TABLE' doesn't exist

DB Error: Bad SQL Query: SELECT count(*) AS votes FROM VOTED_TABLE WHERE vote_date >= 1110754800
Table 'xxxx.VOTED_TABLE' doesn't exist

DB Error: Bad SQL Query: SELECT count(*) AS votes FROM VOTED_TABLE WHERE vote_date >= 1110150000 AND vote_date <= 1110754800
Table 'xxxx.VOTED_TABLE' doesn't exist

DB Error: Bad SQL Query: SELECT count(*) AS votes FROM VOTED_TABLE WHERE vote_date >= 1109631600
Table 'xxxxx.VOTED_TABLE' doesn't exist

DB Error: Bad SQL Query: SELECT count(*) AS votes FROM VOTED_TABLE WHERE vote_date >= 1107212400 AND vote_date <= 1109631600
Table 'xxxxx.VOTED_TABLE' doesn't exist

DB Error: Bad SQL Query: SELECT count(*) AS votes FROM VOTED_TABLE WHERE user_id >= 18 AND user_id <= 18
Table 'xxx.VOTED_TABLE' doesn't exist

I think i have to make a mysql table ..but i don´t how i do this.

Thanx a lot.

P.s xxx i make for my pagename

Offline Bilal

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Re: [MOD]More than more statistics
« Reply #2 on: March 26, 2005, 07:30:18 AM »
Can someone post the whole thing in english  :oops: I don't know german!  :(
Regards,
Bilal

Offline gwaggli

  • Pre-Newbie
  • Posts: 6
    • View Profile
    • Cini's Fotogalerie
Re: [MOD]More than more statistics
« Reply #3 on: March 30, 2005, 11:09:40 AM »
Hallo

Ich habe alles gemacht wie oben beschrieben. Habe auch alle Erweiterungen neu installiert. Dennoch erscheint mir keine Statistik :(

Unter http://foto.cini.ch kann man mein Album ansehen. Unter dem Zufallsbild, sollte die Statistik erscheinen, aber es erscheint nur ein dünner kaum erkennbarer Strich.

Ich bitte um Hilfe

Greets gwaggli

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: [MOD]More than more statistics
« Reply #4 on: April 05, 2005, 08:08:07 AM »
Here is the modification in /lang/main.php in spanish:

Code: [Select]
//-----------------------------------------------------
//--- Statistics --------------------------------------
//-----------------------------------------------------
$lang['total_images']          = "Total fotos::";
$lang['total_categories']      = "Categorías:";
$lang['users']                 = "Usuarios registrados:";
$lang['total_hits']            = "Impactos:";
$lang['total_votes']           = "Votos:";
$lang['total_downloads']       = "Descargas:";
$lang['total_comments']        = "Comentarios:";

$lang['today_new_users']       = "Hoy";
$lang['yesterday_new_users']   = "Ayer";
$lang['this_week_new_users']   = "Esta semana:";
$lang['last_week_new_users']   = "La semana pasada:";
$lang['this_month_new_users']  = "Este mes:";
$lang['last_month_new_users']  = "Mes pasado";
$lang['since_begin_new_users'] = "Nuevos Usuarios";
                                                                 
$lang['today_new_votes']       = $lang['today_new_users'];     
$lang['yesterday_new_votes']   = $lang['yesterday_new_users']; 
$lang['this_week_new_votes']   = $lang['this_week_new_users'];
$lang['last_week_new_votes']   = $lang['last_week_new_users'];
$lang['this_month_new_votes']  = $lang['this_month_new_users'];
$lang['last_month_new_votes']  = $lang['last_month_new_users'];
$lang['since_begin_new_votes'] = $lang['since_begin_new_users'];

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: [MOD]More than more statistics
« Reply #5 on: April 05, 2005, 07:44:21 PM »
Hi i have installed this Mod and it does work but this part does not
Code: [Select]
<B>{today_new_votes}</B><br>
           <B>{yesterday_new_votes}</B><br>
           <B>{this_week_new_votes}</B><br>
<!--
           <B>{last_week_new_votes}</B><br>
           <B>{this_month_new_votes}</B><br>
           <B>{last_month_new_votes}</B><br>

Offline martrix

  • Hero Member
  • *****
  • Posts: 755
    • View Profile
    • overlord.cz
Re: [MOD]More than more statistics
« Reply #6 on: April 05, 2005, 08:34:24 PM »
And did you install also these mods:

Mindestvoraussetzungen:
- 4images 1.7  :wink:
erweiterte Voraussetzungen (nicht zwingend erforderlich aber sehr hilfreich!):
- v@no´s Votes saved in DB
- effemmess´s Extension for Votes saved in DB
- effemmess´s Old votes 2 DB


 :?:

as long as you won't save the votes in you DB (first mod), you won't be able to get statistics about votes...
and
as long as you won't save the vote-date (second mod), you won't be able to get statistics about the time of voting...
MAяTRIX


Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: [MOD]More than more statistics
« Reply #7 on: April 05, 2005, 09:33:40 PM »
thanks for replay I installed them I think i don't understand german i did what i could i just upload them to the plugign folder an execute them is that what i have to do?

Offline martrix

  • Hero Member
  • *****
  • Posts: 755
    • View Profile
    • overlord.cz
Re: [MOD]More than more statistics
« Reply #8 on: April 05, 2005, 09:49:30 PM »
OK, if you did install the mods, then everything should work fine...

but only if there are already data for the needed statistics ;)
that means - if there's no data for the stats, you can't have any stats  8O

If you don't have any votes where the vote_date is saved, you won't get any statistic-output.

Is that right?
MAяTRIX


Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: [MOD]More than more statistics
« Reply #9 on: April 05, 2005, 11:35:21 PM »
ok thanks!!! I was confused but in these statistic are the any that shows that hits per dya per week and per month?

Offline tikle

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: [MOD]More than more statistics
« Reply #10 on: April 16, 2005, 12:55:31 AM »
im use phpBB

can you halp me?

Quote
DB Error: Bad SQL Query: SELECT COUNT(*) as users FROM phpbb_users WHERE user_id <> -1 AND user_joindate >= 1113602400
Unknown column 'user_joindate' in 'where clause'

DB Error: Bad SQL Query: SELECT COUNT(*) as users FROM phpbb_users WHERE user_id <> -1 AND user_joindate >= 1113516000 AND user_joindate <= 1113602400
Unknown column 'user_joindate' in 'where clause'

DB Error: Bad SQL Query: SELECT COUNT(*) as users FROM phpbb_users WHERE user_id <> -1 AND user_joindate >= 1113170400
Unknown column 'user_joindate' in 'where clause'

DB Error: Bad SQL Query: SELECT COUNT(*) as users FROM phpbb_users WHERE user_id <> -1 AND user_joindate >= 1112565600 AND user_joindate <= 1113170400
Unknown column 'user_joindate' in 'where clause'

DB Error: Bad SQL Query: SELECT COUNT(*) as users FROM phpbb_users WHERE user_id <> -1 AND user_joindate >= 1112306400
Unknown column 'user_joindate' in 'where clause'

DB Error: Bad SQL Query: SELECT COUNT(*) as users FROM phpbb_users WHERE user_id <> -1 AND user_joindate >= 1109631600 AND user_joindate <= 1112306400
Unknown column 'user_joindate' in 'where clause'


Offline police22

  • Jr. Member
  • **
  • Posts: 70
    • View Profile
    • The Dartez Page
Re: [MOD]More than more statistics
« Reply #11 on: April 26, 2005, 05:56:13 PM »
on this MORE THAN MORE STATS, these 2 commands will not show up while in the template stats_box.html
{total_images}
{total_categories}
but I can put them in the, say home.html, it works.. why is that. something need to be changed in the function.php or something

I do have version 1.7.1 but I think did the same thing in 1.7 but not for sure..

Thanks for the help.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD]More than more statistics
« Reply #12 on: April 27, 2005, 12:09:06 AM »
My german is poor..gee..my german is none...so, I belive that's happening if u include stats.php inside functions.php file, but it should work if u include it from page_header.php instead (should be at the end of page_header.php) or if u included after page_header.php included...(how many times I repeaded word "include"? sounds like a broken record :?)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline police22

  • Jr. Member
  • **
  • Posts: 70
    • View Profile
    • The Dartez Page
Re: [MOD]More than more statistics
« Reply #13 on: April 27, 2005, 01:05:08 AM »
My german is poor..gee..my german is none...so, I belive that's happening if u include stats.php inside functions.php file, but it should work if u include it from page_header.php instead (should be at the end of page_header.php) or if u included after page_header.php included...(how many times I repeaded word "include"? sounds like a broken record :?)

Ok.. um.. WHAT?  :lol:
that i see nothing goes in to funtions.php.. so not for sure what you mean there. but.. why would the directions i have for this code that goes in the stats.php is totaly different now. i have tried both of them but nothing.. finally got my votes to work right.. guess after 1.7.1 upgrade or something it quit as it was working before.. but that is neither here nor there, I dont know.. i am totally confusing myself now..  :cry:  :roll:

Offline pierse

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: [MOD]More than more statistics
« Reply #14 on: May 25, 2005, 11:16:41 AM »
I cant get this to work either.  :(