BackupHTMLZip-Talk
This space is for User-contributed commentary and notes. Please include your name and a date along with your comment.
Category pages
Hi, this is working, but the category pages are not being created. Is there are way to generate those? thanks. (February 2, 2025)
There is a way to autocreate category pages, see $AutoCreate
, however this will only happen when you save a page, and only for the categories linked from that page. To generate all wanted categories in bulk, here is a function to add to config.php:
# Create category pages when a page linking to them is saved. $AutoCreate['/^Category\\./'] = array('ctime' => $Now); # Normally you have this defined, or the default one is used. $BHZip['pages'] = '*.*,-SiteAdmin.*,-PmWiki.*,-Site.*'; $HandleActions['gencat'] = 'HandleGenCat'; function HandleGenCat($pagename) { global $BHZip, $Now, $Charset; $auth = RetrieveAuthPage($pagename, 'admin', true, READPAGE_CURRENT); if(!$auth) return Abort('?No permissions'); $list = ListPages("{$BHZip['pages']},Category.*"); $wanted = []; foreach($list as $pn) { $page = ReadPage($pn, READPAGE_CURRENT); if(! isset($page['targets']) || !$page['targets']) continue; $targets = explode(',', $page['targets']); $wanted = array_unique(array_merge($wanted, $targets)); } $cats = preg_grep('/^Category\\./', $wanted); $diff = array_diff($cats, $list); sort($diff); header("Content-type: text/plain; charset=$Charset"); foreach($diff as $pn) { WritePage($pn, array('ctime' => $Now)); echo "Written '$pn'.\n"; } }
Then, navigate to index.php?action=gencat
and type your admin password. --Petko
[solved] Strange header
(April 7, 2020) Works great, but I am getting a strange header at top of many pages:
Site.GroupHeader self=0 basepage=Site.Operators
Any advice?? (April 7, 2020)
Please upgrade to a more recent PmWiki version, at least 2.2.98, or set $MaxIncludes
to a very large number like 999999. --Petko April 07, 2020, at 08:46 AM
[documented] Backup (or exclude) specific wikis in a farm
How does this work with a server farm? Does it back up all the wikis in the farm? How to backup (or exclude) specific wikis?
Added a section in the page. Thanks! --Petko September 01, 2019, at 07:17 AM
Feedback
Works great. Dec 10, 2018.
Talk page for the BackupHTMLZip recipe (users).