Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

config.php

Summary: config.php tips and tricks
Version: 0.0
Prerequisites:
Status:
Maintainer:
Categories: Administration

Description

Things you really wanted to know, but were afraid to ask, about config.php.

The following questions and answers will assist with local customizations of your website.

Please note that any direct function call in config.php, like ResolvePageName(), CondAuth(), PageTextVar(), PageVar(), RetrieveAuthPage(), or others, should be done near the end of config.php.

How do I test for the current page name in config.php

Use the code

$pagename = ResolvePageName($pagename);
if ($pagename=='HomePage') { /*do something...*/}

How do I test for the current group name in config.php

Use the code

list($group, $name) = explode('.', ResolvePageName($pagename));
if ($group=='PmWiki') { /*do something...*/}

How do I keep track of changes to config.php

  1. Use some form of revision control
  2. Judicious use of comments:
## flip box
## added Sept 10, 2009 by John Doe
## http://www.pmwiki.org/wiki/Cookbook/Flipbox
## nice, but won't work on included pages.
include_once($FarmD.'/cookbook/flipbox.php');

I put in title of recipe, add date (not as important if you use revision control, but can be a quick reference, sometimes), author if multiple people edit the file, home page, brief comment.

OtherMichael September 21, 2009, at 08:25 AM

Contributors

simon

Comments

This space is for User-contributed commentary and notes. Please include your name and a date (eg 2007-05-19) along with your comment. Optional alternative: create a new page with a name like "ThisRecipe-Talk" (e.g. PmCalendar-Talk).

See also

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.

Edit - History - Print - Recent Changes - Search
Page last modified on October 26, 2011, at 04:02 AM