mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
Allow for comment-system override. (ie. in theory can now support a Disqus or Facebook commenting plugin if someone wanted to make one)
This commit is contained in:
@@ -165,6 +165,8 @@ class comment
|
|||||||
{
|
{
|
||||||
//rating : boolean, to show rating system in comment
|
//rating : boolean, to show rating system in comment
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$pref = e107::getPref();
|
$pref = e107::getPref();
|
||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
@@ -174,6 +176,11 @@ class comment
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($user_func = e107::getOverride()->check($this,'form_comment'))
|
||||||
|
{
|
||||||
|
return call_user_func($user_func);
|
||||||
|
}
|
||||||
|
|
||||||
// require_once(e_HANDLER."ren_help.php");
|
// require_once(e_HANDLER."ren_help.php");
|
||||||
|
|
||||||
|
|
||||||
@@ -353,6 +360,12 @@ class comment
|
|||||||
*/
|
*/
|
||||||
function render_comment($row, $table, $action, $id, $width, $subject, $addrating = FALSE)
|
function render_comment($row, $table, $action, $id, $width, $subject, $addrating = FALSE)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if ($user_func = e107::getOverride()->check($this,'render_comment'))
|
||||||
|
{
|
||||||
|
return call_user_func($user_func);
|
||||||
|
}
|
||||||
|
|
||||||
//addrating : boolean, to show rating system in rendered comment
|
//addrating : boolean, to show rating system in rendered comment
|
||||||
global $sc_style, $gen;
|
global $sc_style, $gen;
|
||||||
|
|
||||||
@@ -619,11 +632,16 @@ class comment
|
|||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
$sql2 = e107::getDb('sql2');
|
$sql2 = e107::getDb('sql2');
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
$e107cache = e107::getCache();
|
|
||||||
$pref = e107::getPref();
|
$pref = e107::getPref();
|
||||||
|
|
||||||
if ($this->getCommentPermissions() != 'rw') return;
|
if ($this->getCommentPermissions() != 'rw') return;
|
||||||
|
|
||||||
|
if ($user_func = e107::getOverride()->check($this,'enter_comment'))
|
||||||
|
{
|
||||||
|
return call_user_func($user_func);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(!isset($_POST['e-token'])) $_POST['e-token'] = ''; // check posted token
|
if(!isset($_POST['e-token'])) $_POST['e-token'] = ''; // check posted token
|
||||||
if(!e107::getSession()->check(false)) return false; // This will return false on error
|
if(!e107::getSession()->check(false)) return false; // This will return false on error
|
||||||
|
|
||||||
@@ -933,9 +951,12 @@ class comment
|
|||||||
*/
|
*/
|
||||||
function compose_comment($table, $action, $id, $width, $subject, $rate = FALSE, $return = FALSE, $tablerender = TRUE)
|
function compose_comment($table, $action, $id, $width, $subject, $rate = FALSE, $return = FALSE, $tablerender = TRUE)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//compose comment : single call function will render the existing comments and show the form_comment
|
//compose comment : single call function will render the existing comments and show the form_comment
|
||||||
//rate : boolean, to show/hide rating system in comment, default FALSE
|
//rate : boolean, to show/hide rating system in comment, default FALSE
|
||||||
global $e107cache, $totcc;
|
global $totcc;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -943,9 +964,12 @@ class comment
|
|||||||
$ns = e107::getRender();
|
$ns = e107::getRender();
|
||||||
$pref = e107::getPref();
|
$pref = e107::getPref();
|
||||||
|
|
||||||
|
|
||||||
if ($this->getCommentPermissions() === FALSE) return;
|
if ($this->getCommentPermissions() === FALSE) return;
|
||||||
|
|
||||||
|
if ($user_func = e107::getOverride()->check($this,'compose_comment'))
|
||||||
|
{
|
||||||
|
return call_user_func($user_func);
|
||||||
|
}
|
||||||
|
|
||||||
// ------------- TODO move the 'listing' into separate function so that ajax can access it easily.
|
// ------------- TODO move the 'listing' into separate function so that ajax can access it easily.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user