|
Profiles /
HaganFoxPmWiki Contributions
Open Source ProjectI have a GPL-licensed open-source software project called Qdig (Quick Digital Image Gallery). Qdig is a PHP script that automagically generates galleries from image files in a directory tree on your web server. See the Audit Images recipe for information on how to use Qdig to see if someone has uploaded some undesirable images to your wiki. I use PmWiki as a "lightweight Content Management System (CMS)" to maintain the Qdig project Home Page and it has been working very well. Some Items I'm Watching
Hardly-Asked Questions (HAQs)This is a development space for some Question/Answer pairs I think might be useful, however they may not be Frequently Asked enough to merit inclusion on the FAQ page. Now that the new FAQ scheme is in effect, I'll gradually move these out of here.
How do I ban certain passwords? Use the following in your local/config.php:
## Invalidate particular password(s)
$ForbiddenPasswords = array('secret', 'hushhush');
if (in_array(@$_POST['authpw'], $ForbiddenPasswords)) {
unset($_POST['authpw']);
}
Why doesn't the PmWiki default skin include a link to AllRecentChanges? For most of the wikis I run, the wikigroups are almost entirely disconnected -- i.e., each department or student organization has its own group. In these situations the per-group RecentChanges makes a lot more sense than AllRecentChanges. (Yes, for me as the admin I tend to use AllRecentChanges, but the vast majority of people browsing the site are interested only in a single wikigroup, and probably don't even realize that the separate groups are all part of the same wiki. At least, that's what led me to create wikigroups to begin with.) --Pm How do I add a Google searchbox to my wiki? Use the following Custom Markup:
Markup('googlesearch', 'directives', '/\\(:googlesearch:\\)/e',
"'<:block>'.Keep(\"<a href='http://www.google.com'><img
src='http://www.google.com/logos/Logo_40wht.gif' border='0'
alt='Google' title='Google' /></a><form class='wikisearch'
style='margin:0px; margin-bottom:20px;'
action='http://www.google.com/search' method='get'><input
type='text' class='wikisearchbox' title='Search Google' name='q'
size='20' maxlength='255' value='' /><input type='hidden' name='hl'
value='en' /><input type='submit' class='wikisearchbutton'
name='btnG' value='Go' /></form>\")");
This will add a (:googlesearch:) directive. (English version converted from original German version by newmy.) How do I add a Google searchbox to my wiki that returns search results for my site? Use the following Custom Markup:
Markup('googlesearch', 'directives', '/\\(:googlesearch:\\)/e',
"'<:block>'.Keep(\"Search Google: <form class='wikisearch'
style='margin:0px; margin-bottom:20px; display:inline; '
action='http://www.google.com/custom' method='get'><input
type='text' class='wikisearchbox' title='Search Google' name='q'
size='20' maxlength='255' value='' /><input type='hidden' name='hl'
value='en' /><input type='hidden' name='sitesearch'
value='www.pmwiki.org' /><input type='submit' class='wikisearchbutton'
name='btnG' value='Go' /></form>\")");
Of course you'll need to change the value of sitesearch to your site. How do I disable the "!" (single-bang) markup for Level-1 Headings (<h1>)? Use the following in your local/config.php:
Markup('^!', 'block',
'/^(!{1,6})\\s?(.*)$/e',
"'<:block><div class=\"someclass'.strlen('$1').PSS('\">$2</div>')");
How do I hide a comment block within some wiki markup. The %comment% wikistyle sends your comment text to the browser in a block with a "display:none;" attribute, meaning the comment can be viewed in the page's source. To keep your block of text from being sent to the browser at all, you can use conditional markup: (:if false:) This line doesn't get rendered on the page. Nor does this one. (:if:) What cookies does PmWiki set? How can I clear PmWiki has set? Typically PmWiki just sets two cookies; one for the browsing session and one for the Author Name. PmWiki also comes with a script that uses a cookie to identify the location of a preferences page. Some cookbook recipes and skins also use cookies. You can view the cookies a site has set using the "View Cookies" bookmarklet here: http://www.squarefree.com/bookmarklets/misc.html You can clear a site's cookies using the "Zap Cookies" bookmarklet here: http://www.squarefree.com/bookmarklets/zap.html What is the "order" parameter? Is it a query string parameter? What are valid order values? It's a pagelist parameter, which means it can be part of a search
query, specified in the Inside a wiki page, one can do (:pagelist group=Cookbook order=-time count=10:)
and get a list of the ten most recently modified Cookbook pages. Then, url query string parameters can be used to override the
settings in the http://www.pmwiki.org/wiki/Test/PageListOrder?order=name?count=5
overrides the Finally, one can use these in a search box, thus entering a search query of "Cookbook/ order=-time"
returns all of the pages in the cookbook, ordered by last modification time. Any page attribute can be used as an order value; the common ones are order=name page's name order=title page's title order=time last modification time order=ctime page creation time order=author last author order=size size of markup in bytes I want to have a "Today" link on my site's Home Page, like [[D2006/20060206|Today]] You would need pmwiki version 2.1.beta15 or higher for this: Define a page variable in config.php:
Then you can write your link as [[D2006/{$Today}|Today]]
Solved by HansB on the pmwiki-users list. |