Revision [763]
This is an old revision of DreckFehler made by JsnX on 2004-07-22 21:26:05.
contact form
the following hacks and tweaks are based on WakkaWiki v. 1.2. try to figure out yourself, where to put the changes in modified code ;)
discussion
if the config-value "pages_purge_time" is set to another value than zero (never purge), any revision will be deleted if a page is untouched for a while and modified after a period greater than the purge-time. due to this it's possible to destroy old pages which aren't modified frequently without any chance to recover it.this flaw may be covered by the mechanism used in wikka wiki to mark minor changes as non cacheble and only cleanup only those pages(?). if not, there shold be a more sophisticated use of purging in the function $wakka->maintenance. any ideas?
Yes, this is good discussion item. Personally, I've never used "pages_purge_time", and had not given it much thought. It seems that we need another option such as purge_keep_limit, which will specify that at least x number of page revisions should be kept. What do you think? -- JsnX
ready-to-use modifications
bug in rendering of lists
if a list - ordered or unordered - is put at the very begining of a page (i.e. there is no text before that list), the first item of the list will not be recognized as a list-member, because the body is trimmed before saving. the bug is located in the function $wakka->savePage().change this code-snippet
// add new revision
$this->Query("insert into ".$this->config["table_prefix"]."pages set ".
"tag = '".mysql_escape_string($tag)."', ".
($comment_on ? "comment_on = '".mysql_escape_string($comment_on)."', " : "").
"time = now(), ".
"owner = '".mysql_escape_string($owner)."', ".
"user = '".mysql_escape_string($user)."', ".
"latest = 'Y', ".
"body = '".mysql_escape_string(trim($body))."'");
$this->Query("insert into ".$this->config["table_prefix"]."pages set ".
"tag = '".mysql_escape_string($tag)."', ".
($comment_on ? "comment_on = '".mysql_escape_string($comment_on)."', " : "").
"time = now(), ".
"owner = '".mysql_escape_string($owner)."', ".
"user = '".mysql_escape_string($user)."', ".
"latest = 'Y', ".
"body = '".mysql_escape_string(trim($body))."'");
to this one
// add new revision
if (preg_match("/^([\t]+)(-|([1aiAI]\))?)/", $body, $matches)) $lead = $matches[1]; // save tab(s) of first list-definition, if any at the begining
$body = $lead.trim($body); //and write it back to the trimmed body
$this->Query("insert into ".$this->config["table_prefix"]."pages set ".
"tag = '".mysql_escape_string($tag)."', ".
($comment_on ? "comment_on = '".mysql_escape_string($comment_on)."', " : "").
"time = now(), ".
"owner = '".mysql_escape_string($owner)."', ".
"user = '".mysql_escape_string($user)."', ".
"latest = 'Y', ".
"body = '".mysql_escape_string($body)."'"); // <<<<<<< trim() removed! we did it already
if (preg_match("/^([\t]+)(-|([1aiAI]\))?)/", $body, $matches)) $lead = $matches[1]; // save tab(s) of first list-definition, if any at the begining
$body = $lead.trim($body); //and write it back to the trimmed body
$this->Query("insert into ".$this->config["table_prefix"]."pages set ".
"tag = '".mysql_escape_string($tag)."', ".
($comment_on ? "comment_on = '".mysql_escape_string($comment_on)."', " : "").
"time = now(), ".
"owner = '".mysql_escape_string($owner)."', ".
"user = '".mysql_escape_string($user)."', ".
"latest = 'Y', ".
"body = '".mysql_escape_string($body)."'"); // <<<<<<< trim() removed! we did it already