From: <jo...@or...> - 2001-10-02 01:08:14
|
>> * I really want my searches to be able to tell me when a Category was >> added to a page, even if that page has been modified several times >> since then. > I think this won't work because every time a page is edited/saved, we > first delete all frompage entries in the link table, parse the page for > links, and reinsert them. It would be a nightmare to try to do this the > other way (select all links from the table; parse the page; compare the > two sets; delete the ones not in set 1, insert the ones only in set 2.) Why is this a nightmare? If the links table is indexed the select shouldn't take any time. foreach ($select_result as $s) { $prevlinks[$s] = 1; } $newlinks = ExtractWikiPageLinks($page_submission); foreach ($newlinks as $n) { if (!$prevlinks[$n]) $to_insert[] = $n; $prevlinks[$n] = 0; } $to_delete = (array_flip($prevlinks))[1]; Looks to me like the PHP running time is O(N), where N is the number of links, and the SQL running time is probably O(N log N) but is so fast it doesn't concern us. Not that any of this matters. AN ALTERNATIVE: If word-level diffs are implemented then hopefully the new links will be the ones that show up as added words/lines, and the deleted links will be the ones that show up as deleted words/lines. > My idea has been to keep a log of all transactions in the database, or > maybe a flat file, and you could trace edits that way. Otherwise you have > to resort to looking at diffs. An internal log of edits would provide an > audit trail. I think that one internal-code thing that would be neat to work on would be a kind of diff API. For instance email notifications should be able to send diffs. And imagine if you wanted to confirm every email address that appeared on the site-- it would be no good to check up on all of them in a page in each page save, if there were long lists, but if you had ready access to just the part of the last edit that was different... that seems feasible. Finally there is the possibility of syncronizing multiple wikis using machine readable diffs instead of the CVS backend. >> /SubPages > It's just "syntactic sugar," isn't it? That is, allowing slashes in page > names? I think it's a change to the ParseAndLink or the Link*WikiLink code: bracket links starting with a dot or a slash ("[.Link]") on MyPage need to be linked to WikiURL('MyPage.Link') instead of just WikiURL('.Link'). > I'm wondering at the moment if we shouldn't just make the implementation > of page names case insensitive. I think that's a good idea. |