448 |
ddelon |
1 |
<?php
|
|
|
2 |
/*
|
|
|
3 |
wakka.php
|
|
|
4 |
Copyright (c) 2003, Hendrik Mans <hendrik@mans.de>
|
|
|
5 |
Copyright 2002, 2003 David DELON
|
|
|
6 |
Copyright 2003 Eric FELDSTEIN
|
|
|
7 |
All rights reserved.
|
|
|
8 |
Redistribution and use in source and binary forms, with or without
|
|
|
9 |
modification, are permitted provided that the following conditions
|
|
|
10 |
are met:
|
|
|
11 |
1. Redistributions of source code must retain the above copyright
|
|
|
12 |
notice, this list of conditions and the following disclaimer.
|
|
|
13 |
2. Redistributions in binary form must reproduce the above copyright
|
|
|
14 |
notice, this list of conditions and the following disclaimer in the
|
|
|
15 |
documentation and/or other materials provided with the distribution.
|
|
|
16 |
3. The name of the author may not be used to endorse or promote products
|
|
|
17 |
derived from this software without specific prior written permission.
|
|
|
18 |
|
|
|
19 |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
20 |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
21 |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
22 |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
23 |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
24 |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
25 |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
26 |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
27 |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
28 |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
29 |
*/
|
|
|
30 |
//vérification de sécurité
|
|
|
31 |
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) {
|
|
|
32 |
die ("accès direct interdit");
|
|
|
33 |
}
|
|
|
34 |
echo $this->Header();
|
|
|
35 |
?>
|
|
|
36 |
<div class="page">
|
|
|
37 |
<?php
|
|
|
38 |
if ($global = $_REQUEST["global"])
|
|
|
39 |
{
|
|
|
40 |
$title = "Domaines faisant référence à ce wiki (<a href=\"".$this->href("referrers", "", "global=1")."\">voir la liste des pages externes</a>):";
|
|
|
41 |
$referrers = $this->LoadReferrers();
|
|
|
42 |
}
|
|
|
43 |
else
|
|
|
44 |
{
|
|
|
45 |
$title = "Domaines faisant référence à ".$this->Link($this->GetPageTag()).
|
|
|
46 |
($this->GetConfigValue("referrers_purge_time") ? " (depuis ".($this->GetConfigValue("referrers_purge_time") == 1 ? "24 heures" : $this->GetConfigValue("referrers_purge_time")." jours").")" : "")." (<a href=\"".$this->href("referrers")."\">voir la liste des pages externes</a>):";
|
|
|
47 |
$referrers = $this->LoadReferrers($this->GetPageTag());
|
|
|
48 |
}
|
|
|
49 |
|
|
|
50 |
echo "<b>$title</b><br /><br />\n" ;
|
|
|
51 |
if ($referrers)
|
|
|
52 |
{
|
|
|
53 |
for ($a = 0; $a < count($referrers); $a++)
|
|
|
54 |
{
|
|
|
55 |
$temp_parse_url = parse_url($referrers[$a]["referrer"]);
|
|
|
56 |
$temp_parse_url = ($temp_parse_url["host"] != "") ? strtolower(preg_replace("/^www\./Ui", "", $temp_parse_url["host"])) : "inconnu";
|
|
|
57 |
|
|
|
58 |
if (isset($referrer_sites["$temp_parse_url"]))
|
|
|
59 |
{
|
|
|
60 |
$referrer_sites["$temp_parse_url"] += $referrers[$a]["num"];
|
|
|
61 |
}
|
|
|
62 |
else
|
|
|
63 |
{
|
|
|
64 |
$referrer_sites["$temp_parse_url"] = $referrers[$a]["num"];
|
|
|
65 |
}
|
|
|
66 |
}
|
|
|
67 |
|
|
|
68 |
array_multisort($referrer_sites, SORT_DESC, SORT_NUMERIC);
|
|
|
69 |
reset($referrer_sites);
|
|
|
70 |
|
|
|
71 |
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n" ;
|
|
|
72 |
foreach ($referrer_sites as $site => $site_count)
|
|
|
73 |
{
|
|
|
74 |
echo "<tr>" ;
|
|
|
75 |
echo "<td width=\"30\" align=\"right\" valign=\"top\" style=\"padding-right: 10px\">" , $site_count, "</td>" ;
|
|
|
76 |
echo "<td valign=\"top\">" , (($site != "unknown") ? "<a href=\"http://$site\">$site</a>" : $site) , "</td>" ;
|
|
|
77 |
echo "</tr>\n" ;
|
|
|
78 |
}
|
|
|
79 |
echo "</table>\n" ;
|
|
|
80 |
}
|
|
|
81 |
else
|
|
|
82 |
{
|
|
|
83 |
echo "<i>None</i><br />\n" ;
|
|
|
84 |
}
|
|
|
85 |
|
|
|
86 |
if ($global)
|
|
|
87 |
{
|
|
|
88 |
echo "<br />[<a href=\"",$this->href("referrers_sites"),"\">Voir les domaines faisant référence à ",$this->GetPageTag()," seulement</a> | <a href=\"",$this->href("referrers"),"\">Voir les références ",$this->GetPageTag()," seulement</a>]";
|
|
|
89 |
}
|
|
|
90 |
else
|
|
|
91 |
{
|
|
|
92 |
echo "<br />[<a href=\"",$this->href("referrers_sites", "", "global=1"),"\">Voir tous les domaines faisant référence </a> | <a href=\"",$this->href("referrers", "", "global=1"),"\">Voir toutes les références </a>]" ;
|
|
|
93 |
}
|
|
|
94 |
|
|
|
95 |
|
|
|
96 |
?>
|
|
|
97 |
</div>
|
|
|
98 |
<?php echo $this->Footer(); ?>
|