aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/nav.php7
-rw-r--r--mod/viewcontacts.php57
-rw-r--r--view/contact_edit.tpl2
-rw-r--r--view/profile.php5
-rw-r--r--view/style.css36
-rw-r--r--view/viewcontact_template.tpl15
6 files changed, 119 insertions, 3 deletions
diff --git a/include/nav.php b/include/nav.php
index b95a4263c..ce83d94d3 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -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')) {
diff --git a/mod/viewcontacts.php b/mod/viewcontacts.php
new file mode 100644
index 000000000..47132e6a8
--- /dev/null
+++ b/mod/viewcontacts.php
@@ -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;
+} \ No newline at end of file
diff --git a/view/contact_edit.tpl b/view/contact_edit.tpl
index e1cffc460..dbcc3fd71 100644
--- a/view/contact_edit.tpl
+++ b/view/contact_edit.tpl
@@ -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>
diff --git a/view/profile.php b/view/profile.php
index e8de331e1..8ec9ab599 100644
--- a/view/profile.php
+++ b/view/profile.php
@@ -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>
diff --git a/view/style.css b/view/style.css
index 740ca13f6..f8c483a89 100644
--- a/view/style.css
+++ b/view/style.css
@@ -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;
diff --git a/view/viewcontact_template.tpl b/view/viewcontact_template.tpl
new file mode 100644
index 000000000..3436a5c45
--- /dev/null
+++ b/view/viewcontact_template.tpl
@@ -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>
+