From 3b6b0eaa8ba8f59c70f66a6c92888f9ff2d5b41b Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 24 Oct 2011 15:47:17 -0700 Subject: [PATCH] social tag - add UI --- boot.php | 2 +- include/conversation.php | 3 +++ include/text.php | 10 +++++++--- mod/like.php | 3 ++- mod/tagger.php | 7 ++++--- view/jot-header.tpl | 13 +++++++++++++ view/theme/duepuntozero/style.css | 5 +++++ view/theme/duepuntozero/wall_item.tpl | 1 + view/wall_item.tpl | 1 + 9 files changed, 37 insertions(+), 8 deletions(-) diff --git a/boot.php b/boot.php index 86b219dc2b..143d850a9a 100644 --- a/boot.php +++ b/boot.php @@ -8,7 +8,7 @@ require_once("include/pgettext.php"); require_once('include/nav.php'); define ( 'FRIENDIKA_PLATFORM', 'Free Friendika'); -define ( 'FRIENDIKA_VERSION', '2.3.1143' ); +define ( 'FRIENDIKA_VERSION', '2.3.1144' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); define ( 'DB_UPDATE_VERSION', 1098 ); diff --git a/include/conversation.php b/include/conversation.php index 29fa779024..dec70c1a95 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -466,6 +466,8 @@ function conversation(&$a, $items, $mode, $update) { 'classdo' => (($item['starred']) ? "hidden" : ""), 'classundo' => (($item['starred']) ? "" : "hidden"), 'starred' => t('starred'), + 'tagger' => t("add tag"), + 'classtagger' => "", ); } @@ -747,6 +749,7 @@ function status_editor($a,$x, $notes_cid = 0) { '$linkurl' => t('Please enter a link URL:'), '$vidurl' => t("Please enter a video link/URL:"), '$audurl' => t("Please enter an audio link/URL:"), + '$term' => t('Tag term:'), '$whereareu' => t('Where are you right now?'), '$title' => t('Enter a title for this item') )); diff --git a/include/text.php b/include/text.php index ca8dc5ac3b..ba6c2531fb 100644 --- a/include/text.php +++ b/include/text.php @@ -751,7 +751,9 @@ function prepare_body($item,$attach = false) { $s = prepare_text($item['body']); - call_hooks('prepare_body', $s); + $prep_arr = array('item' => $item, 'html' => $s); + call_hooks('prepare_body', $prep_arr); + $s = $prep_arr['html']; if(! $attach) return $s; @@ -784,8 +786,10 @@ function prepare_body($item,$attach = false) { } $s .= '
'; } - call_hooks('prepare_body_final', $s); - return $s; + + $prep_arr = array('item' => $item, 'html' => $s); + call_hooks('prepare_body_final', $prep_arr); + return $prep_arr['html']; }} diff --git a/mod/like.php b/mod/like.php index 5c3dd323ec..6b97fafb56 100644 --- a/mod/like.php +++ b/mod/like.php @@ -197,5 +197,6 @@ EOT; proc_run('php',"include/notifier.php","like","$post_id"); - return; // NOTREACHED + killme(); +// return; // NOTREACHED } \ No newline at end of file diff --git a/mod/tagger.php b/mod/tagger.php index dd4b8ffea1..4127aaadde 100644 --- a/mod/tagger.php +++ b/mod/tagger.php @@ -22,7 +22,6 @@ function tagger_content(&$a) { $r = q("SELECT * FROM `item` WHERE `id` = '%s' LIMIT 1", - dbesc($item_id), dbesc($item_id) ); @@ -43,8 +42,8 @@ function tagger_content(&$a) { $blocktags = $r[0]['blocktags']; } -// if(local_user() != $owner_uid) -// return; + if(local_user() != $owner_uid) + return; if(remote_user()) { $r = q("select * from contact where id = %d AND `uid` = %d limit 1", @@ -189,6 +188,8 @@ EOT; proc_run('php',"include/notifier.php","tag","$post_id"); + killme(); + return; // NOTREACHED diff --git a/view/jot-header.tpl b/view/jot-header.tpl index 22bd0aa5b2..b067124072 100644 --- a/view/jot-header.tpl +++ b/view/jot-header.tpl @@ -214,6 +214,19 @@ function initEditor(cb){ } } + function itemTag(id) { + $('#like-rotator-' + id).show(); + reply = prompt("$term"); + if(reply && reply.length) { + reply.replace('#',''); + if(reply.length) { + $.get('tagger/' + id + '?term=' + reply, function(data) { + $('#like-rotator-' + id).hide(); + }); + } + } + } + function jotClearLocation() { $('#jot-coord').val(''); $('#profile-nolocation-wrapper').hide(); diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index 6f452cebcc..378e0da1e9 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -958,6 +958,11 @@ input#dfrn-url { margin-left: 10px; float: left; } +.tag-item { + margin-left: 10px; + float: left; +} + .wall-item-links-wrapper { float: left; diff --git a/view/theme/duepuntozero/wall_item.tpl b/view/theme/duepuntozero/wall_item.tpl index d264d39994..3a4a497293 100644 --- a/view/theme/duepuntozero/wall_item.tpl +++ b/view/theme/duepuntozero/wall_item.tpl @@ -49,6 +49,7 @@ {{ if $star }} + {{ endif }}
diff --git a/view/wall_item.tpl b/view/wall_item.tpl index cec5e54048..ef822750a5 100644 --- a/view/wall_item.tpl +++ b/view/wall_item.tpl @@ -40,6 +40,7 @@ {{ if $star }} $star.do $star.undo + $star.tagger {{ endif }} {{ if $vote }}