SourceForge logo
SourceForge logo
Menu

phpwiki-checkins

From: Arno H. <aho...@us...> - 2000年11月13日 14:54:19
Update of /cvsroot/phpwiki/phpwiki/lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv1589
Modified Files:
	config.php mysql.php 
Log Message:
added config options for all mysql table names
Index: config.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/config.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** config.php	2000年11月08日 15:40:00	1.15
--- config.php	2000年11月13日 14:54:08	1.16
***************
*** 51,54 ****
--- 51,57 ----
 $WikiPageStore = "wiki";
 $ArchivePageStore = "archive";
+ $WikiLinksStore = "wikilinks";
+ $WikiScoreStore = "wikiscore";
+ $HitCountStore = "hitcount";
 $mysql_server = 'localhost';
 $mysql_user = 'root';
Index: mysql.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/mysql.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** mysql.php	2000年11月09日 02:57:51	1.5
--- mysql.php	2000年11月13日 14:54:08	1.6
***************
*** 149,153 ****
 
 function RemovePage($dbi, $pagename) {
! global $WikiPageStore, $ArchivePageStore;
 
 $pagename = addslashes($pagename);
--- 149,154 ----
 
 function RemovePage($dbi, $pagename) {
! global $WikiPageStore, $ArchivePageStore
! global $WikiLinksStore, $HitCountStore, $WikiScoreStore;
 
 $pagename = addslashes($pagename);
***************
*** 162,173 ****
 ExitWiki(sprintf($msg, $pagename, $ArchivePageStore, mysql_error()));
 
! if (!mysql_query("delete from wikilinks where frompage='$pagename'", $dbi['dbc']))
! ExitWiki(sprintf($msg, $pagename, 'wikilinks', mysql_error()));
 
! if (!mysql_query("delete from hitcount where pagename='$pagename'", $dbi['dbc']))
! ExitWiki(sprintf($msg, $pagename, 'hitcount', mysql_error()));
 
! if (!mysql_query("delete from wikiscore where pagename='$pagename'", $dbi['dbc']))
! ExitWiki(sprintf($msg, $pagename, 'wikiscore', mysql_error()));
 }
 
--- 163,174 ----
 ExitWiki(sprintf($msg, $pagename, $ArchivePageStore, mysql_error()));
 
! if (!mysql_query("delete from $WikiLinksStore where frompage='$pagename'", $dbi['dbc']))
! ExitWiki(sprintf($msg, $pagename, $WikiLinksStore, mysql_error()));
 
! if (!mysql_query("delete from $HitCountStore where pagename='$pagename'", $dbi['dbc']))
! ExitWiki(sprintf($msg, $pagename, $HitCountStore, mysql_error()));
 
! if (!mysql_query("delete from $WikiScoreStore where pagename='$pagename'", $dbi['dbc']))
! ExitWiki(sprintf($msg, $pagename, $WikiScoreStore, mysql_error()));
 }
 
***************
*** 175,182 ****
 function IncreaseHitCount($dbi, $pagename)
 {
! $res = mysql_query("update hitcount set hits=hits+1 where pagename='$pagename'", $dbi['dbc']);
 
 if (!mysql_affected_rows($dbi['dbc'])) {
! 	 $res = mysql_query("insert into hitcount (pagename, hits) values ('$pagename', 1)", $dbi['dbc']);
 }
 
--- 176,185 ----
 function IncreaseHitCount($dbi, $pagename)
 {
! global $HitCountStore;
 
+ $res = mysql_query("update $HitCountStore set hits=hits+1 where pagename='$pagename'", $dbi['dbc']);
+ 
 if (!mysql_affected_rows($dbi['dbc'])) {
! 	 $res = mysql_query("insert into $HitCountStore (pagename, hits) values ('$pagename', 1)", $dbi['dbc']);
 }
 
***************
*** 186,190 ****
 function GetHitCount($dbi, $pagename)
 {
! $res = mysql_query("select hits from hitcount where pagename='$pagename'", $dbi['dbc']);
 if (mysql_num_rows($res))
 $hits = mysql_result($res, 0);
--- 189,195 ----
 function GetHitCount($dbi, $pagename)
 {
! global $HitCountStore;
! 
! $res = mysql_query("select hits from $HitCountStore where pagename='$pagename'", $dbi['dbc']);
 if (mysql_num_rows($res))
 $hits = mysql_result($res, 0);
***************
*** 235,239 ****
 
 function InitMostPopular($dbi, $limit) {
! $res = mysql_query("select * from hitcount order by hits desc, pagename limit $limit", $dbi["dbc"]);
 
 return $res;
--- 240,245 ----
 
 function InitMostPopular($dbi, $limit) {
! global $HitCountStore;
! $res = mysql_query("select * from $HitCountStore order by hits desc, pagename limit $limit", $dbi["dbc"]);
 
 return $res;
***************
*** 248,252 ****
 
 function GetAllWikiPageNames($dbi) {
! $res = mysql_query("select pagename from wiki", $dbi["dbc"]);
 $rows = mysql_num_rows($res);
 for ($i = 0; $i < $rows; $i++) {
--- 254,259 ----
 
 function GetAllWikiPageNames($dbi) {
! global $WikiPageStore;
! $res = mysql_query("select pagename from $WikiPageStore", $dbi["dbc"]);
 $rows = mysql_num_rows($res);
 for ($i = 0; $i < $rows; $i++) {
***************
*** 262,267 ****
 // takes a page name, returns array of scored incoming and outgoing links
 function GetWikiPageLinks($dbi, $pagename) {
 $pagename = addslashes($pagename);
! $res = mysql_query("select topage, score from wikilinks, wikiscore where topage=pagename and frompage='$pagename' order by score desc, topage");
 $rows = mysql_num_rows($res);
 for ($i = 0; $i < $rows; $i++) {
--- 269,276 ----
 // takes a page name, returns array of scored incoming and outgoing links
 function GetWikiPageLinks($dbi, $pagename) {
+ global $WikiLinksStore, $WikiScoreStore, $HitCountStore;
+ 
 $pagename = addslashes($pagename);
! $res = mysql_query("select topage, score from $WikiLinksStore, $WikiScoreStore where topage=pagename and frompage='$pagename' order by score desc, topage");
 $rows = mysql_num_rows($res);
 for ($i = 0; $i < $rows; $i++) {
***************
*** 270,274 ****
 }
 
! $res = mysql_query("select frompage, score from wikilinks, wikiscore where frompage=pagename and topage='$pagename' order by score desc, frompage");
 $rows = mysql_num_rows($res);
 for ($i = 0; $i < $rows; $i++) {
--- 279,283 ----
 }
 
! $res = mysql_query("select frompage, score from $WikiLinksStore, $WikiScoreStore where frompage=pagename and topage='$pagename' order by score desc, frompage");
 $rows = mysql_num_rows($res);
 for ($i = 0; $i < $rows; $i++) {
***************
*** 277,281 ****
 }
 
! $res = mysql_query("select distinct pagename, hits from wikilinks, hitcount where (frompage=pagename and topage='$pagename') or (topage=pagename and frompage='$pagename') order by hits desc, pagename");
 $rows = mysql_num_rows($res);
 for ($i = 0; $i < $rows; $i++) {
--- 286,290 ----
 }
 
! $res = mysql_query("select distinct pagename, hits from $WikiLinksStore, $HitCountStore where (frompage=pagename and topage='$pagename') or (topage=pagename and frompage='$pagename') order by hits desc, pagename");
 $rows = mysql_num_rows($res);
 for ($i = 0; $i < $rows; $i++) {
***************
*** 291,298 ****
 // the $linklist is an array where the keys are the page names
 function SetWikiPageLinks($dbi, $pagename, $linklist) {
 $frompage = addslashes($pagename);
 
 // first delete the old list of links
! mysql_query("delete from wikilinks where frompage='$frompage'",
 		$dbi["dbc"]);
 
--- 300,309 ----
 // the $linklist is an array where the keys are the page names
 function SetWikiPageLinks($dbi, $pagename, $linklist) {
+ global $WikiLinksStore, $WikiScoreStore;
+ 
 $frompage = addslashes($pagename);
 
 // first delete the old list of links
! mysql_query("delete from $WikiLinksStore where frompage='$frompage'",
 		$dbi["dbc"]);
 
***************
*** 304,308 ****
 $topage = addslashes($topage);
 	 if($topage != $frompage) {
! mysql_query("insert into wikilinks (frompage, topage) " .
 "values ('$frompage', '$topage')", $dbi["dbc"]);
 	 }
--- 315,319 ----
 $topage = addslashes($topage);
 	 if($topage != $frompage) {
! mysql_query("insert into $WikiLinksStore (frompage, topage) " .
 "values ('$frompage', '$topage')", $dbi["dbc"]);
 	 }
***************
*** 310,315 ****
 
 // update pagescore
! mysql_query("delete from wikiscore", $dbi["dbc"]);
! mysql_query("insert into wikiscore select w1.topage, count(*) from wikilinks as w1, wikilinks as w2 where w2.topage=w1.frompage group by w1.topage", $dbi["dbc"]);
 }
 
--- 321,326 ----
 
 // update pagescore
! mysql_query("delete from $WikiScoreStore", $dbi["dbc"]);
! mysql_query("insert into $WikiScoreStore select w1.topage, count(*) from $WikiLinksStore as w1, $WikiLinksStore as w2 where w2.topage=w1.frompage group by w1.topage", $dbi["dbc"]);
 }
 
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /