added friend viewer
This commit is contained in:
parent
7feed93a56
commit
050be99034
6 changed files with 119 additions and 3 deletions
|
@ -6,9 +6,12 @@ if(x($_SESSION['uid'])) {
|
|||
|
||||
$a->page['nav'] .= "<span id=\"nav-link-wrapper\" >\r\n";
|
||||
|
||||
if(($a->module != 'home') && (! (x($_SESSION['uid']))))
|
||||
if(($a->module != 'home') && (! (local_user())))
|
||||
$a->page['nav'] .= '<a id="nav-home-link" class="nav-commlink" href="">' . t('Home') . "</a>\r\n";
|
||||
|
||||
if(($a->config['register_policy'] == REGISTER_OPEN) && (! local_user()) && (! remote_user()))
|
||||
$a->page['nav'] .= '<a id="nav-register-link" class="nav-commlink" href="register" >'
|
||||
. t('Register Now (it\'s FREE)') . "</a>\r\n";
|
||||
|
||||
$a->page['nav'] .= '<a id="nav-directory-link" class="nav-link" href="directory">' . t('Site Directory') . "</a>\r\n";
|
||||
|
||||
if(x($_SESSION,'uid')) {
|
||||
|
|
57
mod/viewcontacts.php
Normal file
57
mod/viewcontacts.php
Normal file
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
|
||||
function viewcontacts_init(&$a) {
|
||||
|
||||
require_once("mod/profile.php");
|
||||
profile_load($a,$a->argv[1]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
function viewcontacts_content(&$a) {
|
||||
|
||||
if(((! count($a->profile)) || ($a->profile['hide-friends']))) {
|
||||
notice( t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
$o .= '<h3>' . t('View Contacts') . '</h3>';
|
||||
|
||||
|
||||
$r = q("SELECT COUNT(*) as `total` FROM `contact` WHERE `uid` = %d AND `blocked` = 0 AND `pending` = 0",
|
||||
intval($a->profile['uid'])
|
||||
);
|
||||
if(count($r))
|
||||
$a->pager['totalitems'] = $r[0]['total'];
|
||||
|
||||
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `blocked` = 0 AND `pending` = 0 ORDER BY `name` ASC LIMIT %d , %d ",
|
||||
intval($a->profile['uid']),
|
||||
intval($a->pager['start']),
|
||||
intval($a->pager['itemspage'])
|
||||
);
|
||||
if(! count($r)) {
|
||||
notice( t('No contacts.') . EOL );
|
||||
return $o;
|
||||
}
|
||||
|
||||
$tpl = file_get_contents("view/viewcontact_template.tpl");
|
||||
|
||||
foreach($r as $rr) {
|
||||
if($rr['self'])
|
||||
continue;
|
||||
|
||||
$o .= replace_macros($tpl, array(
|
||||
'$id' => $rr['id'],
|
||||
'$alt_text' => t('Visit ') . $rr['name'] . t('\'s profile'),
|
||||
'$thumb' => $rr['thumb'],
|
||||
'$name' => $rr['name'],
|
||||
'$url' => $rr['url']
|
||||
));
|
||||
}
|
||||
|
||||
$o .= '<div id="view-contact-end"></div>';
|
||||
|
||||
$o .= paginate($a);
|
||||
|
||||
return $o;
|
||||
}
|
|
@ -18,6 +18,8 @@
|
|||
<div id="contact-edit-links" >
|
||||
<a href="contacts/$contact_id/block" id="contact-edit-block-link" ><img src="images/b_block.gif" alt="Block/Unblock contact" title="$block_text"/></a>
|
||||
<a href="contacts/$contact_id/ignore" id="contact-edit-ignore-link" ><img src="images/no.gif" alt="Ignore contact" title="$ignore_text"/></a>
|
||||
</div>
|
||||
<div id="contact-drop-links" >
|
||||
<a href="contacts/$contact_id/drop" id="contact-edit-drop-link" onclick="return confirmDelete();" ><img src="images/b_drophide.gif" alt="Delete contact" title="Delete contact" onmouseover="imgbright(this);" onmouseout="imgdull(this);" /></a>
|
||||
</div>
|
||||
<div id="contact-edit-nav-end"></div>
|
||||
|
|
|
@ -19,8 +19,11 @@
|
|||
<?php } ?>
|
||||
|
||||
<div id="profile-extra-links">
|
||||
<ul>
|
||||
<li><a id="dfrn-request-link" href="dfrn_request/<?php echo $profile['nickname']; ?>">Introductions</a></li>
|
||||
<?php if(! $profile['hide-friends']) echo '<li><a id="viewcontacts-link" href="viewcontacts/' . $profile['nickname'] . '">View Contacts</a></li>'; ?>
|
||||
|
||||
<a id="dfrn-request-link" href="dfrn_request/<?php echo $profile['nickname']; ?>">Introductions</a>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -295,6 +295,26 @@ input#dfrn-url {
|
|||
clear: both;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
#profile-extra-links ul {
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
#profile-extra-links li {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.view-contact-wrapper {
|
||||
margin-top: 20px;
|
||||
float: left;
|
||||
margin-left: 20px;
|
||||
width: 180px;
|
||||
}
|
||||
#view-contact-end {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
|
||||
#profile-edit-default-desc {
|
||||
color: #FF0000;
|
||||
border: 1px solid #FF8888;
|
||||
|
@ -815,11 +835,27 @@ input#dfrn-url {
|
|||
#contact-edit-photo-wrapper {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
#contact-edit-links {
|
||||
float: left;
|
||||
}
|
||||
#contact-edit-links img {
|
||||
margin-left: 20px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
#contact-drop-links {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#contact-drop-links img {
|
||||
margin-left: 20px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
#contact-edit-nav-end {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#contact-edit-direction-icon {
|
||||
float: left;
|
||||
margin-top: 70px;
|
||||
|
|
15
view/viewcontact_template.tpl
Normal file
15
view/viewcontact_template.tpl
Normal file
|
@ -0,0 +1,15 @@
|
|||
|
||||
<div class="view-contact-wrapper" id="view-contact-wrapper-$id" >
|
||||
<div class="view-contact-photo-wrapper" >
|
||||
<div class="view-contact-photo" id="view-contact-photo-$id" >
|
||||
<a href="$url" title="$alt_text" /><img src="$thumb" alt="$name" /></a>
|
||||
</div>
|
||||
<div class="view-contact-photo-end" ></div>
|
||||
</div>
|
||||
<div class="view-contact-name-wrapper" >
|
||||
<div class="view-contact-name" id="view-contact-name-$id" >$name</div>
|
||||
</div>
|
||||
<div class="view-contact-name-end" ></div>
|
||||
</div>
|
||||
<div class="view-contact-wrapper-end"></div>
|
||||
|
Loading…
Reference in a new issue