lots of little stuff

This commit is contained in:
Mike Macgirvin 2010-07-11 02:52:47 -07:00
parent a42c9616f9
commit 7a21a000a2
9 changed files with 88 additions and 21 deletions

View file

@ -25,7 +25,7 @@ function group_rmv($uid,$name) {
$r = q("SELECT * FROM `group` WHERE `uid` = %d AND `name` = '%s' LIMIT 1", $r = q("SELECT * FROM `group` WHERE `uid` = %d AND `name` = '%s' LIMIT 1",
intval($uid), intval($uid),
dbesc($name) dbesc($name)
} );
if(count($r)) if(count($r))
$group_id = $r[0]['id']; $group_id = $r[0]['id'];
if(! $group_id) if(! $group_id)
@ -103,3 +103,35 @@ function group_add_member($uid,$name,$member) {
); );
return $r; 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;
}

View file

@ -2,6 +2,11 @@
<?php <?php
$a->page['nav'] .= "<span id=\"nav-link-wrapper\" >\r\n"; $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')) { if(x($_SESSION,'uid')) {
$a->page['nav'] .= "<a id=\"nav-notify-link\" class=\"nav-commlink\" href=\"notifications\">Notifications</a>\r\n"; $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'] .= "<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"; $a->page['nav'] .= "</span>\r\n<span id=\"nav-end\"></span>\r\n";

View file

@ -1,6 +1,8 @@
<?php <?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) { function contacts_post(&$a) {
@ -12,8 +14,7 @@ function contacts_post(&$a) {
$contact_id = intval($a->argv[1]); $contact_id = intval($a->argv[1]);
if(! $contact_id) if(! $contact_id)
return; return;
dbg(2);
print_r($_POST);
$orig_record = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", $orig_record = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($contact_id), intval($contact_id),
intval($_SESSION['uid']) intval($_SESSION['uid'])
@ -60,14 +61,6 @@ print_r($_POST);
function contacts_content(&$a) { function contacts_content(&$a) {
if(! local_user()) { if(! local_user()) {
@ -75,8 +68,6 @@ function contacts_content(&$a) {
return; return;
} }
if($a->argc == 3) { if($a->argc == 3) {
$contact_id = intval($a->argv[1]); $contact_id = intval($a->argv[1]);

View file

@ -278,6 +278,12 @@ function profiles_content(&$a) {
'$no_selected' => (($r[0]['publish'] == 0) ? " checked=\"checked\" " : "") '$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'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl()));
$a->page['htmlhead'] .= "<script type=\"text/javascript\" src=\"include/country.js\" ></script>"; $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>" : ""), '$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'], '$name' => $r[0]['name'],
'$dob' => dob($r[0]['dob']), '$dob' => dob($r[0]['dob']),
'$hide_birth' => (($r[0]['dob_hide']) ? " checked=\"checked\" " : ""), '$hide_friends' => $hide_friends,
'$address' => $r[0]['address'], '$address' => $r[0]['address'],
'$locality' => $r[0]['locality'], '$locality' => $r[0]['locality'],
'$region' => $r[0]['region'], '$region' => $r[0]['region'],

View file

@ -26,3 +26,4 @@ ALTER TABLE `profile` DROP `age`;
ALTER TABLE `profile` DROP `employer` ; ALTER TABLE `profile` DROP `employer` ;
ALTER TABLE `profile` ADD `contact` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `education` ; 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` ;

View file

@ -28,7 +28,7 @@ $blocked
<form action="contacts/$contact_id" method="post" > <form action="contacts/$contact_id" method="post" >
<input type="hidden" name="contact_id" value="$contact_id"> <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> <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>Please choose the profile you would like to display to $name - when he/she connects securely to your profile page.
</p> </p>

View file

@ -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>

View file

@ -32,6 +32,8 @@ $dob $age
</div> </div>
<div id="profile-edit-dob-end"></div> <div id="profile-edit-dob-end"></div>
$hide_friends
<div class="profile-edit-submit-wrapper" > <div class="profile-edit-submit-wrapper" >
<input type="submit" name="submit" class="profile-edit-submit-button" value="Submit" /> <input type="submit" name="submit" class="profile-edit-submit-button" value="Submit" />
</div> </div>

View file

@ -316,12 +316,17 @@ input#dfrn-url {
#profile-edit-politic, #profile-edit-politic,
#profile-edit-religion, #profile-edit-religion,
#profile-in-dir-yes, #profile-in-dir-yes,
#profile-in-dir-no { #profile-in-dir-no,
#hide-friends-yes,
#hide-friends-no {
float: left; float: left;
margin-bottom: 20px; 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; margin-left: 125px;
float: left; float: left;
width: 50px; width: 50px;
@ -347,10 +352,16 @@ input#dfrn-url {
#profile-edit-religion-end, #profile-edit-religion-end,
#profile-edit-homepage-end, #profile-edit-homepage-end,
#profile-in-dir-break, #profile-in-dir-break,
#profile-in-dir-end { #profile-in-dir-end,
#hide-friends-break,
#hide-friends-end {
clear: both; clear: both;
} }
#gender-select, #marital-select, #sexual-select { #gender-select, #marital-select, #sexual-select {
width: 220px; width: 220px;
} }
@ -663,7 +674,9 @@ input#dfrn-url {
margin-left: 30px; margin-left: 30px;
} }
#contact-edit-photo-wrapper {
margin-bottom: 20px;
}
#contact-edit-links img { #contact-edit-links img {
margin-left: 20px; margin-left: 20px;
border: none; border: none;