fix post preview

This commit is contained in:
friendica 2012-11-03 05:46:56 -07:00
parent 8a983a82ec
commit 358111c76b
2 changed files with 11 additions and 5 deletions

View File

@ -853,7 +853,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') {
if($item['author-link'] && (! $item['author-name']))
$profile_name = $item['author-link'];
$tags=array();
$hashtags = array();
@ -883,6 +883,11 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') {
else
$profile_avatar = ((strlen($item['author-avatar'])) ? $a->get_cached_avatar_image($item['author-avatar']) : $item['thumb']);
$profile_name = $item['author']['xchan_name'];
$profile_link = $item['author']['xchan_url'];
$profile_avatar = $item['author']['xchan_photo_m'];
$locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
call_hooks('render_location',$locate);
@ -923,7 +928,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') {
'template' => $tpl,
'tags' => $tags,
'id' => (($preview) ? 'P0' : $item['item_id']),
'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])),
'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, $profile_url),
'profile_url' => $profile_link,
'item_photo_menu' => item_photo_menu($item),
'name' => template_escape($profile_name),

View File

@ -138,7 +138,6 @@ function item_post(&$a) {
$observer = $a->get_observer();
if(! perm_is_allowed($profile_uid,$observer['xchan_hash'],(($parent) ? 'post_comments' : 'post_wall'))) {
dbg(0);
notice( t('Permission denied.') . EOL) ;
if(x($_REQUEST,'return'))
goaway($a->get_baseurl() . "/" . $return_path );
@ -539,8 +538,10 @@ function item_post(&$a) {
if($preview) {
require_once('include/conversation.php');
// fixme
$o = conversation($a,array(array_merge($contact_record,$datarray)),'search',false,'preview');
$datarray['owner'] = $owner_xchan;
$datarray['author'] = $observer;
$o = conversation($a,array($datarray),'search',false,'preview');
logger('preview: ' . $o, LOGGER_DEBUG);
echo json_encode(array('preview' => $o));
killme();