public function initializeModule($request_method, $request_data)
 {
     if (!PA::$login_uid) {
         return 'skip';
     }
     if (empty($this->page_id)) {
         return 'skip';
     }
     switch ($this->page_id) {
         case PAGE_GROUPS_HOME:
             if (PA::$page_uid && PA::$page_uid != PA::$login_uid) {
                 $this->uid = PA::$page_uid;
                 $page_user = get_user();
                 $this->title = ucfirst($page_user->first_name) . '\'s ';
                 $this->title .= __('Groups');
                 $this->user_name = $page_user->login_name;
             } else {
                 $this->uid = PA::$login_uid;
             }
             $this->usergroups = Group::get_user_groups((int) $this->uid, FALSE, 12, 1, 'created', 'DESC', 'private', 'regular');
             break;
         case PAGE_USER_PUBLIC:
             $this->uid = PA::$page_uid;
             $this->title = abbreviate_text(ucfirst(PA::$page_user->first_name) . '\'s ', 18, 10);
             $this->title .= __('Groups');
             $this->user_name = PA::$page_user->login_name;
             $this->usergroups = Group::get_user_groups((int) $this->uid, FALSE, 12, 1, 'created', 'DESC', 'public', 'regular', 'regular');
             break;
         case PAGE_USER_PRIVATE:
             $this->title = __('My Groups');
             $this->uid = PA::$login_uid;
             $this->usergroups = Group::get_user_groups((int) $this->uid, FALSE, 12, 1, 'created', 'DESC', 'public', 'regular');
             break;
     }
 }
 public function initializeModule($request_method, $request_data)
 {
     if (empty($this->page_id)) {
         return 'skip';
     }
     switch ($this->page_id) {
         case PAGE_USER_PUBLIC:
             $this->uid = PA::$page_uid;
             $this->title = abbreviate_text(ucfirst(PA::$page_user->first_name) . '\'s ', 18, 10);
             $this->title .= __('Families');
             $this->user_name = PA::$page_user->login_name;
             break;
         case PAGE_USER_PRIVATE:
             $this->title = __('My Families');
             $this->uid = PA::$login_uid;
             break;
         case PAGE_FAMILY:
         case PAGE_FAMILY_DIRECTORY:
         default:
             if (empty(PA::$login_uid)) {
                 return 'skip';
             }
             $this->uid = PA::$login_uid;
             break;
     }
 }
 public function initializeModule($request_method, $request_data)
 {
     if (empty(PA::$login_uid)) {
         return 'skip';
     }
     $this->rel_term = __('Friend');
     if (isset(PA::$extra['relationship_show_mode']['term'])) {
         $this->rel_term = PA::$extra['relationship_show_mode']['term'];
     }
     switch ($this->page_id) {
         case PAGE_USER_PUBLIC:
             if (empty(PA::$page_uid)) {
                 return 'skip';
             }
             $this->title = abbreviate_text(sprintf(__("%s's friends"), PA::$page_user->display_name), 18, 10);
             break;
         case PAGE_USER_PRIVATE:
             if (empty(PA::$login_uid)) {
                 return 'skip';
             }
             $this->title = __("My friends");
             break;
         default:
             $this->title = __("Friends");
     }
 }
 function initializeModule($request_method, $request_data)
 {
     switch ($this->page_id) {
         case PAGE_USER_PUBLIC:
             $this->title = abbreviate_text(ucfirst(PA::$page_user->display_name) . '\'s ', 16, 10);
             $this->title .= __('Comments');
             break;
         case PAGE_USER_PRIVATE:
             $this->title = __("My Friend's Comments");
             break;
         default:
             $this->title = __('Recent Comments');
     }
 }
 /** !!
  * This is determining what kind of page the module is being loaded on and
  * based on that set certain variables so that it has the proper title and
  * default display state.
  * @param string $request_method  If this is not 'AJAX', this method calls {@link handleRequest() }
  * @param array $request_data  Information to determine which group page it is on
  */
 function initializeModule($request_method, $request_data)
 {
     //Different activities will be displayed in the basis of page type or page_id
     $this->request_method = $request_method;
     if ($request_method != 'AJAX') {
         if (empty($this->page_id)) {
             return 'skip';
         }
         switch ($this->page_id) {
             case PAGE_USER_PRIVATE:
                 $this->page_type = 'user_private';
                 $this->subject = PA::$login_uid;
                 $this->title = __('My Activity Feeds');
                 break;
             case PAGE_USER_PUBLIC:
                 $this->page_type = 'user_public';
                 $this->title = abbreviate_text(ucfirst(PA::$page_user->first_name) . '\'s ', 14, 10);
                 $this->title .= __('Activity Feeds');
                 $this->subject = PA::$page_uid;
                 break;
             case PAGE_GROUP:
                 // case PAGE_GROUPS_HOME:
                 $this->page_type = 'group';
                 if (empty($request_data['gid'])) {
                     if (PA::$login_uid) {
                         $user_groups = Group::get_user_groups((int) PA::$login_uid, FALSE, 1, 1, 'created', 'DESC', 'public');
                         if (count($user_groups) > 0) {
                             $this->subject = $user_groups[0]['gid'];
                         } else {
                             return 'skip';
                         }
                     } else {
                         return 'skip';
                     }
                 } else {
                     $this->subject = $request_data['gid'];
                 }
                 break;
             default:
                 //by default network activity will be shown on all the pages.
         }
     } else {
         // NOTE: this is temporrary solution to keep module working on old pages
         $this->handleRequest($request_method, $request_data);
     }
 }
 public function initializeModule($request_method, $request_data)
 {
     switch ($this->page_id) {
         case PAGE_USER_PRIVATE:
             $this->title = __('My Videos');
             if (!empty(PA::$login_uid)) {
                 $this->uid = PA::$login_uid;
                 $this->user = PA::$login_user;
                 $this->login_uid = PA::$login_uid;
             }
             break;
         case PAGE_USER_PUBLIC:
         default:
             $this->uid = PA::$page_uid;
             $this->user = PA::$page_user;
             if (!empty(PA::$login_uid)) {
                 $this->login_uid = PA::$login_uid;
             }
             $this->title = abbreviate_text(ucfirst(PA::$page_user->display_name), 20, 20) . "" . __("'s VOD Theater");
     }
 }
 public function initializeModule($request_method, $request_data)
 {
     $this->uid = !empty(PA::$page_uid) ? PA::$page_uid : PA::$login_uid;
     if ($this->uid == PA::$login_uid) {
         $this->outer_template = 'outer_private_side_module.tpl';
     } else {
         $this->outer_template = 'outer_public_side_module.tpl';
         $links_data_array = $this->get_user_links();
         if (count($links_data_array) == 0) {
             return 'skip';
         }
     }
     switch ($this->page_id) {
         case PAGE_USER_PRIVATE:
             $this->title = __("My Links");
             break;
         case PAGE_USER_PUBLIC:
         default:
             $this->title = abbreviate_text(ucfirst(ucfirst(PA::$page_user->first_name) . '\'s '), 18, 10);
             $this->title .= __("Links");
     }
     $this->manage_links_url = PA::$url . "/links_management.php";
     $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/side_inner_public.tpl';
 }
Exemplo n.º 8
0
        ?>
</a>
      </div>
      <div class="points_rating">
         <?php 
        echo uihelper_resize_mk_img($item['giveuser']->picture, 32, 32, 'images/default.png', 'style=""');
        ?>
<br />
         <a style="font-weight: normal" href="<?php 
        echo PA::$url . PA_ROUTE_USER_PUBLIC . "/{$item['giveuser']->user_id}";
        ?>
" alt="<?php 
        echo $item['giveuser']->display_name;
        ?>
"><?php 
        echo abbreviate_text($item['giveuser']->display_name, 12, 7);
        ?>
</a><br />
        <p>
         <?php 
        echo $item['rating'];
        ?>
        </p>
        <?php 
        echo __("Points");
        ?>
      </div>
    </li>
    <li class="points_buttons">
     <?php 
        if ($edit_perm) {
 public function getMessageSpecificData()
 {
     if (is_array($this->associated_obj)) {
         // to keep compatibility with some old code, we must accept parameters given in arrays also
         foreach ($this->associated_obj as $name => $value) {
             $this->template_vars["%{$name}%"] = $value;
         }
     } else {
         if (is_object($this->associated_obj)) {
             if (is_a($this->associated_obj, 'User')) {
                 $this->addUserData($this->associated_obj, 'related.user');
             } else {
                 if (is_a($this->associated_obj, 'Content')) {
                     $author = new User();
                     $author->load((int) $this->associated_obj->author_id);
                     $this->addUserData($author, 'content.author');
                     $this->template_vars["%content.title%"] = $this->associated_obj->title;
                     $this->template_vars["%content.url%"] = UrlHelper::url_for(PA_ROUTE_CONTENT, array('cid' => $this->associated_obj->content_id));
                     $this->template_vars["%content.link%"] = UrlHelper::link_to(PA_ROUTE_CONTENT, $this->associated_obj->title, null, array('cid' => $this->associated_obj->content_id));
                     $this->template_vars["%content.delete_url%"] = UrlHelper::url_for(PA_ROUTE_CONTENT, array('cid' => $this->associated_obj->content_id, 'action' => 'deleteContent'));
                     $this->template_vars["%content.delete_link%"] = UrlHelper::link_to(PA_ROUTE_CONTENT, $this->template_vars["%content.delete_url%"], null, array('cid' => $this->associated_obj->content_id, 'action' => 'deleteContent'));
                     $this->template_vars["%content.moderation_url%"] = UrlHelper::url_for(PA::$url . '/' . FILE_NETWORK_MANAGE_CONTENT);
                     $this->template_vars["%content.moderation_link%"] = UrlHelper::link_to(PA::$url . '/' . FILE_NETWORK_MANAGE_CONTENT, $this->template_vars["%content.moderation_url%"]);
                     if (get_class($this->associated_obj) == 'Image' || get_class($this->associated_obj) == 'Audio' || get_class($this->associated_obj) == 'Video') {
                         if (!empty($this->associated_obj->group_id)) {
                             // if Group Media
                             $this->group = new Group();
                             $this->group->load((int) $this->associated_obj->group_id);
                             $this->addGroupData($this->group);
                         }
                         $this->template_vars["%media.title%"] = $this->associated_obj->title;
                         $this->template_vars["%media.full_view_url%"] = UrlHelper::url_for(PA::$url . '/' . FILE_MEDIA_FULL_VIEW, array('cid' => $this->associated_obj->content_id, 'login_required' => 'true'));
                         $this->template_vars["%media.full_view_link%"] = UrlHelper::link_to(PA::$url . '/' . FILE_MEDIA_FULL_VIEW, $this->template_vars["%media.full_view_url%"], null, array('cid' => $this->associated_obj->content_id, 'login_required' => 'true'));
                     }
                 } else {
                     if (is_a($this->associated_obj, 'Comment')) {
                         $author = new User();
                         $author->load((int) $this->associated_obj->user_id);
                         $this->addUserData($author, 'comment.author');
                         $this->template_vars["%comment.text%"] = $this->associated_obj->comment;
                         $this->template_vars["%comment.url%"] = UrlHelper::url_for(PA_ROUTE_CONTENT, array('cid' => $this->associated_obj->content_id));
                         $this->template_vars["%comment.link%"] = UrlHelper::link_to(PA_ROUTE_CONTENT, $this->template_vars["%comment.url%"], null, array('cid' => $this->associated_obj->content_id));
                         $this->template_vars["%comment.delete_url%"] = UrlHelper::url_for(PA::$url . '/deletecomment.php', array('comment_id' => $this->associated_obj->comment_id));
                         $this->template_vars["%comment.delete_link%"] = UrlHelper::link_to(PA::$url . '/deletecomment.php', $this->template_vars["%comment.delete_url%"], null, array('comment_id' => $this->associated_obj->comment_id));
                     } else {
                         if (is_a($this->associated_obj, 'Invitation')) {
                             $inviter = new User();
                             $inviter->load((int) $this->associated_obj->user_id);
                             $this->addUserData($inviter, 'invite.inviter');
                             if (!empty($this->associated_obj->inv_collection_id) && $this->associated_obj->inv_collection_id != -1) {
                                 $group = new Group();
                                 $group->load((int) $this->associated_obj->inv_collection_id);
                                 $this->group = $group;
                                 $this->addGroupData($this->group);
                             }
                             if (empty($this->associated_obj->inv_user_id) || $this->associated_obj->inv_summary == "internal_invitation") {
                                 // invitation sent
                                 $reg_link_desc = abbreviate_text($this->associated_obj->register_url, 52, 36);
                                 $acc_link_desc = abbreviate_text($this->associated_obj->accept_url, 52, 36);
                                 $reg_link = "<a href=\"{$this->associated_obj->register_url}\">{$reg_link_desc}</a>";
                                 $acc_link = "<a href=\"{$this->associated_obj->accept_url}\">{$acc_link_desc}</a>";
                                 $this->template_vars["%invite.message%"] = $this->associated_obj->inv_message;
                                 $this->template_vars["%invite.accept_url%"] = $this->associated_obj->accept_url;
                                 $this->template_vars["%invite.accept_link%"] = $acc_link;
                                 $this->template_vars["%invite.register_url%"] = $this->associated_obj->register_url;
                                 $this->template_vars["%invite.register_link%"] = $reg_link;
                                 $this->template_vars["%invite.invited_user_name%"] = $this->associated_obj->inv_user_first_name;
                                 $this->template_vars["%invite.invited_user_email%"] = $this->associated_obj->inv_email;
                                 $this->template_vars["%recipient.email_address%"] = $this->associated_obj->inv_email;
                             } else {
                                 // invitation accepted
                                 $invited = new User();
                                 $invited->load((int) $this->associated_obj->inv_user_id);
                                 $this->addUserData($invited, 'invite.invited');
                                 if (!empty($this->associated_obj->inv_relation_type)) {
                                     $this->template_vars["%invite.relation_type%"] = $this->associated_obj->inv_relation_type;
                                 }
                             }
                         } else {
                             if (is_a($this->associated_obj, 'RelationData')) {
                                 $requester = new User();
                                 $relateduser = new User();
                                 $requester->load((int) $this->associated_obj->user_id);
                                 $relateduser->load((int) $this->associated_obj->relation_id);
                                 $this->addUserData($requester, 'relation.inviter');
                                 $this->addUserData($relateduser, 'relation.invited');
                                 $this->template_vars["%relation.type%"] = Relation::lookup_relation_type($this->associated_obj->relationship_type);
                                 $this->template_vars["%relation.friend_list_url%"] = UrlHelper::url_for(PA::$url . '/' . FILE_VIEW_ALL_MEMBERS, array('view_type' => 'in_relations', 'uid' => $this->associated_obj->user_id, 'login_required' => 'true'));
                                 $this->template_vars["%relation.friend_list_link%"] = UrlHelper::link_to(PA::$url . '/' . FILE_VIEW_ALL_MEMBERS, $this->template_vars["%relation.friend_list_url%"], null, array('view_type' => 'in_relations', 'uid' => $this->associated_obj->user_id, 'login_required' => 'true'));
                                 $this->template_vars["%relation.appr_deny_url%"] = UrlHelper::url_for(PA::$url . '/' . FILE_VIEW_ALL_MEMBERS, array('view_type' => 'in_relations', 'uid' => $this->associated_obj->relation_id, 'login_required' => 'true'));
                                 $this->template_vars["%relation.appr_deny_link%"] = UrlHelper::link_to(PA::$url . '/' . FILE_VIEW_ALL_MEMBERS, $this->template_vars["%relation.appr_deny_url%"], null, array('view_type' => 'in_relations', 'uid' => $this->associated_obj->relation_id, 'login_required' => 'true'));
                             } else {
                                 if (is_a($this->associated_obj, 'ReportAbuse')) {
                                     $author = new User();
                                     $author->load((int) $this->associated_obj->reporter_id);
                                     $this->addUserData($author, 'abuse.reporter');
                                     $this->template_vars["%abuse.report%"] = $this->associated_obj->body;
                                     $this->template_vars["%abuse.url%"] = UrlHelper::url_for(PA_ROUTE_CONTENT, array('cid' => $this->associated_obj->parent_id));
                                     $this->template_vars["%abuse.link%"] = UrlHelper::link_to(PA_ROUTE_CONTENT, $this->template_vars["%abuse.url%"], null, array('cid' => $this->associated_obj->parent_id));
                                     $this->template_vars["%abuse.delete_comment_url%"] = UrlHelper::url_for(PA::$url . '/deletecomment.php', array('comment_id' => $this->associated_obj->parent_id));
                                     $this->template_vars["%abuse.delete_comment_link%"] = UrlHelper::link_to(PA::$url . '/deletecomment.php', $this->template_vars["%abuse.delete_comment_url%"], null, array('comment_id' => $this->associated_obj->parent_id));
                                     $this->template_vars["%abuse.delete_content_url%"] = UrlHelper::url_for(PA::$url . '/deletecontent.php', array('cid' => $this->associated_obj->parent_id));
                                     $this->template_vars["%abuse.delete_content_link%"] = UrlHelper::link_to(PA::$url . '/deletecontent.php', $this->template_vars["%abuse.delete_content_url%"], null, array('cid' => $this->associated_obj->parent_id));
                                 } else {
                                     if (is_a($this->associated_obj, 'Group')) {
                                         $this->addGroupData($this->associated_obj);
                                     } else {
                                         Logger::log("Error exit: function MessageRenderer::getMessageSpecificData() - Unknown associated object type.");
                                         throw new Exception("MessageRenderer::getMessageSpecificData() - Unknown associated object type.");
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
      <?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 
}
?>
          
    </ul>         
  </div>
Exemplo n.º 11
0
 public function initializeModule($request_method, $request_data)
 {
     global $error_msg;
     $this->uid = empty($request_data['uid']) ? PA::$login_uid : $request_data['uid'];
     switch ($this->page_id) {
         case PAGE_HOMEPAGE:
             $this->page = "homepage";
             $this->title = __("Recent Media");
             if (!empty(PA::$login_uid)) {
                 $this->subject = PA::$login_uid;
             } else {
                 $this->subject = 0;
             }
             break;
         case PAGE_GROUP:
             if (!empty($this->shared_data['group_info'])) {
                 $this->group_details = $this->shared_data['group_info'];
                 $this->gid = $this->group_details->collection_id;
                 $this->page_type = 'group';
                 $this->page = "grouppage";
                 $this->title = __(PA::$org_noun . ' Gallery');
                 $this->subject = $this->gid;
                 $this->view_all_url = PA::$url . PA_ROUTE_MEDIA_GALLEY_IMAGES . "/view=groups_media&gid={$this->gid}";
             } else {
                 return "skip";
             }
             break;
         case PAGE_PERMALINK:
             if (!empty($this->shared_data['group_info'])) {
                 $this->group_details = $this->shared_data['group_info'];
                 $this->gid = $this->group_details->collection_id;
                 $this->page_type = 'group';
                 $this->page = "grouppage";
                 $this->title = __(PA::$org_noun . ' Gallery');
                 $this->subject = $this->gid;
                 $this->view_all_url = PA::$url . PA_ROUTE_MEDIA_GALLEY_IMAGES . "/view=groups_media&gid={$this->gid}";
             } else {
                 $this->page = "homepage";
                 $this->title = __("Recent Media");
                 if (!empty(PA::$login_uid)) {
                     $this->subject = PA::$login_uid;
                 } else {
                     $this->subject = 0;
                 }
             }
             break;
         case PAGE_USER_PUBLIC:
             $this->page = "userpage";
             $this->title = ucfirst(PA::$page_user->first_name) . '\'s ';
             $this->title = abbreviate_text($this->title, 18, 10);
             $this->title .= __('Gallery');
             $this->subject = $this->uid;
             if (PA::$login_uid) {
                 $this->view_all_url = PA::$url . PA_ROUTE_MEDIA_GALLEY_IMAGES . "/uid={$this->uid}";
             }
             break;
         case PAGE_USER_PRIVATE:
             $this->mode = PRI;
             $this->page = "userpage";
             $this->title = __('My Gallery');
             $this->subject = $this->uid;
             $this->view_all_url = PA::$url . PA_ROUTE_MEDIA_GALLEY_IMAGES . "/uid={$this->uid}";
             break;
         default:
     }
 }