X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fconversation.php;h=e659ca04d93e44b8c006755cccc2142aa538721c;hb=74caf1a4a745643312ab4ee2bf28d7e82c9e1350;hp=1de77feb1b1aec9c14dd0281a83abd7ece7c4de3;hpb=999c3439e6897525ff23bcbac9beb6a61f4bb421;p=friendica.git diff --git a/include/conversation.php b/include/conversation.php index 1de77feb1b..e659ca04d9 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -369,7 +369,7 @@ if(!function_exists('conversation')) { function conversation(&$a, $items, $mode, $update, $preview = false) { - require_once('bbcode.php'); + require_once('include/bbcode.php'); $ssl_state = ((local_user()) ? true : false); @@ -581,33 +581,54 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { list($categories, $folders) = get_cats_and_terms($item); + if($a->theme['template_engine'] === 'internal') { + $profile_name_e = template_escape($profile_name); + $item['title_e'] = template_escape($item['title']); + $body_e = template_escape($body); + $tags_e = template_escape($tags); + $hashtags_e = template_escape($hashtags); + $mentions_e = template_escape($mentions); + $location_e = template_escape($location); + $owner_name_e = template_escape($owner_name); + } + else { + $profile_name_e = $profile_name; + $item['title_e'] = $item['title']; + $body_e = $body; + $tags_e = $tags; + $hashtags_e = $hashtags; + $mentions_e = $mentions; + $location_e = $location; + $owner_name_e = $owner_name; + } + $tmp_item = array( 'template' => $tpl, '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'])), 'profile_url' => $profile_link, 'item_photo_menu' => item_photo_menu($item), - 'name' => template_escape($profile_name), + 'name' => $profile_name_e, 'sparkle' => $sparkle, 'lock' => $lock, 'thumb' => $profile_avatar, - 'title' => template_escape($item['title']), - 'body' => template_escape($body), - 'tags' => template_escape($tags), - 'hashtags' => template_escape($hashtags), - 'mentions' => template_escape($mentions), + 'title' => $item['title_e'], + 'body' => $body_e, + 'tags' => $tags_e, + 'hashtags' => $hashtags_e, + 'mentions' => $mentions_e, 'txt_cats' => t('Categories:'), 'txt_folders' => t('Filed under:'), 'has_cats' => ((count($categories)) ? 'true' : ''), 'has_folders' => ((count($folders)) ? 'true' : ''), 'categories' => $categories, 'folders' => $folders, - 'text' => strip_tags(template_escape($body)), + 'text' => strip_tags($body_e), 'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'), 'ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])), - 'location' => template_escape($location), + 'location' => $location_e, 'indent' => '', - 'owner_name' => template_escape($owner_name), + 'owner_name' => $owner_name_e, 'owner_url' => $owner_url, 'owner_photo' => $owner_photo, 'plink' => get_plink($item), @@ -686,7 +707,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { '$mode' => $mode, '$user' => $a->user, '$threads' => $threads, - '$dropping' => ($page_dropping?t('Delete Selected Items'):False), + '$dropping' => ($page_dropping && feature_enabled(local_user(),'multi_delete') ? t('Delete Selected Items') : False), )); return $o; @@ -856,12 +877,22 @@ function format_like($cnt,$arr,$type,$id) { if($cnt == 1) $o .= (($type === 'like') ? sprintf( t('%s likes this.'), $arr[0]) : sprintf( t('%s doesn\'t like this.'), $arr[0])) . EOL ; else { - $spanatts = 'class="fakelink" onclick="openClose(\'' . $type . 'list-' . $id . '\');"'; - $o .= (($type === 'like') ? - sprintf( t('%2$d people like this.'), $spanatts, $cnt) - : - sprintf( t('%2$d people don\'t like this.'), $spanatts, $cnt) ); - $o .= EOL ; + $spanatts = "class=\"fakelink\" onclick=\"openClose('{$type}list-$id');\""; + switch($type) { + case 'like': + $phrase = sprintf( t('%2$d people like this'), $spanatts, $cnt); + break; + case 'dislike': + $phrase = sprintf( t('%2$d people don\'t like this'), $spanatts, $cnt); + break; + } + $phrase .= EOL ; + $o .= replace_macros(get_markup_template('voting_fakelink.tpl'), array( + '$phrase' => $phrase, + '$type' => $type, + '$id' => $id + )); + $total = count($arr); if($total >= MAX_LIKERS) $arr = array_slice($arr, 0, MAX_LIKERS - 1); @@ -885,11 +916,14 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) { $o = ''; - $geotag = (($x['allow_location']) ? get_markup_template('jot_geotag.tpl') : ''); + $geotag = (($x['allow_location']) ? replace_macros(get_markup_template('jot_geotag.tpl'), array()) : ''); - $plaintext = false; - if(local_user() && intval(get_pconfig(local_user(),'system','plaintext'))) - $plaintext = true; +/* $plaintext = false; + if( local_user() && (intval(get_pconfig(local_user(),'system','plaintext')) || !feature_enabled(local_user(),'richtext')) ) + $plaintext = true;*/ + $plaintext = true; + if( local_user() && feature_enabled(local_user(),'richtext') ) + $plaintext = false; $tpl = get_markup_template('jot-header.tpl'); $a->page['htmlhead'] .= replace_macros($tpl, array( @@ -958,7 +992,7 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) { if($notes_cid) $jotnets .= ''; - $tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins)); +// $tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins)); $o .= replace_macros($tpl,array( '$return_path' => $a->query_string, @@ -981,7 +1015,7 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) { '$title' => "", '$placeholdertitle' => t('Set title'), '$category' => "", - '$placeholdercategory' => t('Categories (comma-separated list)'), + '$placeholdercategory' => (feature_enabled(local_user(),'categories') ? t('Categories (comma-separated list)') : ''), '$wait' => t('Please wait'), '$permset' => t('Permission settings'), '$shortpermset' => t('permissions'), @@ -1000,7 +1034,8 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) { '$acl' => $x['acl'], '$bang' => $x['bang'], '$profile_uid' => $x['profile_uid'], - '$preview' => t('Preview'), + '$preview' => ((feature_enabled($x['profile_uid'],'preview')) ? t('Preview') : ''), + '$jotplugins' => $jotplugins, '$sourceapp' => t($a->sourcename), '$cancel' => t('Cancel'), '$rand_num' => random_digits(12)