mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Listview/ReplyPreview
* fix links to parent comment * implement go-to-reply redirect
This commit is contained in:
@@ -26,7 +26,7 @@ class AjaxGotocomment extends AjaxHandler
|
|||||||
if (!$this->_get['id'])
|
if (!$this->_get['id'])
|
||||||
return '.'; // go home
|
return '.'; // go home
|
||||||
|
|
||||||
if ($_ = DB::Aowow()->selectRow('SELECT IFNULL(c2.id, c1.id) AS id, IFNULL(c2.type, c1.type) AS type, IFNULL(c2.typeId, c1.typeId) AS typeId FROM ?_comments c1 LEFT JOIN ?_comments c2 ON c1.replyTo = c2.id WHERE c1.id = ?d', $this->_get['id']))
|
if ($_ = DB::Aowow()->selectRow('SELECT IFNULL(c2.`id`, c1.`id`) AS "id", IFNULL(c2.`type`, c1.`type`) AS "type", IFNULL(c2.`typeId`, c1.`typeId`) AS "typeId" FROM ?_comments c1 LEFT JOIN ?_comments c2 ON c1.`replyTo` = c2.`id` WHERE c1.`id` = ?d', $this->_get['id']))
|
||||||
return '?'.Type::getFileString(intVal($_['type'])).'='.$_['typeId'].'#comments:id='.$_['id'].($_['id'] != $this->_get['id'] ? ':reply='.$this->_get['id'] : null);
|
return '?'.Type::getFileString(intVal($_['type'])).'='.$_['typeId'].'#comments:id='.$_['id'].($_['id'] != $this->_get['id'] ? ':reply='.$this->_get['id'] : null);
|
||||||
else
|
else
|
||||||
trigger_error('AjaxGotocomment::handleGoToComment - could not find comment #'.$this->_get['id'], E_USER_ERROR);
|
trigger_error('AjaxGotocomment::handleGoToComment - could not find comment #'.$this->_get['id'], E_USER_ERROR);
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ class CommunityContent
|
|||||||
$c['date'] = $dateFmt ? date(Util::$dateFormatInternal, $c['date']) : intVal($c['date']);
|
$c['date'] = $dateFmt ? date(Util::$dateFormatInternal, $c['date']) : intVal($c['date']);
|
||||||
|
|
||||||
// remove commentid if not looking for replies
|
// remove commentid if not looking for replies
|
||||||
if (empty($params['replies']))
|
if (empty($opt['replies']))
|
||||||
unset($c['commentid']);
|
unset($c['commentid']);
|
||||||
|
|
||||||
// format text for listview
|
// format text for listview
|
||||||
|
|||||||
@@ -89,6 +89,9 @@ switch ($pageCall)
|
|||||||
case 'edit': // guide editor: targeted by QQ fileuploader, detail-page article editor
|
case 'edit': // guide editor: targeted by QQ fileuploader, detail-page article editor
|
||||||
case 'get-description': // guide editor: shorten fulltext into description
|
case 'get-description': // guide editor: shorten fulltext into description
|
||||||
case 'filter': // pre-evaluate filter POST-data; sanitize and forward as GET-data
|
case 'filter': // pre-evaluate filter POST-data; sanitize and forward as GET-data
|
||||||
|
case 'go-to-reply': // find page the reply is on and forward
|
||||||
|
if ($pageCall == 'go-to-reply')
|
||||||
|
$altClass = 'go-to-comment';
|
||||||
case 'go-to-comment': // find page the comment is on and forward
|
case 'go-to-comment': // find page the comment is on and forward
|
||||||
case 'locale': // subdomain-workaround, change the language
|
case 'locale': // subdomain-workaround, change the language
|
||||||
$cleanName = str_replace(['-', '_'], '', ucFirst($altClass ?: $pageCall));
|
$cleanName = str_replace(['-', '_'], '', ucFirst($altClass ?: $pageCall));
|
||||||
|
|||||||
Reference in New Issue
Block a user