mirror of
https://github.com/friendica/friendica
synced 2024-12-23 02:40:17 +00:00
Revert "Progress on #1. Comments are now threaded, at least in the database, for normal view."
This reverts commit da1b47a029
.
Useless, comments are already threaded in the database using parent-uri
This commit is contained in:
parent
da1b47a029
commit
2a1657e361
2 changed files with 4 additions and 8 deletions
|
@ -582,9 +582,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$override_comment_box = ((($page_writeable) && ($item_writeable)) ? true : false);
|
$override_comment_box = ((($page_writeable) && ($item_writeable)) ? true : false);
|
||||||
// The comment box should now appear under each writable item, not only at the end of the thread, don't bother with $comments_seen
|
$show_comment_box = ((($page_writeable) && ($item_writeable) && ($comments_seen == $comments[$item['parent']])) ? true : false);
|
||||||
//$show_comment_box = ((($page_writeable) && ($item_writeable) && ($comments_seen == $comments[$item['parent']])) ? true : false);
|
|
||||||
$show_comment_box = ((($page_writeable) && ($item_writeable)) ? true : false);
|
|
||||||
|
|
||||||
|
|
||||||
if(($comments[$item['parent']] > 2) && ($comments_seen <= ($comments[$item['parent']] - 2)) && ($item['gravity'] == 6)) {
|
if(($comments[$item['parent']] > 2) && ($comments_seen <= ($comments[$item['parent']] - 2)) && ($item['gravity'] == 6)) {
|
||||||
|
@ -683,13 +681,12 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(($show_comment_box) || (($show_comment_box == false) && ($override_comment_box == false) && ($item['last-child']))) {
|
if(($show_comment_box) || (($show_comment_box == false) && ($override_comment_box == false) && ($item['last-child']))) {
|
||||||
// The parent is now the item itself, not his parent
|
|
||||||
$comment = replace_macros($cmnt_tpl,array(
|
$comment = replace_macros($cmnt_tpl,array(
|
||||||
'$return_path' => '',
|
'$return_path' => '',
|
||||||
'$jsreload' => (($mode === 'display') ? $_SESSION['return_url'] : ''),
|
'$jsreload' => (($mode === 'display') ? $_SESSION['return_url'] : ''),
|
||||||
'$type' => (($mode === 'profile') ? 'wall-comment' : 'net-comment'),
|
'$type' => (($mode === 'profile') ? 'wall-comment' : 'net-comment'),
|
||||||
'$id' => $item['item_id'],
|
'$id' => $item['item_id'],
|
||||||
'$parent' => $item['item_id'],
|
'$parent' => $item['parent'],
|
||||||
'$qcomment' => $qcomment,
|
'$qcomment' => $qcomment,
|
||||||
'$profile_uid' => $profile_owner,
|
'$profile_uid' => $profile_owner,
|
||||||
'$mylink' => $a->contact['url'],
|
'$mylink' => $a->contact['url'],
|
||||||
|
|
|
@ -77,15 +77,14 @@ function item_post(&$a) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// if this isn't the real parent of the conversation, find it
|
// if this isn't the real parent of the conversation, find it
|
||||||
// We are now threading the comments, the parent may have a parent
|
if($r !== false && count($r)) {
|
||||||
/*if($r !== false && count($r)) {
|
|
||||||
$parid = $r[0]['parent'];
|
$parid = $r[0]['parent'];
|
||||||
if($r[0]['id'] != $r[0]['parent']) {
|
if($r[0]['id'] != $r[0]['parent']) {
|
||||||
$r = q("SELECT * FROM `item` WHERE `id` = `parent` AND `parent` = %d LIMIT 1",
|
$r = q("SELECT * FROM `item` WHERE `id` = `parent` AND `parent` = %d LIMIT 1",
|
||||||
intval($parid)
|
intval($parid)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
||||||
if(($r === false) || (! count($r))) {
|
if(($r === false) || (! count($r))) {
|
||||||
notice( t('Unable to locate original post.') . EOL);
|
notice( t('Unable to locate original post.') . EOL);
|
||||||
|
|
Loading…
Reference in a new issue