[ PHPXref.com ] [ Generated: Sun Jul 20 19:05:01 2008 ] [ OneOrZero 1.6.3 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/kbase/ -> kbstats.php (source)

   1  <?php
   2  
   3  /**

   4  * file:    kbase.php

   5  * 

   6  *         This is the front end for all of the knowledge base stuff for the users.

   7  * 

   8  /***************************************************************************

   9  *  This program is free software; you can redistribute it and/or

  10  *  modify it under the terms of the GNU General Public

  11  *  License as published by the Free Software Foundation; either

  12  *  version 2.1 of the License, or (at your option) any later version.

  13  *

  14  *  This program is distributed in the hope that it will be useful,

  15  *  but WITHOUT ANY WARRANTY; without even the implied warranty of

  16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU

  17  *  General Public License for more details.

  18  *

  19  *  You should have received a copy of the GNU General Public

  20  *  License along with This program; if not, write to:

  21  *    Free Software Foundation, Inc.

  22  *    59 Temple Place

  23  *    Suite 330

  24  *    Boston, MA  02111-1307  USA

  25  *

  26  * Copyright 2005 One or Zero

  27  * info@oneorzero.com

  28  * http://www.oneorzero.com

  29  * Developers: OneOrZero Team / Contributors: OneOrZero Community

  30  ****************************************************************************/ 
  31  
  32  $limit = 15;
  33  
  34  startTable("$lang_kbstats", "center", 100);
  35  
  36  echo "<tr><td class=back>";
  37  
  38  $sql = "SELECT * from $kb_queries_table where success=0 and query!='' order by timestamp desc limit $limit";
  39  $result = $db->query($sql);
  40  startTable("$limit $lang_latestunsuccessful", "left", 100, 3);
  41  echo "<tr><td class=back2>$lang_query</td><td class=back2>$lang_query $lang_date</td><td class=back2>$lang_query $lang_by</td></tr><tr>";
  42  while ($row = $db->fetch_array($result)) {
  43      $date = date("F j, Y, g:i:s a", $row[timestamp]);
  44      echo "<td class=back>" . $row[query] . "</td><td class=back>" . $date . "</td>";
  45      if ($pubpriv == "Private" && $row[username] != '') {
  46          echo "<td class=back><a href=\"$supporter_site_url/index.php?t=memb&mem=";
  47          echo $row[username] . "\">" . $row[username] . "</a></td></tr>";
  48      } else {
  49          echo "<td class=back>" . $row[ip] . "</td></tr>";
  50      } 
  51  } 
  52  
  53  echo"</td>";
  54  echo "</tr>";
  55  endTable();
  56  
  57  $sql = "SELECT * from $kb_queries_table where success=1 and query!='' order by timestamp desc limit $limit";
  58  $result = $db->query($sql);
  59  startTable("$limit $lang_latestsuccessful", "left", 100, 3);
  60  echo "<tr><td class=back2>$lang_query</td><td class=back2>$lang_query $lang_date</td><td class=back2>$lang_query $lang_by</td></tr><tr>";
  61  while ($row = $db->fetch_array($result)) {
  62      $date = date("F j, Y, g:i:s a", $row[timestamp]);
  63      echo "<td class=back>" . $row[query] . "</td><td class=back>" . $date . "</td>";
  64      if ($pubpriv == "Private" && $row[username] != '') {
  65          echo "<td class=back><a href=\"$supporter_site_url/index.php?t=memb&mem=";
  66          echo $row[username] . "\">" . $row[username] . "</a></td></tr>";
  67      } else {
  68          echo "<td class=back>" . $row[ip] . "</td></tr>";
  69      } 
  70  } 
  71  
  72  echo"</td>";
  73  echo "</tr>";
  74  endTable();
  75  
  76  $sql = "SELECT * from $kbase_table order by time desc limit $limit";
  77  $result = $db->query($sql);
  78  startTable("$limit $lang_latestquestionsadded", "left", 100, 3);
  79  echo "<tr><td class=back2>$lang_question</td><td class=back2>$lang_createdate</td><td class=back2>$lang_author</td></tr><tr>";
  80  while ($row = $db->fetch_array($result)) {
  81      $date = date("F j, Y, g:i:s a", $row[time]);
  82      echo "<td class=back>";
  83      echo "<a href=\"$supporter_site_url/index.php?t=kbase&act=kedit&id=$row[id]\">" . $row[question] . "</a></td><td class=back>" . $date . "</td><td class=back><a href=\"$supporter_site_url/index.php?t=memb&mem=" . $row[added_by] . "\">" . $row[added_by] . "</a></td></tr>";
  84  } 
  85  
  86  echo"</td>";
  87  echo "</tr>";
  88  endTable();
  89  
  90  $sql = "SELECT * from $kbase_table where last_edited!='NULL' and last_edited!='0' order by last_edited desc limit $limit";
  91  $result = $db->query($sql);
  92  startTable("$limit $lang_latestquestionsedited", "left", 100, 3);
  93  echo "<tr><td class=back2>$lang_question</td><td class=back2>$lang_editedon</td><td class=back2>$lang_lastedited</td></tr><tr>";
  94  while ($row = $db->fetch_array($result)) {
  95      $date = date("F j, Y, g:i:s a", $row[last_edited]);
  96      echo "<td class=back><a href=\"$supporter_site_url/index.php?t=kbase&act=kedit&id=$row[id]\">" . $row[question] . "</a></td><td class=back>" . $date . "</td><td class=back><a href=\"$supporter_site_url/index.php?t=memb&mem=$row[edited_by]\">" . $row[edited_by] . "</a></td></tr>";
  97  } 
  98  
  99  echo"</td>";
 100  echo "</tr>";
 101  endTable();
 102  
 103  $sql = "SELECT q.*, k.question from $kb_queries_table AS q, $kbase_table AS k WHERE q.kid!='NULL' and k.id=q.kid order by timestamp desc limit $limit";
 104  $result = $db->query($sql);
 105  startTable("$limit $lang_latestquestionsread", "left", 100, 3);
 106  echo "<tr><td class=back2>$lang_question</td><td class=back2>$lang_readdate</td><td class=back2>$lang_readby</td></tr><tr>";
 107  while ($row = $db->fetch_array($result)) {
 108      $date = date("F j, Y, g:i:s a", $row[5]);
 109      echo "<td class=back><a href=\"$supporter_site_url/index.php?t=kbase&act=kedit&id=$row[1]\">" . $row[7] . "</a></td><td class=back>" . $date . "</td>";
 110      if ($pubpriv == "Private" && $row[6] != '') {
 111          echo "<td class=back><a href=\"$supporter_site_url/index.php?t=memb&mem=";
 112          echo $row[6] . "\">" . $row[6] . "</a></td></tr>";
 113      } else {
 114          echo "<td class=back>" . $row[3] . "</td></tr>";
 115      } 
 116  } 
 117  
 118  echo"</td>";
 119  echo "</tr>";
 120  endTable();
 121  
 122  echo "</td>";
 123  echo "</tr>";
 124  endTable();
 125  
 126  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]