Upload the following file to your system/extensions/ folder:
Upload the following file to your system/plugins/ folder:
Inside your plugins folder, create a new folder called "weever". Inside that folder upload:
Upload the following file to your system/language/english/ folder, or other language folder as appropriate:
Navigate to the EE control panel's Extensions Manager. (Admin -> Utilities -> Extensions Manger) Find "Weever Extension" in the list of available extensions. Click "Enable".
The plugin is "installed" automatically as long as it is placed correctly in the plugins folder.
To achieve maximum performance from Weever, it is strongly recommended that you make some small changes ("hacks") to an ExpressionEngine file. Here's why: there is currently no way to tell the Comment Module which comments to pull from the database each time it runs. That means the Comment Module has to pull all of the ocmments for a given entry in order to make sure Weever has all of the information it needs. If you don't use pagination, that's not a problem; both the Comment Module and Weever need the same information anyway. But if you use pagination, the information needed by the two systems is different.
Let's illustrate with a comparison. Let's say we have ten comments, and we want to display five comments on each page. In date order (the method used by the Comment Module), this looks like:
In a threaded comment system, the order might look like:
See the problem? With the Comment Module, the first page will consist of comments 1-5. In the threaded model, however, the first five comments are 1, 2, 6, 3, 4. If we don't want a comment "thread" (a comment and all its replies) to break across page boundaries, the situation is even more complex. Thus, without being able to tell the Comment Module exactly which comments we want, we have to have it fetch all 10 comments, then filter from there. That is very inefficient.
The performance improvements brought about by this hack are not inconsequential. On large comment threads the system will avoid having to process a tremendous amount of unnecessary code. Furthermore, when cached data is available, even small comment threads become substantially quicker because large chunks of Weever and the Comment Module can be skipped.
This is called the "WSQL Hack" because it involves a variable called $w_sql. Here's how it works:
$order_by = ($order_by == 'date' OR ...We will begin immediately below that line.
/*
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)and ends
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);
}
Below that chunk, place
} /* End Weever Hack */The final code will look like:
/*
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.
...
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 */