trace through the threaded conversation spaghetti to bring back a sane looking network page
This commit is contained in:
parent
7c047bea33
commit
05e08cb5d2
@ -51,6 +51,7 @@ class Item extends BaseObject {
|
|||||||
// FIXME - base this on observer permissions
|
// FIXME - base this on observer permissions
|
||||||
$this->writable = ((local_user() && $channel['channel_hash'] === $item['owner_xchan']) ? true : false);
|
$this->writable = ((local_user() && $channel['channel_hash'] === $item['owner_xchan']) ? true : false);
|
||||||
|
|
||||||
|
|
||||||
$ssl_state = ((local_user()) ? true : false);
|
$ssl_state = ((local_user()) ? true : false);
|
||||||
$this->redirect_url = $a->get_baseurl($ssl_state) . '/redir/' . $this->get_data_value('cid') ;
|
$this->redirect_url = $a->get_baseurl($ssl_state) . '/redir/' . $this->get_data_value('cid') ;
|
||||||
|
|
||||||
@ -474,6 +475,8 @@ class Item extends BaseObject {
|
|||||||
private function is_writable() {
|
private function is_writable() {
|
||||||
$conv = $this->get_conversation();
|
$conv = $this->get_conversation();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
if($conv) {
|
if($conv) {
|
||||||
// This will allow us to comment on wall-to-wall items owned by our friends
|
// This will allow us to comment on wall-to-wall items owned by our friends
|
||||||
// and community forums even if somebody else wrote the post.
|
// and community forums even if somebody else wrote the post.
|
||||||
|
@ -660,7 +660,6 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr
|
|||||||
'thread_level' => $thread_level,
|
'thread_level' => $thread_level,
|
||||||
);
|
);
|
||||||
|
|
||||||
logger('tmp_item: ' . print_r($tmp_item,true));
|
|
||||||
$arr = array('item' => $item, 'output' => $tmp_item);
|
$arr = array('item' => $item, 'output' => $tmp_item);
|
||||||
call_hooks('display_item', $arr);
|
call_hooks('display_item', $arr);
|
||||||
|
|
||||||
@ -803,6 +802,10 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') {
|
|||||||
|
|
||||||
$page_dropping = ((local_user() && local_user() == $profile_owner) ? true : false);
|
$page_dropping = ((local_user() && local_user() == $profile_owner) ? true : false);
|
||||||
|
|
||||||
|
if(! feature_enabled($profile_owner,'multi_delete'))
|
||||||
|
$page_dropping = false;
|
||||||
|
|
||||||
|
|
||||||
$channel = $a->get_channel();
|
$channel = $a->get_channel();
|
||||||
$observer = $a->get_observer();
|
$observer = $a->get_observer();
|
||||||
|
|
||||||
@ -950,7 +953,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') {
|
|||||||
'tags' => template_escape($tags),
|
'tags' => template_escape($tags),
|
||||||
'hashtags' => template_escape($hashtags),
|
'hashtags' => template_escape($hashtags),
|
||||||
'mentions' => template_escape($mentions),
|
'mentions' => template_escape($mentions),
|
||||||
'txt_cats' => t('Categories:'),
|
'txt_cats' => t('Categories:'),
|
||||||
'txt_folders' => t('Filed under:'),
|
'txt_folders' => t('Filed under:'),
|
||||||
'has_cats' => ((count($categories)) ? 'true' : ''),
|
'has_cats' => ((count($categories)) ? 'true' : ''),
|
||||||
'has_folders' => ((count($folders)) ? 'true' : ''),
|
'has_folders' => ((count($folders)) ? 'true' : ''),
|
||||||
@ -995,8 +998,6 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') {
|
|||||||
{
|
{
|
||||||
// Normal View
|
// Normal View
|
||||||
|
|
||||||
$page_template = get_markup_template("threaded_conversation.tpl");
|
|
||||||
|
|
||||||
require_once('include/ConversationObject.php');
|
require_once('include/ConversationObject.php');
|
||||||
require_once('include/ItemObject.php');
|
require_once('include/ItemObject.php');
|
||||||
|
|
||||||
@ -1023,8 +1024,13 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$item['pagedrop'] = $page_dropping;
|
$item['pagedrop'] = $page_dropping;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if($item['id'] == $item['parent']) {
|
if($item['id'] == $item['parent']) {
|
||||||
$item_object = new Item($item);
|
$item_object = new Item($item);
|
||||||
$conv->add_thread($item_object);
|
$conv->add_thread($item_object);
|
||||||
@ -1036,9 +1042,22 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') {
|
|||||||
logger('[ERROR] conversation : Failed to get template data.', LOGGER_DEBUG);
|
logger('[ERROR] conversation : Failed to get template data.', LOGGER_DEBUG);
|
||||||
$threads = array();
|
$threads = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if($page_mode === 'traditional' || $page_mode === 'preview') {
|
||||||
|
$page_template = get_markup_template("threaded_conversation.tpl");
|
||||||
|
}
|
||||||
|
elseif($update) {
|
||||||
|
$page_template = get_markup_template("convobj.tpl");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$page_template = get_markup_template("conv_frame.tpl");
|
||||||
|
$threads = null;
|
||||||
|
}
|
||||||
|
|
||||||
$o = replace_macros($page_template, array(
|
$o = replace_macros($page_template, array(
|
||||||
'$baseurl' => $a->get_baseurl($ssl_state),
|
'$baseurl' => $a->get_baseurl($ssl_state),
|
||||||
'$live_update' => $live_update_div,
|
'$live_update' => $live_update_div,
|
||||||
|
@ -302,7 +302,7 @@ function updateConvItems(mode,data) {
|
|||||||
if(mode === 'update') {
|
if(mode === 'update') {
|
||||||
prev = 'threads-begin';
|
prev = 'threads-begin';
|
||||||
|
|
||||||
$('.thread-wrapper',data).each(function() {
|
$('.thread-wrapper.toplevel_item',data).each(function() {
|
||||||
var ident = $(this).attr('id');
|
var ident = $(this).attr('id');
|
||||||
|
|
||||||
if($('#' + ident).length == 0 && profile_page == 1) {
|
if($('#' + ident).length == 0 && profile_page == 1) {
|
||||||
@ -331,7 +331,7 @@ function updateConvItems(mode,data) {
|
|||||||
}
|
}
|
||||||
if(mode === 'append') {
|
if(mode === 'append') {
|
||||||
next = 'threads-end';
|
next = 'threads-end';
|
||||||
$('.thread-wrapper',data).each(function() {
|
$('.thread-wrapper.toplevel_item',data).each(function() {
|
||||||
var ident = $(this).attr('id');
|
var ident = $(this).attr('id');
|
||||||
|
|
||||||
if($('#' + ident).length == 0) {
|
if($('#' + ident).length == 0) {
|
||||||
@ -359,7 +359,7 @@ function updateConvItems(mode,data) {
|
|||||||
|
|
||||||
prev = 'threads-begin';
|
prev = 'threads-begin';
|
||||||
|
|
||||||
$('.thread-wrapper',data).each(function() {
|
$('.thread-wrapper.toplevel_item',data).each(function() {
|
||||||
var ident = $(this).attr('id');
|
var ident = $(this).attr('id');
|
||||||
|
|
||||||
if($('#' + ident).length == 0 && profile_page == 1) {
|
if($('#' + ident).length == 0 && profile_page == 1) {
|
||||||
|
@ -1 +1 @@
|
|||||||
2012-11-27.152
|
2012-11-28.153
|
||||||
|
@ -98,24 +98,18 @@
|
|||||||
<div class="wall-item-like $item.indent" id="wall-item-like-$item.id">$item.showlike</div>
|
<div class="wall-item-like $item.indent" id="wall-item-like-$item.id">$item.showlike</div>
|
||||||
<div class="wall-item-dislike $item.indent" id="wall-item-dislike-$item.id">$item.showdislike</div>
|
<div class="wall-item-dislike $item.indent" id="wall-item-dislike-$item.id">$item.showdislike</div>
|
||||||
|
|
||||||
{{ if $item.threaded }}
|
|
||||||
{{ if $item.comment }}
|
|
||||||
<div class="wall-item-comment-wrapper $item.indent" >
|
|
||||||
$item.comment
|
|
||||||
</div>
|
|
||||||
{{ endif }}
|
|
||||||
{{ endif }}
|
|
||||||
|
|
||||||
<div class="wall-item-outside-wrapper-end $item.indent" ></div>
|
<div class="wall-item-outside-wrapper-end $item.indent" ></div>
|
||||||
</div>
|
</div>
|
||||||
|
{{ if $item.toplevel }}
|
||||||
{{ for $item.children as $item }}
|
{{ for $item.children as $item }}
|
||||||
{{ inc $item.template }}{{ endinc }}
|
{{ inc $item.template }}{{ endinc }}
|
||||||
{{ endfor }}
|
{{ endfor }}
|
||||||
|
{{ endif }}
|
||||||
|
|
||||||
{{ if $item.flatten }}
|
|
||||||
<div class="wall-item-comment-wrapper" >
|
<div class="wall-item-comment-wrapper" >
|
||||||
$item.comment
|
$item.comment
|
||||||
</div>
|
</div>
|
||||||
{{ endif }}
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{{if $item.comment_lastcollapsed}}</div>{{endif}}
|
{{if $item.comment_lastcollapsed}}</div>{{endif}}
|
||||||
|
4
view/tpl/convobj.tpl
Normal file
4
view/tpl/convobj.tpl
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{{ for $threads as $item }}
|
||||||
|
{{ inc $item.template }}{{ endinc }}
|
||||||
|
{{ endfor }}
|
||||||
|
|
Reference in New Issue
Block a user