This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Pathname to the File that inserts the Comments Box
#1

How do you determine how to change the general tag "<?php require("pathtofile/myphpfile.php"); ?>" to a specific pathname for your website? I've tried all sorts of filenames and nothing works. What file are we supposed to direct our browser to for inserting the Commentics comment box?

I've got a database set up and all the Commentics files installed and the .htaccess modified to execute php code from within an htm file but all I get is error codes when I launch my website,

I'm certain I have the wrong pathname but no idea what I should do to correct it.

Help would be so appreciated!

Bill
Reply
#2

I'm not sure what you're talking about. Are you using the Integration Guide?

Have you completed the interview?
Reply
#3

(21-Jun-2012, 10:04 AM)Steven Wrote:  I'm not sure what you're talking about. Are you using the Integration Guide?

Went back over my stuff and can't find where I found that line of code. Then went back to Integration and followed those instructions carefully, including the addition of "AddHandler application/x-httpd-php5 .html .htm" to my .htaccess file. Different than the code Commentics suggested but Hostgator told me to add that so the php code would work in my html files.

Right now I'm using a test page named commentics.shtml with the three SSI include tags in it to add the top bar (ssi-topbar.htm), sidebar (ssi-sidebar.htm) and comments box (ssi-comments.htm). When I get that working I will be adding all three to every page I develop.

The contents of my test page (commentics.shtml) are...

<html>
<title>Commentics Test Page</title>
<head>
<link rel="stylesheet" href="styles.css" type="text/css" />
</head>

<body>

<!--#include virtual="ssi-topbar.htm" -->
<DIV class="content">
<p>I use SSI to add a topbar and sidebar to each page of my website. This is my test page for adding the Commentics comment box with an SSI tag.</p>
<p><!--#include virtual="ssi-comments.htm" --></p>
</div>

<!--#include virtual="ssi-sidebar.htm" -->
<div style="clear:left;"></div>

</body>
</html>


The server adds the topbar and sidebar but where the Commentics comment box should appear I get the following error messages.

Warning: require_once(includes/functions/page.php) [function.require-once]: failed to open stream: No such file or directory in /home/qwerty/public_html/comments/includes/commentics.php on line 31

Fatal error: require_once() [function.require]: Failed opening required 'includes/functions/page.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/qwerty/public_html/comments/includes/commentics.php on line 31


The contents of ssi-comments.htm are...

<?php
session_start();
ob_start();
?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="comments/css/stylesheet.css"/>
</head>
<body>

<?php
$cmtx_page_id = "1";
$cmtx_reference = "Page One";
$cmtx_path = "comments/";
define('IN_COMMENTICS', 'true'); //no need to edit this line
require $cmtx_path . "includes/commentics.php"; //no need to edit this line
?>

</body>
</html>


Thanks for the reply Steven. Sure would like to use the open source Commentics system. Hope you can help me...

Bill

PS my test page... blogsbybilly.com/commentics.shtml
Reply
#4

What you posted seems okay to me, but having said that, I've never used SSI and know very little about it.

I wish I could help but I think at this point you have more chance at solving it than me.

Have you completed the interview?
Reply
#5

Can you tell me what the error messages mean?
Reply
#6

It means that the file /comments/includes/commentics.php tried to load the file /comments/includes/functions/page.php on line 31 but that file (page.php) was not found.

The first thing to do would be to check that it does exist. Open your FTP programme and check that the file /comments/includes/functions/page.php is there. If it is, check that its file permission is not too low (anything above 644 is probably okay).

It could also be that the $cmtx_path variable in your integration code is not quite right although it seems okay to me.

From what I can tell, ssi-comments.htm is just a part of your overall page so I don't think you should be adding the session_start() and the <html> and <head> tags etc in there. They belong in the commentics.shtml file. If you view the source code of your page, you can see multiple <html> and <head> tags in there.

Also, are you installing v1.8 or v2.0? Judging by the line number you posted, it looks like v1.8. If it's a new installation, it may be better to start with the new version.

Have you completed the interview?
Reply
#7

In fact you will have to use v2.0 because the integration code you are using is only designed for v2.0.

This is the issue.

Have you completed the interview?
Reply
#8

(22-Jun-2012, 04:27 PM)Steven Wrote:  It means that the file /comments/includes/commentics.php tried to load the file /comments/includes/functions/page.php on line 31 but that file (page.php) was not found.

The first thing to do would be to check that it does exist. Open your FTP programme and check that the file /comments/includes/functions/page.php is there. If it is, check that its file permission is not too low (anything above 644 is probably okay).

It could also be that the $cmtx_path variable in your integration code is not quite right although it seems okay to me.

From what I can tell, ssi-comments.htm is just a part of your overall page so I don't think you should be adding the session_start() and the <html> and <head> tags etc in there. They belong in the commentics.shtml file. If you view the source code of your page, you can see multiple <html> and <head> tags in there.

Also, are you installing v1.8 or v2.0? Judging by the line number you posted, it looks like v1.8. If it's a new installation, it may be better to start with the new version.

Thanks Steven,

1-- page.php is on my server and the permission was 644 so I changed it to 666 but that didn't help

2-- the pathname at line 31 of commentics.php is "includes/functions/page.php"
NOT... "comments/includes/functions/page.php"

3-- changing line 31 to "comments/includes/functions/page.php" causes an error message for line 39 and changing line 39 to "comments/includes/functions/page.php" causes an error message for line 44 and so forth down through the file

4-- then I get... "Please ensure that this page contains a Page ID in its file."

5-- What does that mean?

6-- As you suggested, I moved session_start() <html> and <head> tags to commentics.shtml

7-- this left ssi-comments.php with only...
<?php
$cmtx_page_id = "1";
$cmtx_reference = "Commentics Test Page";
$cmtx_path = "comments/";
define('IN_COMMENTICS', 'true'); //no need to edit this line
require $cmtx_path . "includes/commentics.php"; //no need to edit this line
?>

8-- but still get... "Please ensure that this page contains a Page ID in its file."

9-- How did I get integration codes for V2.0? I installed Commentics before you released it. Whatever. I'm just getting frustrated with the whole thing.

10-- So how do I upgrade? Can't find it under Documentation. Will I have to delete the database at my server, too?

I understand how slow and tedious an open source program can be, especially without lots of feedback from users. A few years ago I installed Word Press manually. Then Fantastico came along with basically a one-click install. What are the possibilities you folks can come up with something like that for Commentics?
Reply
#9

Finally got the comment box to appear on my test page (now named template-page.shtml) but typing in a comment and clicking Add Comment just refreshes the page without displaying the comment. I checked the box at my Dashboard to manually approve comments but none show up in Manage Comments to approve. Just says 0 for number of comments in the table. That's the database? The Preview doesn't work either.

The changes I made to get the box to finally show up without any errors are these...

1-- In template-page.shtml, I still have the line <!--#include virtual="ssi-comments.php" --> to tell the server to add the Commentics box but I removed the start session code at the beginning of the file. It now looks like this...

<html>
<title>Page Template -- Content</title>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="comments/css/stylesheet.css"/>
<link rel="stylesheet" href="styles.css" type="text/css" />
</head>
<body>
<!--#include virtual="ssi-topbar.htm" -->
<DIV class="content">
<p class="page-title">Page Title</p>
<p>Begin content here</p>
<p style="text-align:center;"><img src="line-rainbow.jpg" /></p>

<!--#include virtual="ssi-comments.php" -->

</div>
<!--#include virtual="ssi-sidebar.htm" -->
<div style="clear:left;"></div>
</body>
</html>


2-- I removed everything from ssi-comments.php except...

<?php
session_start();
ob_start();
?>

<?php
$page_id = "1";
$reference = "ssi-comments";
$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
?>

Got excited when I saw the box show up but something is still wrong. Hope you have some suggestions because I am out of ideas...

Bill
Reply
#10

It's frustrating for me a little as well. I know it's not your fault. I think your server was to blame for your first post because it showed a directory listing of the /installer/ files, even when there was an index.php file inside it. I also think some of the documentation on the site and my instructions could be clearer and better organised. I think you were unlucky to download v1.8 at a time when v2.0 and its accompanying documentation was being released/updated. However, I have made a few suggestions which I feel have been overlooked. For example, I suggested to start fresh with a v2.0 installation but it looks like you have proceeded with v1.8, and are now talking about how to upgrade it. This makes things slightly more difficult for both you and me because v1.8 has known bugs which will cause problems and then there is the rigmarole of the upgrade. While on the subject of upgrading, there is a link to it on the Download page, there is an upgrade.txt file in the download package, and the first result of a Google search for "Commentics upgrade" would have lead you to it. I agree that it should also be under Documentation so I'll fix that in the near future. I'm not sure why you still have session_start() in ssi-comments.php, it belongs at the very top of template-page.shtml (above the <html> tag). I don't agree with you that Commentics is slow and tedious, there's been a lot of feedback to contradict that. Also, Fantastico wouldn't be able to integrate Commentics into your page, which is where you have had the majority of problems. Have you tried uploading the example.php file from the download package and testing with that? If that works then you know that the issue is to do with how you have integrated it into your page.

Have you completed the interview?
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Steven
29-Jul-2020, 08:34 AM
Last Post by MattyP
13-Apr-2020, 08:33 PM

Forum Jump:


Users browsing this thread: 4 Guest(s)