This commit is contained in:
Mike Macgirvin 2010-07-06 05:07:28 -07:00
parent 6817c5d59a
commit 1ea69ae275
10 changed files with 182 additions and 23 deletions

View file

@ -80,7 +80,44 @@ function contacts_content(&$a) {
return;
}
if(($a->argc2 == 2) && ($a->argv[1] == 'all'))
if(($a->argc == 2) && intval($a->argv[1])) {
$contact_id = intval($a->argv[1]);
$r = q("SELECT * FROM `contact` WHERE `uid` = %d and `id` = %d LIMIT 1",
$_SESSION['uid'],
intval($contact_id)
);
if(! count($r)) {
notice("Contact not found.");
return;
}
require_once('view/contact_selectors.php');
$tpl = file_get_contents("view/contact_edit.tpl");
$o .= replace_macros($tpl,array(
'$profile_select' => contact_profile_assign($r[0]['profile-id']),
'$contact_id' => $r[0]['id'],
'$blocked' => $r[0]['blocked'],
'$rating' => $r[0]['rating'],
'$reason' => $r[0]['reason'],
// '$groups' => group_selector(),
'$photo' => $r[0]['photo'],
'$name' => $r[0]['name'],
'$dir_icon' => $dir_icon,
'$alt_text' => $alt_text
));
return $o;
}
if(($a->argc == 2) && ($a->argv[1] == 'all'))
$sql_extra = '';
else
$sql_extra = " AND `blocked` = 0 ";

View file

@ -187,7 +187,7 @@ function dfrn_request_post(&$a) {
if(is_array($contact_record)) {
// There is a contact record but no issued-id, so this
// is a reciprocal introduction from a known contact
$r = q("UPDATE `contact` SET `issued-id` = '%s', `ret-blocked` = 1 WHERE `id` = %d LIMIT 1",
$r = q("UPDATE `contact` SET `issued-id` = '%s' WHERE `id` = %d LIMIT 1",
dbesc($issued_id),
intval($contact_record['id'])
);

View file

@ -58,7 +58,7 @@ function item_post(&$a) {
intval($post_id));
}
}
goaway($a->get_baseurl() . "/profile/$uid");
goaway($a->get_baseurl() . "/profile/$profile_uid");

34
view/contact_edit.tpl Normal file
View file

@ -0,0 +1,34 @@
<div id="contact-edit-wrapper" >
<div class="contact-edit-photo-wrapper" >
<img id="contact-edit-direction-icon" src="$dir_icon" alt="$alt_text" title="$alt_text" />
<div id="contact-edit-photo" >
<a href="$url" title="Visit $name's profile" /><img src="$photo" alt="$name" /></a>
</div>
<div id="contact-edit-photo-end" ></div>
</div>
<div id="contact-edit-nav-wrapper"
<div id="contact-edit-name" >$name</div>
<div id="contact-edit-break"></div>
<form action="contacts" method="post" >
<input type="hidden" name="contact_id" value="$contact_id">
<div id="contact-edit-links" >
<a href="contacts/$id/block" id="contact-edit-block-link" ><img src="images/b_block.gif" alt="Block contact" title="Block contact"/></a>
<a href="contacts/$id/drop" id="contact-edit-drop-link"><img src="images/b_drop.gif" alt="Delete contact" title="Delete contact"/></a>
</div>
<div id="contact-edit-nav-end"></div>
</div>
<div class="contact-dit-end" ></div>
$profile_select
$groups
$rating
$reason
</form>
</div>

View file

@ -1,12 +1,12 @@
<?php
function select_contact_profile($current) {
function contact_profile_assign($current) {
$o = '';
$o .= "<select id=\"contact_profile_selector\" name=\"profile_id\" />";
$o .= "<select id=\"contact_profile_selector\" name=\"profile_assign\" />";
$r = q("SELECT `id` FROM `profile` WHERE `uid` = %d",
$r = q("SELECT `profile-name` FROM `profile` WHERE `uid` = %d",
intval($_SESSION['uid']));
if(count($r)) {

View file

@ -1,17 +1,23 @@
<div class="contact-entry-wrapper" id="contact-entry-wrapper-$id" >
<img class="contact-entry-direction-icon" src="$dir_icon" alt="$alt_text" title="$alt_text" />
<div class="contact-entry-photo" id="contact-entry-photo-$id" >
<a href="$url" title="Visit $name's profile" /><img src="$thumb" alt="$name" ></a>
</div>
<div class="contact-entry-name" id="contact-entry-name-$id" >$name</div>
</div>
<div class="contact-entry-edit-links" >
<a href="contacts/$id/edit" class="contact-entry-edit-link" ><img src="images/b_edit.gif" alt="Edit contact" title="Edit contact" /></a>
<a href="contacts/$id/block" class="contact-edit-block-link" ><img src="images/b_block.gif" alt="Block contact" title="Block contact"/></a>
<a href="contacts/$id/drop" class="contact-entry-block-link"><img src="images/b_drop.gif" alt="Delete contact" title="Delete contact"/></a>
</div>
<div class="contact-entry-end" ></div>
<div class="contact-entry-photo-wrapper" >
<img class="contact-entry-direction-icon" src="$dir_icon" alt="$alt_text" title="$alt_text" />
<div class="contact-entry-photo" id="contact-entry-photo-$id" >
<a href="$url" title="Visit $name's profile" /><img src="$thumb" alt="$name" /></a>
</div>
<div class="contact-entry-photo-end" ></div>
</div>
<div class="contact-entry-nav-wrapper"
<div class="contact-entry-name" id="contact-entry-name-$id" >$name</div>
<div class="contact-entry-break"></div>
<div class="contact-entry-edit-links" >
<a href="contacts/$id" class="contact-entry-edit-link" ><img src="images/b_edit.gif" alt="Edit contact" title="Edit contact" /></a>
</div>
<div class="contact-entry-nav-end"></div>
</div>
<div class="contact-entry-end" ></div>
</div>
<hr />

View file

@ -5,7 +5,8 @@
tinyMCE.init({
theme : "advanced",
mode : "textareas",
mode : "specific_textareas",
editor_selector: "profile-jot-text",
plugins : "bbcode",
theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor",
theme_advanced_buttons2 : "",

View file

@ -7,7 +7,7 @@ What's on your mind?
<input type="hidden" name="type" value="jot" />
<input type="hidden" name="profile_uid" value="$profile_uid" />
<textarea rows="5" cols="64" id="profile-jot-text" name="body" ></textarea>
<textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" ></textarea>
</div>
<div id="profile-jot-submit-wrapper" >

View file

@ -340,15 +340,49 @@ input#dfrn-url {
float: left;
}
#contacts-main {
margin-bottom: 20px;
}
.contact-entry-photo-wrapper {
float: left;
}
.contact-entry-direction-icon {
margin-top: 24px;
float: left;
}
.contact-entry-photo img {
border: none;
}
.contact-entry-photo-end {
clear: both;
}
.contact-entry-edit-links {
float: left;
margin-top: 10px;
}
.contact-entry-name {
float: left;
}
.contact-entry-nav-wrapper {
float: left;
margin-left: 10px;
}
.contact-entry-nav-end {
clear: both;
}
.contact-entry-break {
clear: both;
}
.contact-entry-edit-links img {
border: none;
margin-right: 15px;
}
.contact-entry-photo {
float: left;
}
.contact-entry-end {
clear: both;
}
.wall-item-photo-wrapper {
margin-top: 20px;
@ -399,9 +433,11 @@ input#dfrn-url {
#profile-listing-new-link-wrapper {
margin-bottom: 30px;
}
.profile-listing-photo-wrapper {
float: left;
}
.profile-listing-edit-buttons-wrapper {
/* float: left;*/
clear: both;
}
.profile-listing-photo-edit-link {

45
wip/atom-ext Normal file
View file

@ -0,0 +1,45 @@
<feed xmlns="http://www.w3.org/2005/Atom"
xmlns:foaf="http://xmlns.com/foaf/0.1"
xml:base="http://www.example.org">
...
<author>
<name>James M Snell</name>
<foaf:homepage rdf:resource="/blog" />
<foaf:img rdf:resource="/mypic.png" />
</author>
<contributor>
<name>Jane Doe</name>
<foaf:homepage rdf:resource="/janesblog" />
<foaf:image rdf:resource="/janespic.png" />
</contributor>
...
</feed>
<feed xmlns="http://www.w3.org/2005/Atom"
xml:base="http://www.example.org/">
<id>http://www.example.org/pictures</id>
<title>My Picture Gallery</title>
<updated>2005-07-15T12:00:00Z</updated>
<author>
<name>James M Snell</name>
</author>
<entry>
<id>http://www.example.org/entries/1</id>
<title>Trip to San Francisco</title>
<link href="/entries/1" />
<updated>2005-07-15T12:00:00Z</updated>
<summary>A picture of my hotel room in San Francisco</summary>
<content type="image/png" src="/mypng1.png" />
</entry>
<entry>
<id>http://www.example.org/entries/2</id>
<title>My new car</title>
<link href="/entries/2" />
<updated>2005-07-15T12:00:00Z</updated>
<summary>A picture of my new car</summary>
<content type="image/png" src="/mypng2.png" />
</entry>
</feed>