My apology for editing the original post, however as there have yet been no responses I’m not too worried.
I have begun to look into blogging at my personal website (my sandbox for learning how to do things that I need to do at work). For the purposes of this exercise, I am trying to implement a system whereby multiple users can post to their individual Blog directory through a single form. Over the course of setting this up I have come to struggle with two different things. The first is how to have one form which will post to the individuals specified directory, and the second is the error I get when I do post.
My solution for the first has been to create a small snippet that reads out the persons "login_home" page, or failing that posts to the root of the blog directory. I’ve got it reading the user settings, but for some reason it fails to fail over to the root. Instead of posting to the root of the blog directory, the entry is placed at the top level of the site! Structurally I have kept the blog directory as created with the sample data. As such, the directory structure is as follows:
mod
Blog dir
Entry form
User 1 dir
post
User 2 dir
post
The Entry form calls NewsPublisher uncached thus:
[!NewsPublisher?
&folder=`[!MyBlogHome!]`
&canpost=`Blog Admins`
&formtpl=`blogForm`
&footertpl=`FormBlogComments`
&makefolder=`1`
&rtcontent=`tvblogContent`!]
Here is the text of the ’MyBlogHome’ snippet I use to feed the folder variable in the NewsPublisher call:
$id = $modx->documentIdentifier;
$pid = $modx->getParent($id,1,'id');
return isset($modx->config['login_home'])? ($modx->config['login_home']):$pid;
As best as I can tell, the $pid variable is not being set. Any help on this would be very appreciated.
On the second issue... I get an error every time I post with the form - even if I hardcode the folder. The document is created, but it cannot be viewed from the front end. Strangely, the document does render when previewed with the Manager! Once I open and save the document in the Manager (no editing involved) the page becomes available for viewing in the front end. Here is the error that is returned:
Fatal error: Call to undefined function: mergeadded() in
/mod/manager/includes/document.parser.class.inc.php(724) : eval()'d code on line 31
What the heck do I do with this?
Web Server:
* PHP version 4.3.11
* MySQL version 4.0.27
* Apache/1.3.33
* Shared Linux host server (godaddy)
Browser/Client:
* Browser: Firefox2
* OS: WinXP
MODx:
* Version 0.9.5
* Additional snippets used on the page:
MaxiGallery Solo, WayFinder (twice), BreadCrumbs
Website:
*
http://mod.ravenwolf.org