Index: lib/mysql.php =================================================================== RCS file: /usr/local/cvsroot/personalwiki/lib/mysql.php,v retrieving revision 1.1.1.2 diff -u -r1.1.1.2 mysql.php --- lib/mysql.php 2001/09/21 17:30:48 1.1.1.2 +++ lib/mysql.php 2001/09/22 01:38:12 @@ -23,6 +23,8 @@ BackLinkSearchNextMatch($dbi, &$pos) InitMostPopular($dbi, $limit) MostPopularNextMatch($dbi, $res) + InitDanglingLinks($dbi) + DanglingLinksNextMatch($dbi, $res) GetAllWikiPageNames($dbi) GetWikiPageLinks($dbi, $pagename) SetWikiPageLinks($dbi, $pagename, $linklist) @@ -301,6 +303,31 @@ else return 0; } + + // setup for dangling links search + function InitDanglingLinks($dbi) { + global $WikiLinksStore, $WikiPageStore; + $RecentChanges = gettext ("RecentChanges"); + $TextFormattingRules = gettext ("TextFormattingRules"); + + $res = mysql_query("select topage from $WikiLinksStore + left join $WikiPageStore on topage=pagename + where frompage!='$RecentChanges' + and frompage!='$TextFormattingRules' + and pagename is NULL + group by topage + order by topage", $dbi["dbc"]); + return $res; + } + + // iterating through database + function DanglingLinksNextMatch($dbi, $res) { + if ($hits = mysql_fetch_array($res)) + return $hits[0]; + else + return 0; + } + function GetAllWikiPageNames($dbi) { global $WikiPageStore; Index: lib/stdlib.php =================================================================== RCS file: /usr/local/cvsroot/personalwiki/lib/stdlib.php,v retrieving revision 1.6 diff -u -r1.6 stdlib.php --- lib/stdlib.php 2001/09/21 20:28:46 1.6 +++ lib/stdlib.php 2001/09/22 01:38:12 @@ -10,6 +10,7 @@ RenderQuickSearch($value) RenderFullSearch($value) RenderMostPopular() + RenderDanglingLinks() CookSpaces($pagearray) class Stack (push(), pop(), cnt(), top()) SetHTMLOutputMode($newmode, $depth) @@ -101,6 +102,19 @@ $result .= "
$qhash[hits] ... " . LinkExistingWikiWord($qhash['pagename']) . "\n"; } $result .= "\n"; + + return $result; + } + + function RenderDanglingLinks() { + global $dbi; + + $query = InitDanglingLinks($dbi); + $result = "\n"; return $result; } Index: lib/transform.php =================================================================== RCS file: /usr/local/cvsroot/personalwiki/lib/transform.php,v retrieving revision 1.3 diff -u -r1.3 transform.php --- lib/transform.php 2001/09/21 19:45:10 1.3 +++ lib/transform.php 2001/09/22 01:38:12 @@ -245,6 +245,8 @@ $tmpline = str_replace('%%Fullsearch%%', RenderFullSearch(), $tmpline); if (strstr($tmpline, '%%Mostpopular%%')) $tmpline = str_replace('%%Mostpopular%%', RenderMostPopular(), $tmpline); + if (strstr($tmpline, '%%Danglinglinks%%')) + $tmpline = str_replace('%%Danglinglinks%%', RenderDanglinglinks(), $tmpline); if(defined('WIKI_ADMIN') && strstr($tmpline, '%%ADMIN-')) $tmpline = ParseAdminTokens($tmpline); Index: pgsrc/DanglingLinks =================================================================== RCS file: DanglingLinks diff -N DanglingLinks --- /dev/null Sat Mar 24 04:37:44 2001 +++ DanglingLinks Sat Sep 22 02:38:13 2001 @@ -0,0 +1,3 @@ +The following pages have been cited on this wiki but not yet defined. Citations from RecentChanges are assumed to be recent deletions and ignored; citations from TextFormattingRules are assumed to be examples and are likewise ignored. + +%%Danglinglinks%% \ No newline at end of file