Пример #1
0
* The lastest version of Cyberspace Networks CoreSystem can be obtained from:
* http://developer.cyberspace-networks.com/
* For questions, help, comments, discussion, etc. please visit
* https://github.com/CyberspaceNetworks/CoreSystem
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*/
?>

<div class="<?php 
echo $block_name;
?>
_content" id="list_images">
    <div id="<?php 
echo $block_name;
?>
_list">
        <ul class="list-group">
            <li class="list-group-item">
                <a href="<?php 
echo PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $uid;
?>
">
                    <?php 
echo uihelper_resize_mk_user_img($picture, 250, 250, 'alt="User Picture"');
?>
                </a>
            </li>
        </ul>
    </div>
</div>
Пример #2
0
function activities_message($subject, $object, $type, $extra)
{
    $msg = '';
    if (!empty($object) && !empty($subject) && !empty($type)) {
        $extra = unserialize($extra);
        $user = new User();
        $user->load($subject, "user_id");
        if (!empty($_REQUEST['debug'])) {
            echo "activity type: {$type} <br />";
        }
        switch ($type) {
            case 'user_post_a_comment':
                $msg = '<span> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '>' . uihelper_resize_mk_user_img($user->picture, 20, 20, 'alt="User Picture"') . '</a> </span> <b> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '> ' . $user->display_name . '</a> has left a <a href=' . $extra['content_url'] . '>comment</a> </b>';
                break;
            case 'user_post_a_blog':
                $msg = '<span> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '>' . uihelper_resize_mk_user_img($user->picture, 20, 20, 'alt="User Picture"') . '</a> </span> <b> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '> ' . $user->display_name . '</a> posted a new blog <a href=' . $extra['blog_url'] . '>' . $extra['blog_name'] . '</a> </b>';
                break;
            case 'content_modified':
                $msg = '<span> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '>' . uihelper_resize_mk_user_img($user->picture, 20, 20, 'alt="User Picture"') . '</a> </span> <b> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '> ' . $user->display_name . '</a> modified content <a href=' . $extra['blog_url'] . '>' . $extra['blog_name'] . '</a> </b>';
                break;
            case 'user_image_upload':
                $msg = '<span> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '>' . uihelper_resize_mk_user_img($user->picture, 20, 20, 'alt="User Picture"') . '</a> </span> <b> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '> ' . $user->display_name . '</a> uploaded a new <a href=' . PA::$url . '/media_full_view.php?cid=' . $extra['content_id'] . '>image</a> </b>';
                break;
            case 'user_video_upload':
                $msg = '<span> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '>' . uihelper_resize_mk_user_img($user->picture, 20, 20, 'alt="User Picture"') . '</a> </span> <b> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '> ' . $user->display_name . '</a> uploaded a new <a href=' . PA::$url . '/media_full_view.php?cid=' . $extra['content_id'] . '>video</a> </b>';
                break;
            case 'user_audio_upload':
                $msg = ' <span> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '>' . uihelper_resize_mk_user_img($user->picture, 20, 20, 'alt="User Picture"') . '</a> </span> <b> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '> ' . $user->display_name . '</a> uploaded a new <a href=' . PA::$url . '/media_full_view.php?cid=' . $extra['content_id'] . '>audio</a> </b>';
                break;
            case 'user_friend_requested':
                break;
            case 'user_friend_added':
                $user = new User();
                $user->load($subject, "user_id");
                $friend = new User();
                $friend->load($object, 'user_id');
                $msg = ' <span> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '>' . uihelper_resize_mk_user_img($user->picture, 20, 20, 'alt="User Picture"') . '</a> </span> <em> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '> ' . $user->display_name . '</a> added  </em> <span> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $object . '>' . uihelper_resize_mk_user_img($friend->picture, 20, 20, 'alt="User Picture"') . '</a> </span> <em> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $object . '> ' . $friend->display_name . '</a> as friend</em>';
                break;
            case 'user_friend_send_a_message':
                break;
            case 'group_created':
                $msg = '<span> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '>' . uihelper_resize_mk_user_img($user->picture, 20, 20, 'alt="User Picture"') . '</a> </span> <b> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '> ' . $user->display_name . '</a> created a new group <a href=' . $extra['group_url'] . '>' . $extra['group_name'] . '</a> </b>';
                break;
            case 'group_settings_updated':
                $msg = '<span> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '>' . uihelper_resize_mk_user_img($user->picture, 20, 20, 'alt="User Picture"') . '</a> </span> <b> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '> ' . $user->display_name . '</a> updated settings for group <a href=' . $extra['group_url'] . '>' . $extra['group_name'] . '</a> </b>';
                break;
            case 'group_joined':
                $msg = '<span> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '>' . uihelper_resize_mk_user_img($user->picture, 20, 20, 'alt="User Picture"') . '</a> </span> <b> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '> ' . $user->display_name . '</a> joined the group <a href=' . PA::$url . PA_ROUTE_GROUP . '/gid=' . $extra['group_id'] . '>' . $extra['group_name'] . '</a> </b>';
                break;
            case 'group_image_upload':
                $msg = '<span> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '>' . uihelper_resize_mk_user_img($user->picture, 20, 20, 'alt="User Picture"') . '</a> </span> <b> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '> ' . $user->display_name . '</a> uploaded a new <a href=' . PA::$url . '/media_full_view.php?cid=' . $extra['content_id'] . '&gid=' . $object . '>image</a> in <a href=' . PA::$url . PA_ROUTE_MEDIA_GALLEY_IMAGES . '&gid=' . $object . '>group gallery</a> </b>';
                break;
            case 'group_video_upload':
                $msg = '<span> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '>' . uihelper_resize_mk_user_img($user->picture, 20, 20, 'alt="User Picture"') . '</a> </span> <b> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '> ' . $user->display_name . '</a> uploaded a new <a href=' . PA::$url . '/media_full_view.php?cid=' . $extra['content_id'] . '>video</a> in <a href=' . PA::$url . PA_ROUTE_MEDIA_GALLEY_VIDEOS . '&gid=' . $object . '>group gallery</a> </b>';
                break;
            case 'group_audio_upload':
                $msg = '<span> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '>' . uihelper_resize_mk_user_img($user->picture, 20, 20, 'alt="User Picture"') . '</a> </span> <b> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '> ' . $user->display_name . '</a> uploaded a new <a href=' . PA::$url . '/media_full_view.php?cid=' . $extra['content_id'] . '>audio</a> in <a href=' . PA::$url . PA_ROUTE_MEDIA_GALLEY_AUDIOS . '&gid=' . $object . '>group gallery</a> </b>';
                break;
            case 'group_post_a_blog':
                $msg = '<span> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '>' . uihelper_resize_mk_user_img($user->picture, 20, 20, 'alt="User Picture"') . '</a> </span> <b> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '> ' . $user->display_name . '</a> posted a new blog <a href=' . $extra['blog_url'] . '>' . $extra['blog_name'] . '</a> </b>';
                break;
            case 'network_joined':
                break;
            case 'network_created':
                break;
            default:
                if (defined('SHOW_EXTERNAL_ACTIVITY_FEEDS') and SHOW_EXTERNAL_ACTIVITY_FEEDS) {
                    if (is_array($extra['info'])) {
                        $msg = '<span> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '>' . uihelper_resize_mk_user_img($user->picture, 20, 20, 'alt="User Picture"') . '</a> </span> <b> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '> ' . $user->display_name . ' </a></b>';
                        foreach ($extra['info'] as $key => $value) {
                            $msg .= "<p>{$value}</p>";
                        }
                        $msg .= ' (external)';
                    } else {
                        $msg = '<span> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '>' . uihelper_resize_mk_user_img($user->picture, 20, 20, 'alt="User Picture"') . '</a> </span> <b> <a href=' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $subject . '> ' . $user->display_name . ' </a></b>' . $extra['info'] . ' (external)';
                    }
                }
        }
    }
    return $msg;
}
    function render_network_image($net_or_id) {
	// find the id
	if (is_numeric($net_or_id)) {
	    // there's no easy way to get info about a network; we have to go through this incantation...
	    $net_obj = new Network();
	    $net_obj->network_id = $net_or_id;
	    $net = $net_obj->get();
	    $net = $net[0];
	} else {
	    $net = $net_or_id;
	}

	// and display
	$networks = $this->state['networks'];
	$included = isset($networks['included'][(int)$net->network_id]);

	$img = uihelper_resize_mk_user_img($net->inner_logo_image, 75, 75);
	$name = $net->name;
	$cls = "friend_pic";
	if ($included) $cls .= " included_friend";
	$include_op = $included ? "exclude" : "include";

	$onclick = "badge.include_obj('networks', 'network_$net->network_id', $net->network_id, '$include_op');";
	return <<<ENS
<div class="$cls" onclick="$onclick" title="Click to $include_op this network.">
	<p>$img</p>
	<p>$name</p>
</div>
ENS;
    }
Пример #4
0
if (count($users_data)) {
    $xml_obj = new DomDocument();
    $buddylist = $xml_obj->createElement('buddylist');
    foreach ($users_data as $user) {
        $profile_data = User::load_user_profile($user['user_id'], $viewer_uid);
        $profile_data = sanitize_user_data($profile_data);
        $buddy = $xml_obj->createElement("buddy");
        //adding idbuddy to the xml
        $idbuddy = $xml_obj->createElement("idbuddy");
        $idbuddy->appendChild($xml_obj->createTextNode($user['user_id']));
        $buddy->appendChild($idbuddy);
        //adding thumbnail to the xml
        if (empty($user['picture'])) {
            $user['picture'] = $current_theme_path . '/images/default.png';
        } else {
            $img = uihelper_resize_mk_user_img($user['picture'], 80, 80, 'alt="PA"');
            preg_match("/src=\"([^']*?)\"/", $img, $match);
            //preg_match to get the src of the image
            $user['picture'] = $match[1];
        }
        $thumbnail = $xml_obj->createElement("thumbnail");
        $thumbnail->appendChild($xml_obj->createTextNode($user['picture']));
        $buddy->appendChild($thumbnail);
        //adding presence to the xml
        $presence = $xml_obj->createElement("presence");
        $personaIds = Persona::get_user_persona_ids_with_service($user['user_id'], 'AIM');
        $pp = PersonaHelper::can_see(@$personaIds[0], $user['user_id'], $viewer_uid);
        if ($pp) {
            // we are allowed to see it
            $presence_image = 'offline.png';
            $Screen_name = $pp->configuration_data->userName;
        ?>
        <tr class="activities_ranking_row activities_ranking_<?php 
        echo $even_odd;
        ?>
" id="activities_<?php 
        echo $idx;
        ?>
" onclick="$('.activities_actions#'+this.id).toggle();" style="cursor:pointer;">
          <td class="ranking_position">
            <?php 
        echo $i + $increment;
        ?>
          </td>
          <td class="ranking_image">
            <?php 
        echo "<a href=\"" . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . "{$ranked_user->user_id}\">" . uihelper_resize_mk_user_img($ranked_user->picture, 35, 35, "alt=\"{$ranked_user->display_name}\"") . "</a>";
        ?>
          </td>
          <td class="ranking_name">
            <a href="<?php 
        echo PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $ranked_user->user_id;
        ?>
"><?php 
        echo $ranked_user->display_name;
        ?>
</a>
          </td>
          <td class="ranking_date">
            <?php 
        echo !empty($ranked_user->last_activity) ? PA::datetime($ranked_user->last_activity, 'long', 'short') : __("unknown");
        ?>
Пример #6
0
 //save post normally
 if ($_POST['route_to_pa_home'] == 1) {
     $display_on_homepage = DISPLAY_ON_HOMEPAGE;
     //its zero
 } else {
     $display_on_homepage = NO_DISPLAY_ON_HOMEPAGE;
     //This will not show up on homepage - flag has opposite values
 }
 $post_saved = BlogPost::save_blogpost(0, $login_uid, $_POST["blog_title"], $_POST["description"], NULL, $terms, -1, 1, $display_on_homepage);
 $permalink_cid = $post_saved['cid'];
 if ($extra['network_content_moderation'] == NET_YES && $network_info->owner_id != $user->user_id) {
     Network::moderate_network_content(-1, $permalink_cid);
     // -1 for contents; not a part of any collection
     $error_msg = "&err=" . urlencode(MessagesHandler::get_message(1004));
 }
 $content_author_image = uihelper_resize_mk_user_img($user->picture, 80, 80, 'alt="' . $user->first_name . '" align="left" style="padding: 0px 12px 12px 0px;"');
 $network_owner_name = User::map_ids_to_logins($network_info->owner_id);
 $params['cid'] = $permalink_cid;
 $params['first_name'] = $user->first_name;
 $params['user_id'] = $user->user_id;
 $params['user_image'] = $content_author_image;
 $params['content_title'] = $_POST["blog_title"];
 $params['network_name'] = $network_info->name;
 $params['content_url'] = PA::$url . '/' . FILE_CONTENT . '?cid=' . $permalink_cid;
 $params['content_moderation_url'] = PA::$url . '/' . FILE_NETWORK_MANAGE_CONTENT;
 $params['config_site_name'] = $config_site_name;
 $params['network_owner_name'] = $network_owner_name[$network_info->owner_id];
 auto_email_notification('content_posted', $params);
 if ($_POST['route_to_pa_home'] == 1) {
     auto_email_notification('content_posted_to_comm_blog', $params);
 }
Пример #7
0
echo $outer_block_id;
?>
">
    <!-- Post -->
    <div class="post">
        <h2>
            <?php 
echo $contents->title;
?>
        </h2>
        <div class="user-block">
            <a href="<?php 
echo PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $contents->author->user_id;
?>
"><?php 
echo uihelper_resize_mk_user_img($contents->author->picture, 128, 128, 'class="img-circle img-bordered-sm" alt=".$contents->author_name."');
?>
</a>
            <span class="username">
                <?php 
echo $contents->author_name;
?>
            </span>
            <span class="description"><?php 
echo __("Blog post");
?>
 - <?php 
echo date("l, F d Y", $contents->created);
?>
</span>
        </div>
function getUserImage($args)
{
    $login = $args['login'];
    $user = new User();
    $user->load($login);
    if ($args['width'] == null || $args['height'] == null) {
        $p = $user->picture;
        $pic = !empty($p) ? $p : 'default.png';
        return array('success' => TRUE, 'url' => PA::$url . '/files/' . $pic);
    } else {
        $pic = uihelper_resize_mk_user_img($user, $args['width'], $args['height']);
        $pic = explode("\"", $pic);
        $pic = $pic[3];
        return array('success' => TRUE, 'url' => $pic);
    }
}
Пример #9
0
 switch ($show_what) {
     case 'friends':
         $perpage = (int) $param;
         $relations = Relation::get_all_relations($user->user_id, 0, FALSE, $param, $page);
         $n = count($relations);
         $rows = intval($n / 3) + ($n % 3 ? 1 : 0);
         $pos = 0;
         $html .= "<table>";
         for ($y = 0; $y < $rows; ++$y) {
             $html .= "<tr>";
             for ($x = 0; $x < $cols && $pos < $n; ++$x, ++$pos) {
                 $html .= '<td valign="bottom">';
                 $rel = $relations[$pos];
                 $html .= '<a target="_blank" href="' . $base_url . '/user.php?uid=' . $rel['user_id'] . '">';
                 if ($rel['picture'] && file_exists("files/" . $rel['picture'])) {
                     $html .= uihelper_resize_mk_user_img($rel['picture'], 50, 50) . "<br/>";
                 }
                 $html .= htmlspecialchars($rel['login_name']) . '</a>';
                 $html .= "</td>";
             }
             $html .= "</tr>";
         }
         $show_all_url = "{$base_url}/view_all_members.php?view_type=relations&uid={$user->user_id}";
         $html .= "<tr>";
         for ($i = 0; $i < $cols - 1; ++$i) {
             $html .= '<td style="background-color: white"></td>';
         }
         $html .= "<td><a target=\"_blank\" href=\"{$show_all_url}\">show all</a></td></tr>";
         $html .= "</table>";
         break;
     case 'groups':
* @license http://bit.ly/aVWqRV PayAsYouGo License
* @copyright Copyright (c) 2010 Broadband Mechanics
* @package PeopleAggregator
*/
?>
<div <?= ($mod->may_see_details) ? 'class="module_icon_list"' : '' ?> id="list_members">
<ul class="memb ers">
  <?php
    for ($counter = 0; $counter < count($links['users_data']); $counter++) {
      $class = (( $counter%2 ) == 0) ? 'class="color"': NULL;
  ?>  
  
  <li <?php echo $class?>>
  	<?php if ($mod->may_see_details) { ?>
    <a href="<?= PA::$url . PA_ROUTE_USER_PUBLIC . '/' . urlencode($links['users_data'][$counter]['login_name']) ?>">
      <?php echo uihelper_resize_mk_user_img($links['users_data'][$counter]['picture'], 35, 35, 'alt="PA"') ?>
    </a>
        <span>
          <b><?= link_to($links['users_data'][$counter]['display_name'],
			 "user_blog", array("login" => urlencode($links['users_data'][$counter]['login_name']))) ?></b><br/>
			 <?= $links['users_data'][$counter]['family_status'] ?>
        </span>
  	<? } else { ?>
  	<span>
          <b><?= link_to($links['users_data'][$counter]['display_name'],
			 "user_blog", array("login" => urlencode($links['users_data'][$counter]['login_name']))) ?></b>,
			 <?= $links['users_data'][$counter]['family_status'] ?>
        </span>
  	<? } ?>
  </li>
  <?php 
 $new_video->allow_comments = 1;
 if (!empty($_GET['group_id'])) {
     $perm = 1;
 } else {
     $perm = !empty($_GET['video_perm']) ? $_GET['video_perm'] : 1;
 }
 $new_video->video_perm = $new_video->file_perm = $perm;
 $new_video->save();
 $tag_array = NULL;
 if (!empty($_GET['tag'])) {
     $tag_array = Tag::split_tags($_GET['tag']);
     Tag::add_tags_to_content($new_video->content_id, $tag_array);
 }
 global $config_site_name;
 $uploaded = TRUE;
 $media_owner_image = uihelper_resize_mk_user_img(PA::$user->picture, 80, 80, 'alt="' . PA::$user->first_name . '" align="left" style="padding: 0px 12px 12px 0px;"');
 $params['first_name'] = PA::$user->first_name;
 $params['user_id'] = PA::$login_uid;
 $params['user_image'] = $media_owner_image;
 $params['cid'] = $new_video->content_id;
 $params['media_title'] = $new_video->title;
 $params['content_url'] = $redirect_url . '/' . FILE_CONTENT . '?cid=' . $new_video->content_id;
 $params['config_site_name'] = $config_site_name;
 $params['media_full_view_url'] = $redirect_url . '/' . FILE_MEDIA_FULL_VIEW . '?cid=' . $new_video->content_id;
 $params['content_moderation_url'] = $redirect_url . '/' . FILE_NETWORK_MANAGE_CONTENT;
 $params['network_name'] = PA::$network_info->name;
 //   auto_email_notification('media_uploaded', $params, $network_details);
 $moderation = FALSE;
 if (!empty($_GET['group_id'])) {
     $activity = 'group_video_upload';
     //for rivers of people
Пример #12
0
 }
 try {
     $relation = Relation::get_relation($rel_creater->user_id, $relation_uid);
     $edit = $relation ? TRUE : FALSE;
 } catch (PAException $e) {
     $edit = FALSE;
 }
 try {
     if (isset($_POST['in_family'])) {
         // If the user has checked the in_family checkbox.
         Relation::add_relation($uid, $relation_uid, $relationship_level, NULL, NULL, NULL, NULL, NULL, true, $status);
     } else {
         Relation::add_relation($uid, $relation_uid, $relationship_level, NULL, NULL, NULL, NULL, NULL, NULL, $status);
     }
     // relationship establisher image
     $rel_creater_picture = uihelper_resize_mk_user_img($rel_creater->picture, 80, 80, 'alt="' . $rel_creater->first_name . '" align="left" style="padding: 0px 12px 12px 0px;"');
     if ($edit == FALSE) {
         if ($extra['reciprocated_relationship'] == NET_YES) {
             $approve_deny_url = $base_url . '/view_all_members.php?view_type=in_relations&uid=' . $user->user_id;
             // defining array to be sent, to fill message frame
             $params = array('first_name' => $_SESSION['user']['first_name'], 'last_name' => $_SESSION['user']['last_name'], 'user_id' => $_SESSION['user']['id'], 'approve_deny_url' => $approve_deny_url, 'invited_user_name' => $user->login_name, 'requestor_image' => $rel_creater_picture, 'to' => $user->email, 'requested_user_id' => $user->user_id, 'config_site_name' => $config_site_name);
             // send notification
             auto_email_notification_members('relationship_requested', $params);
         } else {
             $params['related_uid'] = $relation_uid;
             $params['related_user'] = $user->first_name;
             $params['user_name'] = $rel_creater->login_name;
             $params['user_id'] = $rel_creater->user_id;
             $params['user_image'] = $rel_creater_picture;
             $params['to'] = $user->email;
             $params['my_friends_url'] = PA::$url . '/' . FILE_VIEW_ALL_MEMBERS . '?view_type=in_relations&uid=' . $relation_uid;
              </table>
            </th>
          </tr>

          <tr valign="top">
            <td class="author_info" width="<?php 
echo $avatar_size['width'];
?>
">
              <div class="forum_avatar">
                <a href="<?php 
echo PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $post->user->login_name;
?>
">
                  <?php 
echo uihelper_resize_mk_user_img($post->user->picture, $avatar_size['width'], $avatar_size['height'], 'alt="' . $post->user->login_name . '"');
?>
                </a>
              </div>
              <div class="smallfont">
                <div><?php 
echo __('Posts');
?>
: <?php 
echo $post->user->user_id != -1 ? PaForumPost::countPaForumPost("user_id = " . $post->user->user_id) : '';
?>
 </div>
                <div><?php 
echo __('Last login');
?>
: <?php 
'>
  <td class="author">

      <?php 
        if ($comment['user_id'] == -1) {
            ?>
      <a rel="nofollow" href="<?php 
            echo htmlspecialchars($comment['homepage']);
            ?>
"><?php 
            echo $comment['name'];
            ?>
</a> said:
      <?php 
        } else {
            echo '<a href="' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $comment['user_id'] . '">' . uihelper_resize_mk_user_img($comment['picture'], 80, 80, 'alt=""') . '</a>';
            ?>

      <br /><a href="<?php 
            echo PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $comment['user_id'];
            ?>
"> <?php 
            echo $comment['name'];
            ?>
</a>
      <?php 
        }
        ?>
  </td>
    <td class="message">
   <?php 
Пример #15
0
             // if group is joined through group invitation
             $Ginv = Invitation::load($group_invitation_id);
             $gid = $Ginv->inv_collection_id;
             $user_obj = new User();
             $user_obj->load((int) $Ginv->user_id);
             $group = ContentCollection::load_collection((int) $gid, $Ginv->user_id);
             $user_type = Group::get_user_type($user_obj->user_id, $gid);
             if ($group->reg_type == REG_MODERATED && $user_type == OWNER) {
                 $group->collection_id = $gid;
                 $group->approve($login_uid, 'user');
             }
             $user_accepting_ginv_obj = new User();
             $user_accepting_ginv_obj->load((int) $login_uid);
             $group_name = $group->title;
             $group_url = PA::$url . '/' . FILE_GROUP . '?gid=' . $gid;
             $invited_user_image = uihelper_resize_mk_user_img($user_accepting_ginv_obj->picture, 80, 80, 'alt="' . $user_accepting_ginv_obj->first_name . '" align="left" style="padding: 0px 12px 12px 0px;"');
             // data for passing in common mail method
             $array_of_data = array('first_name' => $user_accepting_ginv_obj->first_name, 'last_name' => $user_accepting_ginv_obj->last_name, 'user_name' => $user_accepting_ginv_obj->login_name, 'user_id' => $user_accepting_ginv_obj->user_id, 'invited_user_id' => $user_obj->user_id, 'invited_user_name' => $user_obj->login_name, 'invited_user_image' => $invited_user_image, 'group_id' => $gid, 'mail_type' => 'invite_accept_group', 'to' => $user_obj->email, 'group_name' => $group_name, 'group_member_count' => Group::get_member_count((int) $gid), 'config_site_name' => $config_site_name, 'group_url' => $group_url);
             auto_email_notification_members('invitation_accept', $array_of_data);
         }
     } catch (PAException $e) {
         if ($e->code == GROUP_NOT_INVITED) {
             $group_top_mesg = $e->message;
             //header("Location: groups_home.php");
             //exit;
         }
         $group_top_mesg = $e->message;
     }
 } else {
     $group_top_mesg = "You are already a member of \"" . stripslashes($group->title) . "\" .";
 }
            $obj->user_id = $_POST['uid'];
            $obj->comment = $_POST['comment'];
            $obj->slug = $_POST['slug'];
            $obj->channel_id = $_POST['c_id'];
            $obj->is_active = 1;
            $obj->save();
            //if the comment is posted then need to print the new set of comments.
            $channel_id = ChannelComment::convert_slug_to_channel_id($_POST['slug']);
            $new_comments = ChannelComment::get_channel_comments($channel_id, NULL, FALSE, 5, 1);
            $cnt = count($new_comments);
            $result = NULL;
            if ($cnt > 0) {
                $i = 1;
                $result .= '<div class="mheader_t"><span class="mh1 blue">' . $cnt . '</span></div><br><br><ul>';
                foreach ($new_comments as $comment) {
                    $img = uihelper_resize_mk_user_img($comment['author_details']->picture, 35, 35);
                    $login = User::get_login_name_from_id($comment['author_details']->user_id);
                    $result .= '<li><div class="asc_i"><a href="' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $login . '" target="_blank">' . $img . '</a></div><div><div class="asc_t"><span class="mh3b"><a href="' . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $login . '" target="_blank">' . $login . '</a></span><br><span class="nh_body2">' . $comment["comment"] . '</span></div><div class="clear"></div></li>';
                    $i++;
                }
                $result .= '</ul>';
            }
            print $result;
            //      print(__('comment posted sucessfully'));
        } else {
            print $msg;
        }
    } else {
        print __('Please login to comment');
    }
}
//                echo "<li>person: $name $email";
                if ($u) {
                    $existing_people[] = $u;
                } else {
                    $new_people[] = $person;
                }
                echo "</li>";
            }
            echo <<<EOF
                <table width="100%" border="0">
                <tr><td width="50%" style="color: #909090">existing members</td><td style="color: #a0a0a0">unknown people</td></tr>
                <tr><td>
EOF;
            // show list of people who are already here
            foreach ($existing_people as $u) {
                echo '<div class="fleft">'.mk_input($u->first_name, $u->last_name, $u->email, ($u->user_id != $login_uid)).' '.uihelper_resize_mk_user_img($u, 50, 50)."<br/><a href=\"mailto:$u->email\">$u->first_name $u->last_name</a></div>";
            }
            echo <<<EOF
                </td><td>
EOF;
            // show list of new people
            foreach ($new_people as $p) {
                echo '<p>'.mk_input($p->{'first-name'}, $p->{'last-name'}, $p->{'email-address'}).' <a href="mailto:'.$p->{'email-address'}.'">'.$p->{'first-name'}.' '.$p->{'last-name'}."</a></p>";
            }
            echo <<<EOF
                </td></tr>
                </table>
EOF;
        }
        break;
    <?php 
for ($counter = 0; $counter < count($links['users_data']); $counter++) {
    $class = $counter % 2 == 0 ? 'class="color"' : NULL;
    ?>
  

        <li <?php 
    echo $class;
    ?>
>
            <a href="<?php 
    echo PA::$url . PA_ROUTE_USER_PUBLIC . '/' . urlencode($links['users_data'][$counter]['login_name']);
    ?>
">
                <?php 
    echo uihelper_resize_mk_user_img($links['users_data'][$counter]['picture'], 35, 35, 'alt="User Image"');
    ?>
            </a>
            <span>
                <b><?php 
    echo link_to($links['users_data'][$counter]['display_name'], "user_blog", array("login" => urlencode($links['users_data'][$counter]['login_name'])));
    ?>
</b><br/>
                    <?php 
    echo sprintf(__("(%d %ss)"), $links['users_data'][$counter]['no_of_relations'], $rel_term);
    ?>
            </span>
        </li>
        <?php 
}
?>
Пример #19
0
         'login' => $login
         );
         $user_url = get_url(FILE_USER_BLOG, $url_perms);
        */
        $user_url = PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $login;
        ?>
                        <td><input type="checkbox" name="uid[]" value="<?php 
        echo $links[$i]['user_id'];
        ?>
" /></td>
                        <td><a href="<?php 
        echo $user_url;
        ?>
">
                                <?php 
        echo uihelper_resize_mk_user_img($links[$i]['picture'], 35, 35, 'alt="facewall"');
        ?>
                            </a>
                        </td>
                        <td><?php 
        echo PA::date($links[$i]['created'], 'short');
        ?>
</td>
                        <td><a href="<?php 
        echo $user_url;
        ?>
"><?php 
        echo $links[$i]['login_name'];
        ?>
</a></td>
                        <td><?php 
    echo PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $login_user->user_id;
    ?>
" class="dropdown-toggle" data-toggle="dropdown">
                            <?php 
    echo uihelper_resize_mk_user_img($login_user->picture, 160, 160, 'class="user-image" alt="User Image"');
    ?>
                            <span class="hidden-xs"><?php 
    echo $login_user->login_name;
    ?>
</span>
                        </a>
                        <ul class="dropdown-menu">
                            <!-- User image -->
                            <li class="user-header">
                                <?php 
    echo uihelper_resize_mk_user_img($login_user->picture, 160, 160, 'class="img-circle" alt="User Image"');
    ?>
                                <p>
                                    <?php 
    echo $login_user->login_name;
    ?>
                                    <small>Member since Nov. 2012</small>
                                </p>
                            </li>
                            <!-- Menu Body -->
                            <li class="user-body">
                                <div class="row">
                                    <div class="col-xs-4 text-center">
                                        <a href="#">Followers</a>
                                    </div>
                                    <div class="col-xs-4 text-center">
    ?>
<div id="GroupsDirectoryModule">
  <div class="group_list">
    <table cellspacing="0" cellpadding="0">
     <?php 
    for ($i = 0; $i < $cnt; $i++) {
        $pic = $links[$i]['picture'];
        ?>
         
       <tr>   
         <td align="center" valign="top" width="80">
           <a href="<?php 
        echo PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $links[$i]['user_id'];
        ?>
"><?php 
        echo uihelper_resize_mk_user_img($links[$i]['picture'], 35, 35, 'alt="User image"');
        ?>
</a>
         </td>
              
         <td valign="top" width="415">
           <h2><a href="<?php 
        echo PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $links[$i]['user_id'];
        ?>
"><?php 
        echo $links[$i]['login_name'];
        ?>
</a></h2>
               
         <?php 
        echo ucfirst($links[$i]['first_name']) . ' ' . $links[$i]['last_name'];
Пример #22
0
function save_post($cid = NULL, $ccid = NULL, $is_album = FALSE, $display_on = 1)
{
    global $user, $network_info;
    $extra = unserialize($network_info->extra);
    $micro_content_post = new SBMicroContent();
    $micro_content_post->set_mc_type($_REQUEST['sb_mc_type']);
    $content = $micro_content_post->format_structured_content();
    $micro_content_post->body = $content;
    $micro_content_post->author_id = $_SESSION['user']['id'];
    $micro_content_post->allow_comments = 1;
    $micro_content_post->trackbacks = $_REQUEST['trackback'];
    $micro_content_post->is_active = 1;
    if ($cid) {
        $micro_content_post->content_id = $cid;
        $condition = array('content_id' => $cid);
        $is_active = ACTIVE;
        if ($extra['network_content_moderation'] == NET_YES) {
            $content = Content::load_all_content_for_moderation(NULL, $condition);
            if (!empty($content)) {
                $is_active = $content[0]['is_active'];
            }
        }
        $micro_content_post->is_active = $is_active;
    }
    if (!$ccid) {
        //independent post which is not part of any contentcollection
        $ccid = -1;
    }
    $micro_content_post->parent_collection_id = $ccid;
    $micro_content_post->display_on = $display_on;
    $sb_content = array();
    $sb_content = SBMicroContent::get_sbtype_id($_REQUEST['sb_mc_type'], $with_name = true);
    $micro_content_post->sbtype_id = $sb_content["sbtype_id"];
    $micro_content_post->title = $_POST[$sb_content["titlefield"]];
    //echo '<pre>';print_r($content);
    $micro_content_post->save();
    $return_array = array('title' => $_POST[$sb_content["titlefield"]], 'body' => $content, 'content_id' => $micro_content_post->content_id);
    if ($ccid != -1 && !$is_album) {
        // Code for checking groups with moderated content.
        //fix me change it for using ContentCollection::get_collection_type()
        $collection = ContentCollection::load_collection($micro_content_post->parent_collection_id, $micro_content_post->author_id);
        //$collection->assert_user_access($_SESSION['user']['id']);
        if ($collection->is_moderated) {
            $Group = new Group();
            $Group->collection_id = $micro_content_post->parent_collection_id;
            $Group->moderate_content($micro_content_post->content_id);
            $return_array['is_moderated'] = 1;
        }
    }
    $permalink_cid = $micro_content_post->content_id;
    $content_author_image = uihelper_resize_mk_user_img($user->picture, 80, 80, 'alt="' . $user->first_name . '" align="left" style="padding: 0px 12px 12px 0px;"');
    $params['cid'] = $permalink_cid;
    $params['first_name'] = $user->first_name;
    $params['user_id'] = $user->user_id;
    $params['user_image'] = $content_author_image;
    $params['content_title'] = $micro_content_post->title;
    $params['network_name'] = $network_info->name;
    auto_email_notification('content_posted', $params);
    if ($_POST['route_to_pa_home'] == 1) {
        auto_email_notification('content_posted_to_comm_blog', $params);
    }
    if ($extra['network_content_moderation'] == NET_YES && $network_info->owner_id != $user->user_id) {
        Network::moderate_network_content(-1, $permalink_cid);
        // -1 for contents; not a part of any collection
        $return_array['msg'] = 1004;
    }
    return $return_array;
}
 private function getUserProfile($user, $prefix = null)
 {
     if (!isset($user->display_name)) {
         $u_dname = new UserDisplayName($user);
         $user->display_name = $u_dname->get();
     }
     $user_info = array();
     $user_info["%{$prefix}.user_id%"] = $user->user_id;
     $user_info["%{$prefix}.first_name%"] = $user->first_name;
     $user_info["%{$prefix}.last_name%"] = $user->last_name;
     $user_info["%{$prefix}.login_name%"] = $user->login_name;
     $user_info["%{$prefix}.display_name%"] = $user->display_name;
     $user_info["%{$prefix}.profile_url%"] = UrlHelper::url_for(PA_ROUTE_USER_PUBLIC, array($user->user_id));
     $user_info["%{$prefix}.profile_link%"] = UrlHelper::link_to(PA_ROUTE_USER_PUBLIC, $user->display_name, null, array($user->user_id));
     $user_info["%{$prefix}.image%"] = uihelper_resize_mk_user_img($user->picture, 80, 80, 'alt="' . $user->display_name . '" align="left" style="padding: 0px 12px 12px 0px;"');
     $user_info["%{$prefix}.email_address%"] = $user->email;
     $user_info["%{$prefix}.messages_link%"] = UrlHelper::link_to(PA_ROUTE_MYMESSAGE, __("My messages"));
     return $user_info;
 }
*/
?>
  <div class="module_icon_list" id="list_members">
    <ul class="members">
      <?php 
for ($counter = 0; $counter < count($users_ranking); $counter++) {
    $class = $counter % 2 == 0 ? 'class="color"' : NULL;
    ?>
  
      
      <li <?php 
    echo $class;
    ?>
>
        <?php 
    echo link_to(uihelper_resize_mk_user_img($users_ranking[$counter]->picture, 35, 35, 'alt="PA"'), "user_blog", array("login" => $users_ranking[$counter]->login_name));
    ?>
        <span>
          <b><?php 
    echo link_to(abbreviate_text($users_ranking[$counter]->display_name, 18, 10), "user_blog", array("login" => $users_ranking[$counter]->login_name));
    ?>
</b>
          &nbsp;(<?php 
    echo _n(";%d points\n1;one point\n0;no points", $users_ranking[$counter]->ranking_points);
    ?>
)
        </span>
      </li>
      <?php 
}
?>
<?php 
}
?>

<ul class="members_list">
<?php 
if (!empty($links)) {
    foreach ($links as $link) {
        $user_link = PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $link['user_id'];
        ?>
<li><a href="<?php 
        echo $user_link;
        ?>
">
      <?php 
        echo uihelper_resize_mk_user_img($link['picture'], 50, 50, 'alt="User picture."');
        ?>
      <div class="description" style="text-align: center">
      <h2><?php 
        echo chop_string($link['display_name'], 18);
        ?>
</h2>
      <?php 
        if (!empty(PA::$config->useTypedGroups) && !empty($link['membertype'])) {
            ?>
      <b><?php 
            echo $link['membertype'];
            ?>
</b>
      <?php 
        }
Пример #26
0
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * @note
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * @todo
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * @version 0.0.0-1
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * @author Cyberspace Networks <*****@*****.**>
 * @license GNU General Public License
 * @copyright Copyright (c) 2000-2014 Cyberspace Networks
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * The lastest version of Cyberspace Networks CoreSystem can be obtained from:
 * http://developer.cyberspace-networks.com/
 * For questions, help, comments, discussion, etc. please visit
 * https://github.com/CyberspaceNetworks/CoreSystem
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 */
for ($counter = 0; $counter < count($links['users_data']); $counter++) {
    $class = $counter % 2 == 0 ? 'class="color"' : NULL;
    ?>
      
    <li>
        <?php 
    echo link_to(uihelper_resize_mk_user_img($links['users_data'][$counter]['picture'], 128, 128, 'alt="User Image"'), "user_blog", array("login" => urlencode($links['users_data'][$counter]['login_name'])));
    ?>
    </li>  
<?php 
}
?>
 
 function get_links()
 {
     // Loading the Searching data
     if ($this->sort_by == 'alphabetic') {
         $this->sort_by = 'login_name';
         $sorting_direction = 'ASC';
     } else {
         $this->sort_by = 'created';
         $sorting_direction = 'DESC';
     }
     $this->only_with_photo = !$this->no_photo_ok;
     $extra_condition = null;
     if ($this->only_with_photo) {
         $extra_condition = "U.picture IS NOT NULL";
     }
     $users = array();
     $this->users_data = array();
     if (empty($this->search_data)) {
         $this->search_data = @$this->search;
     }
     if ($this->search_data) {
         // load users on the basis of the search parameters.
         if ($this->only_with_photo) {
             $users_count = User::user_search($this->search_data, $this->viewer_uid, PA::$network_info->network_id, TRUE, 'ALL', 0, 'U.' . $this->sort_by, 'DESC', $extra_condition);
             $this->Paging["count"] = $users_count['total_users'];
             $users = User::user_search($this->search_data, $this->viewer_uid, PA::$network_info->network_id, FALSE, $this->Paging["show"], $this->Paging["page"], 'U.' . $this->sort_by, $sorting_direction, $extra_condition);
         } else {
             $users_count = User::user_search($this->search_data, $this->viewer_uid, PA::$network_info->network_id, FALSE);
             $this->Paging["count"] = $users_count['total_users'];
             $users = User::user_search($this->search_data, $this->viewer_uid, PA::$network_info->network_id, FALSE, $this->Paging["show"], $this->Paging["page"], 'U.' . $this->sort_by, $sorting_direction);
         }
     } else {
         if ($this->only_with_photo) {
             $this->Paging["count"] = Network::get_network_members(PA::$network_info->network_id, array('cnt' => TRUE, 'extra_condition' => $extra_condition));
             $params = array('page' => $this->Paging["page"], 'show' => $this->Paging["show"], 'sort_by' => $this->sort_by, 'direction' => $sorting_direction, 'extra_condition' => $extra_condition);
             $users = Network::get_network_members(PA::$network_info->network_id, $params);
         } else {
             $this->Paging["count"] = Network::get_network_members(PA::$network_info->network_id, array('cnt' => TRUE));
             $params = array('page' => $this->Paging["page"], 'show' => $this->Paging["show"], 'sort_by' => $this->sort_by, 'direction' => $sorting_direction);
             $users = Network::get_network_members(PA::$network_info->network_id, $params);
         }
     }
     $users_count = count(@$users['users_data']);
     if ($users_count) {
         $user_profiles = $this->get_profile_data($users['users_data']);
         for ($cnt = 0; $cnt < $users_count; $cnt++) {
             if (empty($users['users_data'][$cnt]['picture'])) {
                 $users['users_data'][$cnt]['picture'] = 'files/default.png';
                 $big_img = uihelper_resize_img($users['users_data'][$cnt]['picture'], 120, 120, NULL, "alt=\"" . $users['users_data'][$cnt]['login_name'] . "\"");
                 $users['users_data'][$cnt]['big_picture'] = $big_img['url'];
             } else {
                 $img = uihelper_resize_mk_user_img($users['users_data'][$cnt]['picture'], 80, 80, 'alt="PA"');
                 $big_img = uihelper_resize_img($users['users_data'][$cnt]['picture'], 120, 120, NULL, "alt=\"" . $users['users_data'][$cnt]['login_name'] . "\"");
                 $users['users_data'][$cnt]['big_picture'] = $big_img['url'];
                 preg_match("/src=\"([^']*?)\"/", $img, $match);
                 //preg_match to get the src of the image
                 $users['users_data'][$cnt]['picture'] = $match[1];
             }
             $users['users_data'][$cnt] = array_merge($users['users_data'][$cnt], $user_profiles[$cnt]);
         }
         $this->users_data = $users['users_data'];
     }
 }
                          </tr>
                        </table>
                      </th>
                    </tr>
                    <tr valign="top">
                      <td class="author_info" width="<?php 
echo $avatar_size['width'];
?>
">
                      <div class="forum_avatar">
                          <a href="<?php 
echo PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $created_by->login_name;
?>
">
                            <?php 
echo uihelper_resize_mk_user_img($created_by->picture, $avatar_size['width'], $avatar_size['height'], 'alt="' . $created_by->login_name . '"');
?>
                          </a>
                        </div>
                        <div class="smallfont">
                          <div><?php 
echo __('Posts');
?>
: <?php 
echo PaForumPost::countPaForumPost("user_id = {$created_by->user_id}");
?>
 </div>
                          <div><?php 
echo __('Last login');
?>
: <?php 
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * @version 0.0.0-1
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * @author Cyberspace Networks <*****@*****.**>
 * @license GNU General Public License
 * @copyright Copyright (c) 2000-2014 Cyberspace Networks
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * The lastest version of Cyberspace Networks CoreSystem can be obtained from:
 * http://developer.cyberspace-networks.com/
 * For questions, help, comments, discussion, etc. please visit
 * https://github.com/CyberspaceNetworks/CoreSystem
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 */
require_once "api/CNPermissions/CNPermissionsHandler.php";
?>

<div class="box-body box-profile">
    <?php 
echo uihelper_resize_mk_user_img($user->picture, 128, 128, 'class="profile-user-img img-responsive img-circle" alt="' . __("User profile picture") . '"');
?>

    <h3 class="profile-username text-center">
        <?php 
$name_string = $user->first_name . ' ' . $user->last_name;
$name_string = chop_string($name_string, 17);
echo $name_string;
?>
    </h3>
    
</div>
<!-- /.box-body -->
Пример #30
0
 function render_for_ajax()
 {
     $op = $this->params["op"];
     if ($op != 'paging' && empty(PA::$login_user)) {
         return __("Login required");
     }
     switch ($op) {
         case "add_friend":
             do {
                 $extra = array();
                 if (isset(PA::$network_info->extra)) {
                     $extra = unserialize(PA::$network_info->extra);
                 }
                 $status = APPROVED;
                 if (@$extra['reciprocated_relationship'] == NET_YES) {
                     $status = PENDING;
                 }
                 $added = FALSE;
                 try {
                     Relation::add_relation(PA::$login_user->user_id, $this->user->user_id, 2, NULL, NULL, NULL, NULL, NULL, NULL, $status);
                     $added = TRUE;
                 } catch (PAException $e) {
                     $this->err = __("There was a problem with adding the relation: ") . $e->getMessage();
                     $added = FALSE;
                 }
                 if ($added) {
                     if ($status == PENDING) {
                         $this->note = __("You have requested to be friends.");
                     } else {
                         $this->note = __("Friend added successfully.");
                     }
                 }
                 // and now for Notifications etc
                 // relationship establisher image
                 $rel_creater_picture = uihelper_resize_mk_user_img(PA::$login_user->picture, 80, 80, 'alt="' . PA::$login_user->first_name . '" align="left" style="padding: 0px 12px 12px 0px;"');
                 if (@$extra['reciprocated_relationship'] == NET_YES) {
                     // defining array to be sent, to fill message fram
                     $params = array('first_name' => PA::$login_user->first_name, 'last_name' => PA::$login_user->last_name, 'user_id' => PA::$login_user->id, 'approve_deny_url' => PA::$url . '/' . FILE_VIEW_ALL_MEMBERS . '?view_type=in_relations&uid=' . $this->uid, 'invited_user_name' => $this->user->login_name, 'requestor_image' => $rel_creater_picture, 'to' => $this->user->email, 'requested_user_id' => $this->user->user_id, 'config_site_name' => PA::$site_name);
                     // send notification
                     auto_email_notification_members('relationship_requested', $params);
                 } else {
                     $params = array('related_uid' => $this->uid, 'related_user' => $this->user->first_name, 'user_name' => PA::$login_user->login_name, 'user_id' => PA::$login_user->user_id, 'user_image' => $rel_creater_picture, 'to' => $this->user->email, 'my_friends_url' => PA::$url . '/' . FILE_VIEW_ALL_MEMBERS . '?view_type=in_relations&uid=' . $this->uid, 'user_url' => PA::$url . '/' . FILE_USER_BLOG . '?uid=' . PA::$login_user->user_id, 'config_site_name' => PA::$site_name);
                     auto_email_notification('relation_added', $params);
                     auto_email_notification_members('relationship_created_with_other_member', $params);
                     // for rivers of people
                     $activity = 'user_friend_added';
                     $extra = serialize(array('info' => PA::$login_user->login_name . ' added new relation with id = ' . $this->uid));
                     Activities::save(PA::$login_uid, $activity, $this->uid, $extra, array($activity));
                 }
             } while (0);
             break;
         case "deny_friend":
             // deny and remove are essentially equivalent
         // deny and remove are essentially equivalent
         case "remove_friend":
             do {
                 $user_id = PA::$login_user->user_id;
                 $remove_id = (int) $this->params['remove_id'];
                 if ($op == "deny_friend") {
                     try {
                         $res = Relation::delete_relation($remove_id, $user_id);
                         // relation reversed
                         $this->note = __("You denied the friend request successfully.");
                     } catch (PAException $e) {
                         $this->err = __("There was a problem with denying the relation: ") . $e->getMessage();
                     }
                 } else {
                     // remove
                     try {
                         $res = Relation::delete_relation($user_id, $remove_id);
                         $this->note = __("You removed the friend successfully.");
                     } catch (PAException $e) {
                         $this->err = __("There was a problem removing the relation: ") . $e->getMessage();
                     }
                     // make sure we don't leave the relation existing in the other direction
                     try {
                         $res2 = Relation::delete_relation($remove_id, $user_id);
                         // relation reversed
                     } catch (PAException $e) {
                         $this->err = __("There was a problem removing the reversed relation: ") . $e->getMessage();
                     }
                 }
                 if ($res) {
                     $requested_user = User::map_ids_to_logins((int) $remove_id);
                     $requested_user_name = $requested_user[$remove_id];
                     // defining array of values to fill message fram
                     $params = array('user_id' => $user_id, 'first_name' => PA::$login_user->first_name, 'last_name' => PA::$login_user->last_name, 'to' => $this->params['related_email'], 'requested_user_id' => $remove_id, 'requested_user_name' => $requested_user_name, 'network_name' => PA::$network_info->name, 'config_site_name' => PA::$site_name);
                     // send notification
                     auto_email_notification_members('relationship_denied', $params);
                 }
             } while (0);
             break;
         case "approve_friend":
             do {
                 $user_id = PA::$login_user->user_id;
                 $relation_id = (int) $this->params['approve_id'];
                 $status = APPROVED;
                 try {
                     $result = Relation::update_relation_status($user_id, $relation_id, $status);
                     if ($result) {
                         // if relationship has been made then send mail to the requestor
                         $this->note = __("You approved the friend request successfully.");
                         Relation::add_relation($user_id, $relation_id);
                         // for rivers of people
                         // notif approval
                         $activity = 'user_friend_approved';
                         $extra = serialize(array('info' => PA::$login_user->login_name . ' approved  relation with id = ' . $relation_id));
                         Activities::save(PA::$login_uid, $activity, $relation_id, $extra, array($activity));
                         // notify the originator direction also
                         $activity = 'user_friend_added';
                         $ou = new User();
                         $ou->load((int) $relation_id);
                         $extra = serialize(array('info' => $ou->login_name . ' added new relation with id = ' . PA::$login_user->login_name));
                         Activities::save($relation_id, $activity, PA::$login_uid, $extra, array($activity));
                         $from = PA::$login_user->email;
                         $requested_user = User::map_ids_to_logins($relation_id);
                         if (PA::$network_info->type == MOTHER_NETWORK_TYPE) {
                             $network_owner_id = SUPER_USER_ID;
                         } else {
                             $network_owner_id = PA::$network_info->owner_id;
                         }
                         $net_user = new User();
                         $net_user->load((int) $network_owner_id);
                         $relation_type = $relation_type = Relation::lookup_relation_type(Relation::get_relation($relation_id, $user_id));
                         $params['cnt'] = TRUE;
                         $rel_count = Relation::get($params, 'status =\'' . APPROVED . '\'');
                         $friend_list_url = PA::$url . '/' . FILE_VIEW_ALL_MEMBERS . '?view_type=in_relations&uid=' . $relation_id;
                         $user_url = url_for(FILE_USER_BLOG, array('login' => $requested_user[$relation_id]));
                         $member_moderation_url = PA::$url . '/' . FILE_NETWORK_MANAGE_USER;
                         $params = array('first_name' => PA::$login_user->first_name, 'last_name' => PA::$login_user->last_name, 'user_name' => PA::$login_user->login_name, 'invited_user_id' => $relation_id, 'user_id' => $user_id, 'invited_user_name' => $requested_user[$relation_id], 'relation_type' => $relation_type, 'network_name' => PA::$network_info->name, 'member_count' => PA::$network_info->member_count, 'reci_relation_count' => $rel_count, 'network_owner_name' => $net_user->first_name, 'to' => $this->params['related_email'], 'mail_type' => 'friend_response', 'user_url' => $user_url, 'friend_list_url' => $friend_list_url, 'member_moderation_url' => $member_moderation_url, 'config_site_name' => PA::$site_name);
                         // send mail to proper notification
                         auto_email_notification_members('invitation_accept', $params);
                         // add check for network owner's notification
                         $extra = unserialize(PA::$network_info->extra);
                         if (@$extra['notify_owner']['relation_added']['value'] != NET_NONE) {
                             // send mail to network owner
                             $to = $net_user->email;
                             $mail_type = 'reciprocated_relation_estab';
                             $check = pa_mail($to, $mail_type, $params);
                         }
                     }
                 } catch (PAException $e) {
                     $this->err = __("There was a problem with adding the relation: ") . $e->getMessage();
                 }
             } while (0);
             break;
         default:
             // just ignore any others
             $this->note = "Unknown operation {$op}.";
             break;
     }
     return $this->render();
 }