]> git.mxchange.org Git - friendica.git/commitdiff
lots of little stuff
authorMike Macgirvin <mike@macgirvin.com>
Sun, 11 Jul 2010 09:52:47 +0000 (02:52 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Sun, 11 Jul 2010 09:52:47 +0000 (02:52 -0700)
include/group.php
include/nav.php
mod/contacts.php
mod/profiles.php
updates.sql
view/contact_edit.tpl
view/profile-hide-friends.tpl [new file with mode: 0644]
view/profile_edit.tpl
view/style.css

index e92e4480bae2da99a471a10816fe34446b96abef..598d09c2ea1ed086c283c650facff8e77d4018da 100644 (file)
@@ -25,7 +25,7 @@ function group_rmv($uid,$name) {
                $r = q("SELECT * FROM `group` WHERE `uid` = %d AND `name` = '%s' LIMIT 1",
                        intval($uid),
                        dbesc($name)
-               }
+               );
                if(count($r))
                        $group_id = $r[0]['id'];
                if(! $group_id)
@@ -102,4 +102,36 @@ function group_add_member($uid,$name,$member) {
                        intval($member)
        );
        return $r;
+}
+
+
+
+function group_side() {
+
+       if(! local_user())
+               return;
+$o .= <<< EOT
+
+<div id="group-sidebar">
+<h3>Groups</h3>
+
+<div id="sidebar-new-group">
+<a href="group/new">Create a new group</a>
+</div>
+
+<div id="sidebar-group-list">
+<ul id="sidebar-group-ul">
+<li class="sidebar-group-li"><a href="contacts">Everybody</a></li>
+EOT;
+
+       $r = q("SELECT * FROM `group` WHERE `uid` = %d",
+               intval($_SESSION['uid'])
+       );
+       if(count($r)) {
+               foreach($r as $rr)
+                       $o .= "<li class=\"sidebar-group-li\"><a href=\"group/{$rr['id']}\">{$rr['name']}</li>";
+       }
+       $o .= '</ul></div></div>';      
+
+       return $o;
 }
\ No newline at end of file
index c51c56ad22f9eba81db228439cbcc04b0c8dd31b..d24abd4ac53e81e32f619797dd624cec9acb441d 100644 (file)
@@ -2,6 +2,11 @@
 <?php
        $a->page['nav'] .= "<span id=\"nav-link-wrapper\" >\r\n";
 
+       if(($a->module != 'home') && (! (x($_SESSION['uid']))))
+               $a->page['nav'] .= "<a id=\"nav-home-link\" class=\"nav-commlink\" href=\"\">Home</a>\r\n";
+       
+       $a->page['nav'] .= "<a id=\"nav-directory-link\" class=\"nav-commlink\" href=\"directory\">Site Directory</a>\r\n";
+
        if(x($_SESSION,'uid')) {
 
                $a->page['nav'] .= "<a id=\"nav-notify-link\" class=\"nav-commlink\" href=\"notifications\">Notifications</a>\r\n";
@@ -20,4 +25,5 @@
                $a->page['nav'] .= "<a id=\"nav-home-link\" class=\"nav-link\" href=\"profile/{$_SESSION['uid']}\">Home</a>\r\n";
                
        }
+
        $a->page['nav'] .= "</span>\r\n<span id=\"nav-end\"></span>\r\n";
index 38b49475ac890ce7dbe297cfd7f7cc42984a908e..5bf906e060f6bd5daf61e5281bca6baf01f66a4e 100644 (file)
@@ -1,6 +1,8 @@
 <?php
-function edit_contact(&$a,$contact_id) {
 
+function contacts_init(&$a) {
+       require_once('include/group.php');
+       $a->page['aside'] .= group_side();
 }
 
 function contacts_post(&$a) {
@@ -12,8 +14,7 @@ function contacts_post(&$a) {
        $contact_id = intval($a->argv[1]);
        if(! $contact_id)
                return;
-dbg(2);
-print_r($_POST);
+
        $orig_record = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
                intval($contact_id),
                intval($_SESSION['uid'])
@@ -60,14 +61,6 @@ print_r($_POST);
 
 
 
-
-
-
-
-
-
-
-
 function contacts_content(&$a) {
 
        if(! local_user()) {
@@ -75,8 +68,6 @@ function contacts_content(&$a) {
                return;
        }
 
-
-
        if($a->argc == 3) {
 
                $contact_id = intval($a->argv[1]);
index 3f5980ba69d5bf1ac051bf8fcc260b8597b2f44c..4bbfbb44cbc7f047854086b670b31065da4edc39 100644 (file)
@@ -278,6 +278,12 @@ function profiles_content(&$a) {
                        '$no_selected' => (($r[0]['publish'] == 0) ? " checked=\"checked\" " : "")
                ));
 
+               $opt_tpl = file_get_contents("view/profile-hide-friends.tpl");
+               $hide_friends = replace_macros($opt_tpl,array(
+                       '$yes_selected' => (($r[0]['hide-friends']) ? " checked=\"checked\" " : ""),
+                       '$no_selected' => (($r[0]['hide-friends'] == 0) ? " checked=\"checked\" " : "")
+               ));
+
 
                $a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl()));
                $a->page['htmlhead'] .= "<script type=\"text/javascript\" src=\"include/country.js\" ></script>";
@@ -295,7 +301,7 @@ function profiles_content(&$a) {
                        '$default' => (($is_default) ? "<p id=\"profile-edit-default-desc\">This is your <strong>public</strong> profile.<br />It <strong>may</strong> be visible to anybody using the internet.</p>" : ""),
                        '$name' => $r[0]['name'],
                        '$dob' => dob($r[0]['dob']),
-                       '$hide_birth' => (($r[0]['dob_hide']) ? " checked=\"checked\" " : ""),
+                       '$hide_friends' => $hide_friends,
                        '$address' => $r[0]['address'],
                        '$locality' => $r[0]['locality'],
                        '$region' => $r[0]['region'],
index de7bfa1e4214cf631a668aef8ec98e4d6b5c9d0d..b7e2ab3ea4f0f8d6e33b0dc47e3d4bef9d8b514e 100644 (file)
@@ -25,4 +25,5 @@ ALTER TABLE `profile` DROP `age`;
  ALTER TABLE `profile` CHANGE `school` `education` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL  ;
  ALTER TABLE `profile` DROP `employer`  ;
 
-ALTER TABLE `profile` ADD `contact` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `education` ;
\ No newline at end of file
+ALTER TABLE `profile` ADD `contact` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `education` ;
+ALTER TABLE `profile` ADD `hide-friends` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `is-default` ;
index 91ae30ec1688816d3c1beecaa0ead8ae840ad9cb..4a94f708376fe12c8f1bd8d6aa15fc5107f878f4 100644 (file)
@@ -28,7 +28,7 @@ $blocked
 <form action="contacts/$contact_id" method="post" >
 <input type="hidden" name="contact_id" value="$contact_id">
 
-<div class="contact-edit-profile-select-text">
+<div id="contact-edit-profile-select-text">
 <h4>Profile Visibility</h4>
 <p>Please choose the profile you would like to display to $name - when he/she connects securely to your profile page.
 </p> 
diff --git a/view/profile-hide-friends.tpl b/view/profile-hide-friends.tpl
new file mode 100644 (file)
index 0000000..54ade00
--- /dev/null
@@ -0,0 +1,16 @@
+<p id="hide-friends-text">
+Hide my contact/friend list from viewers of this profile?
+</p>
+
+               <div id="hide-friends-yes-wrapper">
+               <label id="hide-friends-yes-label" for="hide-friends-yes">Yes</label>
+               <input type="radio" name="hide-friends" id="hide-friends-yes" $yes_selected value="1" />
+
+               <div id="hide-friends-break" ></div>    
+               </div>
+               <div id="hide-friends-no-wrapper">
+               <label id="hide-friends-no-label" for="hide-friends-no">No</label>
+               <input type="radio" name="hide-friends" id="hide-friends-no" $no_selected value="0"  />
+
+               <div id="hide-friends-end"></div>
+               </div>
index 789da873c24b5904f6f644fe95c4a3d7aefce8a9..3dcf8df2cdfb9a63e0732a5dfca3a9f003ba69de 100644 (file)
@@ -32,6 +32,8 @@ $dob $age
 </div>
 <div id="profile-edit-dob-end"></div>
 
+$hide_friends
+
 <div class="profile-edit-submit-wrapper" >
 <input type="submit" name="submit" class="profile-edit-submit-button" value="Submit" />
 </div>
index 169a89589e1ff16e9cf2088904c506fb447ace69..86876a697d8eb95ed95545de2c5c2613167fc5eb 100644 (file)
@@ -316,12 +316,17 @@ input#dfrn-url {
 #profile-edit-politic,
 #profile-edit-religion,
 #profile-in-dir-yes,
-#profile-in-dir-no {
+#profile-in-dir-no,
+#hide-friends-yes,
+#hide-friends-no {
        float: left;
        margin-bottom: 20px;
 }
 
-#profile-in-dir-yes-label, #profile-in-dir-no-label {
+#profile-in-dir-yes-label, 
+#profile-in-dir-no-label,
+#hide-friends-yes-label,
+#hide-friends-no-label {
        margin-left: 125px;
        float: left;
        width: 50px;
@@ -347,10 +352,16 @@ input#dfrn-url {
 #profile-edit-religion-end,
 #profile-edit-homepage-end,
 #profile-in-dir-break, 
-#profile-in-dir-end {
+#profile-in-dir-end,
+#hide-friends-break,
+#hide-friends-end {
        clear: both;
 }
 
+
+
+
+
 #gender-select, #marital-select, #sexual-select {
        width: 220px;
 }
@@ -663,7 +674,9 @@ input#dfrn-url {
        margin-left: 30px;
 }
 
-
+#contact-edit-photo-wrapper {
+       margin-bottom: 20px;
+}
 #contact-edit-links img {
        margin-left: 20px;
        border: none;