$drop = array(
'dropping' => $dropping,
'pagedrop' => ((feature_enabled($conv->get_profile_owner(),'multi_delete')) ? $item['pagedrop'] : ''),
- 'select' => t('Select'),
+ 'select' => t('Select'),
'delete' => t('Delete'),
);
-
+
$filer = (($conv->get_profile_owner() == local_user()) ? t("save to folder") : false);
$diff_author = ((link_compare($item['url'],$item['author-link'])) ? false : true);
if($sp)
$sparkle = ' sparkle';
else
- $profile_link = zrl($profile_link);
+ $profile_link = zrl($profile_link);
$normalised = normalise_link((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
if(($normalised != 'mailbox') && (x($a->contacts,$normalised)))
$tags=array();
$hashtags = array();
$mentions = array();
- foreach(explode(',',$item['tag']) as $tag){
+
+ $taglist = q("select tag,link from tag where iid=%d", intval($item['id']));
+
+ foreach($taglist as $tag) {
+ $tags[] = substr($tag["tag"], 0, 1)."<a href=\"".$tag["link"]."\" target=\"external-link\">".substr($tag["tag"], 1)."</a>";
+ if (substr($tag["tag"], 0, 1) == "#")
+ $hashtags[] = "#<a href=\"".$tag["link"]."\" target=\"external-link\">".substr($tag["tag"], 1)."</a>";
+ elseif (substr($tag["tag"], 0, 1) == "@")
+ $mentions[] = "@<a href=\"".$tag["link"]."\" target=\"external-link\">".substr($tag["tag"], 1)."</a>";
+ }
+
+ /*foreach(explode(',',$item['tag']) as $tag){
$tag = trim($tag);
if ($tag!="") {
$t = bbcode($tag);
elseif($t[0] == '@')
$mentions[] = $t;
}
-
- }
+ }*/
$like = ((x($alike,$item['uri'])) ? format_like($alike[$item['uri']],$alike[$item['uri'] . '-l'],'like',$item['uri']) : '');
$dislike = ((x($dlike,$item['uri'])) ? format_like($dlike[$item['uri']],$dlike[$item['uri'] . '-l'],'dislike',$item['uri']) : '');
localize_item($item);
+ if ($item["postopts"]) {
+ //$langdata = explode(";", $item["postopts"]);
+ //$langstr = substr($langdata[0], 5)." (".round($langdata[1]*100, 1)."%)";
+ $langstr = "";
+ if (substr($item["postopts"], 0, 5) == "lang=") {
+ $postopts = substr($item["postopts"], 5);
+
+ $languages = explode(":", $postopts);
+
+ if (sizeof($languages) == 1) {
+ $languages = array();
+ $languages[] = $postopts;
+ }
+
+ foreach ($languages as $language) {
+ $langdata = explode(";", $language);
+ if ($langstr != "")
+ $langstr .= ", ";
+
+ //$langstr .= $langdata[0]." (".round($langdata[1]*100, 1)."%)";
+ $langstr .= round($langdata[1]*100, 1)."% ".$langdata[0];
+ }
+ }
+ }
+
$body = prepare_body($item,true);
- list($categories, $folders) = get_cats_and_terms($item);
+ list($categories, $folders) = get_cats_and_terms($item);
+
+ if($a->theme['template_engine'] === 'internal') {
+ $body_e = template_escape($body);
+ $text_e = strip_tags(template_escape($body));
+ $name_e = template_escape($profile_name);
+ $title_e = template_escape($item['title']);
+ $location_e = template_escape($location);
+ $owner_name_e = template_escape($this->get_owner_name());
+ }
+ else {
+ $body_e = $body;
+ $text_e = strip_tags($body);
+ $name_e = $profile_name;
+ $title_e = $item['title'];
+ $location_e = $location;
+ $owner_name_e = $this->get_owner_name();
+ }
$tmp_item = array(
'template' => $this->get_template(),
-
+
'type' => implode("",array_slice(explode("/",$item['verb']),-1)),
'tags' => $tags,
'hashtags' => $hashtags,
'has_cats' => ((count($categories)) ? 'true' : ''),
'has_folders' => ((count($folders)) ? 'true' : ''),
'categories' => $categories,
- 'folders' => $folders,
- 'body' => template_escape($body),
- 'text' => strip_tags(template_escape($body)),
+ 'folders' => $folders,
+ 'body' => $body_e,
+ 'text' => $text_e,
'id' => $this->get_id(),
'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])),
'olinktitle' => sprintf( t('View %s\'s profile @ %s'), $this->get_owner_name(), ((strlen($item['owner-link'])) ? $item['owner-link'] : $item['url'])),
'vwall' => t('via Wall-To-Wall:'),
'profile_url' => $profile_link,
'item_photo_menu' => item_photo_menu($item),
- 'name' => template_escape($profile_name),
+ 'name' => $name_e,
'thumb' => $profile_avatar,
'osparkle' => $osparkle,
'sparkle' => $sparkle,
- 'title' => template_escape($item['title']),
+ 'title' => $title_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'])),
'lock' => $lock,
- 'location' => template_escape($location),
+ 'location' => $location_e,
'indent' => $indent,
'shiny' => $shiny,
'owner_url' => $this->get_owner_url(),
'owner_photo' => $this->get_owner_photo(),
- 'owner_name' => template_escape($this->get_owner_name()),
+ 'owner_name' => $owner_name_e,
'plink' => get_plink($item),
'edpost' => ((feature_enabled($conv->get_profile_owner(),'edit_posts')) ? $edpost : ''),
'isstarred' => $isstarred,
'comment' => $this->get_comment_box($indent),
'previewing' => ($conv->is_preview() ? ' preview ' : ''),
'wait' => t('Please wait'),
- 'thread_level' => $thread_level
+ 'thread_level' => $thread_level,
+ 'postopts' => $langstr
);
$arr = array('item' => $item, 'output' => $tmp_item);
* Set template
*/
private function set_template($name) {
+ $a = get_app();
+
if(!x($this->available_templates, $name)) {
logger('[ERROR] Item::set_template : Template not available ("'. $name .'").', LOGGER_DEBUG);
return false;
}
- $this->template = $this->available_templates[$name];
+
+ if($a->theme['template_engine'] === 'smarty3') {
+ $template_file = get_template_file($a, 'smarty3/' . $this->available_templates[$name]);
+ }
+ else {
+ $template_file = $this->available_templates[$name];
+ }
+ $this->template = $template_file;
}
/**