Comments plugin doesn't work

Feed 12 posts, 7 voices

Avatar
4 posts

Hy guys, this is my code:

<?php
if(!url_match('/weblog') && url_start_with('/weblog')){
    echo '<div id="published">Pubblicato: '.$this->published_on.'<br/><hr/></div>';
	if($this->commentsCount() > 0) {
        echo '<ol class="comments">';
        foreach ($this->comments() as $comment) {
            echo '<li><p>'.$comment->body().'</p><p> - '.$comment->name().'<small class="comment-date">'.$comment->date().'</small></p></li>';
        }
        echo '</ol>';
    } else {
        echo '<b>Non ci sono commenti</b>';
    }
    $this->includeSnippet('comment-form');
}
?>

but it doesn’t work. after the “Pubblicato” echo, nothing appears and the page footer is missing.

 
Avatar
8 posts

Hello, I have managed today to install Frog for a first time and seems to have the same problem like above.

I’ve followed the comments instructions and added this entry to layout code:

<?php if (Plugins::isEnabled(‘comment’)) { if ($this->comment_status != Comment::NONE) $this->includeSnippet(‘comment-each’); if ($this->comment_status == Comment::OPEN) $this->includeSnippet(‘comment-form’); }
?>

..and the page stops loading after that lines.

 
Avatar
125 posts

Hi,
you need to go to the tab comment (when activated), and click on configurations link (on the right), then put Use captcha on No
It could work.

 
Avatar
8 posts

I am using with captcha set to “NO” but this not made any changes. Problem still persist.

 
Avatar
8 posts

I have discused this problem on WolfCRM Forum, and I have a solution:
http://www.wolfcms.org/forum/topic93.html

 
Avatar
4 posts

This is my code in Layout:

<?php echo $this->content(); ?> <?php if($this->comment_status == 1) { ?> <?php $comments = Comment::findApprovedByPageId($page->id); ?> <ol class=“comments”> <?php foreach ($comments as $comment): ?> <li class=“comment”> <p><?php echo $comment->body(); ?></p> <p> – <?php echo $comment->name(); ?> <small class=“comment-date”><?php echo $comment->date(); ?></small> </p> </li> <?php endforeach; // comments ?> </ol> <?php $this->includeSnippet(“comment-form”); ?> <?php } ?>

But it doesn’t work. Before it worked but I changed something and now it doesn’t not work. What should I do? Help please

 
Avatar
16 posts

Hi
Has anyone solved this issue? I am having the same with 0.9.5 under php 5.1.6 where the page stops rendering directly after the comments code in the layout:


		    if (Plugins::isEnabled('comment'))
    			{
        		if ($this->comment_status != Comment::NONE)
            			$this->includeSnippet('comment-each');
       		 	if ($this->comment_status == Comment::OPEN)
            			$this->includeSnippet('comment-form');

Nothing in the php error.log

 
Avatar
8 posts

Hello,

I have had exacly the same problem. And I found the solution. Please take a look here:
http://www.wolfcms.org/forum/topic93.html

 
Avatar
16 posts

Thank you for the response, but unfortunately no joy. I turned up the error reporting and I am getting this error now (both with and without the changes to Framework.php:

 Fatal error: Class 'Plugins' not found in /data/sites/staging.artsandhealth.org/web/frog/app/classes/Page.php(393) : eval()'d code on line 79
 
Avatar
5 posts

The awnser is

if (Plugin::isEnabled('comment'))
   {

        if ($this->comment_status != Comment::NONE)

            $this->includeSnippet('comment-each');

        if ($this->comment_status == Comment::OPEN)

            $this->includeSnippet('comment-form');

 }

Instead of

if (Plugins::isEnabled('comment'))

   {

        if ($this->comment_status != Comment::NONE)

            $this->includeSnippet('comment-each');

        if ($this->comment_status == Comment::OPEN)

            $this->includeSnippet('comment-form');

 }

Just remove the “s” of Plugins

Cheers!

 
Avatar
16 posts

Well wasn’t that too easy! Fantastic….many thanks!

 
Avatar
5 posts

Your welcome :D

 
Avatar
1 posts

remove “s” of “Plugins” and change “== Comment::OPEN)” become “!= Comment::OPEN)”

<?php
    if (Plugin::isEnabled('comment'))
    {
        if ($this->comment_status != Comment::OPEN)
            $this->includeSnippet('comment-each');
        if ($this->comment_status != Comment::OPEN)
            $this->includeSnippet('comment-form');
    }
?>

It’s works with captha