From 2456174cc905d2d0ae19d21c94fec2c5552322a8 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 23 Aug 2012 20:00:10 -0700 Subject: back to identity creation form --- mod/mood.php | 142 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100755 mod/mood.php (limited to 'mod/mood.php') diff --git a/mod/mood.php b/mod/mood.php new file mode 100755 index 000000000..7a793c71e --- /dev/null +++ b/mod/mood.php @@ -0,0 +1,142 @@ +user['allow_cid']; + $allow_gid = $a->user['allow_gid']; + $deny_cid = $a->user['deny_cid']; + $deny_gid = $a->user['deny_gid']; + } + + $poster = $a->contact; + + $uri = item_new_uri($a->get_hostname(),$uid); + + $action = sprintf( t('%1$s is currently %2$s'), '[url=' . $poster['url'] . ']' . $poster['name'] . '[/url]' , $verbs[$verb]); + + $arr = array(); + + $arr['uid'] = $uid; + $arr['uri'] = $uri; + $arr['parent-uri'] = (($parent_uri) ? $parent_uri : $uri); + $arr['type'] = 'activity'; + $arr['wall'] = 1; + $arr['contact-id'] = $poster['id']; + $arr['owner-name'] = $poster['name']; + $arr['owner-link'] = $poster['url']; + $arr['owner-avatar'] = $poster['thumb']; + $arr['author-name'] = $poster['name']; + $arr['author-link'] = $poster['url']; + $arr['author-avatar'] = $poster['thumb']; + $arr['title'] = ''; + $arr['allow_cid'] = $allow_cid; + $arr['allow_gid'] = $allow_gid; + $arr['deny_cid'] = $deny_cid; + $arr['deny_gid'] = $deny_gid; + $arr['last-child'] = 1; + $arr['visible'] = 1; + $arr['verb'] = $activity; + $arr['private'] = $private; + + $arr['origin'] = 1; + $arr['body'] = $action; + + $item_id = item_store($arr); + if($item_id) { + q("UPDATE `item` SET `plink` = '%s' WHERE `uid` = %d AND `id` = %d LIMIT 1", + dbesc($a->get_baseurl() . '/display/' . $poster['nickname'] . '/' . $item_id), + intval($uid), + intval($item_id) + ); + proc_run('php',"include/notifier.php","tag","$item_id"); + } + + + call_hooks('post_local_end', $arr); + + proc_run('php',"include/notifier.php","like","$post_id"); + + return; +} + + + +function mood_content(&$a) { + + if(! local_user()) { + notice( t('Permission denied.') . EOL); + return; + } + + $parent = ((x($_GET,'parent')) ? intval($_GET['parent']) : '0'); + + + + $verbs = get_mood_verbs(); + + $shortlist = array(); + foreach($verbs as $k => $v) + if($v !== 'NOTRANSLATION') + $shortlist[] = array($k,$v); + + + $tpl = get_markup_template('mood_content.tpl'); + + $o = replace_macros($tpl,array( + '$title' => t('Mood'), + '$desc' => t('Set your current mood and tell your friends'), + '$verbs' => $shortlist, + '$parent' => $parent, + '$submit' => t('Submit'), + )); + + return $o; + +} \ No newline at end of file -- cgit v1.2.3