26-Oct-2011, 04:31 PM
First of all thanks for a great piece of work!
I do have some trouble getting it to work though, hope you can help me out here.
I am using modxcms from modxcms.com - the evolution version 1.05
In that I can define snippets of php code to be parsed and used by modx within pages.
I have tried this
<?php
$page_id = $modx->documentIdentifier;
$reference = $modx->documentObject['pagetitle'];
$path_to_comments_folder = "comments/";
define ('IN_COMMENTICS', 'true'); //no need to edit this line
require $path_to_comments_folder . "includes/commentics.php"; //no need to edit this line
?>
And get this error message:
Comments
Please ensure that this page contains a Page ID in its file.
I am trying to see what happens here so I added something else to see if the page id is received from modx, as you can see below I //out the line require $path etc
<?php
$page_id = $modx->documentIdentifier;
$reference = $modx->documentObject['pagetitle'];
$path_to_comments_folder = "comments/";
define ('IN_COMMENTICS', 'true'); //no need to edit this line
//require $path_to_comments_folder . "includes/commentics.php"; //no need to edit this line
echo ( '<pre>' );
print($page_id);
print($reference);
echo ( '</pre>' );
?>
Now when I run this modx shows the page and in it shows the id and the pagetitle. So the modx code clearly works, but somehow the require bit screws things up.
I uploaded the example.php and that works ok, so commentics is installed ok, but it just can not be called from within cms generated pages - yet?
Any idea how to get this working?
I do have some trouble getting it to work though, hope you can help me out here.
I am using modxcms from modxcms.com - the evolution version 1.05
In that I can define snippets of php code to be parsed and used by modx within pages.
I have tried this
<?php
$page_id = $modx->documentIdentifier;
$reference = $modx->documentObject['pagetitle'];
$path_to_comments_folder = "comments/";
define ('IN_COMMENTICS', 'true'); //no need to edit this line
require $path_to_comments_folder . "includes/commentics.php"; //no need to edit this line
?>
And get this error message:
Comments
Please ensure that this page contains a Page ID in its file.
I am trying to see what happens here so I added something else to see if the page id is received from modx, as you can see below I //out the line require $path etc
<?php
$page_id = $modx->documentIdentifier;
$reference = $modx->documentObject['pagetitle'];
$path_to_comments_folder = "comments/";
define ('IN_COMMENTICS', 'true'); //no need to edit this line
//require $path_to_comments_folder . "includes/commentics.php"; //no need to edit this line
echo ( '<pre>' );
print($page_id);
print($reference);
echo ( '</pre>' );
?>
Now when I run this modx shows the page and in it shows the id and the pagetitle. So the modx code clearly works, but somehow the require bit screws things up.
I uploaded the example.php and that works ok, so commentics is installed ok, but it just can not be called from within cms generated pages - yet?
Any idea how to get this working?