list of all comments in a static page?.

iosmaniosman Member
11 mai modifié dans Discussions générales


just like the code that displays all the
articles on a static page, is it possible to do the same with comments? If yes, what would be the code to insert?



  • zetraderzetrader Member
    23 mai modifié

    Hi iosman, as i see that nobody answered you, i will do it because i've done it myself long time ago in a static page.
    This way, in a static page, you'll have all the comments of the blog, from the newest to older one, here's the code i used :

    <?php global $plxShow; ?>
    <?php $plxShow->lastComList('<li>Le #com_date <a href="#com_url">#com_author a dit :</a> #com_content(140)</li>',$max=10000); ?>

    Just to explain : 140 is the max length of each comment to display, you can choose less or more.
    max=10000 is the max of comments you want to display in that static page (the last 10 000 comments), same here, you can choose less or more.
    Edit : sorry, the forum destroyed the way the code is, with the old forum (fluxbb) i could choose "code" to display exactly a bit of code, without the code to be destroyed by the way of formatting of the forum.
    So if any admin could make it display correctly, it would be great.
    Edit 2 : thanks bazooka07 to show me how to display correctly the code.

    For you it woud be, in english :

    <?php global $plxShow; ?>
    <?php $plxShow->lastComList('<li>The #com_date <a href="#com_url">#com_author said :</a> #com_content(140)</li>',$max=10000); ?>

    Thanks to the admin to make it display the right way, when i edit the message, the code is correct, when i save the answer, it changes the code.

  • bazooka07bazooka07 Member

    for the new forum, you can use markdown format. For displaying a snippet of code, begin a line with an english quote "`" three times and end your code with a new line with these 3 characters.
    You can look at "Syntax highlighting" in this page :

    When editing a static page (not a template), you can access to $plxShow directly with "$this".

  • zetraderzetrader Member

    @bazooka07 Thanks, i corrected it. I just took a look at iosman links, it's not all articles in a static page, and it's using seems to be a scam to make spam with those 3 links, but anyway, i hope this could help other people.

Connectez-vous ou Inscrivez-vous pour répondre.