[php-blog-cvs] serendipity serendipity_functions.inc.php,1.4,1.5
A reliable, secure & extensible PHP blog | Not mainstream since 2002
Brought to you by:
garvinhicking,
jhermanns
From: <jhe...@us...> - 2003-03-30 14:44:12
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv9783 Modified Files: serendipity_functions.inc.php Log Message: Bundled Referers Index: serendipity_functions.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- serendipity_functions.inc.php 29 Mar 2003 16:44:46 -0000 1.4 +++ serendipity_functions.inc.php 30 Mar 2003 14:44:07 -0000 1.5 @@ -1429,11 +1429,13 @@ $rows = serendipity_db_query($query); if (is_array($rows)) { - foreach ($rows as $row) { - preg_match("#//([^/]+)#", $row[url], $matches); - $row['url'] = htmlentities($row['url']); - echo "<a href=\"$row[url]\">$matches[1] ($row[total])</a><br/>"; - } + foreach ($rows as $row) { + $u = parse_url($row['url']); + $ref[$u['scheme']."://".$u['host']] += $row['total']; + } + foreach ($ref as $k=>$v) { + echo "<a href='$k'>$k</a> ($v)<br>"; + } } } |