function social_news() { global $db; $news = array(); $actvity_obj = new Activity(); $activities = $actvity_obj->getFriendsActivities($_SESSION['member_id']); foreach ($activities as $row) { $link_title = printSocialName($row['member_id']) . ' ' . $row['title']; $news[] = array('time' => $row['created_date'], 'object' => $row, 'thumb' => 'images/home-directory_sm.png', 'link' => '<span title="' . strip_tags($link_title) . '">' . $link_title . "</span>"); } return $news; }
</div> <div class="contentbox"> <?php /** * Loop through all the friends and print out a list. */ if (!empty($this->activities)) { ?> <ul> <?php foreach ($this->activities as $id => $array) { ?> <li class="activity"><?php echo $array['created_date'] . ' - ' . printSocialName($array['member_id']) . ' ' . $array['title']; ?> </li> <?php } ?> </ul> <?php //little hack, show_all will only be displayed when the flag is used. if (sizeof($this->activities) == SOCIAL_FRIEND_ACTIVITIES_MAX) { ?> <a href="<?php echo url_rewrite(AT_SOCIAL_BASENAME . 'activities.php', AT_PRETTY_URL_IS_HEADER); ?> "><?php echo _AT('show_all');
<dt><?php echo _AT('access'); ?> </dt> <dd><?php echo $this->group_obj->getPrivacy() ? _AT('private') : _AT('public'); ?> <br/></dd> <dt><?php echo _AT('created_by'); ?> </dt> <dd><?php echo printSocialName($this->group_obj->getUser()); ?> </dd> <dt><?php echo _AT('created_date'); ?> </dt> <dd><?php echo AT_DATE(_AT('startend_date_long_format'), $this->group_obj->getCreatedDate(), AT_DATE_MYSQL_DATETIME); ?> </dd> <dt><?php echo _AT('group_last_updated'); ?>
<h5><?php echo _AT('mutual_connections'); ?> </h5> </div> <div class="contentbox"> <?php foreach ($this->mutual_friends as $friend_id) { ?> <div> <?php echo printSocialProfileImg($friend_id); ?> <br/> <?php echo printSocialName($friend_id); ?> </div> <?php } ?> </div> <?php } //this->mutual_friends != empty ?> <?php } ?>
echo _AT('people_you_may_know'); ?> </h3> </div> <div class="contentbox"> <?php foreach ($people_you_may_know as $index => $id) { ?> <div id="contentbox-a"> <div id="contentbox-b"> <?php echo printSocialProfileImg($id); ?> <?php echo printSocialName($id); ?> <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');
<?php //Group requests if (!empty($this->group_requests)) { ?> <div class="headingbox"><h3><?php echo _AT('new_group_requests'); ?> </h3></div> <div class="contentbox"> <?php foreach ($this->group_requests as $id => $senders) { $gobj = new SocialGroup($id); foreach ($senders as $index => $sender_id) { $name = printSocialName($sender_id); ?> <div class="box" style="border:thin solid black;"> <div style="float:right;"> <a href="<?php echo AT_SOCIAL_BASENAME; ?> groups/invitation_handler.php?request=accept<?php echo SEP; ?> id=<?php echo $gobj->getID() . SEP; ?> sender_id=<?php echo $sender_id; ?>
" title="<?php echo _AT('remove_group_member'); ?> " border="0"/></a> </div> <?php } ?> <div> <div style="float:left;"><?php echo printSocialProfileImg($person_obj->getID()); ?> </div> <div style="padding-left:0.5em; float:left;"> <?php $profile = $person_obj->getDetails(); echo printSocialName($person_obj->getID()) . '<br/>'; echo $profile['country'] . ' ' . $profile['province'] . '<br/>'; ?> </div> <div style="clear:both;"></div><br/> </div> </div> <?php } } ?> </div> <!-- <div style="float:right;"> [-- TODO: Paginator --] </div>
if ((!isset($person['added']) || $person['added'] != 1) && !PrivacyController::validatePrivacy(AT_SOCIAL_SEARCH_VISIBILITY, $relationship, $privacy_obj->getSearch())) { //if this user doesn't want to be searched. continue; } ?> <div class="contact_mini" > <div> <div ><?php echo printSocialProfileImg($id); ?> </div> <div> <?php $member_obj = new Member($id); $profile = $member_obj->getAddress(); echo printSocialName($id) . '<br/>'; echo $profile['country'] . ' ' . $profile['province'] . '<br/>'; ?> </div> <div style="clear:both;"></div><br/> </div> </div> <?php } } else { echo _AT('none_found'); } ?> </div> <!-- <div style="float:right;">
$count = ($page - 1) * SOCIAL_FRIEND_SEARCH_MAX + 1; $offset = ($page - 1) * SOCIAL_FRIEND_SEARCH_MAX; //if $_GET['q'] is set, handle Ajax. if (isset($_GET['q'])) { $query = $addslashes($_GET['q']); //retrieve a list of friends by the search $search_result = searchFriends($query); if (!empty($search_result)) { echo '<div class="suggestions">' . _AT('suggestions') . ':<br/>'; $counter = 0; foreach ($search_result as $member_id => $member_array) { //display 10 suggestions if ($counter > 10) { break; } echo '<a href="javascript:void(0);" onclick="document.getElementById(\'search_friends\').value=\'' . printSocialName($member_id, false) . '\'; document.getElementById(\'search_friends_form\').submit();">' . printSocialName($member_id, false) . '</a><br/>'; $counter++; } echo '</div>'; } exit; } //handle search friends request if (isset($rand_key) && $rand_key != '' && isset($_POST['search_friends_' . $rand_key]) || isset($_GET['search_friends'])) { if (empty($_POST['search_friends_' . $rand_key]) && !isset($_GET['search_friends'])) { $msg->addError('CANNOT_BE_EMPTY'); header('Location: ' . url_rewrite(AT_SOCIAL_BASENAME . 'index_public.php', AT_PRETTY_URL_IS_HEADER)); exit; } //to adapt paginator GET queries if (isset($_GET['search_friends'])) {
<select name="group_admin" id="group_admin"> <?php foreach ($this->group_obj->getGroupMembers() as $garbage => $member_obj) { $selected = ''; if ($this->group_obj->getUser() == $member_obj->getID()) { $selected = ' selected="selected"'; } ?> <option value="<?php echo $member_obj->getID(); ?> " <?php echo $selected; ?> ><?php echo printSocialName($member_obj->getID()); ?> </option> <?php } ?> </select> </div> <?php } ?> <div class="row"> <label for="group_type"><?php echo _AT('group_type'); ?>
/** * This function adds a friend to the database, remove the equivalent friend request. * * @param int the member being approved, not "MYSELF" */ function approveFriendRequest($friend_id){ global $db; $friend_id = intval($friend_id); if ($friend_id < 1){ return; } //TODO: hardcoded relationship = 1 $sql = "INSERT INTO ".TABLE_PREFIX."social_friends SET member_id=$_SESSION[member_id], friend_id=$friend_id, relationship=1"; $is_succeeded = mysql_query($sql, $db); //remove the equivalent friend request if ($is_succeeded){ $is_succeeded = removeFriendRequest($friend_id, $_SESSION['member_id']); } //add to activities log if ($is_succeeded){ $act = new Activity(); $str1 = _AT('now_friends1', printSocialName($friend_id)); $act->addActivity($_SESSION['member_id'], $str1); $str2 = _AT('now_friends2', printSocialName($_SESSION['member_id'])); $act->addActivity($friend_id, $str2); unset($act); } }
$pos_after_last_match = strpos($str, $tag[0]) + strlen($tag[0]); $str_after_last_match = substr($str, $pos_after_last_match); if ($curr_len + strlen($str_after_last_match) > $length) { $rtn .= substr($str_after_last_match, 0, $length - $curr_len) . ' ...'; } else { $rtn = $str; } } else { $rtn = substr($str, 0, $length); } return $rtn; } global $db; $link_limit = 3; //Numero massimo dei possibili sottocontenuti visualizzabili nella home-page $cnt = 0; $actvity_obj = new Activity(); $activities = $actvity_obj->getFriendsActivities($_SESSION['member_id']); if (is_array($activities)) { foreach ($activities as $i => $activity) { if ($cnt >= $link_limit) { break; } $cnt++; $link_title = printSocialName($activity['member_id']) . ' ' . $activity['title']; $list[] = '<span title="' . strip_tags($link_title) . '">' . substring($link_title, SUBLINK_TEXT_LEN) . "</span>"; } return $list; } else { return 0; }
<?php $people_you_may_know = getPeopleYouMayKnow(); if(!empty($people_you_may_know)): ?> <!-- people you may know --> <div class="people-you-may-know"> <div class="headingbox"> <h3><?php echo _AT('people_you_may_know'); ?></h3> </div> <div class="contentbox"> <?php foreach ($people_you_may_know as $index=>$id): ?> <div id="contentbox-a"> <div id="contentbox-b"> <?php echo printSocialProfileImg($id); ?> <?php echo printSocialName($id); ?> <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> </div> <?php endforeach; ?> </div> </div> <?php endif; ?> <!-- groups --><br /><br /><br /> <div class="my-network-groups"><br /> <?php //if my groups array is not empty. $social_group = new SocialGroups(); $my_groups = $social_group->getMemberGroups($_SESSION['member_id']); $random_groups = array(); for ($i=0; (sizeof($random_groups)<SOCIAL_GROUP_HOMEPAGE_MAX && $i<sizeof($my_groups)); $i++){
?> <input type="checkbox" name="new_members[<?php echo $member_id; ?> ]" id="member_<?php echo $member_id; ?> " <?php echo $extra; ?> /> <label for="member_<?php echo $member_id; ?> "><?php echo printSocialName($member_id, false); ?> </label><br/> <?php } ?> </div> <input type="hidden" name="id" value="<?php echo $_REQUEST['id']; ?> " /> <input class="button" type="submit" name="inviteMember" value="<?php echo _AT('invite'); ?> " /> </div>