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
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Steve W. <wai...@us...> - 2001-01-19 22:20:25
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv14244 Modified Files: config.php Added Files: dbalib.php Log Message: Joel Uckelman <uck...@ia...> contributed code changes including a new database library file 'dbalib.php' that uses the new interface library for DBM files. The changes in config.php still default to the dbmlib.php library for now, and the user must set 'dba' in config.php if they are using PHP 4.0.4 or later. Tested this (just barely) on a newly built PHP 4.0.4p1 on my RH6.2 box. ***** Error reading new file: [Errno 2] No such file or directory: 'dbalib.php' Index: config.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/config.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** config.php 2001/01/04 18:32:43 1.19 --- config.php 2001/01/19 22:20:30 1.20 *************** *** 1,4 **** <?php ! // essential internal stuff -- skip it set_magic_quotes_runtime(0); error_reporting(E_ALL ^ E_NOTICE); --- 1,8 ---- <?php ! ! // essential internal stuff -- skip it. Go down to Part One. There ! // are four parts to this file that interest you, all labeled Part ! // One, Two, Three and Four. ! set_magic_quotes_runtime(0); error_reporting(E_ALL ^ E_NOTICE); *************** *** 12,15 **** --- 16,20 ---- ///////////////////////////////////////////////////////////////////// + // Part One: // Constants and settings. Edit the values below for your site. ///////////////////////////////////////////////////////////////////// *************** *** 29,39 **** ///////////////////////////////////////////////////////////////////// // Database section ! // set your database here and edit the according section below ! $WhichDatabase = 'dbm'; // use one of "dbm", "mysql", "pgsql", "msql", ! // or "file" ! // DBM settings (default) ! if ($WhichDatabase == 'dbm') { $DBMdir = "/tmp"; $WikiPageStore = "wiki"; --- 34,48 ---- ///////////////////////////////////////////////////////////////////// + // Part Two: // Database section ! // set your database here and edit the according section below. ! // For PHP 4.0.4 and later you must use "dba" if you are using ! // DBM files for storage. "dbm" uses the older deprecated interface. ! ! $WhichDatabase = 'dbm'; // use one of "dbm", "dba", "mysql", ! // "pgsql", "msql", or "file" ! // DBM (default) and DBA settings ! if ($WhichDatabase == 'dbm' or 'dba') { $DBMdir = "/tmp"; $WikiPageStore = "wiki"; *************** *** 46,50 **** // try this many times if the dbm is unavailable define("MAX_DBM_ATTEMPTS", 20); ! include "lib/dbmlib.php"; // MySQL settings -- see INSTALL.mysql for details on using MySQL --- 55,63 ---- // try this many times if the dbm is unavailable define("MAX_DBM_ATTEMPTS", 20); ! if ($WhichDatabase == 'dbm') { ! include "lib/dbmlib.php"; ! } else { ! include "lib/dbalib.php"; ! } // MySQL settings -- see INSTALL.mysql for details on using MySQL *************** *** 102,106 **** ///////////////////////////////////////////////////////////////////// ! // Miscellanious // logo image (path relative to index.php) --- 115,121 ---- ///////////////////////////////////////////////////////////////////// ! // Part Three: ! // Miscellaneous ! ///////////////////////////////////////////////////////////////////// // logo image (path relative to index.php) *************** *** 138,142 **** --- 153,159 ---- ///////////////////////////////////////////////////////////////////// + // Part Four: // Original pages and layout + ///////////////////////////////////////////////////////////////////// // need to define localization function first -- skip this |
From: Arno H. <aho...@us...> - 2001-01-15 12:33:06
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv13871 Modified Files: stdlib.php Log Message: ExtractWikiPageLinks now recognizes references of the form [\d+] Index: stdlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -r1.20 -r1.21 *** stdlib.php 2001/01/09 18:22:49 1.20 --- stdlib.php 2001/01/15 12:32:57 1.21 *************** *** 293,296 **** --- 293,299 ---- $linkname = htmlspecialchars($URL); $link['link'] = "<a href=\"$ScriptUrl$match[1]\">$linkname</a>"; + } elseif (preg_match("#^\d+$#", $URL)) { + $link['type'] = "reference-$linktype"; + $link['link'] = $URL; } else { $link['type'] = "wiki-unknown-$linktype"; |
From: Arno H. <aho...@us...> - 2001-01-11 09:53:52
|
Update of /cvsroot/phpwiki/phpwiki/locale In directory usw-pr-cvs1:/tmp/cvs-serv20119/locale Added Files: README Log Message: initial commit - text by Jan Nieuwenhuizen and me --- NEW FILE --- Phpwiki can be localized and use different languages. If you would like to use one of supported languages, then just go to lib/config.php and set the language to use there. This README describes how to add support for a new language. Let's assume you would like to support Islandic (code 'is'). Just copy locale/po/phpwiki.pot to locale/po/is.po. Then, translate all the strings inside is.po to Islandic. See the other *.po files as example if you are uncertain about the syntax. Hint: Emacs has a handy po translation mode for you. Most of the work, though, is in translating the pgsrc and template files. Do the following: mkdir locale/is cp -rv pgsrc locale/is cp -rv templates locale/is Note: it is more important to translate the templates than to translate the pgsrc/ files. For the pgsrc/ files it is sufficient to change their names to Islandic and maybe translate the FrontPage (or how it is called in Islandic). Again, for anything you don't know, look at the `nl' or `de' versions. After you have finished translating, you may want to check the result of your efforts. First you need to modify locale/translate.sh Add Islandic to the variable ALL_LINGUAS like this: ALL_LINGUAS="nl es de is" Then (from the main directory where index.php resides) run: ./locale/translate.sh which generates all necessary files**. If this step fails, because you don't have the necessary software installed, then just send your files to one of the phpwiki developers and we run translate.sh for you. Next edit ./lib/config.php and change the line that sets $LANG to make phpwiki use your language, e.g. make them look like this: // Select your language - default language "C": English // other languages available: Dutch "nl", Spanish "es", German "de" // $LANG="C"; $LANG="is"; Phpwiki should now speak Islandic. If you're unfamiliar with GNU gettext and po files, you may find some information at http://www.iro.umontreal.ca/contrib/po/HTML/ If you succeed, you may also want to add instructions to this translation README for phpwiki ;-) Good luck, Jan Nieuwenhuizen <ja...@gn...> Arno Hollosi <aho...@ma...> **)translate.sh is a simple script that tries to replace the usual `make po po-update'. It actually does these things: * make the .pot file up to date * merge differences into all translated .po files * generate .mo files * generate legacy php3 translation dictionary [this is the hairiest part and should be dropped when we drop php3 support] |
From: Steve W. <wai...@us...> - 2001-01-09 19:02:36
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv28892 Modified Files: dbmlib.php Log Message: Reverted to version 1.4; there is a bug in Jan Hidders' patch for dbmlib. It causes a stack overflow in stdlib.php line 318. Index: dbmlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/dbmlib.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** dbmlib.php 2000/12/15 03:11:41 1.5 --- dbmlib.php 2001/01/09 19:02:52 1.6 *************** *** 6,23 **** Database functions: ! OpenDataBase($table) ! CloseDataBase($dbi) ! RetrievePage($dbi, $pagename, $pagestore) ! InsertPage($dbi, $pagename, $pagehash) SaveCopyToArchive($dbi, $pagename, $pagehash) ! IsWikiPage($dbi, $pagename) ! InitTitleSearch($dbi, $search) ! TitleSearchNextMatch($dbi, $res) ! InitFullSearch($dbi, $search) ! FullSearchNextMatch($dbi, $res) ! IncreaseHitCount($dbi, $pagename) ! GetHitCount($dbi, $pagename) ! InitMostPopular($dbi, $limit) ! MostPopularNextMatch($dbi, $res) */ --- 6,27 ---- Database functions: ! OpenDataBase($dbname) ! CloseDataBase($dbi) ! PadSerializedData($data) ! UnPadSerializedData($data) ! RetrievePage($dbi, $pagename, $pagestore) ! InsertPage($dbi, $pagename, $pagehash) SaveCopyToArchive($dbi, $pagename, $pagehash) ! IsWikiPage($dbi, $pagename) ! IsInArchive($dbi, $pagename) ! InitTitleSearch($dbi, $search) ! TitleSearchNextMatch($dbi, &$pos) ! InitFullSearch($dbi, $search) ! FullSearchNextMatch($dbi, &$pos) ! IncreaseHitCount($dbi, $pagename) ! GetHitCount($dbi, $pagename) ! InitMostPopular($dbi, $limit) ! MostPopularNextMatch($dbi, &$res) ! GetAllWikiPagenames($dbi) */ *************** *** 88,101 **** // Either insert or replace a key/value (a page) function InsertPage($dbi, $pagename, $pagehash) { - - global $WikiPageStore; - - $linklist = ExtractWikiPageLinks($pagehash['content']); - $SetWikiPageLinks($dbi, $pagename, $linklist); - $pagedata = PadSerializedData(serialize($pagehash)); ! if (dbminsert($dbi[$WikiPageStore], $pagename, $pagedata)) { ! if (dbmreplace($dbi[$WikiPageStore], $pagename, $pagedata)) { ExitWiki("Error inserting page '$pagename'"); } --- 92,99 ---- // Either insert or replace a key/value (a page) function InsertPage($dbi, $pagename, $pagehash) { $pagedata = PadSerializedData(serialize($pagehash)); ! if (dbminsert($dbi['wiki'], $pagename, $pagedata)) { ! if (dbmreplace($dbi['wiki'], $pagename, $pagedata)) { ExitWiki("Error inserting page '$pagename'"); } *************** *** 128,163 **** - function RemovePage($dbi, $pagename) { - - dbmdelete($dbi['wiki'], $pagename); // report error if this fails? - dbmdelete($dbi['archive'], $pagename); // no error if this fails - dbmdelete($dbi['hitcount'], $pagename); // no error if this fails - - $linkinfo = RetrievePage($dbi, $pagename, 'wikilinks'); - - // remove page from fromlinks of pages it had links to - if (is_array($linkinfo)) { // page exists? - $tolinks = $linkinfo['tolinks']; - reset($tolinks); - while (list($tolink, $dummy) = each($tolinks)) { - $tolinkinfo = RetrievePage($dbi, $tolink, 'wikilinks'); - if (is_array($tolinkinfo)) { // page found? - $oldFromlinks = $tolinkinfo['fromlinks']; - $tolinkinfo['fromlinks'] = array(); // erase fromlinks - reset($oldFromlinks); - while (list($fromlink, $dummy) = each($oldFromlinks)) { - if ($fromlink != $pagename) // not to be erased? - $tolinkinfo['fromlinks'][$fromlink] = 1; // put link back - } // put link info back in DBM file - InsertPage($dbi, $tolink, $tolinkinfo, 'wikilinks'); - } - } - - // remove page itself - dbmdelete($dbi['wikilinks'], $pagename); - } - } - - // setup for title-search function InitTitleSearch($dbi, $search) { --- 126,129 ---- *************** *** 168,172 **** } - // iterating through database function TitleSearchNextMatch($dbi, &$pos) { --- 134,137 ---- *************** *** 182,186 **** } - // setup for full-text search function InitFullSearch($dbi, $search) { --- 147,150 ---- *************** *** 188,192 **** } - //iterating through database function FullSearchNextMatch($dbi, &$pos) { --- 152,155 ---- *************** *** 207,214 **** } - //////////////////////// // new database features function IncreaseHitCount($dbi, $pagename) { --- 170,177 ---- } //////////////////////// // new database features + function IncreaseHitCount($dbi, $pagename) { *************** *** 221,224 **** --- 184,188 ---- } else { // add it, set the hit count to one + // echo "adding $pagename to hitcount...<br>\n"; $count = 1; dbminsert($dbi['hitcount'], $pagename, $count); *************** *** 226,230 **** } - function GetHitCount($dbi, $pagename) { --- 190,193 ---- *************** *** 244,290 **** // n..$limit results - // Because sorting all the pages may be a lot of work - // we only get the top $limit. A page is only added if it's score is - // higher than the lowest score in the list. If the list is full then - // one of the pages with the lowest scores is removed. - $pagename = dbmfirstkey($dbi['hitcount']); ! $score = dbmfetch($dbi['hitcount'], $pagename); ! $res = array($pagename => (int) $score); ! $lowest = $score; while ($pagename = dbmnextkey($dbi['hitcount'], $pagename)) { ! $score = dbmfetch($dbi['hitcount'], $pagename); ! if (count($res) < $limit) { // room left in $res? ! if ($score < $lowest) ! $lowest = $score; ! $res[$pagename] = (int) $score; // add page to $res ! } elseif ($score > $lowest) { ! $oldres = $res; // save old result ! $res = array(); ! $removed = 0; // nothing removed yet ! $newlowest = $score; // new lowest score ! $res[$pagename] = (int) $score; // add page to $res ! reset($oldres); ! while(list($pname, $pscore) = each($oldres)) { ! if (!$removed and ($pscore = $lowest)) ! $removed = 1; // don't copy this entry ! else { ! $res[$pname] = (int) $pscore; ! if ($pscore < $newlowest) ! $newlowest = $pscore; ! } ! } ! $lowest = $newlowest; ! } } ! ! arsort($res); // sort ! reset($res); ! return($res); } - function MostPopularNextMatch($dbi, &$res) { --- 207,222 ---- // n..$limit results $pagename = dbmfirstkey($dbi['hitcount']); ! $res[$pagename] = dbmfetch($dbi['hitcount'], $pagename); while ($pagename = dbmnextkey($dbi['hitcount'], $pagename)) { ! $res[$pagename] = dbmfetch($dbi['hitcount'], $pagename); ! //echo "got $pagename with value " . $res[$pagename] . "<br>\n"; } ! ! arsort($res); return($res); } function MostPopularNextMatch($dbi, &$res) { *************** *** 292,300 **** --- 224,238 ---- // and 'pagename' as the keys + if (count($res) == 0) + return 0; + if (list($pagename, $hits) = each($res)) { + //echo "most popular next match called<br>\n"; + //echo "got $pagename, $hits back<br>\n"; $nextpage = array( "hits" => $hits, "pagename" => $pagename ); + // $dbm_mostpopular_cntr++; return $nextpage; } else { *************** *** 303,307 **** } - function GetAllWikiPagenames($dbi) { $namelist = array(); --- 241,244 ---- *************** *** 316,482 **** return $namelist; - } - - - //////////////////////////////////////////// - // functionality for the wikilinks DBM file - - // format of the 'wikilinks' DBM file : - // pagename => - // { tolinks => ( pagename => 1}, fromlinks => { pagename => 1 } } - - // takes a page name, returns array of scored incoming and outgoing links - function GetWikiPageLinks($dbi, $pagename) { - - $linkinfo = RetrievePage($dbi, $pagename, 'wikilinks'); - if (is_array($linkinfo)) { // page exists? - $tolinks = $linkinfo['tolinks']; // outgoing links - $fromlinks = $linkinfo['fromlinks']; // incoming links - } else { // new page, but pages may already point to it - // create info for page - $tolinks = array(); - $fromlinks = array(); - // look up pages that link to $pagename - $pname = dbmfirstkey($dbi['wikilinks']); - while ($pname) { - $linkinfo = RetrievePage($dbi, $pname, 'wikilinks'); - if ($linkinfo['tolinks'][$pagename]) // $pname links to $pagename? - $fromlinks[$pname] = 1; - $pname = dbmnextkey($dbi['wikilinks'], $pname); - } - } - - // get and sort the outgoing links - $outlinks = array(); - reset($tolinks); // look up scores for tolinks - while(list($tolink, $dummy) = each($tolinks)) { - $toPage = RetrievePage($dbi, $tolink, 'wikilinks'); - if (is_array($toPage)) // link to internal page? - $outlinks[$tolink] = count($toPage['fromlinks']); - } - arsort($outlinks); // sort on score - $links['out'] = array(); - reset($outlinks); // convert to right format - while(list($link, $score) = each($outlinks)) - $links['out'][] = array($link, $score); - - // get and sort the incoming links - $inlinks = array(); - reset($fromlinks); // look up scores for fromlinks - while(list($fromlink, $dummy) = each($fromlinks)) { - $fromPage = RetrievePage($dbi, $fromlink, 'wikilinks'); - $inlinks[$fromlink] = count($fromPage['fromlinks']); - } - arsort($inlinks); // sort on score - $links['in'] = array(); - reset($inlinks); // convert to right format - while(list($link, $score) = each($inlinks)) - $links['in'][] = array($link, $score); - - // sort all the incoming and outgoing links - $allLinks = $outlinks; // copy the outlinks - reset($inlinks); // add the inlinks - while(list($key, $value) = each($inlinks)) - $allLinks[$key] = $value; - reset($allLinks); // lookup hits - while(list($key, $value) = each($allLinks)) - $allLinks[$key] = (int) dbmfetch($dbi['hitcount'], $key); - arsort($allLinks); // sort on hits - $links['popular'] = array(); - reset($allLinks); // convert to right format - while(list($link, $hits) = each($allLinks)) - $links['popular'][] = array($link, $hits); - - return $links; - } - - - // takes page name, list of links it contains - // the $linklist is an array where the keys are the page names - function SetWikiPageLinks($dbi, $pagename, $linklist) { - - $cache = array(); - - // Phase 1: fetch the relevant pairs from 'wikilinks' into $cache - // --------------------------------------------------------------- - - // first the info for $pagename - $linkinfo = RetrievePage($dbi, $pagename, 'wikilinks'); - if (is_array($linkinfo)) // page exists? - $cache[$pagename] = $linkinfo; - else { - // create info for page - $cache[$pagename] = array( 'fromlinks' => array(), - 'tolinks' => array() - ); - // look up pages that link to $pagename - $pname = dbmfirstkey($dbi['wikilinks']); - while ($pname) { - $linkinfo = RetrievePage($dbi, $pname, 'wikilinks'); - if ($linkinfo['tolinks'][$pagename]) - $cache[$pagename]['fromlinks'][$pname] = 1; - $pname = dbmnextkey($dbi['wikilinks'], $pname); - } - } - - // then the info for the pages that $pagename used to point to - $oldTolinks = $cache[$pagename]['tolinks']; - reset($oldTolinks); - while (list($link, $dummy) = each($oldTolinks)) { - $linkinfo = RetrievePage($dbi, $link, 'wikilinks'); - if (is_array($linkinfo)) - $cache[$link] = $linkinfo; - } - - // finally the info for the pages that $pagename will point to - reset($linklist); - while (list($link, $dummy) = each($linklist)) { - $linkinfo = RetrievePage($dbi, $link, 'wikilinks'); - if (is_array($linkinfo)) - $cache[$link] = $linkinfo; - } - - // Phase 2: delete the old links - // --------------------------------------------------------------- - - // delete the old tolinks for $pagename - // $cache[$pagename]['tolinks'] = array(); - // (overwritten anyway in Phase 3) - - // remove $pagename from the fromlinks of pages in $oldTolinks - - reset($oldTolinks); - while (list($oldTolink, $dummy) = each($oldTolinks)) { - if ($cache[$oldTolink]) { // links to existing page? - $oldFromlinks = $cache[$oldTolink]['fromlinks']; - $cache[$oldTolink]['fromlinks'] = array(); // erase fromlinks - reset($oldFromlinks); // comp. new fr.links - while (list($fromlink, $dummy) = each($oldFromlinks)) { - if ($fromlink != $pagename) - $cache[$oldTolink]['fromlinks'][$fromlink] = 1; - } - } - } - - // Phase 3: add the new links - // --------------------------------------------------------------- - - // set the new tolinks for $pagename - $cache[$pagename]['tolinks'] = $linklist; - - // add $pagename to the fromlinks of pages in $linklist - reset($linklist); - while (list($link, $dummy) = each($linklist)) { - if ($cache[$link]) // existing page? - $cache[$link]['fromlinks'][$pagename] = 1; - } - - // Phase 4: write $cache back to 'wikilinks' - // --------------------------------------------------------------- - - reset($cache); - while (list($link,$fromAndTolinks) = each($cache)) - InsertPage($dbi, $link, $fromAndTolinks, 'wikilinks'); - } --- 253,256 ---- |
From: Arno H. <aho...@us...> - 2001-01-09 18:22:33
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv23760/lib Modified Files: stdlib.php Log Message: added description to GeneratePage() Index: stdlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** stdlib.php 2001/01/04 18:32:25 1.19 --- stdlib.php 2001/01/09 18:22:49 1.20 *************** *** 379,382 **** --- 379,391 ---- + # GeneratePage() -- takes $content and puts it in the template $template + # this function contains all the template logic + # + # $template ... name of the template (see config.php for list of names) + # $content ... html content to put into the page + # $name ... page title + # $hash ... if called while creating a wiki page, $hash points to + # the $pagehash array of that wiki page. + function GeneratePage($template, $content, $name, $hash) { |
From: Steve W. <wai...@us...> - 2001-01-06 19:30:23
|
Update of /cvsroot/phpwiki/phpwiki In directory usw-pr-cvs1:/tmp/cvs-serv27674 Added Files: INSTALL.flatfile Log Message: Installation directions for flat file Wikis. ***** Error reading new file: [Errno 2] No such file or directory: 'INSTALL.flatfile' |
From: Arno H. <aho...@us...> - 2001-01-04 18:37:55
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv8878 Modified Files: mysql.php Log Message: yet another E_NOTICED fixed and some comments added. Index: mysql.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/mysql.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** mysql.php 2001/01/01 23:34:57 1.9 --- mysql.php 2001/01/04 18:37:56 1.10 *************** *** 58,61 **** --- 58,62 ---- + // prepare $pagehash for storing in mysql function MakeDBHash($pagename, $pagehash) { *************** *** 73,76 **** --- 74,79 ---- } + + // convert mysql result $dbhash to $pagehash function MakePageHash($dbhash) { *************** *** 207,210 **** --- 210,214 ---- $search = addslashes(preg_replace("/\s+/", " ", $search)); $term = strtok($search, ' '); + $clause = ''; while($term) { $word = "$term"; |
From: Arno H. <aho...@us...> - 2001-01-04 18:34:14
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv8448 Modified Files: transform.php Log Message: ZERO/SINGLE_DEPTH renamed into ZERO/NESTED_LEVEL empty lines are now treated as tag '' (i.e. no tag) instead of '<p>' normal text is now treated as '<p>' instead of tag '' added and corrected some comments, some code cleanup Index: transform.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/transform.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** transform.php 2000/11/08 15:40:00 1.7 --- transform.php 2001/01/04 18:34:15 1.8 *************** *** 1,13 **** ! <!-- $Id$ --> ! <?php // expects $pagehash and $html to be set - function tokenize($str, $pattern, &$orig, &$ntokens) { global $FieldSeparator; // Find any strings in $str that match $pattern and ! // store them in $tokens[], replacing them with a token ! // replaced strings are stored in $orig ! $new = ""; while (preg_match("/^(.*?)($pattern)/", $str, $matches)) { $linktoken = $FieldSeparator . $FieldSeparator . ($ntokens++) . $FieldSeparator; --- 1,11 ---- ! <?php rcs_id('$Id$'); // expects $pagehash and $html to be set function tokenize($str, $pattern, &$orig, &$ntokens) { global $FieldSeparator; // Find any strings in $str that match $pattern and ! // store them in $orig, replacing them with tokens ! // starting at number $ntokens - returns tokenized string ! $new = ''; while (preg_match("/^(.*?)($pattern)/", $str, $matches)) { $linktoken = $FieldSeparator . $FieldSeparator . ($ntokens++) . $FieldSeparator; *************** *** 29,38 **** } else { // ordinary link ! $embedded[$i] = "<a href=\"" . $pagehash['refs'][$i] . "\">[$i]</a>"; } } } - $numlines = count($pagehash["content"]); // only call these once, for efficiency --- 27,35 ---- } else { // ordinary link ! $embedded[$i] = LinkURL($pagehash['refs'][$i], "[$i]"); } } } // only call these once, for efficiency *************** *** 43,46 **** --- 40,45 ---- // Loop over all lines of the page and apply transformation rules + $numlines = count($pagehash["content"]); + for ($index = 0; $index < $numlines; $index++) { unset($tokens); *************** *** 49,57 **** $replacements = array(); ! $tmpline = $pagehash["content"][$index]; if (!strlen($tmpline) || $tmpline == "\r") { // this is a blank line, send <p> ! $html .= SetHTMLOutputMode("p", ZERO_DEPTH, 0); continue; } --- 48,56 ---- $replacements = array(); ! $tmpline = $pagehash['content'][$index]; if (!strlen($tmpline) || $tmpline == "\r") { // this is a blank line, send <p> ! $html .= SetHTMLOutputMode('', ZERO_LEVEL, 0); continue; } *************** *** 63,67 **** elseif (preg_match("/(^\|)(.*)/", $tmpline, $matches)) { // HTML mode ! $html .= SetHTMLOutputMode("", ZERO_DEPTH, 0); $html .= $matches[2]; continue; --- 62,66 ---- elseif (preg_match("/(^\|)(.*)/", $tmpline, $matches)) { // HTML mode ! $html .= SetHTMLOutputMode("", ZERO_LEVEL, 0); $html .= $matches[2]; continue; *************** *** 76,88 **** // First need to protect [[. $oldn = $ntokens; ! $tmpline = tokenize($tmpline, "\[\[", $replacements, $ntokens); while ($oldn < $ntokens) ! $replacements[$oldn++] = "["; // Now process the [\d+] links which are numeric references $oldn = $ntokens; ! $tmpline = tokenize($tmpline, "\[\s*\d+\s*\]", $replacements ,$ntokens); while ($oldn < $ntokens) { ! $num = (int)substr($replacements[$oldn], 1); if (! empty($embedded[$num])) $replacements[$oldn] = $embedded[$num]; --- 75,87 ---- // First need to protect [[. $oldn = $ntokens; ! $tmpline = tokenize($tmpline, '\[\[', $replacements, $ntokens); while ($oldn < $ntokens) ! $replacements[$oldn++] = '['; // Now process the [\d+] links which are numeric references $oldn = $ntokens; ! $tmpline = tokenize($tmpline, '\[\s*\d+\s*\]', $replacements, $ntokens); while ($oldn < $ntokens) { ! $num = (int) substr($replacements[$oldn], 1); if (! empty($embedded[$num])) $replacements[$oldn] = $embedded[$num]; *************** *** 92,96 **** // match anything else between brackets $oldn = $ntokens; ! $tmpline = tokenize($tmpline, "\[.+?\]", $replacements, $ntokens); while ($oldn < $ntokens) { $link = ParseAndLink($replacements[$oldn]); --- 91,95 ---- // match anything else between brackets $oldn = $ntokens; ! $tmpline = tokenize($tmpline, '\[.+?\]', $replacements, $ntokens); while ($oldn < $ntokens) { $link = ParseAndLink($replacements[$oldn]); *************** *** 102,105 **** --- 101,105 ---- // replace all URL's with tokens, so we don't confuse them // with Wiki words later. Wiki words in URL's break things. + // URLs preceeded by a '!' are not linked $tmpline = tokenize($tmpline, "!?\b($AllowedProtocols):[^\s<>\[\]\"'()]*[^\s<>\[\]\"'(),.?]", $replacements, $ntokens); *************** *** 130,149 **** } // escape HTML metachars ! $tmpline = str_replace("&", "&", $tmpline); ! $tmpline = str_replace(">", ">", $tmpline); ! $tmpline = str_replace("<", "<", $tmpline); // four or more dashes to <hr> ! $tmpline = ereg_replace("^-{4,}", "<hr>", $tmpline); // %%% are linebreaks ! $tmpline = str_replace("%%%", "<br>", $tmpline); ! // bold italics $tmpline = preg_replace("|(''''')(.*?)(''''')|", "<strong><em>\\2</em></strong>", $tmpline); ! // bold $tmpline = preg_replace("|(''')(.*?)(''')|", "<strong>\\2</strong>", $tmpline); --- 130,151 ---- } + + ////////////////////////////////////////////////////////// // escape HTML metachars ! $tmpline = str_replace('&', '&', $tmpline); ! $tmpline = str_replace('>', '>', $tmpline); ! $tmpline = str_replace('<', '<', $tmpline); // four or more dashes to <hr> ! $tmpline = ereg_replace("^-{4,}", '<hr>', $tmpline); // %%% are linebreaks ! $tmpline = str_replace('%%%', '<br>', $tmpline); ! // bold italics (old way) $tmpline = preg_replace("|(''''')(.*?)(''''')|", "<strong><em>\\2</em></strong>", $tmpline); ! // bold (old way) $tmpline = preg_replace("|(''')(.*?)(''')|", "<strong>\\2</strong>", $tmpline); *************** *** 157,185 **** "<em>\\2</em>", $tmpline); - // HTML modes: pre, unordered/ordered lists, term/def (using TAB) if (preg_match("/(^\t+)(.*?)(:\t)(.*$)/", $tmpline, $matches)) { ! // this is a dictionary list item $numtabs = strlen($matches[1]); ! $html .= SetHTMLOutputMode("dl", SINGLE_DEPTH, $numtabs); $tmpline = ''; if(trim($matches[2])) ! $tmpline = "<dt>" . $matches[2]; ! $tmpline .= "<dd>" . $matches[4]; } elseif (preg_match("/(^\t+)(\*|\d+|#)/", $tmpline, $matches)) { ! // this is part of a list $numtabs = strlen($matches[1]); ! if ($matches[2] == "*") { ! $listtag = "ul"; } else { ! $listtag = "ol"; // a rather tacit assumption. oh well. } $tmpline = preg_replace("/^(\t+)(\*|\d+|#)/", "", $tmpline); ! $html .= SetHTMLOutputMode($listtag, SINGLE_DEPTH, $numtabs); ! $html .= "<li>"; ! // tabless markup for unordered and ordered lists ! // list types can be mixed, so we only look at the last // character. Changes e.g. from "**#*" to "###*" go unnoticed. // and wouldn't make a difference to the HTML layout anyway. --- 159,191 ---- "<em>\\2</em>", $tmpline); + + ////////////////////////////////////////////////////////// + // unordered, ordered, and dictionary list (using TAB) if (preg_match("/(^\t+)(.*?)(:\t)(.*$)/", $tmpline, $matches)) { ! // this is a dictionary list (<dl>) item $numtabs = strlen($matches[1]); ! $html .= SetHTMLOutputMode('dl', NESTED_LEVEL, $numtabs); $tmpline = ''; if(trim($matches[2])) ! $tmpline = '<dt>' . $matches[2]; ! $tmpline .= '<dd>' . $matches[4]; } elseif (preg_match("/(^\t+)(\*|\d+|#)/", $tmpline, $matches)) { ! // this is part of a list (<ul>, <ol>) $numtabs = strlen($matches[1]); ! if ($matches[2] == '*') { ! $listtag = 'ul'; } else { ! $listtag = 'ol'; // a rather tacit assumption. oh well. } $tmpline = preg_replace("/^(\t+)(\*|\d+|#)/", "", $tmpline); ! $html .= SetHTMLOutputMode($listtag, NESTED_LEVEL, $numtabs); ! $html .= '<li>'; ! ! ////////////////////////////////////////////////////////// ! // tabless markup for unordered, ordered, and dictionary lists ! // ul/ol list types can be mixed, so we only look at the last // character. Changes e.g. from "**#*" to "###*" go unnoticed. // and wouldn't make a difference to the HTML layout anyway. *************** *** 189,197 **** // this is part of an unordered list $numtabs = strlen($matches[1]); ! $listtag = "ul"; ! ! $tmpline = preg_replace("/^([#*]*\*)/", "", $tmpline); ! $html .= SetHTMLOutputMode($listtag, SINGLE_DEPTH, $numtabs); ! $html .= "<li>"; // ordered lists <OL>: "#" --- 195,201 ---- // this is part of an unordered list $numtabs = strlen($matches[1]); ! $tmpline = preg_replace("/^([#*]*\*)/", '', $tmpline); ! $html .= SetHTMLOutputMode('ul', NESTED_LEVEL, $numtabs); ! $html .= '<li>'; // ordered lists <OL>: "#" *************** *** 199,207 **** // this is part of an ordered list $numtabs = strlen($matches[1]); - $listtag = "ol"; - $tmpline = preg_replace("/^([#*]*\#)/", "", $tmpline); ! $html .= SetHTMLOutputMode($listtag, SINGLE_DEPTH, $numtabs); ! $html .= "<li>"; // definition lists <DL>: ";text:text" --- 203,209 ---- // this is part of an ordered list $numtabs = strlen($matches[1]); $tmpline = preg_replace("/^([#*]*\#)/", "", $tmpline); ! $html .= SetHTMLOutputMode('ol', NESTED_LEVEL, $numtabs); ! $html .= '<li>'; // definition lists <DL>: ";text:text" *************** *** 209,242 **** // this is a dictionary list item $numtabs = strlen($matches[1]); ! $html .= SetHTMLOutputMode("dl", SINGLE_DEPTH, $numtabs); $tmpline = ''; if(trim($matches[2])) ! $tmpline = "<dt>" . $matches[2]; ! $tmpline .= "<dd>" . $matches[3]; } elseif (preg_match("/^\s+/", $tmpline)) { // this is preformatted text, i.e. <pre> ! $html .= SetHTMLOutputMode("pre", ZERO_DEPTH, 0); } elseif (preg_match("/^(!{1,3})[^!]/", $tmpline, $whichheading)) { // lines starting with !,!!,!!! are headings ! if($whichheading[1] == '!') $heading = "h3"; ! elseif($whichheading[1] == '!!') $heading = "h2"; ! elseif($whichheading[1] == '!!!') $heading = "h1"; ! $tmpline = preg_replace("/^!+/", "", $tmpline); ! $html .= SetHTMLOutputMode($heading, ZERO_DEPTH, 0); } else { // it's ordinary output if nothing else ! $html .= SetHTMLOutputMode("", ZERO_DEPTH, 0); } ! $tmpline = str_replace("%%Search%%", $quick_search_box, $tmpline); ! $tmpline = str_replace("%%Fullsearch%%", $full_search_box, $tmpline); ! $tmpline = str_replace("%%Mostpopular%%", $most_popular_list, $tmpline); ! if(defined('WIKI_ADMIN') && strstr($tmpline, "%%ADMIN-")) $tmpline = ParseAdminTokens($tmpline); /////////////////////////////////////////////////////// // Replace tokens --- 211,248 ---- // this is a dictionary list item $numtabs = strlen($matches[1]); ! $html .= SetHTMLOutputMode('dl', NESTED_LEVEL, $numtabs); $tmpline = ''; if(trim($matches[2])) ! $tmpline = '<dt>' . $matches[2]; ! $tmpline .= '<dd>' . $matches[3]; ! + ////////////////////////////////////////////////////////// + // remaining modes: preformatted text, headings, normal text } elseif (preg_match("/^\s+/", $tmpline)) { // this is preformatted text, i.e. <pre> ! $html .= SetHTMLOutputMode('pre', ZERO_LEVEL, 0); } elseif (preg_match("/^(!{1,3})[^!]/", $tmpline, $whichheading)) { // lines starting with !,!!,!!! are headings ! if($whichheading[1] == '!') $heading = 'h3'; ! elseif($whichheading[1] == '!!') $heading = 'h2'; ! elseif($whichheading[1] == '!!!') $heading = 'h1'; ! $tmpline = preg_replace("/^!+/", '', $tmpline); ! $html .= SetHTMLOutputMode($heading, ZERO_LEVEL, 0); } else { // it's ordinary output if nothing else ! $html .= SetHTMLOutputMode('p', ZERO_LEVEL, 0); } ! $tmpline = str_replace('%%Search%%', $quick_search_box, $tmpline); ! $tmpline = str_replace('%%Fullsearch%%', $full_search_box, $tmpline); ! $tmpline = str_replace('%%Mostpopular%%', $most_popular_list, $tmpline); ! if(defined('WIKI_ADMIN') && strstr($tmpline, '%%ADMIN-')) $tmpline = ParseAdminTokens($tmpline); + /////////////////////////////////////////////////////// // Replace tokens *************** *** 246,252 **** ! $html .= "$tmpline\n"; } ! $html .= SetHTMLOutputMode("", ZERO_DEPTH, 0); ?> --- 252,258 ---- ! $html .= $tmpline . "\n"; } ! $html .= SetHTMLOutputMode('', ZERO_LEVEL, 0); ?> |
From: Arno H. <aho...@us...> - 2001-01-04 18:32:42
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv8399 Modified Files: config.php Log Message: ZERO/SINGLE_DEPTH renamed into ZERO/NESTED_LEVEL Index: config.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/config.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** config.php 2000/12/30 21:09:13 1.18 --- config.php 2001/01/04 18:32:43 1.19 *************** *** 217,224 **** } ! // constants used for HTML output. List tags like UL and ! // OL have a depth of one, PRE has a depth of 0. ! define("ZERO_DEPTH", 0); ! define("SINGLE_DEPTH", 1); // constants for flags in $pagehash --- 217,224 ---- } ! // constants used for HTML output. HTML tags may allow nesting ! // other tags always start at level 0 ! define("ZERO_LEVEL", 0); ! define("NESTED_LEVEL", 1); // constants for flags in $pagehash |
From: Arno H. <aho...@us...> - 2001-01-04 18:32:23
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv8258 Modified Files: stdlib.php Log Message: moved UpdateRecentChanges() to savepage.php ZERO/SINGLE_DEPTH renamed into ZERO/NESTED_LEVEL added and corrected some comments, some code cleanup Index: stdlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** stdlib.php 2001/01/01 23:34:57 1.18 --- stdlib.php 2001/01/04 18:32:25 1.19 *************** *** 1,22 **** ! <?php ! rcs_id('$Id$'); /* Standard functions for Wiki functionality ! LinkRelatedPages($dbi, $pagename) ! GeneratePage($template, $content, $name, $hash) LinkExistingWikiWord($wikiword) LinkUnknownWikiWord($wikiword) ! LinkURL($url) ! LinkImage($url) ! RenderQuickSearch() ! RenderFullSearch() RenderMostPopular() CookSpaces($pagearray) ! class Stack SetHTMLOutputMode($newmode, $depth) UpdateRecentChanges($dbi, $pagename, $isnewpage) ParseAndLink($bracketlink) ExtractWikiPageLinks($content) ! ExitWiki($errormsg) */ --- 1,22 ---- ! <?php rcs_id('$Id$'); ! /* Standard functions for Wiki functionality ! ExitWiki($errormsg) LinkExistingWikiWord($wikiword) LinkUnknownWikiWord($wikiword) ! LinkURL($url, $linktext) ! LinkImage($url, $alt) ! RenderQuickSearch($value) ! RenderFullSearch($value) RenderMostPopular() CookSpaces($pagearray) ! class Stack (push(), pop(), cnt(), top()) SetHTMLOutputMode($newmode, $depth) UpdateRecentChanges($dbi, $pagename, $isnewpage) ParseAndLink($bracketlink) ExtractWikiPageLinks($content) ! LinkRelatedPages($dbi, $pagename) ! GeneratePage($template, $content, $name, $hash) */ *************** *** 42,171 **** - function LinkRelatedPages($dbi, $pagename) - { - // currently not supported everywhere - if(!function_exists('GetWikiPageLinks')) - return ''; - - $links = GetWikiPageLinks($dbi, $pagename); - - $txt = "<b>"; - $txt .= sprintf (gettext ("%d best incoming links:"), NUM_RELATED_PAGES); - $txt .= "</b>\n"; - for($i = 0; $i < NUM_RELATED_PAGES; $i++) { - if(isset($links['in'][$i])) { - list($name, $score) = $links['in'][$i]; - $txt .= LinkExistingWikiWord($name) . " ($score), "; - } - } - - $txt .= "\n<br><b>"; - $txt .= sprintf (gettext ("%d best outgoing links:"), NUM_RELATED_PAGES); - $txt .= "</b>\n"; - for($i = 0; $i < NUM_RELATED_PAGES; $i++) { - if(isset($links['out'][$i])) { - list($name, $score) = $links['out'][$i]; - if(IsWikiPage($dbi, $name)) - $txt .= LinkExistingWikiWord($name) . " ($score), "; - } - } - - $txt .= "\n<br><b>"; - $txt .= sprintf (gettext ("%d most popular nearby:"), NUM_RELATED_PAGES); - $txt .= "</b>\n"; - for($i = 0; $i < NUM_RELATED_PAGES; $i++) { - if(isset($links['popular'][$i])) { - list($name, $score) = $links['popular'][$i]; - $txt .= LinkExistingWikiWord($name) . " ($score), "; - } - } - - return $txt; - } - - - function GeneratePage($template, $content, $name, $hash) - { - global $ScriptUrl, $AllowedProtocols, $templates; - global $datetimeformat, $dbi, $logo, $FieldSeparator; - - if (!is_array($hash)) - unset($hash); - - function _dotoken ($id, $val, &$page) { - global $FieldSeparator; - $page = str_replace("$FieldSeparator#$id$FieldSeparator#", - $val, $page); - } - - function _iftoken ($id, $condition, &$page) { - global $FieldSeparator; - - // line based IF directive - $lineyes = "$FieldSeparator#IF $id$FieldSeparator#"; - $lineno = "$FieldSeparator#IF !$id$FieldSeparator#"; - // block based IF directive - $blockyes = "$FieldSeparator#IF:$id$FieldSeparator#"; - $blockyesend = "$FieldSeparator#ENDIF:$id$FieldSeparator#"; - $blockno = "$FieldSeparator#IF:!$id$FieldSeparator#"; - $blocknoend = "$FieldSeparator#ENDIF:!$id$FieldSeparator#"; - - if ($condition) { - $page = str_replace($lineyes, '', $page); - $page = str_replace($blockyes, '', $page); - $page = str_replace($blockyesend, '', $page); - $page = preg_replace("/$blockno(.*?)$blocknoend/s", '', $page); - $page = ereg_replace("${lineno}[^\n]*\n", '', $page); - } else { - $page = str_replace($lineno, '', $page); - $page = str_replace($blockno, '', $page); - $page = str_replace($blocknoend, '', $page); - $page = preg_replace("/$blockyes(.*?)$blockyesend/s", '', $page); - $page = ereg_replace("${lineyes}[^\n]*\n", '', $page); - } - } - - $page = join('', file($templates[$template])); - $page = str_replace('###', "$FieldSeparator#", $page); - - // valid for all pagetypes - _iftoken('COPY', isset($hash['copy']), $page); - _iftoken('LOCK', (isset($hash['flags']) && - ($hash['flags'] & FLAG_PAGE_LOCKED)), $page); - _iftoken('ADMIN', defined('WIKI_ADMIN'), $page); - - _dotoken('SCRIPTURL', $ScriptUrl, $page); - _dotoken('PAGE', htmlspecialchars($name), $page); - _dotoken('ALLOWEDPROTOCOLS', $AllowedProtocols, $page); - _dotoken('LOGO', $logo, $page); - - // invalid for messages (search results, error messages) - if ($template != 'MESSAGE') { - _dotoken('PAGEURL', rawurlencode($name), $page); - _dotoken('LASTMODIFIED', - date($datetimeformat, $hash['lastmodified']), $page); - _dotoken('LASTAUTHOR', $hash['author'], $page); - _dotoken('VERSION', $hash['version'], $page); - if (strstr($page, "$FieldSeparator#HITS$FieldSeparator#")) { - _dotoken('HITS', GetHitCount($dbi, $name), $page); - } - if (strstr($page, "$FieldSeparator#RELATEDPAGES$FieldSeparator#")) { - _dotoken('RELATEDPAGES', LinkRelatedPages($dbi, $name), $page); - } - } - - // valid only for EditLinks - if ($template == 'EDITLINKS') { - for ($i = 1; $i <= NUM_LINKS; $i++) { - $ref = isset($hash['refs'][$i]) ? $hash['refs'][$i] : ''; - _dotoken("R$i", $ref, $page); - } - } - - _dotoken('CONTENT', $content, $page); - print $page; - } - - function LinkExistingWikiWord($wikiword, $linktext='') { global $ScriptUrl; --- 42,45 ---- *************** *** 189,193 **** return "<b><u>BAD URL -- remove all of <, >, "</u></b>"; } - if(empty($linktext)) $linktext = htmlspecialchars($url); --- 63,66 ---- *************** *** 195,202 **** } ! ! function LinkImage($url, $alt="[External Image]") { global $ScriptUrl; ! if(ereg("[<>\"]", $url)) { return "<b><u>BAD URL -- remove all of <, >, "</u></b>"; } --- 68,74 ---- } ! function LinkImage($url, $alt='[External Image]') { global $ScriptUrl; ! if(ereg('[<>"]', $url)) { return "<b><u>BAD URL -- remove all of <, >, "</u></b>"; } *************** *** 205,209 **** ! function RenderQuickSearch($value = "") { global $ScriptUrl; return "<form action=\"$ScriptUrl\">\n" . --- 77,81 ---- ! function RenderQuickSearch($value = '') { global $ScriptUrl; return "<form action=\"$ScriptUrl\">\n" . *************** *** 213,217 **** } ! function RenderFullSearch($value = "") { global $ScriptUrl; return "<form action=\"$ScriptUrl\">\n" . --- 85,89 ---- } ! function RenderFullSearch($value = '') { global $ScriptUrl; return "<form action=\"$ScriptUrl\">\n" . *************** *** 234,242 **** } function ParseAdminTokens($line) { global $ScriptUrl; while (preg_match("/%%ADMIN-INPUT-(.*?)-(\w+)%%/", $line, $matches)) { ! $head = str_replace("_", " ", $matches[2]); $form = "<FORM ACTION=\"$ScriptUrl\" METHOD=POST>" ."$head: <INPUT NAME=$matches[1] SIZE=20> " --- 106,115 ---- } + function ParseAdminTokens($line) { global $ScriptUrl; while (preg_match("/%%ADMIN-INPUT-(.*?)-(\w+)%%/", $line, $matches)) { ! $head = str_replace('_', ' ', $matches[2]); $form = "<FORM ACTION=\"$ScriptUrl\" METHOD=POST>" ."$head: <INPUT NAME=$matches[1] SIZE=20> " *************** *** 287,292 **** ! // I couldn't move this to lib/config.php because it ! // wasn't declared yet. $stack = new Stack; --- 160,164 ---- ! // I couldn't move this to lib/config.php because it wasn't declared yet. $stack = new Stack; *************** *** 296,310 **** plain text etc. When we change modes we have to issue close tags for one mode and start tags for another. */ ! function SetHTMLOutputMode($tag, $tagdepth, $tabcount) { global $stack; ! $retvar = ""; ! if ($tagdepth == SINGLE_DEPTH) { ! if ($tabcount < $stack->cnt()) { ! // there are fewer tabs than stack, // reduce stack to that tab count ! while ($stack->cnt() > $tabcount) { $closetag = $stack->pop(); if ($closetag == false) { --- 168,205 ---- plain text etc. When we change modes we have to issue close tags for one mode and start tags for another. + + $tag ... HTML tag to insert + $tagtype ... ZERO_LEVEL - close all open tags before inserting $tag + NESTED_LEVEL - close tags until depths match + $level ... nesting level (depth) of $tag + nesting is arbitrary limited to 10 levels */ ! function SetHTMLOutputMode($tag, $tagtype, $level) ! { global $stack; ! $retvar = ''; ! ! if ($tagtype == ZERO_LEVEL) { ! // empty the stack until $level == 0; ! if ($tag == $stack->top()) { ! return; // same tag? -> nothing to do ! } ! while ($stack->cnt() > 0) { ! $closetag = $stack->pop(); ! $retvar .= "</$closetag>\n"; ! } ! if ($tag) { ! $retvar .= "<$tag>\n"; ! $stack->push($tag); ! } ! ! ! } elseif ($tagtype == NESTED_LEVEL) { ! if ($level < $stack->cnt()) { ! // $tag has fewer nestings (old: tabs) than stack, // reduce stack to that tab count ! while ($stack->cnt() > $level) { $closetag = $stack->pop(); if ($closetag == false) { *************** *** 323,331 **** } ! } elseif ($tabcount > $stack->cnt()) { // we add the diff to the stack // stack might be zero ! while ($stack->cnt() < $tabcount) { ! #echo "<$tag>\n"; $retvar .= "<$tag>\n"; $stack->push($tag); --- 218,225 ---- } ! } elseif ($level > $stack->cnt()) { // we add the diff to the stack // stack might be zero ! while ($stack->cnt() < $level) { $retvar .= "<$tag>\n"; $stack->push($tag); *************** *** 336,377 **** } ! } else { if ($tag == $stack->top()) { ! return; } else { $closetag = $stack->pop(); - #echo "</$closetag>\n"; - #echo "<$tag>\n"; $retvar .= "</$closetag>\n"; $retvar .= "<$tag>\n"; $stack->push($tag); } - } - - } elseif ($tagdepth == ZERO_DEPTH) { - // empty the stack for $depth == 0; - // what if the stack is empty? - if ($tag == $stack->top()) { - return; } ! while ($stack->cnt() > 0) { ! $closetag = $stack->pop(); ! #echo "</$closetag>\n"; ! $retvar .= "</$closetag>\n"; ! } ! ! if ($tag) { ! #echo "<$tag>\n"; ! $retvar .= "<$tag>\n"; ! $stack->push($tag); ! } ! } else { ! // error ! ExitWiki ("Passed bad tag depth value in SetHTMLOutputMode"); } return $retvar; - } // end SetHTMLOutputMode --- 230,251 ---- } ! } else { // $level == $stack->cnt() if ($tag == $stack->top()) { ! return; // same tag? -> nothing to do } else { + // different tag - close old one, add new one $closetag = $stack->pop(); $retvar .= "</$closetag>\n"; $retvar .= "<$tag>\n"; $stack->push($tag); } } ! ! } else { // unknown $tagtype ! ExitWiki ("Passed bad tag type value in SetHTMLOutputMode"); } return $retvar; } // end SetHTMLOutputMode *************** *** 379,455 **** - // The Recent Changes file is solely handled here - function UpdateRecentChanges($dbi, $pagename, $isnewpage) { - - global $remoteuser; // this is set in the config - global $dateformat; - global $WikiPageStore; - - $recentchanges = RetrievePage($dbi, gettext ("RecentChanges"), - $WikiPageStore); - - // this shouldn't be necessary, since PhpWiki loads - // default pages if this is a new baby Wiki - if ($recentchanges == -1) { - $recentchanges = array(); - } - - $now = time(); - $today = date($dateformat, $now); - - if (date($dateformat, $recentchanges["lastmodified"]) != $today) { - $isNewDay = TRUE; - $recentchanges["lastmodified"] = $now; - } else { - $isNewDay = FALSE; - } - - $numlines = sizeof($recentchanges["content"]); - $newpage = array(); - $k = 0; - - // scroll through the page to the first date and break - // dates are marked with "____" at the beginning of the line - for ($i = 0; $i < $numlines; $i++) { - if (preg_match("/^____/", - $recentchanges["content"][$i])) { - break; - } else { - $newpage[$k++] = $recentchanges["content"][$i]; - } - } - - // if it's a new date, insert it, else add the updated page's - // name to the array - - $newpage[$k++] = $isNewDay ? "____$today\r" - : $recentchanges["content"][$i++]; - if($isnewpage) { - $newpage[$k++] = "* [$pagename] (new) ..... $remoteuser\r"; - } else { - $diffurl = "phpwiki:?diff=" . rawurlencode($pagename); - $newpage[$k++] = "* [$pagename] ([diff|$diffurl]) ..... $remoteuser\r"; - } - if ($isNewDay) - $newpage[$k++] = "\r"; - - // copy the rest of the page into the new array - $pagename = preg_quote($pagename); - for (; $i < $numlines; $i++) { - // skip previous entry for $pagename - if (preg_match("|\[$pagename\]|", $recentchanges["content"][$i])) { - continue; - } else { - $newpage[$k++] = $recentchanges["content"][$i]; - } - } - - $recentchanges["content"] = $newpage; - - InsertPage($dbi, gettext ("RecentChanges"), $recentchanges); - } - - - function ParseAndLink($bracketlink) { global $dbi, $ScriptUrl, $AllowedProtocols, $InlineImages; --- 253,256 ---- *************** *** 509,513 **** for($l = 0; $l < $numlines; $l++) { ! $line = str_replace('[[', ' ', $content[$l]); // remove escaped '[' $numBracketLinks = preg_match_all("/\[\s*([^\]|]+\|)?\s*(.+?)\s*\]/", $line, $brktlinks); for ($i = 0; $i < $numBracketLinks; $i++) { --- 310,317 ---- for($l = 0; $l < $numlines; $l++) { ! // remove escaped '[' ! $line = str_replace('[[', ' ', $content[$l]); ! ! // bracket links (only type wiki-* is of interest) $numBracketLinks = preg_match_all("/\[\s*([^\]|]+\|)?\s*(.+?)\s*\]/", $line, $brktlinks); for ($i = 0; $i < $numBracketLinks; $i++) { *************** *** 520,523 **** --- 324,328 ---- } + // BumpyText old-style wiki links if (preg_match_all("/!?$WikiNameRegexp/", $line, $link)) { for ($i = 0; isset($link[0][$i]); $i++) { *************** *** 529,531 **** --- 334,462 ---- return $wikilinks; } + + + function LinkRelatedPages($dbi, $pagename) + { + // currently not supported everywhere + if(!function_exists('GetWikiPageLinks')) + return ''; + + $links = GetWikiPageLinks($dbi, $pagename); + + $txt = "<b>"; + $txt .= sprintf (gettext ("%d best incoming links:"), NUM_RELATED_PAGES); + $txt .= "</b>\n"; + for($i = 0; $i < NUM_RELATED_PAGES; $i++) { + if(isset($links['in'][$i])) { + list($name, $score) = $links['in'][$i]; + $txt .= LinkExistingWikiWord($name) . " ($score), "; + } + } + + $txt .= "\n<br><b>"; + $txt .= sprintf (gettext ("%d best outgoing links:"), NUM_RELATED_PAGES); + $txt .= "</b>\n"; + for($i = 0; $i < NUM_RELATED_PAGES; $i++) { + if(isset($links['out'][$i])) { + list($name, $score) = $links['out'][$i]; + if(IsWikiPage($dbi, $name)) + $txt .= LinkExistingWikiWord($name) . " ($score), "; + } + } + + $txt .= "\n<br><b>"; + $txt .= sprintf (gettext ("%d most popular nearby:"), NUM_RELATED_PAGES); + $txt .= "</b>\n"; + for($i = 0; $i < NUM_RELATED_PAGES; $i++) { + if(isset($links['popular'][$i])) { + list($name, $score) = $links['popular'][$i]; + $txt .= LinkExistingWikiWord($name) . " ($score), "; + } + } + + return $txt; + } + + + function GeneratePage($template, $content, $name, $hash) + { + global $ScriptUrl, $AllowedProtocols, $templates; + global $datetimeformat, $dbi, $logo, $FieldSeparator; + + if (!is_array($hash)) + unset($hash); + + function _dotoken ($id, $val, &$page) { + global $FieldSeparator; + $page = str_replace("$FieldSeparator#$id$FieldSeparator#", + $val, $page); + } + + function _iftoken ($id, $condition, &$page) { + global $FieldSeparator; + + // line based IF directive + $lineyes = "$FieldSeparator#IF $id$FieldSeparator#"; + $lineno = "$FieldSeparator#IF !$id$FieldSeparator#"; + // block based IF directive + $blockyes = "$FieldSeparator#IF:$id$FieldSeparator#"; + $blockyesend = "$FieldSeparator#ENDIF:$id$FieldSeparator#"; + $blockno = "$FieldSeparator#IF:!$id$FieldSeparator#"; + $blocknoend = "$FieldSeparator#ENDIF:!$id$FieldSeparator#"; + + if ($condition) { + $page = str_replace($lineyes, '', $page); + $page = str_replace($blockyes, '', $page); + $page = str_replace($blockyesend, '', $page); + $page = preg_replace("/$blockno(.*?)$blocknoend/s", '', $page); + $page = ereg_replace("${lineno}[^\n]*\n", '', $page); + } else { + $page = str_replace($lineno, '', $page); + $page = str_replace($blockno, '', $page); + $page = str_replace($blocknoend, '', $page); + $page = preg_replace("/$blockyes(.*?)$blockyesend/s", '', $page); + $page = ereg_replace("${lineyes}[^\n]*\n", '', $page); + } + } + + $page = join('', file($templates[$template])); + $page = str_replace('###', "$FieldSeparator#", $page); + + // valid for all pagetypes + _iftoken('COPY', isset($hash['copy']), $page); + _iftoken('LOCK', (isset($hash['flags']) && + ($hash['flags'] & FLAG_PAGE_LOCKED)), $page); + _iftoken('ADMIN', defined('WIKI_ADMIN'), $page); + + _dotoken('SCRIPTURL', $ScriptUrl, $page); + _dotoken('PAGE', htmlspecialchars($name), $page); + _dotoken('ALLOWEDPROTOCOLS', $AllowedProtocols, $page); + _dotoken('LOGO', $logo, $page); + + // invalid for messages (search results, error messages) + if ($template != 'MESSAGE') { + _dotoken('PAGEURL', rawurlencode($name), $page); + _dotoken('LASTMODIFIED', + date($datetimeformat, $hash['lastmodified']), $page); + _dotoken('LASTAUTHOR', $hash['author'], $page); + _dotoken('VERSION', $hash['version'], $page); + if (strstr($page, "$FieldSeparator#HITS$FieldSeparator#")) { + _dotoken('HITS', GetHitCount($dbi, $name), $page); + } + if (strstr($page, "$FieldSeparator#RELATEDPAGES$FieldSeparator#")) { + _dotoken('RELATEDPAGES', LinkRelatedPages($dbi, $name), $page); + } + } + + // valid only for EditLinks + if ($template == 'EDITLINKS') { + for ($i = 1; $i <= NUM_LINKS; $i++) { + $ref = isset($hash['refs'][$i]) ? $hash['refs'][$i] : ''; + _dotoken("R$i", $ref, $page); + } + } + + _dotoken('CONTENT', $content, $page); + print $page; + } ?> |
From: Arno H. <aho...@us...> - 2001-01-04 18:30:31
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv8160 Modified Files: savepage.php Log Message: moved UpdateRecentChanges() to savepage.php Index: savepage.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/savepage.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** savepage.php 2000/11/08 15:40:00 1.6 --- savepage.php 2001/01/04 18:30:32 1.7 *************** *** 1,4 **** ! <!-- $Id$ --> ! <?php /* --- 1,3 ---- ! <?php rcs_id('$Id$'); /* *************** *** 9,12 **** --- 8,79 ---- */ + function UpdateRecentChanges($dbi, $pagename, $isnewpage) + { + global $remoteuser; // this is set in the config + global $dateformat; + global $WikiPageStore; + + $recentchanges = RetrievePage($dbi, gettext ("RecentChanges"), $WikiPageStore); + + // this shouldn't be necessary, since PhpWiki loads + // default pages if this is a new baby Wiki + if ($recentchanges == -1) { + $recentchanges = array(); + } + + $now = time(); + $today = date($dateformat, $now); + + if (date($dateformat, $recentchanges['lastmodified']) != $today) { + $isNewDay = TRUE; + $recentchanges['lastmodified'] = $now; + } else { + $isNewDay = FALSE; + } + + $numlines = sizeof($recentchanges['content']); + $newpage = array(); + $k = 0; + + // scroll through the page to the first date and break + // dates are marked with "____" at the beginning of the line + for ($i = 0; $i < $numlines; $i++) { + if (preg_match("/^____/", + $recentchanges['content'][$i])) { + break; + } else { + $newpage[$k++] = $recentchanges['content'][$i]; + } + } + + // if it's a new date, insert it + $newpage[$k++] = $isNewDay ? "____$today\r" + : $recentchanges['content'][$i++]; + + // add the updated page's name to the array + if($isnewpage) { + $newpage[$k++] = "* [$pagename] (new) ..... $remoteuser\r"; + } else { + $diffurl = "phpwiki:?diff=" . rawurlencode($pagename); + $newpage[$k++] = "* [$pagename] ([diff|$diffurl]) ..... $remoteuser\r"; + } + if ($isNewDay) + $newpage[$k++] = "\r"; + + // copy the rest of the page into the new array + // and skip previous entry for $pagename + $pagename = preg_quote($pagename); + for (; $i < $numlines; $i++) { + if (!preg_match("|\[$pagename\]|", $recentchanges['content'][$i])) { + $newpage[$k++] = $recentchanges['content'][$i]; + } + } + + $recentchanges['content'] = $newpage; + + InsertPage($dbi, gettext ("RecentChanges"), $recentchanges); + } + + function ConcurrentUpdates($pagename) { *************** *** 38,41 **** --- 105,110 ---- } + + $pagename = rawurldecode($post); $pagehash = RetrievePage($dbi, $pagename, $WikiPageStore); *************** *** 44,50 **** if (! is_array($pagehash)) { $pagehash = array(); ! $pagehash["version"] = 0; ! $pagehash["created"] = time(); ! $pagehash["flags"] = 0; $newpage = 1; } else { --- 113,119 ---- if (! is_array($pagehash)) { $pagehash = array(); ! $pagehash['version'] = 0; ! $pagehash['created'] = time(); ! $pagehash['flags'] = 0; $newpage = 1; } else { *************** *** 56,65 **** } ! if(isset($editversion) && ($editversion != $pagehash["version"])) { ConcurrentUpdates($pagename); } // archive it if it's a new author ! if ($pagehash["author"] != $remoteuser) { SaveCopyToArchive($dbi, $pagename, $pagehash); } --- 125,134 ---- } ! if(isset($editversion) && ($editversion != $pagehash['version'])) { ConcurrentUpdates($pagename); } // archive it if it's a new author ! if ($pagehash['author'] != $remoteuser) { SaveCopyToArchive($dbi, $pagename, $pagehash); } *************** *** 67,73 **** } ! $pagehash["lastmodified"] = time(); ! $pagehash["version"]++; ! $pagehash["author"] = $remoteuser; // create page header --- 136,143 ---- } ! // set new pageinfo ! $pagehash['lastmodified'] = time(); ! $pagehash['version']++; ! $pagehash['author'] = $remoteuser; // create page header *************** *** 83,91 **** $content = stripslashes($content); ! $pagehash["content"] = preg_split('/[ \t\r]*\n/', chop($content)); // convert spaces to tabs at user request if (isset($convert)) { ! $pagehash["content"] = CookSpaces($pagehash["content"]); } } --- 153,161 ---- $content = stripslashes($content); ! $pagehash['content'] = preg_split('/[ \t\r]*\n/', chop($content)); // convert spaces to tabs at user request if (isset($convert)) { ! $pagehash['content'] = CookSpaces($pagehash['content']); } } *************** *** 107,110 **** --- 177,181 ---- $html .= "\n"; + // fixme: no test for flat file db system if ($WikiPageStore == "/tmp/wikidb") { $html .= "<P><B>Warning: the Wiki DBM file still lives in the " . *************** *** 115,119 **** $html .= "<P><img src=\"$SignatureImg\"></P><hr noshade><P>"; ! include("lib/transform.php"); GeneratePage('BROWSE', $html, $pagename, $pagehash); --- 186,190 ---- $html .= "<P><img src=\"$SignatureImg\"></P><hr noshade><P>"; ! include('lib/transform.php'); GeneratePage('BROWSE', $html, $pagename, $pagehash); |
From: Steve W. <wai...@us...> - 2000-12-15 03:11:44
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory slayer.i.sourceforge.net:/tmp/cvs-serv8739 Modified Files: dbmlib.php Log Message: Initial commit of Jan Hidders' changes to dbmlib.php. He added the code needed for the incoming/outgoing/most popular nearby features. The only change I made was to revert the signature for InsertPage, which he added a fourth parameter to. In fact it should have a (shudder) global variable $WikiPageStore, which makes it consistent with SaveCopyToArchive. Index: dbmlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/dbmlib.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** dbmlib.php 2000/12/12 22:06:09 1.4 --- dbmlib.php 2000/12/15 03:11:41 1.5 *************** *** 6,27 **** Database functions: ! OpenDataBase($dbname) ! CloseDataBase($dbi) ! PadSerializedData($data) ! UnPadSerializedData($data) ! RetrievePage($dbi, $pagename, $pagestore) ! InsertPage($dbi, $pagename, $pagehash) SaveCopyToArchive($dbi, $pagename, $pagehash) ! IsWikiPage($dbi, $pagename) ! IsInArchive($dbi, $pagename) ! InitTitleSearch($dbi, $search) ! TitleSearchNextMatch($dbi, &$pos) ! InitFullSearch($dbi, $search) ! FullSearchNextMatch($dbi, &$pos) ! IncreaseHitCount($dbi, $pagename) ! GetHitCount($dbi, $pagename) ! InitMostPopular($dbi, $limit) ! MostPopularNextMatch($dbi, &$res) ! GetAllWikiPagenames($dbi) */ --- 6,23 ---- Database functions: ! OpenDataBase($table) ! CloseDataBase($dbi) ! RetrievePage($dbi, $pagename, $pagestore) ! InsertPage($dbi, $pagename, $pagehash) SaveCopyToArchive($dbi, $pagename, $pagehash) ! IsWikiPage($dbi, $pagename) ! InitTitleSearch($dbi, $search) ! TitleSearchNextMatch($dbi, $res) ! InitFullSearch($dbi, $search) ! FullSearchNextMatch($dbi, $res) ! IncreaseHitCount($dbi, $pagename) ! GetHitCount($dbi, $pagename) ! InitMostPopular($dbi, $limit) ! MostPopularNextMatch($dbi, $res) */ *************** *** 92,99 **** // Either insert or replace a key/value (a page) function InsertPage($dbi, $pagename, $pagehash) { $pagedata = PadSerializedData(serialize($pagehash)); ! if (dbminsert($dbi['wiki'], $pagename, $pagedata)) { ! if (dbmreplace($dbi['wiki'], $pagename, $pagedata)) { ExitWiki("Error inserting page '$pagename'"); } --- 88,101 ---- // Either insert or replace a key/value (a page) function InsertPage($dbi, $pagename, $pagehash) { + + global $WikiPageStore; + + $linklist = ExtractWikiPageLinks($pagehash['content']); + $SetWikiPageLinks($dbi, $pagename, $linklist); + $pagedata = PadSerializedData(serialize($pagehash)); ! if (dbminsert($dbi[$WikiPageStore], $pagename, $pagedata)) { ! if (dbmreplace($dbi[$WikiPageStore], $pagename, $pagedata)) { ExitWiki("Error inserting page '$pagename'"); } *************** *** 126,129 **** --- 128,163 ---- + function RemovePage($dbi, $pagename) { + + dbmdelete($dbi['wiki'], $pagename); // report error if this fails? + dbmdelete($dbi['archive'], $pagename); // no error if this fails + dbmdelete($dbi['hitcount'], $pagename); // no error if this fails + + $linkinfo = RetrievePage($dbi, $pagename, 'wikilinks'); + + // remove page from fromlinks of pages it had links to + if (is_array($linkinfo)) { // page exists? + $tolinks = $linkinfo['tolinks']; + reset($tolinks); + while (list($tolink, $dummy) = each($tolinks)) { + $tolinkinfo = RetrievePage($dbi, $tolink, 'wikilinks'); + if (is_array($tolinkinfo)) { // page found? + $oldFromlinks = $tolinkinfo['fromlinks']; + $tolinkinfo['fromlinks'] = array(); // erase fromlinks + reset($oldFromlinks); + while (list($fromlink, $dummy) = each($oldFromlinks)) { + if ($fromlink != $pagename) // not to be erased? + $tolinkinfo['fromlinks'][$fromlink] = 1; // put link back + } // put link info back in DBM file + InsertPage($dbi, $tolink, $tolinkinfo, 'wikilinks'); + } + } + + // remove page itself + dbmdelete($dbi['wikilinks'], $pagename); + } + } + + // setup for title-search function InitTitleSearch($dbi, $search) { *************** *** 134,137 **** --- 168,172 ---- } + // iterating through database function TitleSearchNextMatch($dbi, &$pos) { *************** *** 147,150 **** --- 182,186 ---- } + // setup for full-text search function InitFullSearch($dbi, $search) { *************** *** 152,155 **** --- 188,192 ---- } + //iterating through database function FullSearchNextMatch($dbi, &$pos) { *************** *** 170,177 **** } //////////////////////// // new database features - function IncreaseHitCount($dbi, $pagename) { --- 207,214 ---- } + //////////////////////// // new database features function IncreaseHitCount($dbi, $pagename) { *************** *** 184,188 **** } else { // add it, set the hit count to one - // echo "adding $pagename to hitcount...<br>\n"; $count = 1; dbminsert($dbi['hitcount'], $pagename, $count); --- 221,224 ---- *************** *** 190,193 **** --- 226,230 ---- } + function GetHitCount($dbi, $pagename) { *************** *** 207,222 **** // n..$limit results $pagename = dbmfirstkey($dbi['hitcount']); ! $res[$pagename] = dbmfetch($dbi['hitcount'], $pagename); while ($pagename = dbmnextkey($dbi['hitcount'], $pagename)) { ! $res[$pagename] = dbmfetch($dbi['hitcount'], $pagename); ! //echo "got $pagename with value " . $res[$pagename] . "<br>\n"; } ! ! arsort($res); return($res); } function MostPopularNextMatch($dbi, &$res) { --- 244,290 ---- // n..$limit results + // Because sorting all the pages may be a lot of work + // we only get the top $limit. A page is only added if it's score is + // higher than the lowest score in the list. If the list is full then + // one of the pages with the lowest scores is removed. + $pagename = dbmfirstkey($dbi['hitcount']); ! $score = dbmfetch($dbi['hitcount'], $pagename); ! $res = array($pagename => (int) $score); ! $lowest = $score; while ($pagename = dbmnextkey($dbi['hitcount'], $pagename)) { ! $score = dbmfetch($dbi['hitcount'], $pagename); ! if (count($res) < $limit) { // room left in $res? ! if ($score < $lowest) ! $lowest = $score; ! $res[$pagename] = (int) $score; // add page to $res ! } elseif ($score > $lowest) { ! $oldres = $res; // save old result ! $res = array(); ! $removed = 0; // nothing removed yet ! $newlowest = $score; // new lowest score ! $res[$pagename] = (int) $score; // add page to $res ! reset($oldres); ! while(list($pname, $pscore) = each($oldres)) { ! if (!$removed and ($pscore = $lowest)) ! $removed = 1; // don't copy this entry ! else { ! $res[$pname] = (int) $pscore; ! if ($pscore < $newlowest) ! $newlowest = $pscore; ! } ! } ! $lowest = $newlowest; ! } } ! ! arsort($res); // sort ! reset($res); ! return($res); } + function MostPopularNextMatch($dbi, &$res) { *************** *** 224,238 **** // and 'pagename' as the keys - if (count($res) == 0) - return 0; - if (list($pagename, $hits) = each($res)) { - //echo "most popular next match called<br>\n"; - //echo "got $pagename, $hits back<br>\n"; $nextpage = array( "hits" => $hits, "pagename" => $pagename ); - // $dbm_mostpopular_cntr++; return $nextpage; } else { --- 292,300 ---- *************** *** 241,244 **** --- 303,307 ---- } + function GetAllWikiPagenames($dbi) { $namelist = array(); *************** *** 253,256 **** --- 316,482 ---- return $namelist; + } + + + //////////////////////////////////////////// + // functionality for the wikilinks DBM file + + // format of the 'wikilinks' DBM file : + // pagename => + // { tolinks => ( pagename => 1}, fromlinks => { pagename => 1 } } + + // takes a page name, returns array of scored incoming and outgoing links + function GetWikiPageLinks($dbi, $pagename) { + + $linkinfo = RetrievePage($dbi, $pagename, 'wikilinks'); + if (is_array($linkinfo)) { // page exists? + $tolinks = $linkinfo['tolinks']; // outgoing links + $fromlinks = $linkinfo['fromlinks']; // incoming links + } else { // new page, but pages may already point to it + // create info for page + $tolinks = array(); + $fromlinks = array(); + // look up pages that link to $pagename + $pname = dbmfirstkey($dbi['wikilinks']); + while ($pname) { + $linkinfo = RetrievePage($dbi, $pname, 'wikilinks'); + if ($linkinfo['tolinks'][$pagename]) // $pname links to $pagename? + $fromlinks[$pname] = 1; + $pname = dbmnextkey($dbi['wikilinks'], $pname); + } + } + + // get and sort the outgoing links + $outlinks = array(); + reset($tolinks); // look up scores for tolinks + while(list($tolink, $dummy) = each($tolinks)) { + $toPage = RetrievePage($dbi, $tolink, 'wikilinks'); + if (is_array($toPage)) // link to internal page? + $outlinks[$tolink] = count($toPage['fromlinks']); + } + arsort($outlinks); // sort on score + $links['out'] = array(); + reset($outlinks); // convert to right format + while(list($link, $score) = each($outlinks)) + $links['out'][] = array($link, $score); + + // get and sort the incoming links + $inlinks = array(); + reset($fromlinks); // look up scores for fromlinks + while(list($fromlink, $dummy) = each($fromlinks)) { + $fromPage = RetrievePage($dbi, $fromlink, 'wikilinks'); + $inlinks[$fromlink] = count($fromPage['fromlinks']); + } + arsort($inlinks); // sort on score + $links['in'] = array(); + reset($inlinks); // convert to right format + while(list($link, $score) = each($inlinks)) + $links['in'][] = array($link, $score); + + // sort all the incoming and outgoing links + $allLinks = $outlinks; // copy the outlinks + reset($inlinks); // add the inlinks + while(list($key, $value) = each($inlinks)) + $allLinks[$key] = $value; + reset($allLinks); // lookup hits + while(list($key, $value) = each($allLinks)) + $allLinks[$key] = (int) dbmfetch($dbi['hitcount'], $key); + arsort($allLinks); // sort on hits + $links['popular'] = array(); + reset($allLinks); // convert to right format + while(list($link, $hits) = each($allLinks)) + $links['popular'][] = array($link, $hits); + + return $links; + } + + + // takes page name, list of links it contains + // the $linklist is an array where the keys are the page names + function SetWikiPageLinks($dbi, $pagename, $linklist) { + + $cache = array(); + + // Phase 1: fetch the relevant pairs from 'wikilinks' into $cache + // --------------------------------------------------------------- + + // first the info for $pagename + $linkinfo = RetrievePage($dbi, $pagename, 'wikilinks'); + if (is_array($linkinfo)) // page exists? + $cache[$pagename] = $linkinfo; + else { + // create info for page + $cache[$pagename] = array( 'fromlinks' => array(), + 'tolinks' => array() + ); + // look up pages that link to $pagename + $pname = dbmfirstkey($dbi['wikilinks']); + while ($pname) { + $linkinfo = RetrievePage($dbi, $pname, 'wikilinks'); + if ($linkinfo['tolinks'][$pagename]) + $cache[$pagename]['fromlinks'][$pname] = 1; + $pname = dbmnextkey($dbi['wikilinks'], $pname); + } + } + + // then the info for the pages that $pagename used to point to + $oldTolinks = $cache[$pagename]['tolinks']; + reset($oldTolinks); + while (list($link, $dummy) = each($oldTolinks)) { + $linkinfo = RetrievePage($dbi, $link, 'wikilinks'); + if (is_array($linkinfo)) + $cache[$link] = $linkinfo; + } + + // finally the info for the pages that $pagename will point to + reset($linklist); + while (list($link, $dummy) = each($linklist)) { + $linkinfo = RetrievePage($dbi, $link, 'wikilinks'); + if (is_array($linkinfo)) + $cache[$link] = $linkinfo; + } + + // Phase 2: delete the old links + // --------------------------------------------------------------- + + // delete the old tolinks for $pagename + // $cache[$pagename]['tolinks'] = array(); + // (overwritten anyway in Phase 3) + + // remove $pagename from the fromlinks of pages in $oldTolinks + + reset($oldTolinks); + while (list($oldTolink, $dummy) = each($oldTolinks)) { + if ($cache[$oldTolink]) { // links to existing page? + $oldFromlinks = $cache[$oldTolink]['fromlinks']; + $cache[$oldTolink]['fromlinks'] = array(); // erase fromlinks + reset($oldFromlinks); // comp. new fr.links + while (list($fromlink, $dummy) = each($oldFromlinks)) { + if ($fromlink != $pagename) + $cache[$oldTolink]['fromlinks'][$fromlink] = 1; + } + } + } + + // Phase 3: add the new links + // --------------------------------------------------------------- + + // set the new tolinks for $pagename + $cache[$pagename]['tolinks'] = $linklist; + + // add $pagename to the fromlinks of pages in $linklist + reset($linklist); + while (list($link, $dummy) = each($linklist)) { + if ($cache[$link]) // existing page? + $cache[$link]['fromlinks'][$pagename] = 1; + } + + // Phase 4: write $cache back to 'wikilinks' + // --------------------------------------------------------------- + + reset($cache); + while (list($link,$fromAndTolinks) = each($cache)) + InsertPage($dbi, $link, $fromAndTolinks, 'wikilinks'); + } |
From: Steve W. <wai...@us...> - 2000-12-12 22:06:12
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory slayer.i.sourceforge.net:/tmp/cvs-serv11191 Modified Files: dbmlib.php Log Message: Brought the function list in the lead comment box up to date. Index: dbmlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/dbmlib.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** dbmlib.php 2000/11/01 11:31:41 1.3 --- dbmlib.php 2000/12/12 22:06:09 1.4 *************** *** 6,23 **** Database functions: ! OpenDataBase($table) ! CloseDataBase($dbi) ! RetrievePage($dbi, $pagename, $pagestore) ! InsertPage($dbi, $pagename, $pagehash) SaveCopyToArchive($dbi, $pagename, $pagehash) ! IsWikiPage($dbi, $pagename) ! InitTitleSearch($dbi, $search) ! TitleSearchNextMatch($dbi, $res) ! InitFullSearch($dbi, $search) ! FullSearchNextMatch($dbi, $res) ! IncreaseHitCount($dbi, $pagename) ! GetHitCount($dbi, $pagename) ! InitMostPopular($dbi, $limit) ! MostPopularNextMatch($dbi, $res) */ --- 6,27 ---- Database functions: ! OpenDataBase($dbname) ! CloseDataBase($dbi) ! PadSerializedData($data) ! UnPadSerializedData($data) ! RetrievePage($dbi, $pagename, $pagestore) ! InsertPage($dbi, $pagename, $pagehash) SaveCopyToArchive($dbi, $pagename, $pagehash) ! IsWikiPage($dbi, $pagename) ! IsInArchive($dbi, $pagename) ! InitTitleSearch($dbi, $search) ! TitleSearchNextMatch($dbi, &$pos) ! InitFullSearch($dbi, $search) ! FullSearchNextMatch($dbi, &$pos) ! IncreaseHitCount($dbi, $pagename) ! GetHitCount($dbi, $pagename) ! InitMostPopular($dbi, $limit) ! MostPopularNextMatch($dbi, &$res) ! GetAllWikiPagenames($dbi) */ |
From: Steve W. <wai...@us...> - 2000-12-12 21:53:23
|
Update of /cvsroot/phpwiki/phpwiki In directory slayer.i.sourceforge.net:/tmp/cvs-serv9329 Modified Files: DBLIB.txt Log Message: Updated against the mysql.php file. This should be accurate and finished for 1.2. Index: DBLIB.txt =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/DBLIB.txt,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** DBLIB.txt 2000/10/21 04:14:02 1.7 --- DBLIB.txt 2000/12/12 21:53:20 1.8 *************** *** 7,12 **** * While most functions specify a "db reference" as the first value passed in, this can be any kind of data type that your functions ! know about. For example, in the DBM implementation this is an ! integer that refers to an open database handle, but in the MySQL version it's an associative array that contains the DB information. --- 7,12 ---- * While most functions specify a "db reference" as the first value passed in, this can be any kind of data type that your functions ! know about. For example, in the DBM implementation this is a hash of ! integers that refer to open database files, but in the MySQL version it's an associative array that contains the DB information. *************** *** 46,51 **** ! RetrievePage($dbi, $pagename) ! takes: db reference, string which is the name of a page returns: a PHP associative array containing the page data (text, version, author, etc) --- 46,63 ---- ! MakeDBHash($pagename, $pagehash) ! takes: page name, page array ! returns: an encoded version of the $pagehash suitable for ! insertion into the data store. This is an internal helper ! function used mainly for the RDBMSs. ! ! MakePageHash($dbhash) ! takes: an array that came from the database ! returns: the $pagehash data structure used by the ! application. This function undoes what MakeDBHash does. ! ! RetrievePage($dbi, $pagename, $pagestore) ! takes: db reference, string which is the name of a page, and a ! string indicating which store to fetch the page from (live or archive). returns: a PHP associative array containing the page data (text, version, author, etc) *************** *** 57,65 **** returns: nothing (hmm. It should probably return true/false) IsWikiPage($dbi, $pagename) takes: db reference, string containing page name ! returns: true or false, if the page already exists InitTitleSearch($dbi, $search) --- 69,86 ---- returns: nothing (hmm. It should probably return true/false) + SaveCopyToArchive($dbi, $pagename, $pagehash) + Similar to InsertPage but for handling the archive store. The + goal here was to separate the two (live db and archive db) in + case there were different storage formats (for example, the + archive might only store diffs of the pages). However this is + not the case in the implementations. IsWikiPage($dbi, $pagename) takes: db reference, string containing page name ! returns: true or false, if the page already exists in the live db. + IsInArchive($dbi, $pagename) + takes: db reference, string containing page name + returns: true or false, if the page already exists in the archive. InitTitleSearch($dbi, $search) *************** *** 68,71 **** --- 89,96 ---- within the result set. + RemovePage($dbi, $pagename) + takes: db reference, name of the page + returns: nothing + This deletes a page from both the live and archive page stores. TitleSearchNextMatch($dbi, &$pos) *************** *** 75,78 **** --- 100,106 ---- (advances $pos to next result field as well) + MakeSQLSearchClause($search, $column) + takes: a search string, column name + returns: a SQL query string suitable for a database query InitFullSearch($dbi, $search) *************** *** 113,118 **** --- 141,159 ---- GetAllWikiPageNames($dbi) + takes: db reference + returns: an array containing all page names + GetWikiPageLinks($dbi, $pagename) + takes: db reference, page name + returns: a two-dimensional array containing outbound links + ordered by score desc ('out'); inbound links ordered by score + desc ('in'); inbound or outbound links ordered by most number of + page views ('popular'). + SetWikiPageLinks($dbi, $pagename, $linklist) + takes: db reference, page name, list of pages linking to this + one + This deletes the existing list of linking pages and inserts all + the page names in $linklist. $Id$ |
From: Steve W. <wai...@us...> - 2000-12-12 21:24:53
|
Update of /cvsroot/phpwiki/phpwiki In directory slayer.i.sourceforge.net:/tmp/cvs-serv5716 Modified Files: README Log Message: Added a paragraph about the feature differences between the different database implementations. Index: README =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/README,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** README 2000/12/12 17:11:14 1.7 --- README 2000/12/12 21:24:50 1.8 *************** *** 13,16 **** --- 13,22 ---- by your web server! + NOTE: Not all database versions are equal. The MySQL and Postgresql + implementations have the full set of features; DBM and mSQL are + missing only a few, and the flat file implementation is alpha quality + and waiting for your improvement. However all but the flat file + version are suitable for production. + index.php: the "main page", really a set of branching instructions admin.php: entry page for doing wiki administration |
From: Steve W. <wai...@us...> - 2000-12-12 21:10:00
|
Update of /cvsroot/phpwiki/phpwiki/images In directory slayer.i.sourceforge.net:/tmp/cvs-serv3892 Modified Files: wikibase.png Log Message: New 50x50 logo in reverse color (white on dark gray). Index: wikibase.png =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/images/wikibase.png,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 Binary files /tmp/cvs7vUom4 and /tmp/cvskohZmY differ |
From: Steve W. <wai...@us...> - 2000-12-12 17:19:21
|
Update of /cvsroot/phpwiki/phpwiki In directory slayer.i.sourceforge.net:/tmp/cvs-serv9987 Removed Files: test_dbmlib.php3 Log Message: I will never finish this, so I'm removing it from the distribution. --- test_dbmlib.php3 DELETED --- |
From: Steve W. <wai...@us...> - 2000-12-12 17:11:18
|
Update of /cvsroot/phpwiki/phpwiki In directory slayer.i.sourceforge.net:/tmp/cvs-serv8883 Modified Files: README Log Message: Brought the manifest up to date. Some files were removed, others added to the lists of files in the distribution. Index: README =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/README,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** README 2000/10/08 18:12:13 1.6 --- README 2000/12/12 17:11:14 1.7 *************** *** 13,44 **** by your web server! ! index.php: the "main page", really a set of branching instructions ! lib/config.php: configuration options, constants, global variables ! lib/dbmlib.php: database access functions for dbm files ! lib/display.php: display a page (this calls "lib/transform.php") ! lib/editlinks.php: edit the embedded links of a page ! lib/editpage.php: edit a page ! lib/fullsearch.php: full page text search ! lib/mysql.php: database access functions for mySQL ! lib/pageinfo.php: gives detailed low-level info on the page structure ! lib/pgsql.php: database access functions for PostgreSQL ! lib/savepage.php: save a page to db, thank user ! lib/search.php: page title search ! lib/setupwiki.php: load a set of pages from ./pgsrc/ directory ! lib/stdlib.php: standard library of functions (non-db related) ! lib/transform.php: convert wiki markup into HTML admin/: ! index.php3: entry point for administration forms ! shrinkdbm.pl: Perl script to reduce size of DBM files ! wiki_adminforms.php: the HTML forms for administration ! wiki_auth.php3: authorization code for admin features ! wiki_dumpHTML.php: dump the Wiki out as HTML pages ! wiki_dumpserial.php: dump the Wiki out as serialize() pages ! wiki_loadserial.php: load Wiki pages that were dumped with dumpserial ! wiki_lockpage.php: lock a page so it cannot be edited ! wiki_port1_0.php: import a 1.0 PhpWiki database ! wiki_rebuilddbms.php: rebuild DBM files to reclaim disk space ! wiki_zip.php3: create a Zip archive of all Wiki pages templates/: --- 13,45 ---- by your web server! ! index.php: the "main page", really a set of branching instructions ! admin.php: entry page for doing wiki administration + lib/config.php: configuration options, constants, global variables + lib/db_filesystem.php alpha support for flat file Wiki + lib/dbmlib.php: database access functions for dbm files + lib/display.php: display a page (this calls "lib/transform.php") + lib/editlinks.php: edit the embedded links of a page + lib/editpage.php: edit a page + lib/fullsearch.php: full page text search + lib/mysql.php: database access functions for mySQL + lib/pageinfo.php: gives detailed low-level info on the page structure + lib/pgsql.php: database access functions for PostgreSQL + lib/savepage.php: save a page to db, thank user + lib/search.php: page title search + lib/setupwiki.php: load a set of pages from ./pgsrc/ directory + lib/stdlib.php: standard library of functions (non-db related) + lib/transform.php: convert wiki markup into HTML + lib/ziplib.php: support for zip/unzip, used for page dumps + admin/: ! admin/dumpserial.php: dump the Wiki out as serialize() pages ! admin/loadserial.php: load Wiki pages that were dumped with dumpserial ! admin/lockpage.php: lock a page so it cannot be edited ! admin/shrinkdbm.pl: Perl script to reduce size of DBM files ! admin/wiki_dumpHTML.php: dump the Wiki out as HTML pages ! admin/wiki_port1_0.php: import a 1.0 PhpWiki database ! admin/wiki_rebuilddbms.php: rebuild DBM files to reclaim disk space ! admin/zip.php3: create a Zip archive of all Wiki pages templates/: |
From: Arno H. <aho...@us...> - 2000-12-11 14:00:53
|
Update of /cvsroot/phpwiki/phpwiki/locale/po In directory slayer.i.sourceforge.net:/tmp/cvs-serv29479/locale/po Modified Files: nl.po Log Message: update to Dutch translation by Jan Nieuwenhuizen Index: nl.po =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/locale/po/nl.po,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** nl.po 2000/11/13 11:22:10 1.6 --- nl.po 2000/12/11 14:00:42 1.7 *************** *** 11,15 **** msgstr "" "Project-Id-Version: phpwiki 1.1.7\n" ! "POT-Creation-Date: 2000-11-13 12:30+0100\n" "PO-Revision-Date: 2000-09-30 02:23+0200\n" "Last-Translator: Jan Nieuwenhuizen <ja...@gn...>\n" --- 11,15 ---- msgstr "" "Project-Id-Version: phpwiki 1.1.7\n" ! "POT-Creation-Date: 2000-12-11 14:30+0100\n" "PO-Revision-Date: 2000-09-30 02:23+0200\n" "Last-Translator: Jan Nieuwenhuizen <ja...@gn...>\n" *************** *** 23,72 **** #: admin.php:26 msgid "You entered an invalid login or password." ! msgstr "" #: admin.php:47 #, c-format msgid "You are about to remove '%s' permanently!" ! msgstr "" #: admin.php:50 #, c-format msgid "Click %shere%s to remove the page now." ! msgstr "" #: admin.php:53 msgid "Otherwise press the \"Back\" button of your browser." ! msgstr "" #: admin.php:55 msgid "Function not yet implemented." ! msgstr "" #: admin.php:57 admin.php:65 msgid "Remove page" ! msgstr "" #: admin.php:63 #, c-format msgid "Removed page '%s' succesfully." ! msgstr "" ! #: lib/config.php:159 msgid "templates/browse.html" msgstr "locale/nl/templates/browse.html" ! #: lib/config.php:160 msgid "templates/editpage.html" msgstr "locale/nl/templates/editpage.html" ! #: lib/config.php:161 msgid "templates/editlinks.html" msgstr "locale/nl/templates/editlinks.html" ! #: lib/config.php:162 msgid "templates/message.html" msgstr "locale/nl/templates/message.html" ! #: lib/config.php:178 msgid "./pgsrc" msgstr "locale/nl/pgsrc" --- 23,72 ---- #: admin.php:26 msgid "You entered an invalid login or password." ! msgstr "Je hebt een ongeldige gebruikersnaam of wachtwoord ingevoerd." #: admin.php:47 #, c-format msgid "You are about to remove '%s' permanently!" ! msgstr "Je staat op het punt '%s' voorgoed te verwijderen!" #: admin.php:50 #, c-format msgid "Click %shere%s to remove the page now." ! msgstr "Klik %shier%s om de pagina nu te verwijderen." #: admin.php:53 msgid "Otherwise press the \"Back\" button of your browser." ! msgstr "Druk anders op de \"Terug\" knop van je bladeraar." #: admin.php:55 msgid "Function not yet implemented." ! msgstr "Functie nog niet geïmplementeerd." #: admin.php:57 admin.php:65 msgid "Remove page" ! msgstr "Verwijder pagina" #: admin.php:63 #, c-format msgid "Removed page '%s' succesfully." ! msgstr "Pagina '%s' verwijderd." ! #: lib/config.php:162 msgid "templates/browse.html" msgstr "locale/nl/templates/browse.html" ! #: lib/config.php:163 msgid "templates/editpage.html" msgstr "locale/nl/templates/editpage.html" ! #: lib/config.php:164 msgid "templates/editlinks.html" msgstr "locale/nl/templates/editlinks.html" ! #: lib/config.php:165 msgid "templates/message.html" msgstr "locale/nl/templates/message.html" ! #: lib/config.php:181 msgid "./pgsrc" msgstr "locale/nl/pgsrc" *************** *** 163,176 **** msgstr "Zoeken naar \"%s\" ..." ! #: lib/fullsearch.php:44 #, c-format msgid "%d matches found in %d pages." msgstr "%d keer gevonden in %d pagina's." ! #: lib/fullsearch.php:47 msgid "Full Text Search Results" msgstr "Volledige tekst zoek resultaten" ! #: lib/msql.php:29 lib/mysql.php:35 msgid "Cannot establish connection to database, giving up." msgstr "Kan verbinding naar data base niet tot stand brengen, geef op." --- 163,176 ---- msgstr "Zoeken naar \"%s\" ..." ! #: lib/fullsearch.php:45 #, c-format msgid "%d matches found in %d pages." msgstr "%d keer gevonden in %d pagina's." ! #: lib/fullsearch.php:48 msgid "Full Text Search Results" msgstr "Volledige tekst zoek resultaten" ! #: lib/msql.php:29 lib/mysql.php:36 msgid "Cannot establish connection to database, giving up." msgstr "Kan verbinding naar data base niet tot stand brengen, geef op." *************** *** 181,185 **** msgstr "Foutboodschap: %s" ! #: lib/msql.php:35 lib/mysql.php:41 #, c-format msgid "Cannot open database %s, giving up." --- 181,185 ---- msgstr "Foutboodschap: %s" ! #: lib/msql.php:35 lib/mysql.php:42 #, c-format msgid "Cannot open database %s, giving up." *************** *** 201,218 **** msgstr "Insert in %s gefaald: %s" ! #: lib/mysql.php:37 lib/mysql.php:43 lib/mysql.php:117 lib/mysql.php:156 #, c-format msgid "MySQL error: %s" msgstr "MySQL fout: %s" ! #: lib/mysql.php:115 #, c-format msgid "Error writing page '%s'" msgstr "Fout bij schrijven pagina `%s'" ! #: lib/mysql.php:154 #, c-format msgid "Cannot delete '%s' from table '%s'" ! msgstr "" #: lib/pageinfo.php:9 --- 201,218 ---- msgstr "Insert in %s gefaald: %s" ! #: lib/mysql.php:38 lib/mysql.php:44 lib/mysql.php:118 lib/mysql.php:158 #, c-format msgid "MySQL error: %s" msgstr "MySQL fout: %s" ! #: lib/mysql.php:116 #, c-format msgid "Error writing page '%s'" msgstr "Fout bij schrijven pagina `%s'" ! #: lib/mysql.php:156 #, c-format msgid "Cannot delete '%s' from table '%s'" ! msgstr "Kan '%s' niet verwijderen uit tabel '%s'" #: lib/pageinfo.php:9 *************** *** 334,344 **** #: lib/stdlib.php:207 lib/stdlib.php:215 msgid "Search" ! msgstr "" #: lib/stdlib.php:330 msgid "Stack bounds exceeded in SetHTMLOutputMode" ! msgstr "" ! #: lib/stdlib.php:384 lib/stdlib.php:447 msgid "RecentChanges" msgstr "RecenteVeranderingen" --- 334,344 ---- #: lib/stdlib.php:207 lib/stdlib.php:215 msgid "Search" ! msgstr "Zoek" #: lib/stdlib.php:330 msgid "Stack bounds exceeded in SetHTMLOutputMode" ! msgstr "Stack grenzen overschreden in SetHTMLOutputMode" ! #: lib/stdlib.php:384 lib/stdlib.php:445 msgid "RecentChanges" msgstr "RecenteVeranderingen" |
From: Arno H. <aho...@us...> - 2000-12-06 23:12:04
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory slayer.i.sourceforge.net:/tmp/cvs-serv20215/lib Modified Files: stdlib.php Log Message: fixed bug in _iftoken() - variable-in-string-brackets were used in a way that causes problems for PHP3. Fix by Jan Hidders. Index: stdlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** stdlib.php 2000/12/06 10:59:27 1.14 --- stdlib.php 2000/12/06 23:12:02 1.15 *************** *** 116,120 **** $page = str_replace($blockyesend, '', $page); $page = preg_replace("/$blockno(.*?)$blocknoend/s", '', $page); ! $page = ereg_replace("{$lineno}[^\n]*\n", '', $page); } else { $page = str_replace($lineno, '', $page); --- 116,120 ---- $page = str_replace($blockyesend, '', $page); $page = preg_replace("/$blockno(.*?)$blocknoend/s", '', $page); ! $page = ereg_replace("${lineno}[^\n]*\n", '', $page); } else { $page = str_replace($lineno, '', $page); *************** *** 122,126 **** $page = str_replace($blocknoend, '', $page); $page = preg_replace("/$blockyes(.*?)$blockyesend/s", '', $page); ! $page = ereg_replace("{$lineyes}[^\n]*\n", '', $page); } } --- 122,126 ---- $page = str_replace($blocknoend, '', $page); $page = preg_replace("/$blockyes(.*?)$blockyesend/s", '', $page); ! $page = ereg_replace("${lineyes}[^\n]*\n", '', $page); } } |
From: Arno H. <aho...@us...> - 2000-12-06 10:59:31
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory slayer.i.sourceforge.net:/tmp/cvs-serv21886/lib Modified Files: stdlib.php Log Message: fixed another bug in ExtractWikiPageLinks(): wiki_unknown-named was not recognized and named wiki links had the wrong linktext inserted into the wikilinks table Index: stdlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** stdlib.php 2000/11/22 22:17:06 1.13 --- stdlib.php 2000/12/06 10:59:27 1.14 *************** *** 527,536 **** { $line = str_replace('[[', ' ', $content[$l]); // remove escaped '[' ! $numBracketLinks = preg_match_all("/\[\s*(.+?)\s*\]/", $line, $brktlinks); for ($i = 0; $i < $numBracketLinks; $i++) { $link = ParseAndLink($brktlinks[0][$i]); ! if ($link['type'] == 'wiki' || $link['type'] == 'wiki-unknown' ! || $link['type'] == 'wiki-named') ! $wikilinks[$brktlinks[1][$i]] = 1; $brktlink = preg_quote($brktlinks[0][$i]); --- 527,535 ---- { $line = str_replace('[[', ' ', $content[$l]); // remove escaped '[' ! $numBracketLinks = preg_match_all("/\[\s*([^\]|]+\|)?\s*(.+?)\s*\]/", $line, $brktlinks); for ($i = 0; $i < $numBracketLinks; $i++) { $link = ParseAndLink($brktlinks[0][$i]); ! if (preg_match("#^wiki#", $link['type'])) ! $wikilinks[$brktlinks[2][$i]] = 1; $brktlink = preg_quote($brktlinks[0][$i]); *************** *** 545,549 **** } } - return $wikilinks; } --- 544,547 ---- |
From: Steve W. <wai...@us...> - 2000-11-24 22:07:41
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory slayer.i.sourceforge.net:/tmp/cvs-serv27943 Modified Files: mysql.php Log Message: Added semicolon on line 153, which caused the file to not compile correctly. . Index: mysql.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/mysql.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** mysql.php 2000/11/18 13:50:36 1.7 --- mysql.php 2000/11/24 22:07:34 1.8 *************** *** 150,154 **** function RemovePage($dbi, $pagename) { ! global $WikiPageStore, $ArchivePageStore global $WikiLinksStore, $HitCountStore, $WikiScoreStore; --- 150,154 ---- function RemovePage($dbi, $pagename) { ! global $WikiPageStore, $ArchivePageStore; global $WikiLinksStore, $HitCountStore, $WikiScoreStore; |
From: Arno H. <aho...@us...> - 2000-11-22 22:17:10
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory slayer.i.sourceforge.net:/tmp/cvs-serv12483 Modified Files: stdlib.php Log Message: fix newline bug in UpdateRecentChanges / fix for-loop boundary Index: stdlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** stdlib.php 2000/11/16 08:52:51 1.12 --- stdlib.php 2000/11/22 22:17:06 1.13 *************** *** 407,411 **** // scroll through the page to the first date and break // dates are marked with "____" at the beginning of the line ! for ($i = 0; $i < ($numlines + 1); $i++) { if (preg_match("/^____/", $recentchanges["content"][$i])) { --- 407,411 ---- // scroll through the page to the first date and break // dates are marked with "____" at the beginning of the line ! for ($i = 0; $i < $numlines; $i++) { if (preg_match("/^____/", $recentchanges["content"][$i])) { *************** *** 419,428 **** // name to the array ! if ($isNewDay) { ! $newpage[$k++] = "____$today\r"; ! $newpage[$k++] = "\r"; ! } else { ! $newpage[$k++] = $recentchanges["content"][$i++]; ! } if($isnewpage) { $newpage[$k++] = "* [$pagename] (new) ..... $remoteuser\r"; --- 419,424 ---- // name to the array ! $newpage[$k++] = $isNewDay ? "____$today\r" ! : $recentchanges["content"][$i++]; if($isnewpage) { $newpage[$k++] = "* [$pagename] (new) ..... $remoteuser\r"; *************** *** 431,434 **** --- 427,432 ---- $newpage[$k++] = "* [$pagename] ([diff|$diffurl]) ..... $remoteuser\r"; } + if ($isNewDay) + $newpage[$k++] = "\r"; // copy the rest of the page into the new array |
From: Arno H. <aho...@us...> - 2000-11-18 13:50:39
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory slayer.i.sourceforge.net:/tmp/cvs-serv11835/lib Modified Files: fullsearch.php mysql.php Log Message: more sophisticated search: match individual words, also excluding words possible Index: fullsearch.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/fullsearch.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** fullsearch.php 2000/10/20 11:42:52 1.2 --- fullsearch.php 2000/11/18 13:50:36 1.3 *************** *** 17,25 **** $result .= "</B></P>\n<DL>\n"; - // quote regexp chars - $full = preg_quote($full); - // search matching pages $query = InitFullSearch($dbi, $full); while ($pagehash = FullSearchNextMatch($dbi, $query)) { $result .= "<DT><B>" . LinkExistingWikiWord($pagehash["pagename"]) . "</B>\n"; --- 17,26 ---- $result .= "</B></P>\n<DL>\n"; // search matching pages $query = InitFullSearch($dbi, $full); + + // quote regexp chars + $full = preg_replace("/\s+/", "|", preg_quote($full)); + while ($pagehash = FullSearchNextMatch($dbi, $query)) { $result .= "<DT><B>" . LinkExistingWikiWord($pagehash["pagename"]) . "</B>\n"; *************** *** 28,33 **** // print out all matching lines, highlighting the match for ($j = 0; $j < (count($pagehash["content"])); $j++) { ! if ($hits = preg_match_all("|$full|i", $pagehash["content"][$j], $dummy)) { ! $matched = preg_replace("|$full|i", "${FieldSeparator}OT\\0${FieldSeparator}CT", $pagehash["content"][$j]); --- 29,34 ---- // print out all matching lines, highlighting the match for ($j = 0; $j < (count($pagehash["content"])); $j++) { ! if ($hits = preg_match_all("/$full/i", $pagehash["content"][$j], $dummy)) { ! $matched = preg_replace("/$full/i", "${FieldSeparator}OT\\0${FieldSeparator}CT", $pagehash["content"][$j]); Index: mysql.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/mysql.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** mysql.php 2000/11/13 14:54:08 1.6 --- mysql.php 2000/11/18 13:50:36 1.7 *************** *** 15,18 **** --- 15,19 ---- IncreaseHitCount($dbi, $pagename) GetHitCount($dbi, $pagename) + MakeSQLSearchClause($search, $column) InitTitleSearch($dbi, $search) TitleSearchNextMatch($dbi, $res) *************** *** 200,208 **** } // setup for title-search function InitTitleSearch($dbi, $search) { ! $search = addslashes($search); ! $res = mysql_query("select pagename from $dbi[table] where pagename like '%$search%' order by pagename", $dbi["dbc"]); return $res; --- 201,226 ---- } + function MakeSQLSearchClause($search, $column) + { + $search = addslashes(preg_replace("/\s+/", " ", $search)); + $term = strtok($search, ' '); + while($term) { + $word = "$term"; + if ($word[0] == '-') { + $word = substr($word, 1); + $clause .= "not ($column like '%$word%') "; + } else { + $clause .= "($column like '%$word%') "; + } + if ($term = strtok(' ')) + $clause .= 'and '; + } + return $clause; + } // setup for title-search function InitTitleSearch($dbi, $search) { ! $clause = MakeSQLSearchClause($search, 'pagename'); ! $res = mysql_query("select pagename from $dbi[table] where $clause order by pagename", $dbi["dbc"]); return $res; *************** *** 223,228 **** // setup for full-text search function InitFullSearch($dbi, $search) { ! $search = addslashes($search); ! $res = mysql_query("select * from $dbi[table] where content like '%$search%'", $dbi["dbc"]); return $res; --- 241,246 ---- // setup for full-text search function InitFullSearch($dbi, $search) { ! $clause = MakeSQLSearchClause($search, 'content'); ! $res = mysql_query("select * from $dbi[table] where $clause", $dbi["dbc"]); return $res; |
From: Arno H. <aho...@us...> - 2000-11-18 13:50:39
|
Update of /cvsroot/phpwiki/phpwiki/pgsrc In directory slayer.i.sourceforge.net:/tmp/cvs-serv11835/pgsrc Modified Files: FindPage Log Message: more sophisticated search: match individual words, also excluding words possible Index: FindPage =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/pgsrc/FindPage,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** FindPage 2000/11/06 16:14:43 1.4 --- FindPage 2000/11/18 13:50:35 1.5 *************** *** 13,14 **** --- 13,20 ---- %%Fullsearch%% + + ------ + Separate words with a space. All words have to match. + %%%To exclude words prepend a '-'. + %%%Example: 'wiki text -php' looks for all pages containing the words 'wiki' + __and__ 'text', but __not__ containing the word 'php'. |