mirror of
https://github.com/friendica/friendica
synced 2024-12-22 18:00:16 +00:00
lots of little stuff
This commit is contained in:
parent
a42c9616f9
commit
7a21a000a2
9 changed files with 88 additions and 21 deletions
|
@ -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;
|
||||
}
|
|
@ -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";
|
||||
|
|
|
@ -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]);
|
||||
|
|
|
@ -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'],
|
||||
|
|
|
@ -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` ;
|
||||
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` ;
|
||||
|
|
|
@ -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>
|
||||
|
|
16
view/profile-hide-friends.tpl
Normal file
16
view/profile-hide-friends.tpl
Normal 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>
|
|
@ -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>
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue