Closed philips300-code closed 4 months ago
Hello,
You just need to remove this one <?php session_start(); ?>
because we already called it.
Hello,
When I remove when <?php session_start(); ?>
When there is a new comment, it is not visible on the new device.
When cleared from here, a comment is displayed /admin/clear-cache
For users who are not logged in, each visit will be given a cache page if the cache feature enabled. So if you are using PHP integration (the comments included directly to the page) with cache enable, ideally you need to delete the post cache every time new comment added and this requires a custom code.
The simplest way, of course, uses iframes like in their WordPress plugins.
thank you for the information
Hello, From here I need to take the code and link to the cache. But I don't understand where the file is located.
Link: https://commentics.com/events
<?php
/* Event for when a new comment is added */
if ($event == 'comment_added') {
// add your own code here
}
The cache is in cache/page folder.
Try in post.html.php
<?php
$cmtx_identifier = strtok($_SERVER["REQUEST_URI"],'?');
$cmtx_reference = $p->title;
$cmtx_folder = '/comments/';
require($_SERVER['DOCUMENT_ROOT'] . $cmtx_folder . 'frontend/index.php');
?>
And all.php
example:
<?php
/* Event for when a new comment is added */
if ($event == 'comment_added') {
$c = str_replace('/', '#', rawurldecode($page_identifier));
$cachefile = dirname(CMTX_DIR_ROOT) . '/cache/page/' . $c . '.cache';
if (file_exists($cachefile)) {
unlink($cachefile);
}
}
Hello i can't figure out where i should create the folder all.php
Well already written here: https://commentics.com/events
To listen for an event, create a file called all.php inside the folder below:
/comments/system/events/
Thank you for your help.
https://commentics.com/integration
Hello, when you add integration code
post.html.php
I have an error in the console. _PHP Notice: session_start(): Ignoring session_start() because a session is already active in /home/...../publichtml/themes/doks/post.html.php on line 1