==== Wikka Mod 032 ==== Type: Bug Fix ---- ===Credit:=== **[[http://web.archive.org/web/20040810214724/http://www.wakkawiki.com/JoeD | Joe Delaney]]** -- [[http://web.archive.org/web/20040811010939/http://www.wakkawiki.com/RewriteMode | RewriteMode @ WakkaWiki]] **[[JsnX | Jason Tourtelotte]]** -- Minor improvements. ---- **Note:** These are not the exact coding changes used in Wikka....but the ideas and file pointers are pretty much right on. ---- When rewrite mode is off, the base url will contain "wakka.php?wakka=" and this will cause a series of problem for dependent files (stylesheets, graphics) and generated links (the revisions page and backlink page search). Here is a solution that I came up with. It works for me, but use at your own risk. Replace actions/header.php with this version: %%(php) GetMessage(); $user = $this->GetUser(); $site_base = $this->GetConfigValue("base_url"); if ( substr_count($site_base, 'wakka.php?wakka=') > 0 ) $site_base = substr($site_base,0,-16); ?> <?php echo $this->GetWakkaName()." : ".$this->GetPageTag(); ?> " /> " /> GetMethod() == "show") ? "ondblclick=\"document.location='".$this->href("edit")."';\" " : "" ?> >

config["wakka_name"] ?> : TextSearchconfig["rewrite_mode"]) { echo "&"; } else { echo "?"; } ?>phrase=GetPageTag()); ?>">GetPageTag(); ?>

Link($this->config["root_page"]); ?> :: config["navigation_links"] ? $this->Format($this->config["navigation_links"])." :: " : "" ?> You are Format($this->UserName()) ?>
%% You will have to edit actions/footer.php too, look for the img tag with the "xml/xml.gif" source and change it to %% \"XML\" %% Now in handlers/page/revisions.php %%(php) replace  href("show")."?time=".urlencode($page["time"])."\">".$page["time"].""; ?> with config["rewrite_mode"]) { $output .= " href("show")."&time=".urlencode($page["time"])."\">".$page["time"].""; } else { $output .= " href("show")."?time=".urlencode($page["time"])."\">".$page["time"].""; } ?> %% There may be other broken links that depend on the rewrite rules (look on WakkaBugTracker), but I haven't found any others yet. With these modifications you can turn rewrite_mode on or off at will (remember to change the base_url too) and the stylesheets, xml icon, back-linking and revisions keep working. You may also need to delete the .htaccess file on the /xml and /css directories. ---- actions/recentchanges.php need the same xml/xml.gif as actions/footer.php ---- Similarly in handlers/page/revisions.xml.php %%(php) replace ".$this->href("show")."?time=".urlencode($page["time"])."\n"; ?> with config["rewrite_mode"]) { $xml .= "".$this->href("show")."&time=".urlencode($page["time"])."\n"; } else { $xml .= "".$this->href("show")."?time=".urlencode($page["time"])."\n"; } ?> %%