Wiki source for Mod001fUserSettings


Show raw source

==== Wikka Mod 001 ====
Type: Feature addition
----
===Credit:===
**[[http://web.archive.org/web/20031212223719/http://www.wakkawiki.com/DanielBergman | DanielBergman]]**
[[http://web.archive.org/web/20040603110235/http://www.wakkawiki.com/RenamingUserSettings | RenamingUserSettings @ WakkaWiki]]
----

I wanted the UserSettings link to be a bit more userfriendly, so by doing this small fix I changed it to say ''Login/register'' when the user isn't logged in and ''Change settings/logout'' when he/she is.

Changes to wakka.config.php

%%(php)
- "navigation_links" => "PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings",

+ "navigation_links" => "PageIndex :: RecentChanges :: RecentlyCommented :: [[UserSettings | Login/register]]",
+ "logged_in_navigation_links" => "PageIndex :: RecentChanges :: RecentlyCommented :: [[UserSettings | Change settings/logout]]",
%%



Changes to actions/header.php

%%(php)
- <?php echo $this->config["navigation_links"] ? $this->Format($this->config["navigation_links"])." :: " : "" ?>

+ <?php
+ if ($this->GetUser()) {
+ echo $this->config["logged_in_navigation_links"] ? $this->Format($this->config["logged_in_navigation_links"])." :: " : "";
+ } else {
+ echo $this->config["navigation_links"] ? $this->Format($this->config["navigation_links"])." :: " : "";
+ }
+ ?>
%%

----

== Wikka notes: ==

To make this work on an **fresh install**, wakka.php was modified as described above instead of wakka.config.php.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki