From a0d19ffb7241a1c7a4b85e6d0fd58fbb2f718468 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Sun, 6 Jan 2013 14:42:51 -0700 Subject: implement Smarty3 --- include/ItemObject.php | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'include/ItemObject.php') diff --git a/include/ItemObject.php b/include/ItemObject.php index 45ea6860a..8ae13e0d8 100644 --- a/include/ItemObject.php +++ b/include/ItemObject.php @@ -204,13 +204,28 @@ class Item extends BaseObject { $body = prepare_body($item,true); + if($a->theme['template_engine'] === 'internal') { + $body_e = 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; + $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, - 'body' => $body, - 'text' => strip_tags(template_escape($body)), + 'body' => $body_e, + 'text' => strip_tags($body_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'])), @@ -219,19 +234,19 @@ class Item extends BaseObject { '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, '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, // Item toolbar buttons 'like' => $like, -- cgit v1.2.3 From b4a95460e65dbadaf074a414a9e3d9367e109f19 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Sun, 6 Jan 2013 19:34:54 -0700 Subject: fix show-stopping bugs --- include/ItemObject.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/ItemObject.php') diff --git a/include/ItemObject.php b/include/ItemObject.php index 8ae13e0d8..cb79c180c 100644 --- a/include/ItemObject.php +++ b/include/ItemObject.php @@ -204,7 +204,7 @@ class Item extends BaseObject { $body = prepare_body($item,true); - if($a->theme['template_engine'] === 'internal') { + if($a->get_template_engine() === 'internal') { $body_e = template_escape($body); $name_e = template_escape($profile_name); $title_e = template_escape($item['title']); -- cgit v1.2.3