Update of /cvsroot/phpwiki/phpwiki/lib/plugin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28725
Modified Files:
AddComment.php WikiBlog.php
Log Message:
possible fix for problem reported by Whit Blauvelt
Message-ID: <20040327211707.GA22374@xxxxxxxxxxxxxxxxxx>
create intermediate redirect subpages for blog/comment/forum
Index: AddComment.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/AddComment.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -2 -b -p -d -r1.6 -r1.7
--- AddComment.php 16 Mar 2004 15:44:34 -0000 1.6
+++ AddComment.php 29 Mar 2004 21:33:32 -0000 1.7
@@ -64,9 +64,10 @@ extends WikiPlugin_WikiBlog
function getDefaultArguments() {
- return array('page' => '[pagename]',
+ return array('pagename' => '[pagename]',
'order' => 'normal',
'mode' => 'add,show',
'jshide' => '0',
- 'noheader' => false
+ 'noheader' => false,
+ //'sortby' => '-pagename' // oldest first. reverse by
order=reverse
);
}
@@ -74,6 +75,6 @@ extends WikiPlugin_WikiBlog
function run($dbi, $argstr, &$request, $basepage) {
$args = $this->getArgs($argstr, $request);
- if (!$args['page'])
- return $this->error("No page specified");
+ if (!$args['pagename'])
+ return $this->error(_("No pagename specified"));
// Get our form args.
@@ -136,4 +137,9 @@ function togglecomments(a) {
// $Log$
+// Revision 1.7 2004/03/29 21:33:32 rurban
+// possible fix for problem reported by Whit Blauvelt
+// Message-ID: <20040327211707.GA22374@xxxxxxxxxxxxxxxxxx>
+// create intermediate redirect subpages for blog/comment/forum
+//
// Revision 1.6 2004/03/16 15:44:34 rurban
// jshide not default as in CreateToc
Index: WikiBlog.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/WikiBlog.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -2 -b -p -d -r1.13 -r1.14
--- WikiBlog.php 15 Mar 2004 10:59:40 -0000 1.13
+++ WikiBlog.php 29 Mar 2004 21:33:32 -0000 1.14
@@ -110,5 +110,5 @@ extends WikiPlugin
function getDefaultArguments() {
- return array('page' => '[pagename]',
+ return array('pagename' => '[pagename]',
'order' => 'normal',
'mode' => 'show,add',
@@ -119,6 +119,6 @@ extends WikiPlugin
function run($dbi, $argstr, &$request, $basepage) {
$args = $this->getArgs($argstr, $request);
- if (!$args['page'])
- return $this->error("No page specified");
+ if (!$args['pagename'])
+ return $this->error(_("No pagename specified"));
// Get our form args.
@@ -153,6 +153,6 @@ extends WikiPlugin
function add (&$request, $blog, $type='wikiblog') {
- if (!($parent = $blog['page']))
- $request->finish(fmt("No page specified for %s",$type));
+ if (!($parent = $blog['pagename']))
+ $request->finish(fmt("No pagename specified for %s",$type));
$user = $request->getUser();
@@ -210,4 +210,26 @@ extends WikiPlugin
$pagename = "Topic";
+ // Check intermediate pages. If not existing they should
RedirectTo the parent page.
+ $redirected = $parent . SUBPAGE_SEPARATOR . $pagename;
+ if (!$dbi->isWikiPage($redirected)) {
+ require_once('lib/loadsave.php');
+ $pageinfo = array('pagename' => $redirected,
+ 'content' => '<?plugin RedirectTo
page='.$parent.' ?>',
+ 'pagedata' => array(),
+ 'versiondata' => array('author' =>
$blog_meta['creator']),
+ );
+ SavePage($request, $pageinfo, '', '');
+ }
+ $redirected = $parent . SUBPAGE_SEPARATOR . $pagename .
SUBPAGE_SEPARATOR . preg_replace("/T.*/", "", "$time");
+ if (!$dbi->isWikiPage($redirected)) {
+ require_once('lib/loadsave.php');
+ $pageinfo = array('pagename' => $redirected,
+ 'content' => '<?plugin RedirectTo
page='.$parent.' ?>',
+ 'pagedata' => array(),
+ 'versiondata' => array('author' =>
$blog_meta['creator']),
+ );
+ SavePage($request, $pageinfo, '', '');
+ }
+
$p = $dbi->getPage($parent . SUBPAGE_SEPARATOR . $pagename .
SUBPAGE_SEPARATOR . str_replace("T", SUBPAGE_SEPARATOR, "$time"));
$pr = $p->getCurrentRevision();
@@ -251,5 +273,5 @@ extends WikiPlugin
$dbi = $request->getDbh();
- $parent = $args['page'];
+ $parent = $args['pagename'];
$blogs = $this->findBlogs($dbi, $parent, $type);
$html = HTML();
@@ -324,9 +346,14 @@ extends WikiPlugin
// Show blog-entry form.
return new Template($template, $request,
- array('PAGENAME' => $args['page']));
+ array('PAGENAME' => $args['pagename']));
}
};
// $Log$
+// Revision 1.14 2004/03/29 21:33:32 rurban
+// possible fix for problem reported by Whit Blauvelt
+// Message-ID: <20040327211707.GA22374@xxxxxxxxxxxxxxxxxx>
+// create intermediate redirect subpages for blog/comment/forum
+//
// Revision 1.13 2004/03/15 10:59:40 rurban
// fix also early attach type bug, attached as wikiblog pagetype
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
|