From 47edaf9ad79b59d96f908b4501d564e5e63cc210 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 4 Jan 2012 18:03:09 -0800 Subject: [PATCH] dynamic title input box - via fabrixxm --- include/conversation.php | 5 ++++- mod/ping.php | 29 +++++++--------------------- view/jot-header.tpl | 8 ++++++-- view/jot.tpl | 4 +--- view/theme/dispy/jot-header.tpl | 7 +++++++ view/theme/dispy/jot.tpl | 8 ++++---- view/theme/dispy/style.css | 13 +++++++++++++ view/theme/duepuntozero/style.css | 13 +++++++++++++ view/theme/loozah/style.css | 14 ++++++++++++++ view/theme/quattro/jot.tpl | 8 ++++---- view/theme/quattro/quattro.less | 2 ++ view/theme/testbubble/jot-header.tpl | 8 ++++++++ view/theme/testbubble/jot.tpl | 9 +++++---- view/theme/testbubble/style.css | 14 ++++++++++++++ 14 files changed, 102 insertions(+), 40 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index a30a782718..ec1fd4152c 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -812,7 +812,8 @@ function status_editor($a,$x, $notes_cid = 0) { '$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') + '$title' => t('Enter a title for this item'), + '$addtitle' => t('click here to add a title') )); @@ -880,6 +881,8 @@ function status_editor($a,$x, $notes_cid = 0) { '$acl' => $x['acl'], '$bang' => $x['bang'], '$profile_uid' => $x['profile_uid'], + '$addtitle' => t('click here to add a title') + )); return $o; diff --git a/mod/ping.php b/mod/ping.php index 5b9159fa46..df07cb768e 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -7,7 +7,6 @@ function ping_init(&$a) { header("Content-type: text/xml"); echo " "; - $xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">"; if(local_user()){ @@ -18,11 +17,10 @@ function ping_init(&$a) { $dislikes = array(); $friends = array(); $posts = array(); - $cit = array(); $r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`, - `item`.`author-link`, `item`.`author-avatar`, `item`.`created`, `item`.`object`, `item`.`body`, + `item`.`author-link`, `item`.`author-avatar`, `item`.`created`, `item`.`object`, `pitem`.`author-name` as `pname`, `pitem`.`author-link` as `plink` FROM `item` INNER JOIN `item` as `pitem` ON `pitem`.`id`=`item`.`parent` WHERE `item`.`unseen` = 1 AND `item`.`visible` = 1 AND @@ -31,8 +29,6 @@ function ping_init(&$a) { intval(local_user()) ); - - $network = count($r); foreach ($r as $it) { switch($it['verb']){ @@ -53,11 +49,8 @@ function ping_init(&$a) { $friends[] = $it; break; default: - $reg = "|@\[url=".$a->get_baseurl()."/profile/".$a->user['nickname']."|"; if ($it['parent']!=$it['id']) { $comments[] = $it; - } else if(preg_match( $reg, $it['body'])){ - $cit[] = $it; } else { $posts[] = $it; } @@ -93,9 +86,6 @@ function ping_init(&$a) { break; default: if ($it['parent']!=$it['id']) $comments[] = $it; - if(preg_match("/@\[[^]]*\]".$a->user['username']."/", $it['body'])){ - $cit[] = $it; - } } } @@ -128,9 +118,9 @@ function ping_init(&$a) { ); $mail = $mails[0]['total']; - if ($a->config['register_policy'] == REGISTER_APPROVE && is_site_admin()) { - $regs = q("select register.created, contact.name, contact.url, contact.micro from register left join contact on register.uid = contact.uid where contact.self = 1"); - $register = count($regs); + if ($a->config['register_policy'] == REGISTER_APPROVE && is_site_admin()){ + $regs = q("SELECT `contact`.`name`, `contact`.`url`, `contact`.`micro`, `register`.`created`, COUNT(*) as `total` FROM `contact` RIGHT JOIN `register` ON `register`.`uid`=`contact`.`uid` WHERE `contact`.`self`=1"); + $register = $regs[0]['total']; } else { $register = "0"; } @@ -150,12 +140,12 @@ function ping_init(&$a) { $home"; if ($register!=0) echo "$register"; - $tot = $mail+$intro+$register+count($comments)+count($likes)+count($dislikes)+count($friends)+count($posts)+count($tags)+count($cit); + $tot = $mail+$intro+$register+count($comments)+count($likes)+count($dislikes)+count($friends)+count($posts)+count($tags); echo ' '; if ($intro>0){ foreach ($intros as $i) { - echo xmlize( $a->get_baseurl().'/notifications/intros/'.$i['id'], $i['name'], $i['url'], $i['photo'], relative_date($i['datetime']), t("{0} wants to be your friend") ); + echo xmlize( $a->get_baseurl().'/notifications/'.$i['id'], $i['name'], $i['url'], $i['photo'], relative_date($i['datetime']), t("{0} wants to be your friend") ); }; } if ($mail>0){ @@ -191,7 +181,7 @@ function ping_init(&$a) { } if (count($posts)){ foreach ($posts as $i) { - echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), t("{0} posted") ); + echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} posted") ) ); }; } if (count($tags)){ @@ -199,11 +189,6 @@ function ping_init(&$a) { echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} tagged %s's post with #%s"), $i['pname'], $i['tname'] ) ); }; } - if (count($cit)){ - foreach ($cit as $i) { - echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), t("{0} mentioned you in a post") ); - }; - } echo " "; } diff --git a/view/jot-header.tpl b/view/jot-header.tpl index 941a8f3e27..f35cbee175 100644 --- a/view/jot-header.tpl +++ b/view/jot-header.tpl @@ -7,7 +7,7 @@ var textlen = 0; function initEditor(cb){ if (editor==false){ $("#profile-jot-text-loading").show(); -// $("#jot-title").show(); + $("#jot-title-desc").show(); tinyMCE.init({ theme : "advanced", mode : "specific_textareas", @@ -111,7 +111,11 @@ function initEditor(cb){ $(this).val(""); initEditor(); }); - + + $("#jot-title-desc").click(function() { + $("#jot-title-desc").hide(); + $("#jot-title").show(); + }); var uploader = new window.AjaxUpload( 'wall-image-upload', diff --git a/view/jot.tpl b/view/jot.tpl index 83af1ae371..cb4eb64d43 100644 --- a/view/jot.tpl +++ b/view/jot.tpl @@ -14,6 +14,7 @@
+
@@ -46,9 +47,6 @@ -
- -
$jotplugins diff --git a/view/theme/dispy/jot-header.tpl b/view/theme/dispy/jot-header.tpl index 7a1012230f..a3464f3f7a 100644 --- a/view/theme/dispy/jot-header.tpl +++ b/view/theme/dispy/jot-header.tpl @@ -8,6 +8,7 @@ var textlen = 0; function initEditor(cb) { if (editor==false) { $("#profile-jot-text-loading").show(); + $("#jot-title-desc").show(); tinyMCE.init({ theme : "advanced", mode : "specific_textareas", @@ -100,6 +101,12 @@ function initEditor(cb) { $(this).val(""); initEditor(); }); + + $("#jot-title-desc").click(function() { + $("#jot-title-desc").hide(); + $("#jot-title").show(); + }); + var uploader = new window.AjaxUpload( 'wall-image-upload', { action: 'wall_upload/$nickname', diff --git a/view/theme/dispy/jot.tpl b/view/theme/dispy/jot.tpl index a2c883e4be..b340b532b3 100644 --- a/view/theme/dispy/jot.tpl +++ b/view/theme/dispy/jot.tpl @@ -14,8 +14,11 @@ - +
+ + +
@@ -49,9 +52,6 @@ -