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

trouble with integrating
#1

Hi there,
Thanks for this terrific resource!  I followed instructions as best I could for installation and integration, but am seeing nothing yet on my pages where I have tried to add comments.

Here is a test page I made:
http://imaginesonomacounty.com/test.html

I'm not sure where I went wrong -- installation or database creation or integration steps?  Installation seemed to go smoothly.

Any help or tips would be appreciated - thanks!
Reply
#2

Hello,

If you view the source code of your page you can see the PHP code. This may be because you're integrating into a HTML file and you haven't instructed your server to treat any PHP code found in HTML files as PHP, so it doesn't know what to do with it.

See this FAQ for more info:
https://www.commentics.org/faq/php-integ...html-files

Also I noticed that in your integration code you've put "/comment/" but you've installed it at "/comments/" with an "s" at the end. Also don't forget to delete the install folder.

Have you completed the interview?
Reply
#3

Thanks, this helped me get part way there. I fixed the /comments/ line and made sure install folder was deleted.

I tried renaming as a .php file and everything immediately worked perfectly.

However, when I tried adding the two sample lines below into the .htaccess file (first tried one, then the other), I still get nothing in my .html test.

AddHandler application/x-httpd-php5 .html .htm .shtml
AddHandler x-httpd-php5-cgi .html .htm .shtml

Here's how my .htaccess file reads now:


# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php72” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php72 .php .php7 .phtml
AddHandler x-httpd-php5-cgi .html .htm .shtml
</IfModule>
# php -- END cPanel-generated handler, do not edit


Are there any other tricks I should try or am I just going to need to use .php for any pages with comments?

Thank you!
Reply
#4

And to follow up on my message above...

I have now tested switching to .php on a page from my actual website and although the comment form appears to work, I do not see the comments showing below.

The test version works fine:  http://imaginesonomacounty.com/test.php

But this version does not yet show the comments:  http://imaginesonomacounty.com/solutions...stuff1.php

Also every time I answer the security question the first time it tells me I have the wrong answer and then it lets me through on the second question.
Reply
#5

Okay I see. Remove any changes you made to your .htaccess file, then do this:

Change this:
Code:
AddHandler application/x-httpd-ea-php72 .php .php7 .phtml

To this:
Code:
AddHandler application/x-httpd-ea-php72 .php .php7 .phtml .html

Have you completed the interview?
Reply
#6

The reason the comments aren't showing is because your website's own stylesheet, http://imaginesonomacounty.com/imagine.css, has this:

Code:
section {
    position: fixed;
    left: 50%;
    margin-right: -50%;
    transform: translate(-50%, -50%);
}

Try adding the following just below it:

Code:
.cmtx_container section {
    position: static;
    left: auto;
    margin-right: 0;
    transform: none;
}

Have you completed the interview?
Reply
#7

In your integration code try changing this:
PHP Code:
<?php 
session_start
();

To this:
PHP Code:
<?php 
$session_parameters
= [
    'cookie_httponly'  => 1,
    'use_only_cookies' => 1,
    'use_trans_sid'    => 0,
    'gc_maxlifetime'  => 1440,
    'cookie_lifetime'  => 0,
    'cookie_path'      => '/; SameSite=Lax',
    'cookie_secure'    => 0
];

session_start($session_parameters);

(That's a fix for having to answer the security question twice)

Have you completed the interview?
Reply
#8

I made the .htaccess file change you suggest and the .html test page (http://imaginesonomacounty.com/test.html) still is not working.

.htaccess file now reads:


# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php72” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php72 .php .php7 .phtml .html
AddHandler x-httpd-php5-cgi .html .htm .shtml
</IfModule>
# php -- END cPanel-generated handler, do not edit


The stylesheet change did not fix the disappearing comments problem, but I did try an alternate stylesheet where I removed the code you mentioned and it worked fine after that -- so I might be able to get by with simply using an alternate stylesheet for pages with comments.

As for the double security questions, I now realize I can disable the questions... so I will just do that rather than add code.

Thanks again for your help and great resource you offer.
Reply
#9

You might need to remove this line for it to work:
Code:
AddHandler x-httpd-php5-cgi .html .htm .shtml

Okay well if you find time at some point it'd be great to know if the solution for the security question works because I think a few other people have experienced the same thing.

Have you completed the interview?
Reply
#10

Thanks.

Success: removing the line from .htaccess file that you suggested removing did work. Now it is working with .html files.

I will also try to test the security question fix soon to let you know if it works.
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by afoster
21-Aug-2020, 06:47 PM
Last Post by Steven
20-Mar-2017, 09:09 PM
Last Post by Steven
21-Sep-2015, 05:40 PM
Last Post by Steven
25-Apr-2014, 11:05 PM
Last Post by Steven
10-Apr-2014, 08:32 PM

Forum Jump:


Users browsing this thread: 3 Guest(s)