We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Weever installed, now Closed status comments are appearning on site

Development and Programming

scottystang's avatar
scottystang
106 posts
16 years ago
scottystang's avatar scottystang

Hey everyone,

I’m using the Weever extension for nested comments http://studio625.com/ee/weever/

I noticed that after installing Weever, any comments that are Closed status in EE are now appearing on our site. I’m guessing this is related to Weever and therefore isn’t supported by EE, but is there anything else I can check?

Closed comments should not appear right? Some of them are nasty spam and I’m deleting them now, but am afraid they will continue.

Thanks, Scott

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

I’ve not used the Weever extension so not exactly sure what it does but are you able to disable it and still have the commenting system work and show the existing comments without it?

Might be good to check if the comments still show up without it enabled. Failing that I would create a new test template and just use stock ExpressionEngine tags to show your comment entries and see if they still show up then. If they do then you may have something else going on in your system. If not then I would suggest that getting in touch with the author of the extension would be your best bet here.

If you can check the comments system though without the extension just to rule out ExpressionEngine then that I think would be your best first bet.

Best wishes,

Mark

       
Ingmar Greil's avatar
Ingmar Greil
29,243 posts
16 years ago
Ingmar Greil's avatar Ingmar Greil

As this is not a first party offering, I am moving this to the plugins forum.

       
scottystang's avatar
scottystang
106 posts
16 years ago
scottystang's avatar scottystang

Thanks guys. I just manually deleted all Closed comments (almost 99% of them were spam).

Mark, great advice on creating a test template to show comment entries. I can also toggle Weever on/off to test that way, good idea.

I’ll try some things and check back in, thanks.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen
Mark, great advice on creating a test template to show comment entries. I can also toggle Weever on/off to test that way, good idea. I’ll try some things and check back in, thanks.

No problem. Let us know what you come up with.

       
scottystang's avatar
scottystang
106 posts
16 years ago
scottystang's avatar scottystang

This may also help. Weever suggest “hacking” the EE file mod.comment.php. Here’s the snippet I had to adjust, maybe something here is wacky?

/*
        Begin Weever Hack */
        
        if ($TMPL->fetch_param('weever') == 'on')
        {
            // -------------------------------------------
            // 'comment_entries_modify_wsql' hook.
            //  - Add conditions to the WHERE clause
            //
            if ($EXT->active_hook('comment_entries_modify_wsql') === TRUE)
            {
                $w_sql = $EXT->call_extension('comment_entries_modify_wsql', $w_sql, $entry_id);
                if ($EXT->end_script === TRUE) return;
            }
            //
            // -------------------------------------------
        
            $query = $DB->query("
                SELECT comment_date, comment_id
                FROM exp_comments
                WHERE entry_id = '".$DB->escape_str($entry_id)."'".
                $w_sql."
                ORDER BY ".$order_by
                );
        }
        else
        {

            if ( ! $dynamic)
            {
                // When we are only showing comments and it is not based on an entry id or url title
                // in the URL, we can make the query much more efficient and save some work.
            
                if ($show_trackbacks === FALSE)
                {
                    $this_page = ($current_page == '' || ($limit > 1 AND $current_page == 1)) ? 0 : $current_page;
                    $this_sort = (strtolower($sort) == 'desc') ? 'DESC' : 'ASC';
            
                    $sql = "SELECT comment_date, comment_id FROM exp_comments 
                            WHERE status = 'o' ".$w_sql." 
                            ORDER BY ".$order_by." ".$this_sort."
                            LIMIT {$this_page}, ".$limit;
                    
                    $query = $DB->query($sql);
                    
                    $count_query = $DB->query("SELECT COUNT(*) AS count FROM exp_comments WHERE status = 'o' ".$w_sql);
                    
                    $total_rows = $count_query->row['count'];
                }
                else
                {
                    $sql = "SELECT comment_date, comment_id FROM exp_comments WHERE status = 'o' ".$w_sql." ORDER BY ".$order_by;        
                }
                
                $query = $DB->query($sql);
            }
            else
            {
                $query = $DB->query("SELECT comment_date, comment_id FROM exp_comments WHERE entry_id = '".$DB->escape_str($entry_id)."' AND status = 'o' ORDER BY ".$order_by);    
            }
        
        }
        /*
        End Weever Hack */
       
scottystang's avatar
scottystang
106 posts
16 years ago
scottystang's avatar scottystang

Ok, I created a test template that displays all the comments in my weblog. I Closed one of my comments and it did not display using the default EE comment entries tag. However, that same comment did appear in my other template where I have Weever turned on. So my EE comment entries is not the issue.

Next I’ll try toggling Weever on/off to see if that has an affect.

       
scottystang's avatar
scottystang
106 posts
16 years ago
scottystang's avatar scottystang

Update. If I toggle Weever off (either by disabling it in EE extensions or through the code weever=”off”) the Closed comment still shows up. However, if I revert back to the EE original file mod.comment.php, the Closed comment does NOT appear and Weever works ok. The “hack” is highly recommended, but not if it’s buggy!

Any way to strengthen the “hack” to not break EE comments? Maybe I can do without the hack since we don’t get that many comments?

http://studio625.com/ee/weever/installation_and_setup/

       
Lisa Wess's avatar
Lisa Wess
20,502 posts
16 years ago
Lisa Wess's avatar Lisa Wess

Have you spoken with the author? Mr. Wilson is usually great about supporting his add-ons. =)

       
scottystang's avatar
scottystang
106 posts
16 years ago
scottystang's avatar scottystang

Yes, I emailed him about how the “hack” to mod.comment.php is causing the issue of Closed comments showing up (at least for me). We’re working on it, will keep this post updated.

       
scottystang's avatar
scottystang
106 posts
16 years ago
scottystang's avatar scottystang

So I’m not going to hack the mod.comment.php in order to keep Closed comments from appearing. However, I now seem to have another issue.

A non-logged in user cannot post a comment without the comment either being held for moderation or the “can’t post comment at this time” message appearing. However, when I log in and post a comment everything works fine. My guess is this is also related to the Weever extension, but is there anything other test I can try to debug this issue?

Maybe I can use a test weblog to try and post comments as a non-logged in user.

Update: The specific error I get after trying to submit a comment is the following.

The form you submitted contained the following errors

* Your input cannot be processed right now, so it will be moderated first.

Return to Previous Page

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.