From dfbabafa5d09ee3960764580a86fe6911583ce31 Mon Sep 17 00:00:00 2001 From: ahollosi Date: Mon, 26 Jun 2000 21:26:45 +0000 Subject: [PATCH] Added support for hitcount and MostPopular (%%Mostpopular%% markup) quick hack - works only with mySQL so far git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@114 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- pgsrc/MostPopular | 4 ++++ wiki_display.php3 | 5 ++++- wiki_mysql.php3 | 36 +++++++++++++++++++++++++++++++++++- wiki_stdlib.php3 | 25 +++++++++++++++++++------ wiki_transform.php3 | 6 +++++- 5 files changed, 67 insertions(+), 9 deletions(-) create mode 100644 pgsrc/MostPopular diff --git a/pgsrc/MostPopular b/pgsrc/MostPopular new file mode 100644 index 000000000..a682a3d23 --- /dev/null +++ b/pgsrc/MostPopular @@ -0,0 +1,4 @@ +The 20 most popular pages of this wiki: +(hitcount, pagename) + +%%Mostpopular%% diff --git a/wiki_display.php3 b/wiki_display.php3 index 0298ca6c2..4bf548e62 100644 --- a/wiki_display.php3 +++ b/wiki_display.php3 @@ -1,4 +1,4 @@ - + diff --git a/wiki_mysql.php3 b/wiki_mysql.php3 index ecea2f284..042db055b 100644 --- a/wiki_mysql.php3 +++ b/wiki_mysql.php3 @@ -1,4 +1,4 @@ - + diff --git a/wiki_stdlib.php3 b/wiki_stdlib.php3 index bc3d5d9fc..c1df1401e 100644 --- a/wiki_stdlib.php3 +++ b/wiki_stdlib.php3 @@ -1,4 +1,4 @@ - + \n"; + while ($qhash = MostPopularNextMatch($dbi, $query)) { + $result .= "
$qhash[hits] ... " . LinkExistingWikiWord($qhash['pagename']) . "\n"; + } + $result .= "\n"; + + return $result; + } + // converts spaces to tabs function CookSpaces($pagearray) { return preg_replace("/ {3,8}/", "\t", $pagearray); @@ -355,10 +372,6 @@ return LinkExistingWikiWord($linkname); } elseif (preg_match("#^($AllowedProtocols):#", $linkname)) { return LinkURL($linkname); - } elseif ($linkname == 'Search') { - return RenderQuickSearch(); - } elseif ($linkname == 'Fullsearch') { - return RenderFullSearch(); } else { return LinkUnknownWikiWord($linkname); } diff --git a/wiki_transform.php3 b/wiki_transform.php3 index 191248ad6..ea2989cb2 100644 --- a/wiki_transform.php3 +++ b/wiki_transform.php3 @@ -1,4 +1,4 @@ - +