SourceForge logo
SourceForge logo
Menu

phpwiki-checkins — Automatic notification of CVS checkins on PhpWiki.

You can subscribe to this list here.

2000 Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
(43)
Nov
(73)
Dec
(10)
2001 Jan
(34)
Feb
(110)
Mar
(24)
Apr
(44)
May
(37)
Jun
(22)
Jul
(20)
Aug
(28)
Sep
(50)
Oct
(11)
Nov
(132)
Dec
(595)
2002 Jan
(1099)
Feb
(579)
Mar
(63)
Apr
May
Jun
Jul
Aug
(125)
Sep
(101)
Oct
(25)
Nov
(34)
Dec
(47)
2003 Jan
(82)
Feb
(182)
Mar
(71)
Apr
(3)
May
(1)
Jun
(3)
Jul
Aug
Sep
(14)
Oct
(6)
Nov
(124)
Dec
(68)
2004 Jan
(64)
Feb
(191)
Mar
(199)
Apr
(298)
May
(252)
Jun
(426)
Jul
(134)
Aug
(13)
Sep
(96)
Oct
(75)
Nov
(232)
Dec
(171)
2005 Jan
(205)
Feb
(165)
Mar
(8)
Apr
(74)
May
(21)
Jun
(19)
Jul
(37)
Aug
(69)
Sep
(141)
Oct
(118)
Nov
(31)
Dec
(7)
2006 Jan
(5)
Feb
(10)
Mar
(35)
Apr
(24)
May
(34)
Jun
(29)
Jul
(5)
Aug
(38)
Sep
(30)
Oct
(37)
Nov
(30)
Dec
(86)
2007 Jan
(414)
Feb
(40)
Mar
(18)
Apr
(10)
May
(66)
Jun
(60)
Jul
(105)
Aug
(55)
Sep
(64)
Oct
(7)
Nov
(11)
Dec
(5)
2008 Jan
(26)
Feb
(28)
Mar
(79)
Apr
(34)
May
(61)
Jun
(24)
Jul
(29)
Aug
(160)
Sep
(62)
Oct
(70)
Nov
(32)
Dec
(14)
2009 Jan
(140)
Feb
(135)
Mar
(153)
Apr
(53)
May
(24)
Jun
(138)
Jul
(90)
Aug
(46)
Sep
(72)
Oct
(84)
Nov
(32)
Dec
(4)
2010 Jan
(13)
Feb
(7)
Mar
(14)
Apr
(55)
May
(89)
Jun
(131)
Jul
(41)
Aug
(38)
Sep
(42)
Oct
(11)
Nov
(27)
Dec
(54)
2011 Jan
(127)
Feb
(16)
Mar
(71)
Apr
(52)
May
(32)
Jun
(31)
Jul
(4)
Aug
Sep
(45)
Oct
(26)
Nov
(36)
Dec
(10)
2012 Jan
(23)
Feb
(6)
Mar
(13)
Apr
(18)
May
(1)
Jun
(4)
Jul
(3)
Aug
(12)
Sep
(57)
Oct
(96)
Nov
(163)
Dec
(124)
2013 Jan
(11)
Feb
(17)
Mar
(7)
Apr
(48)
May
(15)
Jun
(29)
Jul
(12)
Aug
Sep
(9)
Oct
Nov
Dec
(3)
2014 Jan
(4)
Feb
(1)
Mar
(2)
Apr
(1)
May
(8)
Jun
(90)
Jul
(104)
Aug
(12)
Sep
(81)
Oct
(139)
Nov
(111)
Dec
(64)
2015 Jan
(46)
Feb
(74)
Mar
(56)
Apr
(61)
May
(3)
Jun
(7)
Jul
(11)
Aug
(5)
Sep
(15)
Oct
(1)
Nov
(1)
Dec
(15)
2016 Jan
(25)
Feb
(33)
Mar
(24)
Apr
(4)
May
(24)
Jun
(3)
Jul
(75)
Aug
Sep
(2)
Oct
(38)
Nov
(4)
Dec
(18)
2017 Jan
(8)
Feb
(1)
Mar
(1)
Apr
May
(14)
Jun
Jul
(5)
Aug
(9)
Sep
Oct
(23)
Nov
Dec
2018 Jan
Feb
Mar
Apr
May
Jun
(2)
Jul
Aug
Sep
Oct
Nov
Dec
2019 Jan
Feb
Mar
(9)
Apr
(60)
May
(1)
Jun
Jul
(13)
Aug
Sep
(11)
Oct
Nov
Dec
2020 Jan
Feb
Mar
(15)
Apr
(4)
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
(47)
2021 Jan
(24)
Feb
(33)
Mar
(1)
Apr
May
(1)
Jun
(64)
Jul
(71)
Aug
(114)
Sep
(82)
Oct
(32)
Nov
(76)
Dec
(86)
2022 Jan
(162)
Feb
(41)
Mar
(11)
Apr
(9)
May
Jun
Jul
(1)
Aug
(2)
Sep
Oct
Nov
Dec
(7)
2023 Jan
Feb
(1)
Mar
(2)
Apr
May
Jun
Jul
(25)
Aug
Sep
Oct
Nov
(7)
Dec
2024 Jan
(7)
Feb
(3)
Mar
(3)
Apr
(1)
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2025 Jan
Feb
(90)
Mar
(19)
Apr
May
(6)
Jun
Jul
(1)
Aug
Sep
Oct
Nov
Dec

Showing results of 13438

<< < 1 .. 520 521 522 523 524 .. 538 > >> (Page 522 of 538)
From: Joel U. <uck...@us...> - 2001年07月18日 04:59:50
Update of /cvsroot/phpwiki/phpwiki/schemas
In directory usw-pr-cvs1:/tmp/cvs-serv27676/schemas
Modified Files:
	schema.psql 
Log Message:
Changed PostgreSQL db library and schema to work with versioning, maybe.
Index: schema.psql
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/schemas/schema.psql,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** schema.psql	2001年07月12日 03:25:11	1.7
--- schema.psql	2001年07月18日 04:59:47	1.8
***************
*** 29,33 ****
 content TEXT NOT NULL,
 refs TEXT, 
! PRIMARY KEY (pagename)
 );
 
--- 29,33 ----
 content TEXT NOT NULL,
 refs TEXT, 
! PRIMARY KEY (pagename, version)
 );
 
From: Joel U. <uck...@us...> - 2001年07月18日 04:59:50
Update of /cvsroot/phpwiki/phpwiki/lib
In directory usw-pr-cvs1:/tmp/cvs-serv27676/lib
Modified Files:
	pgsql.php 
Log Message:
Changed PostgreSQL db library and schema to work with versioning, maybe.
Index: pgsql.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/pgsql.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** pgsql.php	2001年07月15日 16:03:26	1.7
--- pgsql.php	2001年07月18日 04:59:47	1.8
***************
*** 7,15 ****
 OpenDataBase($table)
 CloseDataBase($dbi)
! RetrievePage($dbi, $pagename, $pagestore)
! InsertPage($dbi, $pagename, $pagehash)
! SaveCopyToArchive($dbi, $pagename, $pagehash) 
 IsWikiPage($dbi, $pagename)
 IsInArchive($dbi, $pagename)
 InitTitleSearch($dbi, $search)
 TitleSearchNextMatch($dbi, $res)
--- 7,20 ----
 OpenDataBase($table)
 CloseDataBase($dbi)
! RetrievePage($dbi, $pagename, $pagestore, $version)
! RetrievePageVersions($dbi, $pagename, $curstore, $archstore)
! GetMaxVersionNumber($dbi, $pagename, $pagestore)
! InsertPage($dbi, $pagename, $pagehash, $clobber)
! SelectStore($dbi, $pagename, $version, $curstore, $archstore)
! IsVersionInWiki($dbi, $pagename, $version)
! IsVersionInArchive($dbi, $pagename, $version)
 IsWikiPage($dbi, $pagename)
 IsInArchive($dbi, $pagename)
+ RemovePage($dbi, $pagename)
 InitTitleSearch($dbi, $search)
 TitleSearchNextMatch($dbi, $res)
***************
*** 65,71 ****
 
 // Return hash of page + attributes or default
! function RetrievePage($dbi, $pagename, $pagestore) {
 $pagename = addslashes($pagename);
! $query = "select * from $pagestore where pagename='$pagename'";
 // echo "<p>$query<p>";
 $res = pg_exec($dbi['dbc'], $query);
--- 70,77 ----
 
 // Return hash of page + attributes or default
! function RetrievePage($dbi, $pagename, $pagestore, $version) {
 $pagename = addslashes($pagename);
! $version = $version ? " and version=$version" : '';
! $query = "select * from $pagestore where pagename='$pagename'$version";
 // echo "<p>$query<p>";
 $res = pg_exec($dbi['dbc'], $query);
***************
*** 95,100 ****
 
 
 // Either insert or replace a key/value (a page)
! function InsertPage($dbi, $pagename, $pagehash) {
 $pagename = addslashes($pagename);
 
--- 101,145 ----
 
 
+ // Return all versions of a page as an array of page hashes
+ function RetrievePageVersions($dbi, $pagename, $curstore, $archstore) {
+ $pagename = addslashes($pagename);
+ if (($page[0] = RetrievePage($dbi, $pagename, $curstore, 0)) != -1) {
+ $res = pg_exec($dbi['dbc'], "select * from $archstore where pagename='$pagename' order by version desc");
+ if (pg_numrows($res)) {
+ while ($array = pg_fetch_array($res, 0)) {
+ while (list($key, $val) = each($array)) {
+ if (gettype($key) == "integer") {
+ continue;
+ }
+ $dbhash[$key] = $val;
+ }
+ 
+ $dbhash['refs'] = unserialize($dbhash['refs']);
+ $dbhash['content'] = explode("\n", $dbhash['content']);
+ 
+ array_push($page, $dbhash);
+ }
+ 
+ return $page;
+ }
+ }
+ 
+ // if we reach this the query failed
+ return -1;
+ }
+ 
+ 
+ // Get maximum version number of a page in pagestore
+ function GetMaxVersionNumber($dbi, $pagename, $pagestore) {
+ $pagename = addslashes($pagename);
+ if ($res = pg_exec($dbi['dbc'], "select max(version) from $pagestore where pagename='$pagename'")) {
+ return pg_result($res, 0, "version");
+ }
+ return -1;
+ }
+ 
+ 
 // Either insert or replace a key/value (a page)
! function InsertPage($dbi, $pagename, $pagehash, $clobber) {
 $pagename = addslashes($pagename);
 
***************
*** 123,240 ****
 // record the time of modification
 $pagehash["lastmodified"] = time();
- 
 
! if (IsWikiPage($dbi, $pagename)) {
 
! $PAIRS = "author='$pagehash[author]'," .
! "content='$pagehash[content]'," .
! "created=$pagehash[created]," .
! "flags=$pagehash[flags]," .
! "lastmodified=$pagehash[lastmodified]," .
! "pagename='$pagehash[pagename]'," .
! "refs='$pagehash[refs]'," .
! "version=$pagehash[version]";
 
! $query = "UPDATE $dbi[table] SET $PAIRS WHERE pagename='$pagename'";
! 
! } else {
! // do an insert
! // build up the column names and values for the query
! 
! $COLUMNS = "author, content, created, flags, " .
! "lastmodified, pagename, refs, version";
 
! $VALUES = "'$pagehash[author]', '$pagehash[content]', " .
! "$pagehash[created], $pagehash[flags], " .
! "$pagehash[lastmodified], '$pagehash[pagename]', " .
! "'$pagehash[refs]', $pagehash[version]";
 
 
! $query = "INSERT INTO $dbi[table] ($COLUMNS) VALUES($VALUES)";
 }
 
- // echo "<p>Query: $query<p>\n";
- $retval = pg_exec($dbi['dbc'], $query);
- if ($retval == false) 
- echo "Insert/update failed: " . pg_errormessage($dbi['dbc']);
 
 }
 
 
! function SaveCopyToArchive($dbi, $pagename, $pagehash) {
 global $ArchivePageStore;
- // echo "<p>save copy called<p>";
 
 $pagename = addslashes($pagename);
! // echo "<p>dbi in SaveCopyToArchive: '$dbi' '$ArchivePageStore' '$dbi[dbc]'<p>";
! 
! // prepare the content for storage
! if (!isset($pagehash["pagename"]))
! $pagehash["pagename"] = $pagename;
! if (!isset($pagehash["flags"]))
! $pagehash["flags"] = 0;
! $pagehash["author"] = addslashes($pagehash["author"]);
! $pagehash["content"] = implode("\n", $pagehash["content"]);
! $pagehash["content"] = addslashes($pagehash["content"]);
! $pagehash["pagename"] = addslashes($pagehash["pagename"]);
! $pagehash["refs"] = serialize($pagehash["refs"]);
! 
! if (IsInArchive($dbi, $pagename)) {
! 
! $PAIRS = "author='$pagehash[author]'," .
! "content='$pagehash[content]'," .
! "created=$pagehash[created]," .
! "flags=$pagehash[flags]," .
! "lastmodified=$pagehash[lastmodified]," .
! "pagename='$pagehash[pagename]'," .
! "refs='$pagehash[refs]'," .
! "version=$pagehash[version]";
! 
! $query = "UPDATE $ArchivePageStore SET $PAIRS WHERE pagename='$pagename'";
 
- } else {
- // do an insert
- // build up the column names and values for the query
 
! $COLUMNS = "author, content, created, flags, " .
! "lastmodified, pagename, refs, version";
 
- $VALUES = "'$pagehash[author]', '$pagehash[content]', " .
- "$pagehash[created], $pagehash[flags], " .
- "$pagehash[lastmodified], '$pagehash[pagename]', " .
- "'$pagehash[refs]', $pagehash[version]";
 
 
! $query = "INSERT INTO $ArchivePageStore ($COLUMNS) VALUES($VALUES)";
 }
 
- // echo "<p>Query: $query<p>\n";
- $retval = pg_exec($dbi['dbc'], $query);
- if ($retval == false) 
- echo "Insert/update failed: " . pg_errormessage($dbi['dbc']);
 
 
! }
 
 
! function IsWikiPage($dbi, $pagename) {
! global $WikiPageStore; 	
! $pagename = addslashes($pagename);
! $query = "select count(*) from $WikiPageStore " .
! "where pagename='$pagename'";
! $res = pg_exec($query);
! $array = pg_fetch_array($res, 0);
! return $array[0];
! }
 
 
! function IsInArchive($dbi, $pagename) {
! 	 global $ArchivePageStore;
! $pagename = addslashes($pagename);
! $query = "select count(*) from $ArchivePageStore " .
! "where pagename='$pagename'";
! $res = pg_exec($query);
! $array = pg_fetch_array($res, 0);
! return $array[0];
 }
 
--- 168,275 ----
 // record the time of modification
 $pagehash["lastmodified"] = time();
 
! // Clobber existing page?
! $clobber = $clobber ? 'replace' : 'insert';
 
! $COLUMNS = "author, content, created, flags, " .
! "lastmodified, pagename, refs, version";
 
! $VALUES = "'$pagehash[author]', '$pagehash[content]', " .
! "$pagehash[created], $pagehash[flags], " .
! "$pagehash[lastmodified], '$pagehash[pagename]', " .
! "'$pagehash[refs]', $pagehash[version]";
! 
! if (!pg_exec($dbi['dbc'], "$clobber into $dbi[table] ($COLUMNS) values ($VALUES)")) {
! $msg = htmlspecialchars(sprintf(gettext("Error writing page '%s'"), $pagename));
! $msg .= "<BR>";
! $msg .= htmlspecialchars(sprintf(gettext("PostgreSQL error: %s"), pg_errormessage($dbi['dbc'])));
! ExitWiki($msg);
! }
! }
 
! 
! // Adds a page to the archive pagestore
! function SavePageToArchive($pagename, $pagehash) {
! global $ArchivePageStore;
! $dbi = OpenDataBase($ArchivePageStore);
! InsertPage($dbi, $pagename, $pagehash, false);
! } 
 
 
! // Returns store where version of page resides
! function SelectStore($dbi, $pagename, $version, $curstore, $archstore) {
! if ($version) {
! if (IsVersionInWiki($dbi, $pagename, $version)) return $curstore;
! elseif (IsVersionInArchive($dbi, $pagename, $version)) return $archstore;
! else return -1;
 }
+ elseif (IsWikiPage($dbi, $pagename)) return $curstore;
+ else return -1;
+ }
 
 
+ function IsVersionInWiki($dbi, $pagename, $version) {
+ $pagename = addslashes($pagename);
+ if ($res = pg_exec($dbi['dbc'], "select count(*) from $dbi[table] where pagename='$pagename' and version='$version'")) {
+ return pg_result($res, 0, "count");
+ }
+ return 0;
 }
 
 
! function IsVersionInArchive($dbi, $pagename, $version) {
 global $ArchivePageStore;
 
 $pagename = addslashes($pagename);
! if ($res = pg_exec($dbi['dbc'], "select count(*) from $ArchivePageStore where pagename='$pagename' and version='$version'")) {
! return pg_result($res, 0, "count");
! }
! return 0;
! }
 
 
! function IsWikiPage($dbi, $pagename) {
! $pagename = addslashes($pagename);
! if ($res = pg_exec($dbi['dbc'], "select count(*) from $dbi[table] where pagename='$pagename'")) {
! return pg_result($res, 0, "count");
! }
! return 0;
! }
 
 
+ function IsInArchive($dbi, $pagename) {
+ global $ArchivePageStore;
 
! $pagename = addslashes($pagename);
! if ($res = pg_exec($dbi['dbc'], "select count(*) from $ArchivePageStore where pagename='$pagename'")) {
! return pg_result($res, 0, "count");
 }
+ return 0;
+ }
 
 
+ function RemovePage($dbi, $pagename) {
+ global $WikiPageStore, $ArchivePageStore;
+ global $WikiLinksStore, $HitCountStore, $WikiScoreStore;
 
! $pagename = addslashes($pagename);
! $msg = gettext ("Cannot delete '%s' from table '%s'");
! $msg .= "<br>\n";
! $msg .= gettext ("PostgreSQL error: %s");
 
+ if (!pg_exec($dbi['dbc'], "delete from $WikiPageStore where pagename='$pagename'"))
+ ExitWiki(sprintf($msg, $pagename, $WikiPageStore, pg_errormessage()));
 
! if (!pg_exec($dbi['dbc'], "delete from $ArchivePageStore where pagename='$pagename'"))
! ExitWiki(sprintf($msg, $pagename, $ArchivePageStore, pg_errormessage()));
 
+ if (!pg_exec($dbi['dbc'], "delete from $WikiLinksStore where frompage='$pagename'"))
+ ExitWiki(sprintf($msg, $pagename, $WikiLinksStore, pg_errormessage()));
 
! if (!pg_exec($dbi['dbc'], "delete from $HitCountStore where pagename='$pagename'"))
! ExitWiki(sprintf($msg, $pagename, $HitCountStore, pg_errormessage()));
! 
! if (!pg_exec($dbi['dbc'], "delete from $WikiScoreStore where pagename='$pagename'"))
! ExitWiki(sprintf($msg, $pagename, $WikiScoreStore, mysql_error()));
 }
 
From: Joel U. <uck...@us...> - 2001年07月18日 04:56:19
Update of /cvsroot/phpwiki/phpwiki/lib
In directory usw-pr-cvs1:/tmp/cvs-serv27143
Modified Files:
	mysql.php 
Log Message:
More cosmetic changes... wow did I not follow formating conventions the
first time around.
Index: mysql.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/mysql.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** mysql.php	2001年07月18日 01:06:29	1.15
--- mysql.php	2001年07月18日 04:56:14	1.16
***************
*** 113,116 ****
--- 113,118 ----
 }
 }
+ 
+ // if we reach this the query failed
 return -1;
 }
***************
*** 188,202 ****
 	// Returns store where version of page resides
 	function SelectStore($dbi, $pagename, $version, $curstore, $archstore) {
! if ($version) {
! if (IsVersionInWiki($dbi, $pagename, $version)) return $curstore;
! elseif (IsVersionInArchive($dbi, $pagename, $version)) return $archstore;
! else return -1; 
! }
! elseif (IsWikiPage($dbi, $pagename)) return $curstore;
! else return -1;	
! }
 
 
! function IsVersionInWiki($dbi, $pagename, $version) {
 $pagename = addslashes($pagename);
 if ($res = mysql_query("select count(*) from $dbi[table] where pagename='$pagename' and version='$version'", $dbi['dbc'])) {
--- 190,204 ----
 	// Returns store where version of page resides
 	function SelectStore($dbi, $pagename, $version, $curstore, $archstore) {
! if ($version) {
! if (IsVersionInWiki($dbi, $pagename, $version)) return $curstore;
! elseif (IsVersionInArchive($dbi, $pagename, $version)) return $archstore;
! else return -1; 
! }
! elseif (IsWikiPage($dbi, $pagename)) return $curstore;
! else return -1;	
! }
 
 
! function IsVersionInWiki($dbi, $pagename, $version) {
 $pagename = addslashes($pagename);
 if ($res = mysql_query("select count(*) from $dbi[table] where pagename='$pagename' and version='$version'", $dbi['dbc'])) {
***************
*** 220,224 ****
 $pagename = addslashes($pagename);
 if ($res = mysql_query("select count(*) from $dbi[table] where pagename='$pagename'", $dbi['dbc'])) {
! return(mysql_result($res, 0));
 }
 return 0;
--- 222,226 ----
 $pagename = addslashes($pagename);
 if ($res = mysql_query("select count(*) from $dbi[table] where pagename='$pagename'", $dbi['dbc'])) {
! return mysql_result($res, 0);
 }
 return 0;
***************
*** 230,234 ****
 $pagename = addslashes($pagename);
 if ($res = mysql_query("select count(*) from $ArchivePageStore where pagename='$pagename'", $dbi['dbc'])) {
! return(mysql_result($res, 0));
 }
 return 0;
--- 232,236 ----
 $pagename = addslashes($pagename);
 if ($res = mysql_query("select count(*) from $ArchivePageStore where pagename='$pagename'", $dbi['dbc'])) {
! return mysql_result($res, 0);
 }
 return 0;
From: Joel U. <uck...@us...> - 2001年07月18日 01:06:31
Update of /cvsroot/phpwiki/phpwiki/lib
In directory usw-pr-cvs1:/tmp/cvs-serv26047
Modified Files:
	mysql.php 
Log Message:
Minor cosmetic changes (removed some hard tabs).
Index: mysql.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/mysql.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** mysql.php	2001年07月15日 15:47:59	1.14
--- mysql.php	2001年07月18日 01:06:29	1.15
***************
*** 8,19 ****
 MakePageHash($dbhash)
 RetrievePage($dbi, $pagename, $pagestore, $version)
! 		RetrievePageVersions($dbi, $pagename, $curstore, $archstore)
! 		GetMaxVersionNumber($dbi, $pagename, $pagestore)
 InsertPage($dbi, $pagename, $pagehash, $clobber)
! 		ReplaceCurrentPage($pagename, $pagehash)
 SavePageToArchive($pagename, $pagehash)
! 		SelectStore($dbi, $pagename, $version, $curstore, $archstore)
! 		IsVersionInWiki($dbi, $pagename, $version)
! 		IsVersionInArchive($dbi, $pagename, $version)
 IsWikiPage($dbi, $pagename)
 IsInArchive($dbi, $pagename)
--- 8,19 ----
 MakePageHash($dbhash)
 RetrievePage($dbi, $pagename, $pagestore, $version)
! RetrievePageVersions($dbi, $pagename, $curstore, $archstore)
! GetMaxVersionNumber($dbi, $pagename, $pagestore)
 InsertPage($dbi, $pagename, $pagehash, $clobber)
! ReplaceCurrentPage($pagename, $pagehash)
 SavePageToArchive($pagename, $pagehash)
! SelectStore($dbi, $pagename, $version, $curstore, $archstore)
! IsVersionInWiki($dbi, $pagename, $version)
! IsVersionInArchive($dbi, $pagename, $version)
 IsWikiPage($dbi, $pagename)
 IsInArchive($dbi, $pagename)
***************
*** 106,110 ****
 $pagename = addslashes($pagename);
 
! 		$version = $version ? " and version=$version" : '';
 
 if ($res = mysql_query("select * from $pagestore where pagename='$pagename'$version", $dbi['dbc'])) {
--- 106,110 ----
 $pagename = addslashes($pagename);
 
! $version = $version ? " and version=$version" : '';
 
 if ($res = mysql_query("select * from $pagestore where pagename='$pagename'$version", $dbi['dbc'])) {
***************
*** 119,143 ****
 	// Return all versions of a page as an array of page hashes
 	function RetrievePageVersions($dbi, $pagename, $curstore, $archstore) {
! 		$pagename = addslashes($pagename);
! 		if (($page[0] = RetrievePage($dbi, $pagename, $curstore, 0)) != -1) {
! 			if ($res = mysql_query("select * from $archstore where pagename='$pagename' order by version desc", $dbi['dbc'])) {
! 				while ($dbhash = mysql_fetch_array($res)) {
! 					array_push($page, MakePageHash($dbhash));
! 				}
! 				return $page;
! 			}
! 		}
! 		return -1;
! 	}
 
 
 	// Get maximum version number of a page in pagestore
! 	function GetMaxVersionNumber($dbi, $pagename, $pagestore) {
! 		$pagename = addslashes($pagename);
! 		if ($res = mysql_query("select max(version) from $pagestore where pagename='$pagename'", $dbi['dbc'])) {
! 			return mysql_result($res, 0);
! 		}
! 		return -1;
! 	}
 
 
--- 119,143 ----
 	// Return all versions of a page as an array of page hashes
 	function RetrievePageVersions($dbi, $pagename, $curstore, $archstore) {
! $pagename = addslashes($pagename);
! if (($page[0] = RetrievePage($dbi, $pagename, $curstore, 0)) != -1) {
! if ($res = mysql_query("select * from $archstore where pagename='$pagename' order by version desc", $dbi['dbc'])) {
! while ($dbhash = mysql_fetch_array($res)) {
! array_push($page, MakePageHash($dbhash));
! }
! return $page;
! }
! }
! return -1;
! }
 
 
 	// Get maximum version number of a page in pagestore
! function GetMaxVersionNumber($dbi, $pagename, $pagestore) {
! $pagename = addslashes($pagename);
! if ($res = mysql_query("select max(version) from $pagestore where pagename='$pagename'", $dbi['dbc'])) {
! return mysql_result($res, 0);
! }
! return -1;
! }
 
 
***************
*** 168,202 ****
 
 
! 	// Adds to or replaces a page in the current pagestore
! 	function ReplaceCurrentPage($pagename, $pagehash) {
! 		global $WikiPageStore;
! 		$dbi = OpenDataBase($WikiPageStore);
! 		$linklist = ExtractWikiPageLinks($pagehash['content']);
! 		SetWikiPageLinks($dbi, $pagename, $linklist);
! 		InsertPage($dbi, $pagename, $pagehash, true);
 	}
 
 
! 	// Adds a page to the archive pagestore
! 	function SavePageToArchive($pagename, $pagehash) {
! 		global $ArchivePageStore;
! 		$dbi = OpenDataBase($ArchivePageStore);
! 		InsertPage($dbi, $pagename, $pagehash, false);
! 	}
 
 
 	// Returns store where version of page resides
 	function SelectStore($dbi, $pagename, $version, $curstore, $archstore) {
! 		if ($version) {
! 			if (IsVersionInWiki($dbi, $pagename, $version)) return $curstore;
! 			elseif (IsVersionInArchive($dbi, $pagename, $version)) return $archstore;
! 			else return -1; 
! 		}
! 		elseif (IsWikiPage($dbi, $pagename)) return $curstore;
! 		else return -1;	
! 	}
 
 
! 	function IsVersionInWiki($dbi, $pagename, $version) {
 $pagename = addslashes($pagename);
 if ($res = mysql_query("select count(*) from $dbi[table] where pagename='$pagename' and version='$version'", $dbi['dbc'])) {
--- 168,202 ----
 
 
! // Adds to or replaces a page in the current pagestore
! function ReplaceCurrentPage($pagename, $pagehash) {
! global $WikiPageStore;
! $dbi = OpenDataBase($WikiPageStore);
! $linklist = ExtractWikiPageLinks($pagehash['content']);
! SetWikiPageLinks($dbi, $pagename, $linklist);
! InsertPage($dbi, $pagename, $pagehash, true);
 	}
 
 
! // Adds a page to the archive pagestore
! function SavePageToArchive($pagename, $pagehash) {
! global $ArchivePageStore;
! $dbi = OpenDataBase($ArchivePageStore);
! InsertPage($dbi, $pagename, $pagehash, false);
! }
 
 
 	// Returns store where version of page resides
 	function SelectStore($dbi, $pagename, $version, $curstore, $archstore) {
! if ($version) {
! if (IsVersionInWiki($dbi, $pagename, $version)) return $curstore;
! elseif (IsVersionInArchive($dbi, $pagename, $version)) return $archstore;
! else return -1; 
! }
! elseif (IsWikiPage($dbi, $pagename)) return $curstore;
! else return -1;	
! }
 
 
! function IsVersionInWiki($dbi, $pagename, $version) {
 $pagename = addslashes($pagename);
 if ($res = mysql_query("select count(*) from $dbi[table] where pagename='$pagename' and version='$version'", $dbi['dbc'])) {
***************
*** 207,211 ****
 
 	function IsVersionInArchive($dbi, $pagename, $version) {
! 		global $ArchivePageStore;
 
 $pagename = addslashes($pagename);
--- 207,211 ----
 
 	function IsVersionInArchive($dbi, $pagename, $version) {
! global $ArchivePageStore;
 
 $pagename = addslashes($pagename);
From: Geoffrey T. D. <da...@us...> - 2001年07月17日 21:35:39
Update of /cvsroot/phpwiki/phpwiki/locale/es/templates
In directory usw-pr-cvs1:/tmp/cvs-serv10213/locale/es/templates
Modified Files:
 Tag: release-1_2-branch
	browse.html 
Log Message:
Fix link to BuscarPagina.
(Reported by Aníbal Rojas <ar...@va...>.)
Note the BuscarPagina should probably (I think) be renamed
to BuscarPágina. (PaginaPrincipal, as well as other pages
probably need to have accents added as well.)
Index: browse.html
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/locale/es/templates/browse.html,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -C2 -r1.3.2.1 -r1.3.2.2
*** browse.html	2001年06月14日 00:38:31	1.3.2.1
--- browse.html	2001年07月17日 21:35:37	1.3.2.2
***************
*** 26,30 ****
 [<a href="###SCRIPTURL###?diff=###PAGEURL###">diff</a>]) 
 <br>
! <a href="###SCRIPTURL###?FindPage">BuscarP&aacute;gina</a> navegando o buscando 
 <hr noshade>
 <small>###RELATEDPAGES###</small>
--- 26,30 ----
 [<a href="###SCRIPTURL###?diff=###PAGEURL###">diff</a>]) 
 <br>
! <a href="###SCRIPTURL###?BuscarPagina">BuscarP&aacute;gina</a> navegando o buscando 
 <hr noshade>
 <small>###RELATEDPAGES###</small>
From: Geoffrey T. D. <da...@us...> - 2001年07月17日 15:58:30
Update of /cvsroot/phpwiki/phpwiki/schemas
In directory usw-pr-cvs1:/tmp/cvs-serv11442/schemas
Modified Files:
	schema.mysql 
Log Message:
Bug fix: ..._wikilinks => ..._links.
Index: schema.mysql
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/schemas/schema.mysql,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** schema.mysql	2001年07月12日 03:21:35	1.5
--- schema.mysql	2001年07月17日 15:58:28	1.6
***************
*** 3,7 ****
 drop table if exists phpwiki_pages;
 drop table if exists phpwiki_archive;
! drop table if exists phpwiki_wikilinks;
 drop table if exists phpwiki_hitcount;
 drop table if exists phpwiki_score;
--- 3,7 ----
 drop table if exists phpwiki_pages;
 drop table if exists phpwiki_archive;
! drop table if exists phpwiki_links;
 drop table if exists phpwiki_hitcount;
 drop table if exists phpwiki_score;
From: Steve W. <wai...@us...> - 2001年07月15日 16:03:29
Update of /cvsroot/phpwiki/phpwiki/lib
In directory usw-pr-cvs1:/tmp/cvs-serv27750
Modified Files:
	pgsql.php 
Log Message:
Updated the table names.
Index: pgsql.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/pgsql.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** pgsql.php	2001年02月13日 05:54:38	1.6
--- pgsql.php	2001年07月15日 16:03:26	1.7
***************
*** 25,33 ****
 */
 
! $WikiPageStore = $DBParams['prefix'] . "wiki";
! $ArchivePageStore = $DBParams['prefix'] . "archive";
! $WikiLinksPageStore = $DBParams['prefix'] . "wikilinks";
 $HotTopicsPageStore = $DBParams['prefix'] . "hottopics";
! $HitCountPageStore = $DBParams['prefix'] . "hitcount";
 
 // open a database and return a hash
--- 25,33 ----
 */
 
! $WikiPageStore = $DBParams['prefix'] . "pages";
! $ArchivePageStore = $DBParams['prefix'] . "archive";
! $WikiLinksPageStore = $DBParams['prefix'] . "links";
 $HotTopicsPageStore = $DBParams['prefix'] . "hottopics";
! $HitCountPageStore = $DBParams['prefix'] . "hitcount";
 
 // open a database and return a hash
***************
*** 435,438 ****
--- 435,440 ----
 // mode: php
 // c-file-style: "ellemtel"
+ // tab-width: 4
+ // indent-tabs-mode: nil
 // End: 
 ?>
From: Steve W. <wai...@us...> - 2001年07月15日 15:49:47
Update of /cvsroot/phpwiki/phpwiki
In directory usw-pr-cvs1:/tmp/cvs-serv25692
Modified Files:
	INSTALL.mysql 
Log Message:
Changed one line: lib/config.php to index.php.
Index: INSTALL.mysql
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/INSTALL.mysql,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** INSTALL.mysql	2001年01月24日 18:36:17	1.6
--- INSTALL.mysql	2001年07月15日 15:49:44	1.7
***************
*** 31,35 ****
 the "drop tables" lines from schemas/schema.mysql - it should work now
 
! 4. Edit lib/config.php to reflect your settings.
 
 	a) comment out the DBM settings
--- 31,35 ----
 the "drop tables" lines from schemas/schema.mysql - it should work now
 
! 4. Edit index.php to reflect your settings.
 
 	a) comment out the DBM settings
From: Steve W. <wai...@us...> - 2001年07月15日 15:48:02
Update of /cvsroot/phpwiki/phpwiki/lib
In directory usw-pr-cvs1:/tmp/cvs-serv25371
Modified Files:
	mysql.php 
Log Message:
Fixed the table names. Here is an example of duplicate information,
where the table names are stored both in schema.mysql and
mysql.php. Of course I failed to notice this and the nightly build was
broken. Task #34376.
Index: mysql.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/mysql.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** mysql.php	2001年06月26日 18:01:01	1.13
--- mysql.php	2001年07月15日 15:47:59	1.14
***************
*** 33,41 ****
 */
 
! $WikiPageStore = $DBParams['prefix'] . "wiki";
! $ArchivePageStore = $DBParams['prefix'] . "archive";
! $WikiLinksStore = $DBParams['prefix'] . "wikilinks";
! $WikiScoreStore = $DBParams['prefix'] . "wikiscore";
! $HitCountStore = $DBParams['prefix'] . "hitcount";
 
 // open a database and return the handle
--- 33,41 ----
 */
 
! $WikiPageStore = $DBParams['prefix'] . "pages";
! $ArchivePageStore = $DBParams['prefix'] . "archive";
! $WikiLinksStore = $DBParams['prefix'] . "links";
! $WikiScoreStore = $DBParams['prefix'] . "score";
! $HitCountStore = $DBParams['prefix'] . "hitcount";
 
 // open a database and return the handle
From: Steve W. <wai...@us...> - 2001年07月12日 03:49:08
Update of /cvsroot/phpwiki/phpwiki
In directory usw-pr-cvs1:/tmp/cvs-serv30533
Modified Files:
	index.php 
Log Message:
Added a comment regarding the table name prefix as a precaution to
admins who set up alpha versions of 1.3.
Index: index.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/index.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** index.php	2001年07月12日 03:21:35	1.18
--- index.php	2001年07月12日 03:49:05	1.19
***************
*** 86,90 ****
 // Used by all DB types:
 'database' => 'wiki',
! 'prefix' => 'phpwiki_',	// prefix for filenames or table names
 
 // Used by 'dbm', 'dba', 'file'
--- 86,96 ----
 // Used by all DB types:
 'database' => 'wiki',
! // prefix for filenames or table names
! /* 
! * currently you MUST EDIT THE SQL file too (in the schemas/ directory
! * because we aren't doing on the fly sql generation during the
! * installation.
! */
! 'prefix' => 'phpwiki_',
 
 // Used by 'dbm', 'dba', 'file'
From: Steve W. <wai...@us...> - 2001年07月12日 03:25:14
Update of /cvsroot/phpwiki/phpwiki/schemas
In directory usw-pr-cvs1:/tmp/cvs-serv27060
Modified Files:
	schema.psql 
Log Message:
Oops: fixed a typo just now.
Updated table names so all are prefaced with 'phpwiki_'. This is not
tested with Postgresql yet though.
Index: schema.psql
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/schemas/schema.psql,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** schema.psql	2001年07月12日 03:24:18	1.6
--- schema.psql	2001年07月12日 03:25:11	1.7
***************
*** 8,12 ****
 drop table phpwiki_score;
 
! CREATE TABLE wiki (
 pagename VARCHAR(100) NOT NULL,
 version INT NOT NULL DEFAULT 1,
--- 8,12 ----
 drop table phpwiki_score;
 
! CREATE TABLE phpwiki_pages (
 pagename VARCHAR(100) NOT NULL,
 version INT NOT NULL DEFAULT 1,
From: Steve W. <wai...@us...> - 2001年07月12日 03:24:21
Update of /cvsroot/phpwiki/phpwiki/schemas
In directory usw-pr-cvs1:/tmp/cvs-serv26877
Modified Files:
	schema.psql 
Log Message:
Updated table names so all are prefaced with 'phpwiki_'. This is not
tested with Postgresql yet though.
Index: schema.psql
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/schemas/schema.psql,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** schema.psql	2000年11月02日 04:34:41	1.5
--- schema.psql	2001年07月12日 03:24:18	1.6
***************
*** 1,10 ****
 -- $Id$
 
! drop table wiki;
! drop table archive;
! drop table wikilinks;
! drop table hottopics;
! drop table hitcount;
! drop table wikiscore;
 
 CREATE TABLE wiki (
--- 1,10 ----
 -- $Id$
 
! drop table phpwiki_pages;
! drop table phpwiki_archive;
! drop table phpwiki_links;
! drop table phpwiki_hottopics;
! drop table phpwiki_hitcount;
! drop table phpwiki_score;
 
 CREATE TABLE wiki (
***************
*** 20,24 ****
 );
 
! CREATE TABLE archive (
 pagename VARCHAR(100) NOT NULL,
 version INT NOT NULL DEFAULT 1,
--- 20,24 ----
 );
 
! CREATE TABLE phpwiki_archive (
 pagename VARCHAR(100) NOT NULL,
 version INT NOT NULL DEFAULT 1,
***************
*** 32,36 ****
 );
 
! CREATE TABLE wikilinks (
 frompage VARCHAR(100) NOT NULL,
 topage VARCHAR(100) NOT NULL,
--- 32,36 ----
 );
 
! CREATE TABLE phpwiki_links (
 frompage VARCHAR(100) NOT NULL,
 topage VARCHAR(100) NOT NULL,
***************
*** 38,42 ****
 );
 
! CREATE TABLE hottopics ( 
 pagename VARCHAR(100) NOT NULL,
 lastmodified INT NOT NULL,
--- 38,42 ----
 );
 
! CREATE TABLE phpwiki_hottopics ( 
 pagename VARCHAR(100) NOT NULL,
 lastmodified INT NOT NULL,
***************
*** 44,48 ****
 );
 
! CREATE TABLE hitcount ( 
 pagename VARCHAR(100) NOT NULL, 
 hits INT NOT NULL DEFAULT 0, 
--- 44,48 ----
 );
 
! CREATE TABLE phpwiki_hitcount ( 
 pagename VARCHAR(100) NOT NULL, 
 hits INT NOT NULL DEFAULT 0, 
***************
*** 50,54 ****
 );
 
! CREATE TABLE wikiscore (
 pagename VARCHAR(100) NOT NULL,
 score INT NOT NULL DEFAULT 0,
--- 50,54 ----
 );
 
! CREATE TABLE phpwiki_score (
 pagename VARCHAR(100) NOT NULL,
 score INT NOT NULL DEFAULT 0,
***************
*** 57,65 ****
 
 
! GRANT ALL ON wiki TO nobody;
! GRANT ALL ON archive TO nobody;
! GRANT ALL ON wikilinks TO nobody;
! GRANT ALL ON hottopics TO nobody;
! GRANT ALL ON hitcount TO nobody;
! GRANT ALL ON wikiscore TO nobody;
 
--- 57,65 ----
 
 
! GRANT ALL ON phpwiki_pages TO nobody;
! GRANT ALL ON phpwiki_archive TO nobody;
! GRANT ALL ON phpwiki_links TO nobody;
! GRANT ALL ON phpwiki_hottopics TO nobody;
! GRANT ALL ON phpwiki_hitcount TO nobody;
! GRANT ALL ON phpwiki_score TO nobody;
 
From: Steve W. <wai...@us...> - 2001年07月12日 03:21:37
Update of /cvsroot/phpwiki/phpwiki/schemas
In directory usw-pr-cvs1:/tmp/cvs-serv26353/schemas
Modified Files:
	schema.mysql 
Log Message:
I changed the table names in the schema so all are prefaced with phpwiki_.
I updated index.php (where the config info is) as well; seems to test OK.
Index: schema.mysql
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/schemas/schema.mysql,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** schema.mysql	2001年06月26日 17:51:30	1.4
--- schema.mysql	2001年07月12日 03:21:35	1.5
***************
*** 1,13 ****
 -- $Id$
 
! drop table if exists wiki;
! drop table if exists archive;
! drop table if exists wikilinks;
! drop table if exists hitcount;
! drop table if exists wikiscore;
! drop table if exists hottopics;
 
 
! CREATE TABLE wiki (
 pagename VARCHAR(100) NOT NULL,
 version INT NOT NULL DEFAULT 1,
--- 1,13 ----
 -- $Id$
 
! drop table if exists phpwiki_pages;
! drop table if exists phpwiki_archive;
! drop table if exists phpwiki_wikilinks;
! drop table if exists phpwiki_hitcount;
! drop table if exists phpwiki_score;
! drop table if exists phpwiki_hottopics;
 
 
! CREATE TABLE phpwiki_pages (
 pagename VARCHAR(100) NOT NULL,
 version INT NOT NULL DEFAULT 1,
***************
*** 21,25 ****
 );
 
! CREATE TABLE archive (
 pagename VARCHAR(100) NOT NULL,
 version INT NOT NULL DEFAULT 1,
--- 21,25 ----
 );
 
! CREATE TABLE phpwiki_archive (
 pagename VARCHAR(100) NOT NULL,
 version INT NOT NULL DEFAULT 1,
***************
*** 33,37 ****
 );
 
! CREATE TABLE wikilinks (
 frompage VARCHAR(100) NOT NULL,
 topage VARCHAR(100) NOT NULL,
--- 33,37 ----
 );
 
! CREATE TABLE phpwiki_links (
 frompage VARCHAR(100) NOT NULL,
 topage VARCHAR(100) NOT NULL,
***************
*** 39,43 ****
 );
 
! CREATE TABLE hitcount (
 pagename VARCHAR(100) NOT NULL,
 hits INT NOT NULL DEFAULT 0,
--- 39,43 ----
 );
 
! CREATE TABLE phpwiki_hitcount (
 pagename VARCHAR(100) NOT NULL,
 hits INT NOT NULL DEFAULT 0,
***************
*** 45,49 ****
 );
 
! CREATE TABLE wikiscore (
 pagename VARCHAR(100) NOT NULL,
 score INT NOT NULL DEFAULT 0,
--- 45,49 ----
 );
 
! CREATE TABLE phpwiki_score (
 pagename VARCHAR(100) NOT NULL,
 score INT NOT NULL DEFAULT 0,
***************
*** 54,58 ****
 -- tables below are not yet used
 
! CREATE TABLE hottopics ( 
 pagename VARCHAR(100) NOT NULL,
 lastmodified INT NOT NULL,
--- 54,58 ----
 -- tables below are not yet used
 
! CREATE TABLE phpwiki_hottopics ( 
 pagename VARCHAR(100) NOT NULL,
 lastmodified INT NOT NULL,
From: Steve W. <wai...@us...> - 2001年07月12日 03:21:37
Update of /cvsroot/phpwiki/phpwiki
In directory usw-pr-cvs1:/tmp/cvs-serv26353
Modified Files:
	index.php 
Log Message:
I changed the table names in the schema so all are prefaced with phpwiki_.
I updated index.php (where the config info is) as well; seems to test OK.
Index: index.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/index.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** index.php	2001年05月31日 17:39:01	1.17
--- index.php	2001年07月12日 03:21:35	1.18
***************
*** 86,90 ****
 // Used by all DB types:
 'database' => 'wiki',
! 'prefix' => '',	// prefix for filenames or table names
 
 // Used by 'dbm', 'dba', 'file'
--- 86,90 ----
 // Used by all DB types:
 'database' => 'wiki',
! 'prefix' => 'phpwiki_',	// prefix for filenames or table names
 
 // Used by 'dbm', 'dba', 'file'
From: Steve W. <wai...@us...> - 2001年07月07日 17:44:28
Update of /cvsroot/phpwiki/phpwiki/lib
In directory usw-pr-cvs1:/tmp/cvs-serv16945
Modified Files:
	search.php 
Log Message:
Got fooled by an IF with no braces.
Index: search.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/search.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** search.php	2001年07月07日 17:34:52	1.6
--- search.php	2001年07月07日 17:44:25	1.7
***************
*** 5,27 ****
 rcs_id('$Id$');
 
! if (empty($searchterm))
! $searchterm = '';		// FIXME: do something better here?
 
! fix_magic_quotes_gpc($searchterm);
 
! $html = "<P><B>"
! . sprintf(gettext ("Searching for \"%s\" ....."),
! htmlspecialchars($searchterm))
! . "</B></P>\n";
 
 // quote regexp chars
 $search = preg_quote($searchterm);
 
 // search matching pages
 $query = InitTitleSearch($dbi, $searchterm);
 $found = 0;
 while ($page = TitleSearchNextMatch($dbi, $query)) {
! $found++;
! $html .= LinkExistingWikiWord($page) . "<br>\n";
 }
 
--- 5,30 ----
 rcs_id('$Id$');
 
! if (empty($searchterm)) {
! $searchterm = '';		// FIXME: do something better here?
! }
 
! fix_magic_quotes_gpc($searchterm);
 
! $html = "<P><B>"
! . sprintf(gettext ("Searching for \"%s\" ....."),
! htmlspecialchars($searchterm))
! . "</B></P>\n";
 
 // quote regexp chars
 $search = preg_quote($searchterm);
 
+ 
 // search matching pages
 $query = InitTitleSearch($dbi, $searchterm);
 $found = 0;
+ 
 while ($page = TitleSearchNextMatch($dbi, $query)) {
! $found++;
! $html .= LinkExistingWikiWord($page) . "<br>\n";
 }
 
From: Steve W. <wai...@us...> - 2001年07月07日 17:34:55
Update of /cvsroot/phpwiki/phpwiki/lib
In directory usw-pr-cvs1:/tmp/cvs-serv15027
Modified Files:
	search.php 
Log Message:
Reformatted the code by hand to PEAR standards. Well, mostly by
hand. php-mode doesn't like variable assignments that span several
lines like:
 $html = "<P><B>"
 . sprintf(gettext ("Searching for \"%s\" ....."),
 htmlspecialchars($searchterm))
 . "</B></P>\n";
I have to indent this by hand.
Index: search.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/search.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** search.php	2001年02月12日 01:43:10	1.5
--- search.php	2001年07月07日 17:34:52	1.6
***************
*** 1,31 ****
 <?php
- // Title search: returns pages having a name matching the search term
- rcs_id('$Id$');
 
! if (empty($searchterm))
! $searchterm = '';		// FIXME: do something better here?
 
! fix_magic_quotes_gpc($searchterm);
 
! $html = "<P><B>"
! 	 . sprintf(gettext ("Searching for \"%s\" ....."),
! 		 htmlspecialchars($searchterm))
! 	 . "</B></P>\n";
! 
! // quote regexp chars
! $search = preg_quote($searchterm);
! 
! // search matching pages
! $query = InitTitleSearch($dbi, $searchterm);
! $found = 0;
! while ($page = TitleSearchNextMatch($dbi, $query)) {
! $found++;
! $html .= LinkExistingWikiWord($page) . "<br>\n";
! }
! 
! $html .= "<hr noshade>\n"
! 	 . sprintf(gettext ("%d pages match your query."), $found)
! 	 . "\n";
 
! echo GeneratePage('MESSAGE', $html, gettext ("Title Search Results"), 0);
 ?>
--- 1,34 ----
 <?php
 
! // Title search: returns pages having a name matching the search term
 
! rcs_id('$Id$');
 
! if (empty($searchterm))
! $searchterm = '';		// FIXME: do something better here?
 
! fix_magic_quotes_gpc($searchterm);
! 
! $html = "<P><B>"
! . sprintf(gettext ("Searching for \"%s\" ....."),
! htmlspecialchars($searchterm))
! . "</B></P>\n";
! 
! // quote regexp chars
! $search = preg_quote($searchterm);
! 
! // search matching pages
! $query = InitTitleSearch($dbi, $searchterm);
! $found = 0;
! while ($page = TitleSearchNextMatch($dbi, $query)) {
! $found++;
! $html .= LinkExistingWikiWord($page) . "<br>\n";
! }
! 
! $html .= "<hr noshade>\n"
! . sprintf(gettext ("%d pages match your query."), $found)
! . "\n";
! 
! echo GeneratePage('MESSAGE', $html, gettext ("Title Search Results"), 0);
! 
 ?>
From: Joel U. <uck...@us...> - 2001年06月26日 18:16:09
Update of /cvsroot/phpwiki/phpwiki/admin
In directory usw-pr-cvs1:/tmp/cvs-serv9892
Modified Files:
	wiki_port1_0.php 
Log Message:
Changed call to InsertPage to ReplaceCurrentPage.
Index: wiki_port1_0.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/admin/wiki_port1_0.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** wiki_port1_0.php	2000年08月29日 02:42:59	1.3
--- wiki_port1_0.php	2001年06月26日 18:16:06	1.4
***************
*** 33,37 ****
 $newhash['content'] = explode("\n", $content);
 
! InsertPage($dbi, $pagename, $newhash);
 }
 
--- 33,37 ----
 $newhash['content'] = explode("\n", $content);
 
! ReplaceCurrentPage($pagename, $newhash);
 }
 
From: Joel U. <uck...@us...> - 2001年06月26日 18:15:31
Update of /cvsroot/phpwiki/phpwiki/admin
In directory usw-pr-cvs1:/tmp/cvs-serv9761
Modified Files:
	lockpage.php 
Log Message:
Changed call to InsertPage to ReplaceCurrentPage.
Added $version to RetrievePage call.
Index: lockpage.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/admin/lockpage.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** lockpage.php	2001年02月13日 05:54:38	1.3
--- lockpage.php	2001年06月26日 18:15:28	1.4
***************
*** 4,8 ****
 $user->must_be_admin("lock or unlock pages");
 
! $pagehash = RetrievePage($dbi, $pagename, $WikiPageStore);
 
 if (! is_array($pagehash))
--- 4,8 ----
 $user->must_be_admin("lock or unlock pages");
 
! $pagehash = RetrievePage($dbi, $pagename, $WikiPageStore, 0);
 
 if (! is_array($pagehash))
***************
*** 14,17 ****
 $pagehash['flags'] &= ~FLAG_PAGE_LOCKED;
 
! InsertPage($dbi, $pagename, $pagehash);
 ?>
--- 14,17 ----
 $pagehash['flags'] &= ~FLAG_PAGE_LOCKED;
 
! ReplaceCurrentPage($pagename, $pagehash);
 ?>
From: Joel U. <uck...@us...> - 2001年06月26日 18:14:43
Update of /cvsroot/phpwiki/phpwiki/templates
In directory usw-pr-cvs1:/tmp/cvs-serv9406
Modified Files:
	editpage.html 
Log Message:
Removed EditCopy link.
Removed minor edit code, but I will be adding it back Real Soon(tm).
Added ###IF !CURRENT### block to notify user when editing an archived page.
Added ###CURRENT_VERSION### to handle concurrent edit checking.
Index: editpage.html
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/templates/editpage.html,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** editpage.html	2001年04月07日 15:00:55	1.18
--- editpage.html	2001年06月26日 18:14:41	1.19
***************
*** 18,21 ****
--- 18,23 ----
 <input type="submit" value=" Save "></h1>
 
+ ###IF !CURRENT###<b>Editing old revision ###VERSION###. Saving this page will replace the current version with this text.</b>
+ 
 <textarea name="content"
 rows="###EDIT_AREA_HEIGHT###"
***************
*** 35,40 ****
 <p><a class="wikilink" href="###BROWSE###GoodStyle"><span class="wikiword">GoodStyle</span></a> tips for editing.</p>
 
- ###IF COPY###<br><a class="wikiaction" href="###ACTION###edit&amp;version=archive">EditCopy</a> from previous author
- 
 <hr noshade>
 <small>
--- 37,40 ----
***************
*** 53,57 ****
 <input type="hidden" name="action" value="save">
 <input type="hidden" name="pagename" value="###PAGE###">
! <input type="hidden" name="editversion" value="###VERSION###">
 </form>
 </body>
--- 53,57 ----
 <input type="hidden" name="action" value="save">
 <input type="hidden" name="pagename" value="###PAGE###">
! <input type="hidden" name="editversion" value="###CURRENT_VERSION###">
 </form>
 </body>
From: Joel U. <uck...@us...> - 2001年06月26日 18:13:02
Update of /cvsroot/phpwiki/phpwiki/templates
In directory usw-pr-cvs1:/tmp/cvs-serv9229
Modified Files:
	browse.html 
Log Message:
Edited footer links slightly to allow for page versioning.
Index: browse.html
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/templates/browse.html,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** browse.html	2001年04月07日 17:17:11	1.17
--- browse.html	2001年06月26日 18:13:00	1.18
***************
*** 33,47 ****
 </table>
 <hr noshade>
! ###IF ADMIN###<a class="wikiaction" href="###ACTION###edit">EditText</a> of this page
 ###IF:!ADMIN###
! ###IF LOCK###Page locked
! ###IF !LOCK###<a class="wikiaction" href="###ACTION###edit">EditText</a> of this page
 ###ENDIF:!ADMIN###
! (last edited ###LASTMODIFIED###
! [<a class="wikiaction" href="###ACTION###info">info</a>]
! [<a class="wikiaction" href="###ACTION###diff">diff</a>])
! <br>
! <a class="wikilink" href="###BROWSE###FindPage"><span class="wikiword">FindPage</span></a>
 by browsing or searching
 <hr noshade>
 <small>###RELATEDPAGES###</small>
--- 33,47 ----
 </table>
 <hr noshade>
! ###IF ADMIN###<a class="wikiaction" href="###ACTION###edit&version=###VERSION###">Edit</a> Revision ###VERSION###
 ###IF:!ADMIN###
! ###IF LOCK###Page locked, revision ###VERSION###
! ###IF !LOCK###<a class="wikiaction" href="###ACTION###edit&version=###VERSION###">Edit</a> Revision ###VERSION###
 ###ENDIF:!ADMIN###
! | Created ###LASTMODIFIED###
! | <a href="###ACTION###info">Info</a>
! | <a href="###ACTION###diff&ver2=###VERSION###">Diff</a>
! <br><a class="wikilink" href="###BROWSE###FindPage"><span class="wikiword">FindPage</span></a>
 by browsing or searching
+ 
 <hr noshade>
 <small>###RELATEDPAGES###</small>
Update of /cvsroot/phpwiki/phpwiki/lib
In directory usw-pr-cvs1:/tmp/cvs-serv7797
Modified Files:
	editpage.php loadsave.php savepage.php stdlib.php 
Log Message:
lib/editpage.php
- Added $version to RetrievePage calls.
- Removed EditCopy, since it's no longer needed.
lib/loadsave.php
- Changed call to InsertPage to ReplaceCurrentPage.
- Changed call to SaveCopyToArchive to SavePageToArchive.
- Added $version to RetrievePage calls.
lib/savepage.php
- Changed call to InsertPage to ReplaceCurrentPage.
- Changed call to SaveCopyToArchive to SavePageToArchive.
- All old versions of pages are now saved to archive.
- Added $version to RetrievePage calls.
lib/stdlib.php
- Changed call to InsertPage to ReplaceCurrentPage.
- Added $version to RetrievePage call.
- Added $WikiPageStore as global in GeneratePage.
- Added CURRENT as _iftoken. This is needed so users can edit from archived pages, but still be prevented from completing their edit if the current page version changes while they are editing. VERSION doesn't work for this anymore, since the version being edited might not be CURRENT.
Index: editpage.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/editpage.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** editpage.php	2001年02月27日 23:22:30	1.15
--- editpage.php	2001年06月26日 18:08:32	1.16
***************
*** 4,48 ****
 // editpage relies on $pagename, $version
 
! $currentpage = RetrievePage($dbi, $pagename, $WikiPageStore);
! $editing_copy = isset($version) && $version == 'archive';
 
! if ($editing_copy) { 
! $banner = htmlspecialchars (sprintf (gettext ("Copy of %s"), $pagename));
! $pagehash = RetrievePage($dbi, $pagename, $ArchivePageStore);
! } else {
! $banner = htmlspecialchars($pagename);
! $pagehash = $currentpage;
! }
 
 if (is_array($pagehash)) {
! 
! if (($pagehash['flags'] & FLAG_PAGE_LOCKED) && !$user->is_admin()) {
! 	 $html = "<p>";
! 	 $html .= gettext ("This page has been locked by the administrator and cannot be edited.");
! 	 $html .= "\n<p>";
! 	 $html .= gettext ("Sorry for the inconvenience.");
! 	 $html .= "\n";
! 	 echo GeneratePage('MESSAGE', $html,
! 			 sprintf (gettext ("Problem while editing %s"), $pagename), 0);
! 	 ExitWiki ("");
! }
! 
! $textarea = htmlspecialchars(implode("\n", $pagehash["content"]));
! if ($editing_copy) {
! $pagehash["version"] = $currentpage["version"];
 }
- else {
- 	 if ($pagehash["version"] > 1 && IsInArchive($dbi, $pagename)) {
- 	 $pagehash["copy"] = 1;
- 	 }
- }
- } else {
- if (preg_match("/^${WikiNameRegexp}\$/", $pagename))
- 	 $newpage = $pagename;
- else
- 	 $newpage = "[$pagename]";
 
! $textarea = htmlspecialchars(
! 	 sprintf(gettext ("Describe %s here."), $newpage));
 
 unset($pagehash);
--- 4,30 ----
 // editpage relies on $pagename, $version
 
! $currentpage = RetrievePage($dbi, $pagename, SelectStore($dbi, $pagename, $version, $WikiPageStore, $ArchivePageStore), $version);
 
! 	$banner = htmlspecialchars($pagename);
! 	$pagehash = $currentpage;
 
 if (is_array($pagehash)) {
! 		if (($pagehash['flags'] & FLAG_PAGE_LOCKED) && !$user->is_admin()) {
! 		 $html = "<p>";
! 		 $html .= gettext ("This page has been locked by the administrator and cannot be edited.");
! 		 $html .= "\n<p>";
! 		 $html .= gettext ("Sorry for the inconvenience.");
! 		 $html .= "\n";
! 		 echo GeneratePage('MESSAGE', $html, sprintf (gettext ("Problem while editing %s"), $pagename), 0);
! 		 ExitWiki ("");
 }
 
! 		$textarea = htmlspecialchars(implode("\n", $pagehash["content"]));
! 	}
! 	else {
! if (preg_match("/^${WikiNameRegexp}\$/", $pagename)) $newpage = $pagename;
! else $newpage = "[$pagename]";
! 
! 		$textarea = htmlspecialchars(sprintf(gettext("Describe %s here."), $newpage));
 
 unset($pagehash);
***************
*** 51,78 ****
 $pagehash["author"] = '';
 $currentpage = $pagehash;
- }
- 
- if (empty($pagehash['copy']))
- $do_archive = false;
- else if ( $user->is_admin() )
- $do_archive = 'probably';
- else if ( $user->id() == $currentpage['author'] )
- {
- $page_age = time() - $currentpage['lastmodified'];
- if ($page_age < MINOR_EDIT_TIMEOUT)
- 	 $do_archive = 'maybe';
- else
- 	 $do_archive = 'probably';
- }
- else
- $do_archive = 'force';
- 
- if ($do_archive == 'probably' || $do_archive == 'maybe')
- {
- $pagehash['minor_edit_checkbox']
- 	 = Element('input', array('type' => 'checkbox',
- 				 'name' => 'minor_edit',
- 				 'value' => 'yes',
- 				 'checked' => ($do_archive == 'maybe')));
 }
 
--- 33,36 ----
Index: loadsave.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/loadsave.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** loadsave.php	2001年05月31日 17:43:05	1.6
--- loadsave.php	2001年06月26日 18:08:32	1.7
***************
*** 13,18 ****
 {
 // FIXME: This is a hack
! echo Element('p', QElement('b', gettext ("Complete.")));
! echo Element('p', gettext ("Return to ") . LinkExistingWikiWord($GLOBALS['pagename']));
 echo "</body></html>\n";
 }
--- 13,18 ----
 {
 // FIXME: This is a hack
! echo Element('p', QElement('b', gettext("Complete.")));
! echo Element('p', "Return to " . LinkExistingWikiWord($GLOBALS['pagename']));
 echo "</body></html>\n";
 }
***************
*** 69,73 ****
 {
 set_time_limit(30);	// Reset watchdog.
! $pagehash = RetrievePage($dbi, $pagename, $WikiPageStore);
 
 if (! is_array($pagehash))
--- 69,73 ----
 {
 set_time_limit(30);	// Reset watchdog.
! $pagehash = RetrievePage($dbi, $pagename, $WikiPageStore, 0);
 
 if (! is_array($pagehash))
***************
*** 75,79 ****
 
 if ($include_archive)
! 	 $oldpagehash = RetrievePage($dbi, $pagename, $ArchivePageStore);
 else
 	 $oldpagehash = false;
--- 75,79 ----
 
 if ($include_archive)
! 	 $oldpagehash = RetrievePage($dbi, $pagename, $ArchivePageStore, 0);
 else
 	 $oldpagehash = false;
***************
*** 122,126 ****
 echo "<small>saved as $filename</small> ... ";
 
! $page = RetrievePage($dbi, $pagename, $WikiPageStore);
 
 //$data = serialize($page);
--- 122,126 ----
 echo "<small>saved as $filename</small> ... ";
 
! $page = RetrievePage($dbi, $pagename, $WikiPageStore, 0);
 
 //$data = serialize($page);
***************
*** 175,179 ****
 $mesg[] = sprintf(gettext("from %s"), $source);
 
! if (is_array($current = RetrievePage($dbi, $pagename, $WikiPageStore)))
 {
 $isnew = false;
--- 175,179 ----
 $mesg[] = sprintf(gettext("from %s"), $source);
 
! if (is_array($current = RetrievePage($dbi, $pagename, $WikiPageStore, 0)))
 {
 $isnew = false;
***************
*** 194,198 ****
 else
 {
! 	 SaveCopyToArchive($dbi, $pagename, $current);
 
 	 if ( $version <= $current['version'] )
--- 194,198 ----
 else
 {
! 	 SavePageToArchive($pagename, $current);
 
 	 if ( $version <= $current['version'] )
***************
*** 206,210 ****
 if ($page)
 {
! InsertPage($dbi, $pagename, $page);
 UpdateRecentChanges($dbi, $pagename, $isnew);
 
--- 206,210 ----
 if ($page)
 {
! ReplaceCurrentPage($pagename, $page);
 UpdateRecentChanges($dbi, $pagename, $isnew);
 
***************
*** 260,270 ****
 usort($parts, 'SortByPageVersion');
 for (reset($parts); $page = current($parts); next($parts))
! 	 SavePage($dbi, $page, $defaults, 
! 	 	 gettext ("MIME file") . " $filename", $basename);
 }
 else if ( ($page = ParseSerializedPage($text)) )
 {
! SavePage($dbi, $page, $defaults, 
! gettext ("Serialized file") . " $filename", $basename);
 }
 else
--- 260,268 ----
 usort($parts, 'SortByPageVersion');
 for (reset($parts); $page = current($parts); next($parts))
! 	 SavePage($dbi, $page, $defaults, "MIME file $filename", $basename);
 }
 else if ( ($page = ParseSerializedPage($text)) )
 {
! SavePage($dbi, $page, $defaults, "Serialized file $filename", $basename);
 }
 else
***************
*** 272,277 ****
 // Assume plain text file.
 $page['content'] = preg_split('/[ \t\r]*\n/', chop($text));
! SavePage($dbi, $page, $defaults, 
! gettext ("plain file") . " $filename", $basename);
 }
 }
--- 270,274 ----
 // Assume plain text file.
 $page['content'] = preg_split('/[ \t\r]*\n/', chop($text));
! SavePage($dbi, $page, $defaults, "plain file $filename", $basename);
 }
 }
***************
*** 287,292 ****
 	 || ($exclude && in_array($fn, $exclude)) )
 {
! 	 print Element('dt', LinkExistingWikiWord($fn))
! 	 . QElement('dd', gettext("Skipping"));
 	 continue;
 }
--- 284,288 ----
 	 || ($exclude && in_array($fn, $exclude)) )
 {
! 	 print Element('dt', LinkExistingWikiWord($fn)) . QElement('dd', 'Skipping');
 	 continue;
 }
***************
*** 362,366 ****
 StartLoadDump("Loading '$source'");
 echo "<dl>\n";
! LoadAny($dbi, $source, false, array(gettext("RecentChanges")));
 echo "</dl>\n";
 EndLoadDump();
--- 358,362 ----
 StartLoadDump("Loading '$source'");
 echo "<dl>\n";
! LoadAny($dbi, $source, false, array(gettext('RecentChanges')));
 echo "</dl>\n";
 EndLoadDump();
***************
*** 372,381 ****
 
 //FIXME: This is a hack
! $user->userid = gettext("The PhpWiki programming team");
 
! StartLoadDump(gettext("Loading up virgin wiki"));
 echo "<dl>\n";
 
! $ignore = array(gettext("RecentChanges"));
 
 LoadAny($dbi, FindLocalizedFile(WIKI_PGSRC), false, $ignore);
--- 368,377 ----
 
 //FIXME: This is a hack
! $user->userid = 'The PhpWiki programming team';
 
! StartLoadDump('Loading up virgin wiki');
 echo "<dl>\n";
 
! $ignore = array(gettext('RecentChanges'));
 
 LoadAny($dbi, FindLocalizedFile(WIKI_PGSRC), false, $ignore);
***************
*** 408,412 ****
 
 if (IsZipFile($fd))
! LoadZip($dbi, $fd, false, array(gettext("RecentChanges")));
 else
 Loadfile($dbi, $name, fread($fd, MAX_UPLOAD_SIZE));
--- 404,408 ----
 
 if (IsZipFile($fd))
! LoadZip($dbi, $fd, false, array(gettext('RecentChanges')));
 else
 Loadfile($dbi, $name, fread($fd, MAX_UPLOAD_SIZE));
Index: savepage.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/savepage.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** savepage.php	2001年03月14日 19:45:42	1.14
--- savepage.php	2001年06月26日 18:08:32	1.15
***************
*** 39,43 ****
 
 
! $pagehash = RetrievePage($dbi, $pagename, $WikiPageStore);
 
 // if this page doesn't exist yet, now's the time!
--- 39,43 ----
 
 
! $pagehash = RetrievePage($dbi, $pagename, $WikiPageStore, 0);
 
 // if this page doesn't exist yet, now's the time!
***************
*** 49,58 ****
 $newpage = 1;
 } else {
! if (($pagehash['flags'] & FLAG_PAGE_LOCKED) && ! $user->is_admin()) {
! 	 $html = "<p>" . gettext ("This page has been locked by the administrator and cannot be edited.");
! 	 $html .= "\n<p>" . gettext ("Sorry for the inconvenience.");
! 	 echo GeneratePage('MESSAGE', $html,
! 			 sprintf (gettext ("Problem while editing %s"), $pagename), 0);
! 	 ExitWiki ("");
 }
 
--- 49,58 ----
 $newpage = 1;
 } else {
! 		if (($pagehash['flags'] & FLAG_PAGE_LOCKED) && ! $user->is_admin()) {
! 			$html = "<p>" . gettext ("This page has been locked by the administrator and cannot be edited.");
! 			$html .= "\n<p>" . gettext ("Sorry for the inconvenience.");
! 			echo GeneratePage('MESSAGE', $html,
! 			sprintf (gettext ("Problem while editing %s"), $pagename), 0);
! 			 ExitWiki ("");
 }
 
***************
*** 61,73 ****
 }
 
! if ($user->id() != $pagehash['author'] && ! $user->is_admin())
! 	 unset($minor_edit); // Force archive
! 
! if (empty($minor_edit))
! 	 SaveCopyToArchive($dbi, $pagename, $pagehash);
 
- $newpage = 0;
- }
- 
 // set new pageinfo
 $pagehash['lastmodified'] = time();
--- 61,68 ----
 }
 
! 		SavePageToArchive($pagename, $pagehash);
! 		$newpage = 0;
! 	}
 
 // set new pageinfo
 $pagehash['lastmodified'] = time();
***************
*** 92,97 ****
 }
 
! InsertPage($dbi, $pagename, $pagehash);
! UpdateRecentChanges($dbi, $pagename, $newpage);
 
 $html .= gettext ("Your careful attention to detail is much appreciated.");
--- 87,92 ----
 }
 
! ReplaceCurrentPage($pagename, $pagehash);
! 	UpdateRecentChanges($dbi, $pagename, $newpage);
 
 $html .= gettext ("Your careful attention to detail is much appreciated.");
Index: stdlib.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -r1.39 -r1.40
*** stdlib.php	2001年05月31日 17:43:05	1.39
--- stdlib.php	2001年06月26日 18:08:32	1.40
***************
*** 473,476 ****
--- 473,477 ----
 global $datetimeformat, $dbi, $logo, $FieldSeparator;
 global $user, $pagename;
+ 		global $WikiPageStore;
 
 if (!is_array($hash))
***************
*** 519,522 ****
--- 520,524 ----
 _iftoken('ADMIN', $user->is_admin(), $page);
 _iftoken('ANONYMOUS', !$user->is_authenticated(), $page);
+ 		_iftoken('CURRENT', isset($hash['version']) && $hash['version'] == GetMaxVersionNumber($dbi, $hash['pagename'], $WikiPageStore), $page);
 
 if (empty($hash['minor_edit_checkbox']))
***************
*** 575,578 ****
--- 577,582 ----
 	 if (!empty($hash['version']))
 	 _dotoken('VERSION', $hash['version'], $page);
+ 	 if (!empty($hash['pagename']))
+ _dotoken('CURRENT_VERSION', GetMaxVersionNumber($dbi, $hash['pagename'], $WikiPageStore), $page);
 	 if (strstr($page, "$FieldSeparator#HITS$FieldSeparator#")) {
 _dotoken('HITS', GetHitCount($dbi, $name), $page);
***************
*** 593,597 ****
 global $WikiPageStore;
 
! $recentchanges = RetrievePage($dbi, gettext ("RecentChanges"), $WikiPageStore);
 
 // this shouldn't be necessary, since PhpWiki loads 
--- 597,601 ----
 global $WikiPageStore;
 
! $recentchanges = RetrievePage($dbi, gettext ("RecentChanges"), $WikiPageStore, 0);
 
 // this shouldn't be necessary, since PhpWiki loads 
***************
*** 643,647 ****
 // add the updated page's name to the array
 if($isnewpage) {
! $newpage[$k++] = "* [$pagename] " . gettext("(new)") . " ..... $userid\r";
 } else {
 $diffurl = "phpwiki:" . rawurlencode($pagename) . "?action=diff";
--- 647,651 ----
 // add the updated page's name to the array
 if($isnewpage) {
! $newpage[$k++] = "* [$pagename] (new) ..... $userid\r";
 } else {
 $diffurl = "phpwiki:" . rawurlencode($pagename) . "?action=diff";
***************
*** 662,666 ****
 $recentchanges['content'] = $newpage;
 
! InsertPage($dbi, gettext ("RecentChanges"), $recentchanges);
 }
 
--- 666,670 ----
 $recentchanges['content'] = $newpage;
 
! ReplaceCurrentPage(gettext ("RecentChanges"), $recentchanges);
 }
 
From: Joel U. <uck...@us...> - 2001年06月26日 18:04:56
Update of /cvsroot/phpwiki/phpwiki/lib
In directory usw-pr-cvs1:/tmp/cvs-serv7529
Modified Files:
	display.php 
Log Message:
Added $version to RetrievePage call.
Added code to determine which pagestore to check when displaying pages, since user could be requesting something from the archive.
Index: display.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/display.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** display.php	2001年02月12日 01:43:10	1.8
--- display.php	2001年06月26日 18:04:54	1.9
***************
*** 3,10 ****
 // calls transform.php for actual transformation of wiki markup to HTML
 rcs_id('$Id$');
- 
- $html = "";
 
! $pagehash = RetrievePage($dbi, $pagename, $WikiPageStore);
 
 // we render the page if it exists, else ask the user to write one.
--- 3,12 ----
 // calls transform.php for actual transformation of wiki markup to HTML
 rcs_id('$Id$');
 
! 	if (!isset($version)) $version = 0;
! 	$pagestore = SelectStore($dbi, $pagename, $version, $WikiPageStore, $ArchivePageStore);
! $pagehash = RetrievePage($dbi, $pagename, $pagestore, $version);
! 
! 	$html = "";
 
 // we render the page if it exists, else ask the user to write one.
From: Joel U. <uck...@us...> - 2001年06月26日 18:03:44
Update of /cvsroot/phpwiki/phpwiki/lib
In directory usw-pr-cvs1:/tmp/cvs-serv7389
Modified Files:
	diff.php 
Log Message:
Added $version to RetrievePage calls.
Changed to recognize $ver1 and $ver2 in URLs to allow diffs of aribtrary page versions.
Index: diff.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/diff.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** diff.php	2001年04月07日 00:34:30	1.11
--- diff.php	2001年06月26日 18:03:41	1.12
***************
*** 1050,1065 ****
 if (isset($pagename))
 {
! $wiki = RetrievePage($dbi, $pagename, $WikiPageStore);
! $archive= RetrievePage($dbi, $pagename, $ArchivePageStore);
 
 $html = Element('table',
! 		 PageInfoRow(gettext ("Current page:"), $wiki)
! 		 . PageInfoRow(gettext ("Archived page:"), $archive));
 		 
 $html .= "<p>\n";
 
! if (is_array($wiki) && is_array($archive))
 {
! $diff = new WikiDiff($archive['content'], $wiki['content']);
 if ($diff->isEmpty()) {
 	 $html .= '<hr>[' . gettext ("Versions are identical") . ']';
--- 1050,1074 ----
 if (isset($pagename))
 {
! 	if (!isset($ver1)) {
! 		if (isset($ver2)) $ver1 = $ver2 - 1;
! 		else {
! 			$ver1 = GetMaxVersionNumber($dbi, $pagename, $ArchivePageStore);
! 			$ver2 = 0;
! 		}
! 	}
! 	elseif (!isset($ver2)) $ver2 = 0;
 
+ 	$older = RetrievePage($dbi, $pagename, SelectStore($dbi, $pagename, $ver1, $WikiPageStore, $ArchivePageStore), $ver1);
+ 	$newer = RetrievePage($dbi, $pagename, SelectStore($dbi, $pagename, $ver2, $WikiPageStore, $ArchivePageStore), $ver2);
+ 
 $html = Element('table',
! 		 PageInfoRow(gettext ("Newer page:"), $newer)
! 		 . PageInfoRow(gettext ("Older page:"), $older));
 		 
 $html .= "<p>\n";
 
! if (is_array($newer) && is_array($older))
 {
! $diff = new WikiDiff($older['content'], $newer['content']);
 if ($diff->isEmpty()) {
 	 $html .= '<hr>[' . gettext ("Versions are identical") . ']';
***************
*** 1067,1071 ****
 	 //$fmt = new WikiDiffFormatter;
 	 $fmt = new WikiUnifiedDiffFormatter;
! 	 $html .= $fmt->format($diff, $archive['content']);
 }
 }
--- 1076,1080 ----
 	 //$fmt = new WikiDiffFormatter;
 	 $fmt = new WikiUnifiedDiffFormatter;
! 	 $html .= $fmt->format($diff, $older['content']);
 }
 }
From: Joel U. <uck...@us...> - 2001年06月26日 18:02:46
Update of /cvsroot/phpwiki/phpwiki/lib
In directory usw-pr-cvs1:/tmp/cvs-serv7177
Modified Files:
	pageinfo.php 
Log Message:
This is a near total rewrite of this file. It is responsible for displaying all of the radio buttons and version listing now.
Index: pageinfo.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/pageinfo.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** pageinfo.php	2001年04月07日 00:34:30	1.9
--- pageinfo.php	2001年06月26日 18:02:43	1.10
***************
*** 3,62 ****
 // Display the internal structure of a page. Steve Wainstead, June 2000
 
 
 
! function ViewpageProps($name, $pagestore)
! {
! global $dbi, $showpagesource, $datetimeformat, $FieldSeparator;
! 
! $pagehash = RetrievePage($dbi, $name, $pagestore);
! if ($pagehash == -1) {
! return QElement('p',
! 		 sprintf (gettext ("Page name '%s' is not in the database"),
! 			 $name));
! }
! 
! $rows = '';
! while (list($key, $val) = each($pagehash)) {
! if ($key > 0 || !$key)
! 	 continue; //key is an array index
! $cols = QElement('td', array('align' => 'right'), $key);
! 
! if (is_array($val))
! {
! 	 if (empty($showpagesource))
! 	 continue;
! 	 $cols .= Element('td',
! 			 nl2br(htmlspecialchars(join("\n", $val))));
! }
! elseif (($key == 'lastmodified') || ($key == 'created'))
! 	 $cols .= QElement('td',
! 			 strftime($datetimeformat, $val));
! else
! 	 $cols .= QElement('td', $val);
! 
! $rows .= Element('tr', $cols);
! }
! 
! return Element('table', array('border' => 1, 'bgcolor' => 'white'), $rows);
 }
- 
- 
- $html = '';
- 
- if (empty($showpagesource))
- {
- $text = gettext ("Show the page source");
- $url = WikiURL($pagename, array('action' => 'info',
- 				 'showpagesource' => 'on'));
- $html .= QElement('a', array('href' => $url), $text);
- }
- 
- $html .= Element('p', QElement('b', gettext ("Current version")));
- $html .= ViewPageProps($pagename, $WikiPageStore);
 
! $html .= Element('p', QElement('b', gettext ("Archived version")));
! $html .= ViewPageProps($pagename, $ArchivePageStore);
 
! echo GeneratePage('MESSAGE', $html,
! 		 gettext("PageInfo").": '$pagename'", 0);
 ?>
--- 3,25 ----
 // Display the internal structure of a page. Steve Wainstead, June 2000
 
+ $html = "\n" . Element('th', 'Version') . "\n" . Element('th', 'Newer') . "\n" . Element('th', 'Older') . "\n" . Element('th', 'Created') . "\n" . Element('th', 'Author') . "\n";
+ $html = "\n" . Element('tr', $html) . "\n";
 
+ // Get all versions of a page, then iterate over them to make version list
+ $pages = RetrievePageVersions($dbi, $pagename, $WikiPageStore, $ArchivePageStore);
+ $i = 0;
+ foreach ($pages as $pagehash) {
+ 	$row = "\n" . Element('td', array('align' => 'right'), QElement('a', array('href' => "$pagename?version=" . $pagehash['version']), $pagehash['version']));
+ 	$row .= "\n" . Element('td', array('align' => 'center'), QElement('input', array('type' => 'radio', 'name' => 'ver2', 'value' => ($i ? $pagehash['version'] : 0), 'checked' => ($i ? false : true))));
+ 	$row .= "\n" . Element('td', array('align' => 'center'), QElement('input', array('type' => 'radio', 'name' => 'ver1', 'value' => ($i ? $pagehash['version'] : 0), 'checked' => ($i++-1 ? false : true))));
+ 	$row .= "\n" . QElement('td', strftime($datetimeformat, $pagehash['lastmodified']));
+ 	$row .= "\n" . QElement('td', $pagehash['author']) . "\n";
 
! 	$html .= Element('tr', $row) . "\n"; 
 }
 
! $html = "\n" . Element('table', $html) . "\n" . Element('input', array('type' => 'hidden', 'name' => 'action', 'value' => 'diff')) . "\n" . Element('input', array('type' => 'submit', 'value' => 'Run Diff')) . "\n";
! $html = Element('form', array('method' => 'get', 'action' => $pagename), $html);
 
! echo GeneratePage('MESSAGE', $html, gettext("PageInfo").": '$pagename'", 0);
 ?>
From: Joel U. <uck...@us...> - 2001年06月26日 18:01:04
Update of /cvsroot/phpwiki/phpwiki/lib
In directory usw-pr-cvs1:/tmp/cvs-serv5287
Modified Files:
	mysql.php 
Log Message:
Lots of changes here:
- Added $clobber as argument to InsertPage. If $clobber, then use 'replace '; otherwise use 'insert'i. Pages going into the current store should clobber, but pages going into the archive should not. (Assuming that an unlimited number of pages are kept. I still need to implement archive limiting...)
- Created function ReplaceCurrentPage.
- Moved link updating from InsertPage to ReplaceCurrentPage.
- Renamed SaveCopyToArchive to SavePageToArchive.
- Created function RetrievePageVersions. Returns an arary of page hashes that contains all versions of the specified page.
- Added $version as argument to RetrievePage. It needs to know which version to get. Version 0 (zero)is magic, and always refers to the current version.
- Created function GetMaxVersionNumber. This is used mostly to determine which version to get for the diffs against current pages.
- Created function IsVersionInWiki.
- Created function IsVersionInArchive.
- Created function SelectStore. Given a page name and a version, this function returns the store where that page resides.
Index: mysql.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/mysql.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** mysql.php	2001年02月12日 01:43:10	1.12
--- mysql.php	2001年06月26日 18:01:01	1.13
***************
*** 7,13 ****
 MakeDBHash($pagename, $pagehash)
 MakePageHash($dbhash)
! RetrievePage($dbi, $pagename, $pagestore)
! InsertPage($dbi, $pagename, $pagehash)
! SaveCopyToArchive($dbi, $pagename, $pagehash)
 IsWikiPage($dbi, $pagename)
 IsInArchive($dbi, $pagename)
--- 7,19 ----
 MakeDBHash($pagename, $pagehash)
 MakePageHash($dbhash)
! RetrievePage($dbi, $pagename, $pagestore, $version)
! 		RetrievePageVersions($dbi, $pagename, $curstore, $archstore)
! 		GetMaxVersionNumber($dbi, $pagename, $pagestore)
! InsertPage($dbi, $pagename, $pagehash, $clobber)
! 		ReplaceCurrentPage($pagename, $pagehash)
! SavePageToArchive($pagename, $pagehash)
! 		SelectStore($dbi, $pagename, $version, $curstore, $archstore)
! 		IsVersionInWiki($dbi, $pagename, $version)
! 		IsVersionInArchive($dbi, $pagename, $version)
 IsWikiPage($dbi, $pagename)
 IsInArchive($dbi, $pagename)
***************
*** 97,103 ****
 
 // Return hash of page + attributes or default
! function RetrievePage($dbi, $pagename, $pagestore) {
 $pagename = addslashes($pagename);
! if ($res = mysql_query("select * from $pagestore where pagename='$pagename'", $dbi['dbc'])) {
 if ($dbhash = mysql_fetch_array($res)) {
 return MakePageHash($dbhash);
--- 103,112 ----
 
 // Return hash of page + attributes or default
! function RetrievePage($dbi, $pagename, $pagestore, $version) {
 $pagename = addslashes($pagename);
! 
! 		$version = $version ? " and version=$version" : '';
! 
! if ($res = mysql_query("select * from $pagestore where pagename='$pagename'$version", $dbi['dbc'])) {
 if ($dbhash = mysql_fetch_array($res)) {
 return MakePageHash($dbhash);
***************
*** 108,121 ****
 
 
! // Either insert or replace a key/value (a page)
! function InsertPage($dbi, $pagename, $pagehash)
! {
! global $WikiPageStore; // ugly hack
 
- if ($dbi['table'] == $WikiPageStore) { // HACK
- $linklist = ExtractWikiPageLinks($pagehash['content']);
- 	 SetWikiPageLinks($dbi, $pagename, $linklist);
- }
 
 $pagehash = MakeDBHash($pagename, $pagehash);
 
--- 117,148 ----
 
 
! 	// Return all versions of a page as an array of page hashes
! 	function RetrievePageVersions($dbi, $pagename, $curstore, $archstore) {
! 		$pagename = addslashes($pagename);
! 		if (($page[0] = RetrievePage($dbi, $pagename, $curstore, 0)) != -1) {
! 			if ($res = mysql_query("select * from $archstore where pagename='$pagename' order by version desc", $dbi['dbc'])) {
! 				while ($dbhash = mysql_fetch_array($res)) {
! 					array_push($page, MakePageHash($dbhash));
! 				}
! 				return $page;
! 			}
! 		}
! 		return -1;
! 	}
! 
! 
! 	// Get maximum version number of a page in pagestore
! 	function GetMaxVersionNumber($dbi, $pagename, $pagestore) {
! 		$pagename = addslashes($pagename);
! 		if ($res = mysql_query("select max(version) from $pagestore where pagename='$pagename'", $dbi['dbc'])) {
! 			return mysql_result($res, 0);
! 		}
! 		return -1;
! 	}
 
 
+ // Either insert or replace a key/value (a page)
+ function InsertPage($dbi, $pagename, $pagehash, $clobber)
+ {
 $pagehash = MakeDBHash($pagename, $pagehash);
 
***************
*** 128,132 ****
 "'$pagehash[refs]', $pagehash[version]";
 
! if (!mysql_query("replace into $dbi[table] ($COLUMNS) values ($VALUES)",
 			$dbi['dbc'])) {
 $msg = htmlspecialchars(sprintf(gettext ("Error writing page '%s'"), $pagename));
--- 155,162 ----
 "'$pagehash[refs]', $pagehash[version]";
 
! // Clobber existing page?
! $clobber = $clobber ? 'replace' : 'insert';
! 
! if (!mysql_query("$clobber into $dbi[table] ($COLUMNS) values ($VALUES)",
 			$dbi['dbc'])) {
 $msg = htmlspecialchars(sprintf(gettext ("Error writing page '%s'"), $pagename));
***************
*** 138,147 ****
 
 
! // for archiving pages to a seperate dbm
! function SaveCopyToArchive($dbi, $pagename, $pagehash) {
! global $ArchivePageStore;
! $adbi = OpenDataBase($ArchivePageStore);
! InsertPage($adbi, $pagename, $pagehash);
! }
 
 
--- 168,218 ----
 
 
! 	// Adds to or replaces a page in the current pagestore
! 	function ReplaceCurrentPage($pagename, $pagehash) {
! 		global $WikiPageStore;
! 		$dbi = OpenDataBase($WikiPageStore);
! 		$linklist = ExtractWikiPageLinks($pagehash['content']);
! 		SetWikiPageLinks($dbi, $pagename, $linklist);
! 		InsertPage($dbi, $pagename, $pagehash, true);
! 	}
! 
! 
! 	// Adds a page to the archive pagestore
! 	function SavePageToArchive($pagename, $pagehash) {
! 		global $ArchivePageStore;
! 		$dbi = OpenDataBase($ArchivePageStore);
! 		InsertPage($dbi, $pagename, $pagehash, false);
! 	}
! 
! 
! 	// Returns store where version of page resides
! 	function SelectStore($dbi, $pagename, $version, $curstore, $archstore) {
! 		if ($version) {
! 			if (IsVersionInWiki($dbi, $pagename, $version)) return $curstore;
! 			elseif (IsVersionInArchive($dbi, $pagename, $version)) return $archstore;
! 			else return -1; 
! 		}
! 		elseif (IsWikiPage($dbi, $pagename)) return $curstore;
! 		else return -1;	
! 	}
! 
! 
! 	function IsVersionInWiki($dbi, $pagename, $version) {
! $pagename = addslashes($pagename);
! if ($res = mysql_query("select count(*) from $dbi[table] where pagename='$pagename' and version='$version'", $dbi['dbc'])) {
! return mysql_result($res, 0);
! }
! 		return 0;
! 	}
! 
! 	function IsVersionInArchive($dbi, $pagename, $version) {
! 		global $ArchivePageStore;
! 
! $pagename = addslashes($pagename);
! if ($res = mysql_query("select count(*) from $ArchivePageStore where pagename='$pagename' and version='$version'", $dbi['dbc'])) {
! return mysql_result($res, 0);
! }
! return 0;
! 	}
 
 
286 messages has been excluded from this view by a project administrator.

Showing results of 13438

<< < 1 .. 520 521 522 523 524 .. 538 > >> (Page 522 of 538)
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 によって変換されたページ (->オリジナル) /