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 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ mod/poke.php | 2 +- mod/zentity.php | 91 ++++-------------------------------- 3 files changed, 153 insertions(+), 82 deletions(-) create mode 100755 mod/mood.php (limited to 'mod') 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 diff --git a/mod/poke.php b/mod/poke.php index bb062308f..a4ccc517a 100755 --- a/mod/poke.php +++ b/mod/poke.php @@ -76,7 +76,7 @@ function poke_init(&$a) { $poster = $a->contact; - $uri = item_new_uri($a->get_hostname(),$owner_uid); + $uri = item_new_uri($a->get_hostname(),$uid); $arr = array(); diff --git a/mod/zentity.php b/mod/zentity.php index 011ae8e79..794ac0ecb 100644 --- a/mod/zentity.php +++ b/mod/zentity.php @@ -35,7 +35,7 @@ function zentity_init(&$a) { if($cmd === 'checkaddr.json') { require_once('library/urlify/URLify.php'); $result = array('error' => false, 'message' => ''); - $n = trim($_REQUEST['addr']); + $n = trim($_REQUEST['nick']); $x = strtolower(URLify::transliterate($n)); @@ -56,71 +56,6 @@ function zentity_init(&$a) { } - - -// print_r($test); - -// if(! allowed_email($email)) -// $result['message'] = t('Your email domain is not among those allowed on this site'); -// if((! valid_email($email)) || (! validate_email($email))) -// $result['message'] .= t('Not a valid email address') . EOL; -// if($result['message']) -// $result['error'] = true; - -// header('content-type: application/json'); -// echo json_encode($result); -// killme(); - - - $pw1 = t("Password too short"); - $pw2 = t("Passwords do not match"); - - $a->page['htmlhead'] .= <<< EOT - - -EOT; - } @@ -309,7 +244,7 @@ function zentity_content(&$a) { if(get_config('system','no_age_restriction')) $label_tos = sprintf( t('I accept the %s for this website'), $toslink); else - $label_tos = t('Check this box to import an existing identity file from another location'); + $label_tos = $email = ((x($_REQUEST,'email')) ? $_REQUEST['email'] : "" ); @@ -322,20 +257,14 @@ function zentity_content(&$a) { $o = replace_macros(get_markup_template('zentity.tpl'), array( '$title' => t('Create Identity'), - '$registertext' => t('An identity is a profile container for a personal profile, blog, public or private group/forum, celebrity page, and more.
You may create as many of these as your hub provider allows.'), - '$invitations' => get_config('system','invitation_only'), - '$invite_desc' => t('Membership on this site is by invitation only.'), - '$label_invite' => t('Please enter your invitation code'), - '$invite_id' => $invite_id, - - '$label_email' => t('Full name'), - '$label_pass1' => t('Choose a short nickname'), - '$label_pass2' => t('Your nickname will be used to create an easily remembered web address ("webbie") for your profile.'), - '$label_tos' => $label_tos, - - '$email' => $email, - '$pass1' => $password, - '$pass2' => $password2, + '$desc' => t('An identity is a profile container for a personal profile, blog, public or private group/forum, celebrity page, and more. You may create as many of these as your provider allows.'), + + '$label_name' => t('Full name'), + '$label_nick' => t('Choose a short nickname'), + '$nick_desc' => t('Your nickname will be used to create an easily remembered web address ("webbie") for your profile.'), + '$label_import' => t('Check this box to import an existing identity file from another location'), + '$name' => $name, + '$nickname' => $nickname, '$submit' => t('Create') )); -- cgit v1.2.3