コード例 #1
0
 function render()
 {
     $param['network_id'] = PA::$network_info->network_id;
     $res = Network::get_members($param);
     $links['registered_users'] = count($res['users_data']);
     $this->email_domain_array = $this->get_email_by_domain($res['users_data']);
     $this->blog_post = Content::load_content_id_array(0, NULL, TRUE, 'ALL', 'created', 'DESC');
     $image_array = Image::load_images();
     $this->images = count($image_array);
     $this->profile_views = User::get_profile_view_stats('profile_visitor_count');
     $this->profile_visits_by_user = User::get_profile_view_stats('profile_visited_count');
     $relationship_stats = array();
     $maximum_relation = 0;
     $minimum_relation = 0;
     $average_relation = 0;
     $relationship_stats = Relation::relation_stats();
     if (count($relationship_stats) > 0) {
         $maximum_relation = max($relationship_stats);
         $minimum_relation = min($relationship_stats);
         $average_relation = array_sum($relationship_stats) / count($relationship_stats);
     }
     $this->relationship_stats = array('min' => $minimum_relation, 'max' => $maximum_relation, 'avg' => $average_relation);
     $this->inner_HTML = $this->generate_inner_html($links);
     $content = parent::render();
     return $content;
 }
コード例 #2
0
 function render()
 {
     $this->links = NULL;
     $Pagination = new Pagination();
     switch ($this->type) {
         case IMAGE:
             $this->links = Content::load_content_id_array($this->uid, IMAGE);
             $this->type_image = PA::$theme_url . "/images/type-image.gif";
             break;
         case AUDIO:
             $this->links = Content::load_content_id_array($this->uid, AUDIO);
             $this->type_image = PA::$theme_url . "/images/type-audio.gif";
             break;
         case VIDEO:
             $this->links = Content::load_content_id_array($this->uid, VIDEO);
             $this->type_image = PA::$theme_url . "/images/type-video.gif";
             break;
         default:
         case BLOGPOST:
             $this->links = Content::load_content_id_array($this->uid, BLOGPOST);
             $this->type_image = PA::$theme_url . "/images/type-blog.gif";
             break;
     }
     $this->inner_HTML = $this->generate_inner_html();
     $content = parent::render();
     return $content;
 }
コード例 #3
0
 function render()
 {
     global $current_theme_path;
     $this->links = NULL;
     $Pagination = new Pagination();
     switch ($this->type) {
         case IMAGE:
             $this->links = Content::load_content_id_array($this->uid, IMAGE);
             $this->type_image = $current_theme_path . "/images/type-image.gif";
             break;
         case AUDIO:
             $this->links = Content::load_content_id_array($this->uid, AUDIO);
             $this->type_image = $current_theme_path . "/images/type-audio.gif";
             break;
         case VIDEO:
             $this->links = Content::load_content_id_array($this->uid, VIDEO);
             $this->type_image = $current_theme_path . "/images/type-video.gif";
             break;
         case BLOGPOST:
             $this->links = Content::load_content_id_array($this->uid, BLOGPOST);
             $this->type_image = $current_theme_path . "/images/type-blog.gif";
             break;
         case SBMICROCONTENT_EVENT:
             $this->links = Content::load_content_id_array($this->uid, SBMICROCONTENT_EVENT);
             $this->type_image = $current_theme_path . "/images/sb.gif";
             break;
         case SBMICROCONTENT_REVIEW:
             $this->links = Content::load_content_id_array($this->uid, SBMICROCONTENT_REVIEW);
             $this->type_image = $current_theme_path . "/images/sb.gif";
             break;
         case SBMICROCONTENT_PEOPLE:
             $this->links = Content::load_content_id_array($this->uid, SBMICROCONTENT_PEOPLE);
             $this->type_image = $current_theme_path . "/images/sb.gif";
             break;
         case SBMICROCONTENT_GROUP:
             $this->links = Content::load_content_id_array($this->uid, SBMICROCONTENT_GROUP);
             $this->type_image = $current_theme_path . "/images/sb.gif";
             break;
         default:
             $this->links = Content::load_content_id_array($this->uid, NULL);
             break;
     }
     $this->inner_HTML = $this->generate_inner_html();
     $content = parent::render();
     return $content;
 }
コード例 #4
0
 public function render()
 {
     // group recent posts
     if ($this->type == 'group') {
         $group = new Group();
         $group->collection_id = $this->gid;
         $this->links = $group->get_contents_for_collection('all', FALSE, $this->limit, 1, 'created', 'DESC', TRUE);
         // user recent posts
     } else {
         if ($this->type == 'user') {
             $this->links = Content::get_user_content($this->uid);
             // network recent posts
         } else {
             $this->links = Content::load_content_id_array($user_id = 0, $type = NULL, $cnt = FALSE, $show = $this->limit, $page = 1, $sort_by = 'created', $direction = 'DESC', $only_homepage = false);
         }
     }
     $this->view_all_url = count($this->links) > 0 ? $this->view_all_url : '';
     $this->inner_HTML = $this->generate_inner_html($this->links);
     $content = parent::render();
     return $content;
 }
コード例 #5
0
require_once "BlockModules/ImagesModule/ImagesModule.php";
require_once "BlockModules/FacewallModule/FacewallModule.php";
require_once "BlockModules/RecentPostModule/RecentPostModule.php";
require_once "BlockModules/PopularTagsModule/PopularTagsModule.php";
include_once "../api/Theme/Template.php";
require_once '../api/Content/Content.php';
require_once '../api/Comment/Comment.php';
include_once "../api/ModuleSetting/ModuleSetting.php";
require_once './includes/functions/html_generate.php';
$parameter = '<script type="text/javascript" language="javascript" src="' . $current_theme_path . '/base_javascript.js"></script></script>
<script type="text/javascript" language="javascript" src="' . $current_theme_path . '/javascript/prototype.js"></script>
<script type="text/javascript" language="javascript" src="' . $current_theme_path . '/javascript/scriptaculous.js"></script>';
html_header("PA-block_test", $parameter);
print '<body style="background-color: #336799;">';
default_exception();
$contents = Content::load_content_id_array();
for ($i = 0; $i < count($contents); $i++) {
    $contents[$i]['comments'] = Comment::get_comment_for_content($contents[$i]['content_id']);
    $contents[$i]['trackback'] = Content::get_trackbacks_for_content($contents[$i]['content_id']);
    $user1 = new User();
    // *** FIXME: it looks like user::load used to take a second param
    // *** that determined whether it would load deleted users or not.
    // *** this disappeared a long time ago, though, and in the meantime
    // *** a new second param has appeared, that indicates the type of
    // *** the first param.  so if anyone wants to put this back, feel
    // *** free... until then, the following code may not work as
    // *** expected:
    // Here second parameter of load_user_name is 0 it is is_active = 0
    // (it will load all users name of People aggregator whether user
    // has been deleted or exist)
    $user1->load((int) $contents[$i]['author_id']);
コード例 #6
0
ファイル: badge.php プロジェクト: CivicCommons/oldBellCaPA
<div class="badge_person">
<a href="{$network_url_enc}" target="_blank"><div class="person_image">{$img}</div><div class="person_name">{$network_name_enc}</div></a>
</div>
EOS;
                $items_html[] = array("item", $h);
            }
            $html .= badge_render_section($items_html);
        }
        $posts =& $badge['posts'];
        if (@$posts['enabled']) {
            $html .= <<<ENS
<h4>My posts</h4>
<ul style="text-align: left; list-style-type: square; padding-left: 2em;">
ENS;
            // get all recent posts + sb content
            $entries = Content::load_content_id_array($user->user_id, NULL, FALSE, 8, 1);
            foreach ($entries as $entry) {
                $url_enc = htmlspecialchars("{$base_url}/content.php?cid=" . $entry['content_id']);
                $title_enc = htmlspecialchars($entry['title']);
                $html .= <<<ENS
<li><a target="_blank" href="{$url_enc}">{$title_enc}</a></li>
ENS;
            }
            $html .= <<<ENS
</ul>
ENS;
        }
        foreach (array(array("images", IMAGE, "image_file", NULL, "image_file", "image", "photos"), array("audio", AUDIO, NULL, "images/audio-icon.gif", "audio_file", "audio", "audio"), array("video", VIDEO, NULL, "images/video-icon.gif", "video_file", "video", "video")) as $info) {
            list($badge_key, $content_type, $thumbnail_key, $icon_file, $filename_key, $mfv_type, $display_name) = $info;
            $images =& $badge[$badge_key];
            if (@$images['enabled']) {
コード例 #7
0
function metaWeblog_getRecentPosts($args)
{
    // global var $_base_url has been removed - please, use PA::$url static variable
    $blogid = $args['blogid'];
    $login = $args['login'];
    $password = $args['password'];
    $n_posts = $args['n_posts'];
    $user = api_load_user($login, $password);
    // find content collection info from $blogid
    list($ccid, $post_id_prefix, $group) = api_ccid_from_blogid($user, $blogid);
    if (!$ccid) {
        // fetching the user's blog posts
        $posts = Content::load_content_id_array($user->user_id, NULL, FALSE, 0, $n_posts);
    } else {
        $posts = $group->get_contents_for_collection('all', FALSE, $n_posts, 1);
    }
    if (!$posts) {
        $posts = array();
    }
    $posts_out = array();
    foreach ($posts as $post) {
        $posts_out[] = array("userid" => "user:{$user->user_id}", "postid" => "{$post_id_prefix}:" . $post['content_id'], "title" => $post['title'], "description" => $post['body'], "dateCreated" => new IXR_Date((int) $post['created']), "link" => "", "permaLink" => PA::$url . PA_ROUTE_CONTENT . "/cid=" . $post['content_id'], "categories" => array("Uncategorized"));
    }
    return $posts_out;
}
コード例 #8
0
 function render()
 {
     if ($this->type == 'group') {
         $this->outer_template = 'outer_show_content_group_module.tpl';
         if ($this->content_type == NULL) {
             $this->content_type = 'all';
         }
         //$type = 'all',$cnt=FALSE, $show='ALL', $page=0, $sort_by='created', $direction='DESC'
         if (!empty($this->content_type)) {
             $this->Paging["count"] = $this->links = $this->group->get_contents_for_collection($this->content_type, TRUE, 10, 1, 'created', 'DESC', TRUE);
             $this->contents = $this->group->get_contents_for_collection($this->content_type, FALSE, $this->Paging["show"], $this->Paging["page"], 'created', 'DESC', TRUE);
         } else {
             $this->Paging["count"] = $this->links = $this->group->get_contents_for_collection($type = 'all', $cnt = TRUE, 'all', 0, $sort_by = 'created', $direction = 'DESC');
             $this->contents = $this->group->get_contents_for_collection($type = 'all', $cnt = FALSE, $this->Paging["show"], $this->Paging["page"], 'created', 'DESC');
         }
         $this->title = chop_string(sprintf(__("%s's Group Blog"), $this->group->title, 32));
     } else {
         if ($this->type == "tag") {
             $this->Paging["count"] = Tag::get_associated_content_ids((int) $this->tag_id, $cnt = TRUE);
             $this->contents = Tag::get_associated_content_ids((int) $this->tag_id, $cnt = FALSE, $this->Paging["show"], $this->Paging["page"]);
             if (!empty($this->contents)) {
                 foreach ($this->contents as $key => $value) {
                     $this->contents[$key]['content_id'] = $value['id'];
                 }
             }
         } else {
             if ($this->type == "search") {
                 $this->Paging["count"] = Content::content_search($this->search_string_array, $cnt = TRUE);
                 $this->contents = Content::content_search($this->search_string_array, $cnt = FALSE, $this->Paging["show"], $this->Paging["page"]);
             } else {
                 $this->Paging["count"] = Content::load_content_id_array($this->uid, $this->content_type, $cnt = TRUE);
                 $contents = Content::load_content_id_array($this->uid, $this->content_type, $cnt = FALSE, $this->Paging["show"], $this->Paging["page"]);
                 $this->contents = $contents;
             }
         }
     }
     $this->orientation = LEFT;
     if ($this->type == 'user') {
         $this->block_type = 'ShowContentUserBlock';
         // $this->do_pagination=TRUE;
     } else {
         if ($this->type == 'group') {
             if ($this->html_block_id_flag == 1) {
                 $this->block_type = 'ShowAllContent';
                 // $this->do_pagination=TRUE;
             } else {
                 $this->block_type = 'ShowContentGroupBlock';
             }
         } else {
             if ($this->type == "tag") {
                 $this->block_type = 'ShowAllContent';
                 // $this->do_pagination=TRUE;
             } else {
                 if ($this->type == "search") {
                     $this->block_type = 'ShowAllContent';
                     // $this->do_pagination=TRUE;
                 } else {
                     if ($this->show_all == 1) {
                         $this->block_type = 'ShowAllContent';
                         // $this->do_pagination=TRUE;
                     } else {
                         $this->block_type = 'ShowContentBlock';
                         // $this->do_pagination=TRUE;
                     }
                 }
             }
         }
     }
     $this->inner_HTML = $this->generate_inner_html($this->contents, $this->type);
     if ($this->do_pagination) {
         $Pagination = new Pagination();
         $Pagination->setPaging($this->Paging);
         $this->page_first = $Pagination->getFirstPage();
         $this->page_last = $Pagination->getLastPage();
         $this->page_links = $Pagination->getPageLinks();
     }
     $content = parent::render();
     return $content;
 }
コード例 #9
0
 function render()
 {
     global $login_uid;
     if ($this->type == 'group') {
         $this->outer_template = 'outer_show_content_group_module.tpl';
         $group = new Group();
         $group->collection_id = $this->gid;
         if ($this->content_type == NULL) {
             $this->content_type = 'all';
         }
         //$type = 'all',$cnt=FALSE, $show='ALL', $page=0, $sort_by='created', $direction='DESC'
         if (!empty($this->content_type)) {
             $this->Paging["count"] = $this->links = $group->get_contents_for_collection($this->content_type, TRUE, 10, 1, 'created', 'DESC', TRUE);
             $this->contents = $group->get_contents_for_collection($this->content_type, FALSE, $this->Paging["show"], $this->Paging["page"], 'created', 'DESC', TRUE);
         } else {
             $this->Paging["count"] = $this->links = $group->get_contents_for_collection($type = 'all', $cnt = TRUE, 'all', 0, $sort_by = 'created', $direction = 'DESC');
             $this->contents = $group->get_contents_for_collection($type = 'all', $cnt = FALSE, $this->Paging["show"], $this->Paging["page"], 'created', 'DESC');
         }
         $this->group_owner = FALSE;
         if (Group::is_admin($group->collection_id, $login_uid)) {
             $this->group_owner = TRUE;
         }
         $this->group_member = FALSE;
         if (Group::member_exists($group->collection_id, $login_uid)) {
             $this->group_member = TRUE;
         }
         /*
               if($this->html_block_id_flag == 1) {
                 $this->Paging["count"] = $this->links =  $group->get_contents_for_collection($type = 'all',$cnt=TRUE,'all' , 0, $sort_by='created', $direction='DESC');
                 $this->contents = $group->get_contents_for_collection($type = 'all', $cnt=FALSE, $this->Paging["show"], $this->Paging["page"],'created','DESC');
               } else {
                 $this->contents =  $group->get_contents_for_collection($this->content_type,FALSE, 10, 1, 'created', 'DESC',TRUE);
                 
         
               }*/
         $this->title = $this->group_details['title'] . '\'s Group Blog';
     } else {
         if ($this->type == "tag") {
             $this->Paging["count"] = Tag::get_associated_content_ids((int) $this->tag_id, $cnt = TRUE);
             $this->contents = Tag::get_associated_content_ids((int) $this->tag_id, $cnt = FALSE, $this->Paging["show"], $this->Paging["page"]);
         } else {
             if ($this->type == "search") {
                 $this->Paging["count"] = Content::content_search($this->search_string_array, $cnt = TRUE);
                 $this->contents = Content::content_search($this->search_string_array, $cnt = FALSE, $this->Paging["show"], $this->Paging["page"]);
             } else {
                 //print $this->content_type; exit;
                 $this->Paging["count"] = Content::load_content_id_array($this->uid, $this->content_type, $cnt = TRUE);
                 $contents = Content::load_content_id_array($this->uid, $this->content_type, $cnt = FALSE, $this->Paging["show"], $this->Paging["page"]);
                 $this->contents = $contents;
             }
         }
     }
     $this->orientation = LEFT;
     if ($this->type == 'user') {
         $this->block_type = 'ShowContentUserBlock';
         $this->do_pagination = TRUE;
     } else {
         if ($this->type == 'group') {
             if ($this->html_block_id_flag == 1) {
                 $this->block_type = 'ShowAllContent';
                 $this->do_pagination = TRUE;
             } else {
                 $this->block_type = 'ShowContentGroupBlock';
             }
         } else {
             if ($this->type == "tag") {
                 $this->block_type = 'ShowAllContent';
                 $this->do_pagination = TRUE;
             } else {
                 if ($this->type == "search") {
                     $this->block_type = 'ShowAllContent';
                     $this->do_pagination = TRUE;
                 } else {
                     if ($this->show_all == 1) {
                         $this->block_type = 'ShowAllContent';
                         $this->do_pagination = TRUE;
                     } else {
                         $this->block_type = 'ShowContentBlock';
                         $this->do_pagination = TRUE;
                     }
                 }
             }
         }
     }
     $this->inner_HTML = $this->generate_inner_html($this->contents, $this->type);
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
     $content = parent::render();
     return $content;
 }