]> git.mxchange.org Git - friendica.git/commitdiff
store default location
authorMike Macgirvin <mike@macgirvin.com>
Sat, 21 Aug 2010 23:31:46 +0000 (16:31 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Sat, 21 Aug 2010 23:31:46 +0000 (16:31 -0700)
mod/network.php
mod/profile.php
mod/settings.php
view/jot-header.tpl
view/jot.tpl
view/settings.tpl
view/theme/default/style.css

index 219808afc432a136658c3939cb06574159ef3c4e..cdd8a4976be41ac864d8f9fbd846c12306469e17 100644 (file)
@@ -36,6 +36,7 @@ function network_content(&$a, $update = false) {
                $o .= replace_macros($tpl,array(
                        '$return_path' => $a->cmd,
                        '$baseurl' => $a->get_baseurl(),
+                       '$defloc' => $a->user['default-location'],
                        '$visitor' => 'block',
                        '$lockstate' => 'unlock',
                        '$acl' => populate_acl($a->user),
index 44f7181020cba0f8d8b246fc64f5cf2d844d6059..c5047d6154d64bd4cfd9fad2cd7feccbb1273c8b 100644 (file)
@@ -149,6 +149,7 @@ function profile_content(&$a, $update = false) {
                                $lockstate = 'unlock';
                        $o .= replace_macros($tpl,array(
                                '$baseurl' => $a->get_baseurl(),
+                               '$defloc' => (($_SESSION['uid'] == $a->profile['profile_uid']) ? $a->user['default-location'] : ''),
                                '$return_path' => $a->cmd,
                                '$visitor' => (($_SESSION['uid'] == $a->profile['profile_uid']) ? 'block' : 'none'),
                                '$lockstate' => $lockstate,
index 71109d9033685f4b63fed34c0dc87f49e85046e5..f9cc429df21b3600583cf73ec61853ad15ac7e07 100644 (file)
@@ -56,6 +56,7 @@ function settings_post(&$a) {
        $username = notags(trim($_POST['username']));
        $email = notags(trim($_POST['email']));
        $timezone = notags(trim($_POST['timezone']));
+       $defloc = notags(trim($_POST['defloc']));
 
        $publish = (($_POST['profile_in_directory'] == 1) ? 1: 0);
        $net_publish = (($_POST['profile_in_netdirectory'] == 1) ? 1: 0);
@@ -136,7 +137,7 @@ function settings_post(&$a) {
                $str_contact_deny = implode('',$contact_deny);
        }
 
-       $r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `timezone` = '%s',  `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `notify-flags` = %d, `theme` = '%s'  WHERE `uid` = %d LIMIT 1",
+       $r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `timezone` = '%s',  `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `notify-flags` = %d, `default-location` = '%s', `theme` = '%s'  WHERE `uid` = %d LIMIT 1",
                        dbesc($username),
                        dbesc($email),
                        dbesc($timezone),
@@ -145,6 +146,7 @@ function settings_post(&$a) {
                        dbesc($str_contact_deny),
                        dbesc($str_group_deny),
                        intval($notify),
+                       dbesc($defloc),
                        dbesc($theme),
                        intval($_SESSION['uid'])
        );
@@ -200,6 +202,7 @@ function settings_content(&$a) {
        $nickname = $a->user['nickname'];
        $timezone = $a->user['timezone'];
        $notify   = $a->user['notify-flags'];
+       $defloc   = $a->user['default-location'];
 
        if(! strlen($a->user['timezone']))
                $timezone = date_default_timezone_get();
@@ -269,6 +272,7 @@ function settings_content(&$a) {
                '$nickname_block' => $nickname_block,
                '$timezone' => $timezone,
                '$zoneselect' => select_timezone($timezone),
+               '$defloc' => $defloc,
                '$profile_in_dir' => $profile_in_dir,
                '$profile_in_net_dir' => $profile_in_net_dir,
                '$permissions' => t('Default Post Permissions'),
index 39f8adc6eff8b48224ce4bfe4d20b221326efd89..8c7cce360dc68e828bddc33cb82735ffd646d5e8 100644 (file)
@@ -81,7 +81,7 @@ tinyMCE.init({
        }
 
        function jotGetLocation() {
-               reply = prompt("Where are you right now?");
+               reply = prompt("Where are you right now?", $('#jot-location').val());
                if(reply && reply.length) {
                        $('#jot-location').val(reply);
                }
index 5ceb795037c31d4ee23aa85555333ff378783567..586274c35ca798f5e4beceddc176f010327740d5 100644 (file)
@@ -9,7 +9,7 @@
 <input type="hidden" name="type" value="wall" />
 <input type="hidden" name="profile_uid" value="$profile_uid" />
 <input type="hidden" name="return" value="$return_path" />
-<input type="hidden" name="location" id="jot-location" value="" />
+<input type="hidden" name="location" id="jot-location" value="$defloc" />
 
 <textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" ></textarea>
 
index ce13e2e2e160c133c1f462e6f1aea0c1c8f60f68..aa0bf17e032fa0e4394d716610ddca989b119f5b 100644 (file)
@@ -25,6 +25,13 @@ $zoneselect
 </div>
 <div id="settings-timezone-end" ></div>
 
+<div id="settings-defloc-wrapper" >
+<label id="settings-defloc-label" for="settings-defloc" >Default Post Location: </label>
+<input type="text" name="defloc" id="settings-defloc" value="$defloc" />
+</div>
+<div id="settings-defloc-end" ></div>
+
+
 <div id="settings-theme-select">
 <label id="settings-theme-label" for="theme-select" >Display Theme: </label>
 $theme
index 57d2888f48d0a5b827a89d00fc2a7056e9acad5f..92fb938876ea3ef45e36045fdbc96b30a26e32d7 100644 (file)
@@ -282,7 +282,8 @@ input#dfrn-url {
 
 #settings-username-end, 
 #settings-email-end, 
-#settings-nick-end, 
+#settings-nick-end,
+#settings-defloc-end, 
 #settings-timezone-end,
 #settings-theme-end, 
 #settings-password-end, 
@@ -298,7 +299,8 @@ input#dfrn-url {
 
 #settings-username-label, 
 #settings-email-label, 
-#settings-nick-label, 
+#settings-nick-label,
+#settings-defloc-label, 
 #settings-timezone-label, 
 #settings-theme-label,
 #settings-password-label, 
@@ -315,6 +317,7 @@ input#dfrn-url {
 #settings-username, 
 #settings-email, 
 #settings-nick, 
+#settings-defloc,
 #timezone-select, 
 #theme-select,
 #settings-password, 
@@ -328,7 +331,12 @@ input#dfrn-url {
        margin-bottom: 20px;
 }
 
-#settings-theme-label {
+#settings-theme-label,
+#settings-defloc-label {
+       margin-top: 20px;
+}
+
+#settings-defloc {
        margin-top: 20px;
 }