1 <script src="<?php echo AT_SOCIAL_BASENAME; ?>lib/js/livesearch.js" type="text/javascript"></script>
4 //Generate a random number for the search input name fields, so that the browser will not remember any previous entries.
5 $rand = md5(rand(0, time()));
6 if ($this->rand_key != ''){
7 $last_search = $_POST['search_friends_'.$this->rand_key];
8 } elseif(isset($_GET['search_friends'])) {
9 $last_search = htmlentities_utf8($_GET['search_friends']);
11 $last_search = html_entity_decode($_POST['search_friends_'.$rand]);
13 //take out double quotes until there is a way to escape XSS from the ajax script.
14 $last_search = preg_replace('/\"/', '', $last_search);
16 <div class="social-wrapper">
17 <?php print_paginator($this->page, $this->num_pages, 'search_friends='.$this->search_field, 1); ?>
18 <div class="input-form">
19 <div class="contentrow">
20 <h3><?php echo _AT('search_for_friends'); ?></h3>
21 <form action="<?php echo url_rewrite(AT_SOCIAL_BASENAME.'connections.php');?>" method="POST" id="search_friends_form">
22 <label for="search_friends" style="display:none;"><?php echo _AT('search'); ?></label>
23 <input type="text" size="45" name="search_friends_<?php echo $rand;?>" id="search_friends" value="<?php echo $last_search; ?>" onkeyup="showResults(this.value, 'livesearch', '<?php echo AT_SOCIAL_BASENAME; ?>connections.php')"/>
24 <input type="submit" name="search" value="<?php echo _AT('search'); ?>">
26 if (isset($_POST['myFriendsOnly'])){
27 $mfo_checked = ' checked="checked"';
30 <br/> <div class="social-wrapper-myFriendsOnly"><input type="checkbox" name="myFriendsOnly" id="myFriendsOnly" value="<?php echo _AT('yes'); ?>" <?php echo $mfo_checked; ?> />
31 <label for ="myFriendsOnly"><?php echo _AT('my_friends_only'); ?></label></div>
32 <input type="hidden" name="rand_key" value="<?php echo $rand; ?>" />
34 <div id="livesearch"></div>
38 <div class="headingbox-contentbox">
39 <div class="headingbox"><h3><?php echo _AT('connections'); ?></h3></div>
40 <div class="contentbox">
42 if (!empty($this->friends)):
43 $privacy_controller = new PrivacyController();
44 echo "<h4>"._AT('there_are_entries', sizeof($this->friends))."</h4>";
45 foreach ($this->friends as $id=>$person):
46 $privacy_obj = $privacy_controller->getPrivacyObject($id);
47 // debug($privacy_obj->getSearch(), 'search'.$id);
48 $relationship = $privacy_controller->getRelationship($id);
50 if ((!isset($person['added']) || $person['added']!=1) && !PrivacyController::validatePrivacy(AT_SOCIAL_SEARCH_VISIBILITY, $relationship, $privacy_obj->getSearch())){
51 //if this user doesn't want to be searched.
55 <div class="contact_mini" >
56 <?php if (isset($person['added']) && $person['added']==1): ?>
58 <div style="float:left;"><?php echo printSocialProfileImg($id); ?></div>
59 <div style="padding-left:0.5em; float:left;">
61 $member_obj = new Member($id);
62 $address = $member_obj->getAddress();
63 echo printSocialName($id) . '<br/>';
64 echo $address['province'] . ' ' . $address['country'] . '<br/>';
67 <div style="float:right;"><a href="<?php echo url_rewrite(AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX);?>?remove=yes<?php echo SEP;?>id=<?php echo $id;?>"><img src="<?php echo $_base_href.AT_SOCIAL_BASENAME; ?>images/b_drop.png" alt="<?php echo _AT('delete'); ?>" title="<?php echo _AT('delete'); ?>" border="0"/></a></div>
68 <div style="clear:both;"></div><br/>
72 <?php if (!isset($_POST['myFriendsOnly'])): ?>
74 <div style="float:left;"><?php echo printSocialProfileImg($id); ?></div>
75 <div style="padding-left:0.5em; float:left;">
77 $member_obj = new Member($id);
78 $address = $member_obj->getAddress();
79 echo printSocialName($id) . '<br/>';
80 echo $address['country'] . ' ' . $address['province'] . '<br/>';
83 <?php if ($person['pending']==1): ?>
84 <div style="float:right;"><?php echo _AT('pending'); ?></div>
86 <div style="float:right;"><a href="<?php echo AT_SOCIAL_BASENAME; ?>connections.php?id=<?php echo $id; ?>"><img src="<?php echo $_base_href.AT_SOCIAL_BASENAME; ?>images/plus_icon.gif" alt="<?php echo _AT('add_to_friends'); ?>" title="<?php echo _AT('add_to_friends'); ?>" border="0"/></a> </div>
88 <div style="clear:both;"></div><br/>
96 echo _AT('none_found');
101 <div style="float:right;">
106 <div style="clear:both;"></div>
108 <?php print_paginator($this->page, $this->num_pages, 'search_friends='.$this->search_field, 1); ?>