mirror of
https://github.com/e107inc/e107.git
synced 2025-07-12 18:46:20 +02:00
Preparation for comment pagination
This commit is contained in:
@ -881,8 +881,6 @@ class comment
|
|||||||
* @param unknown_type $subject
|
* @param unknown_type $subject
|
||||||
* @param unknown_type $rate
|
* @param unknown_type $rate
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
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
|
||||||
@ -897,6 +895,7 @@ class comment
|
|||||||
if ($this->getCommentPermissions() === FALSE) return;
|
if ($this->getCommentPermissions() === FALSE) return;
|
||||||
|
|
||||||
|
|
||||||
|
// ------------- TODO move the 'listing' into separate function so that ajax can access it easily.
|
||||||
|
|
||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
$type = $this->getCommentType($table);
|
$type = $this->getCommentType($table);
|
||||||
@ -917,21 +916,11 @@ class comment
|
|||||||
$query = "SELECT c.*, u.*, ue.*, r.* FROM #comments AS c
|
$query = "SELECT c.*, u.*, ue.*, r.* FROM #comments AS c
|
||||||
LEFT JOIN #user AS u ON c.comment_author_id = u.user_id
|
LEFT JOIN #user AS u ON c.comment_author_id = u.user_id
|
||||||
LEFT JOIN #user_extended AS ue ON c.comment_author_id = ue.user_extended_id
|
LEFT JOIN #user_extended AS ue ON c.comment_author_id = ue.user_extended_id
|
||||||
|
LEFT JOIN #rate AS r ON c.comment_id = r.rate_itemid AND r.rate_table = 'comments' ";
|
||||||
LEFT JOIN #rate AS r ON c.comment_id = r.rate_itemid AND r.rate_table = 'comments'
|
|
||||||
";
|
|
||||||
|
|
||||||
|
|
||||||
$query .= "WHERE c.comment_item_id='".intval($id)."' AND c.comment_type='".$tp->toDB($type, true)."'
|
$query .= "WHERE c.comment_item_id='".intval($id)."' AND c.comment_type='".$tp->toDB($type, true)."'
|
||||||
|
|
||||||
|
|
||||||
ORDER BY c.comment_datestamp ".$sort;
|
ORDER BY c.comment_datestamp ".$sort;
|
||||||
}
|
}
|
||||||
|
|
||||||
// AND (c.comment_blocked = 0 OR (c.comment_blocked > 0 AND c.comment_author_id = ".intval(USERID)."))
|
|
||||||
|
|
||||||
// TODO Preference for sort-order.
|
|
||||||
|
|
||||||
|
|
||||||
$text = "";
|
$text = "";
|
||||||
$comment = '';
|
$comment = '';
|
||||||
@ -956,7 +945,6 @@ class comment
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$lock = $row['comment_lock'];
|
$lock = $row['comment_lock'];
|
||||||
// $subject = $tp->toHTML($subject);
|
// $subject = $tp->toHTML($subject);
|
||||||
if ($pref['nested_comments'])
|
if ($pref['nested_comments'])
|
||||||
@ -967,22 +955,24 @@ class comment
|
|||||||
{
|
{
|
||||||
$text .= $this->render_comment($row, $table, $action, $id, $width, $tp->toHTML($subject), $rate);
|
$text .= $this->render_comment($row, $table, $action, $id, $width, $tp->toHTML($subject), $rate);
|
||||||
}
|
}
|
||||||
}
|
} // end loop
|
||||||
|
|
||||||
|
} // end if
|
||||||
|
|
||||||
|
|
||||||
// if ($tablerender)
|
|
||||||
// {
|
|
||||||
// $text = $ns->tablerender(COMLAN_99, $text, '', TRUE);
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (ADMIN && getperms("B"))
|
// -------------------------------------------------------
|
||||||
|
|
||||||
|
if($this->totalComments && getperms("B"))
|
||||||
{
|
{
|
||||||
$modcomment = "<div class='comment-moderate'>";
|
$modcomment = "<div class='comment-moderate'>";
|
||||||
// $modcomment .= "<a href='".e_ADMIN_ABS."modcomment.php?$table.$id'>".COMLAN_314."</a>";
|
// $modcomment .= "<a href='".e_ADMIN_ABS."modcomment.php?$table.$id'>".COMLAN_314."</a>";
|
||||||
$modcomment .= "<a href='".e_ADMIN_ABS."comment.php?searchquery={$id}&filter_options=comment_type__".$this->getCommentType($table)."'>".COMLAN_314."</a>";
|
$modcomment .= "<a href='".e_ADMIN_ABS."comment.php?searchquery={$id}&filter_options=comment_type__".$this->getCommentType($table)."'>".COMLAN_314."</a>";
|
||||||
$modcomment .= "</div>";
|
$modcomment .= "</div>";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
// ---------------------------
|
||||||
|
|
||||||
if ($lock != '1')
|
if ($lock != '1')
|
||||||
{
|
{
|
||||||
@ -1028,6 +1018,27 @@ class comment
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function renderComments($table,$id,$from,$options=null)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function recalc_user_comments($id)
|
function recalc_user_comments($id)
|
||||||
{
|
{
|
||||||
global $sql;
|
global $sql;
|
||||||
|
Reference in New Issue
Block a user