changed git call from https to git readonly
[atutor.git] / mods / wiki / plugins / page / hitcounter.php
1 <?php
2
3 /*
4    -- OBSOLETED by according spages/ plugin --
5    this sums up all the hits from all pages, and prints the
6    overall score points
7 */
8
9
10
11 $ewiki_plugins["page"]["HitCounter"] = "ewiki_page_hitcounter";
12
13
14 function ewiki_page_hitcounter($id, $data, $action) {
15
16    #-- loop thur all pages, and mk sum
17    $n = 0;
18    $result = ewiki_db::GETALL(array("hits"));
19    while ($r = $result->get()) {
20       if ($r["flags"] & EWIKI_DB_F_TEXT) {
21         $n += $r["hits"];
22       }
23    }
24
25    #-- output
26    $title = ewiki_make_title($id, $id, 2);
27    $AllPages = '<a href="'. ewiki_script("", "PageIndex") .'">AllPages</a>';
28    $o = <<< ___
29 $title
30 The overall hit score of $AllPages is:
31 <div class="counter">
32   $n
33 </div>
34 ___
35    ;
36    return($o);
37 }
38
39
40 ?>