Giter VIP home page Giter VIP logo

Comments (10)

philips300-code avatar philips300-code commented on August 28, 2024 1

thank you for the information

from htmly.

philips300-code avatar philips300-code commented on August 28, 2024 1

Thank you for your help.

from htmly.

danpros avatar danpros commented on August 28, 2024

Hello,

You just need to remove this one <?php session_start(); ?> because we already called it.

from htmly.

philips300-code avatar philips300-code commented on August 28, 2024

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

from htmly.

danpros avatar danpros commented on August 28, 2024

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.

from htmly.

philips300-code avatar philips300-code commented on August 28, 2024

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
}

from htmly.

danpros avatar danpros commented on August 28, 2024

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);
    }
}

from htmly.

philips300-code avatar philips300-code commented on August 28, 2024

Hello
i can't figure out where i should create the folder all.php

from htmly.

danpros avatar danpros commented on August 28, 2024

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/

from htmly.

danpros avatar danpros commented on August 28, 2024

Added the code to the docs.

from htmly.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.