9ff7bcaf045539ec111a148577ba3472e40b34ac
[atutor.git] / mods / wiki / spages / HitCounter.php
1 <?php
2 /*
3    this sums up all the hits from all pages, and prints the
4    overall score points
5 */
6
7  echo ewiki_make_title($id, $id, 2);
8
9  #-- loop thur all pages, and mk sum
10  $n = 0;
11  $result = ewiki_db::GETALL(array("hits"));
12  while ($r = $result->get()) {
13     if ($r["flags"] & EWIKI_DB_F_TEXT) {
14       $n += $r["hits"];
15     }
16  }
17
18  #-- output
19  $AllPages = '<a href="'. ewiki_script("", "PageIndex") .'">AllPages</a>';
20  echo <<< EOT
21 $title
22 The overall hit score of $AllPages is:
23 <div class="counter">
24   $n
25 </div>
26 EOT;
27
28 ?>