|
Cookbook /
SharedPages-TalkHi, I've written a quick recipe that creates the ?action=share and =unshare function. A very tiny script (ten real lines), that pushes the file from wiki.d to ../shared.d and vice versa in my farm. You still create the new page in a local wiki, but once the page is made you just run the ?action=share function to 'share' it. Running ?action=unshare moves the file out of the shared.d folder back to the local wiki. It's not much, but it addresses the problem without too much work. 2006-Jun-13 JacobMunoz
<?php if (!defined('PmWiki')) exit();
SDV($HandleActions['share'], 'HandleShare');
SDV($HandleAuth['share'], 'edit');
function HandleShare($pagename) {
rename("wiki.d/$pagename","../shared.d/".basename($pagename));
Redirect($pagename); }
SDV($HandleActions['unshare'], 'HandleUnshare');
SDV($HandleAuth['unshare'], 'edit');
function HandleUnshare($pagename) {
rename("../shared.d/$pagename","wiki.d/".basename($pagename));
Redirect($pagename); }
?>
Shared groupsHere is a working example for sharing groups of pages, where all new pages in the shared group are placed in the shared group directory (noting the use of Per Group Sub Directories for wiki.d and sharedwiki.d page stores). In the following path was replaced by ../../.. in the working configuration.
In config.php (for the website with the
In config.php (for the website wanting to access the
This lets the shared pages to be read (eg by page lists, searches). In the SharedGroup.php (for the website with the ## only alter the directories when a page is posted in this group if (@$_REQUEST['action']=='edit' && preg_grep('/^post/', array_keys($_REQUEST) ) ) { $LockFile = " In the SharedGroup.php (for the website wanting to access the ## only alter the directories when a page is posted in this group if (@$_REQUEST['action']=='edit' && preg_grep('/^post/', array_keys($_REQUEST) ) ) { $LockFile = " The Simon September 15, 2009, at 08:17 PM Talk page for the SharedPages recipe (users). |