示例#1
0
 /**
  * Function used to get user feed
  */
 function getUserFeeds($user)
 {
     global $cbphoto, $userquery, $cbvid, $cbgroup, $cbcollection;
     $allowed_feeds = USER_ACTIVITY_FEEDS_LIMIT;
     $uid = $user['userid'];
     $feeds = $this->getUserFeedsFiles($uid);
     if (!$feeds) {
         return false;
     }
     $newFeeds = array();
     $coutn = 0;
     foreach ($feeds as $feed) {
         $count++;
         if ($count > $allowed_feeds) {
             break;
         }
         $feedArray = json_decode($feed['content'], true);
         if ($feed && count($feedArray > 0)) {
             $remove_feed = false;
             $farr = $feedArray;
             $action = $farr['action'];
             $object = $farr['object'];
             $object_id = $farr['object_id'];
             $farr['user'] = $user;
             $farr['file'] = getName($feed['file']);
             $farr['datetime'] = nicetime($farr['time'], true);
             $userlink = '<a href="' . $userquery->profile_link($user) . '">' . $user['username'] . '</a>';
             //Creating Links
             switch ($action) {
                 case "upload_photo":
                     $photo = $cbphoto->get_photo($object_id);
                     //If photo does not exists, simply remove the feed
                     if (!$photo) {
                         $this->deleteFeed($uid, $feed['file']);
                         $remove_feed = true;
                     } else {
                         $objectArr['details'] = $photo;
                         $objectArr['size'] = 't';
                         $objectArr['output'] = 'non_html';
                         $objectArr['alt'] = $photo['photo_title'];
                         $farr['thumb'] = $cbphoto->getFileSmarty($objectArr);
                         $farr['link'] = $cbphoto->photo_links($photo, 'view_item');
                         //Content Title
                         $farr['title'] = $photo['photo_title'];
                         $farr['action_title'] = sprintf(lang('user_has_uploaded_new_photo'), $userlink);
                         $farr['links'][] = array('link' => $cbphoto->photo_links($photo, 'view_item'), 'text' => lang('view_photo'));
                         $farr['icon'] = 'images.png';
                     }
                     break;
                 case "upload_video":
                 case "add_favorite":
                     $video = $cbvid->get_video($object_id);
                     //If photo does not exists, simply remove the feed
                     if (!$video) {
                         $this->deleteFeed($uid, $feed['file']);
                         $remove_feed = true;
                     } elseif (!video_playable($video)) {
                         $remove_feed = true;
                     } else {
                         //Content Title
                         $farr['title'] = $video['title'];
                         if ($action == 'upload_video') {
                             $farr['action_title'] = sprintf(lang('user_has_uploaded_new_video'), $userlink);
                         }
                         if ($action == 'add_favorite') {
                             $farr['action_title'] = sprintf(lang('user_has_favorited_video'), $userlink);
                         }
                         $farr['link'] = videoLink($video);
                         $farr['object_content'] = $video['description'];
                         $farr['thumb'] = get_thumb($video);
                         $farr['links'][] = array('link' => videoLink($video), 'text' => lang('watch_video'));
                         $farr['icon'] = 'video.png';
                         if ($action == 'add_favorite') {
                             $farr['icon'] = 'heart.png';
                         }
                     }
                     break;
                 case "create_group":
                 case "join_group":
                     $group = $cbgroup->get_group($object_id);
                     //If photo does not exists, simply remove the feed
                     if (!$group) {
                         $this->deleteFeed($uid, $feed['file']);
                         $remove_feed = true;
                     } elseif (!$cbgroup->is_viewable($group)) {
                         $remove_feed = true;
                     } else {
                         //Content Title
                         $farr['title'] = $group['group_name'];
                         if ($action == 'create_group') {
                             $farr['action_title'] = sprintf(lang('user_has_created_new_group'), $userlink);
                         }
                         if ($action == 'join_group') {
                             $farr['action_title'] = sprintf(lang('user_has_joined_group'), $userlink);
                         }
                         $farr['link'] = group_link(array('details' => $group));
                         $farr['object_content'] = $group['group_description'] . "<br>" . lang('total_members') . " : " . $group['total_members'] . "<br>" . lang('total_videos') . " : " . $group['total_videos'] . "<br>" . lang('total_topics') . " : " . $group['total_topics'] . "<br>";
                         $farr['thumb'] = $cbgroup->get_group_thumb($group);
                         $farr['icon'] = 'group.png';
                         $joinlink = $cbgroup->group_opt_link($group, 'join');
                         if ($joinlink) {
                             if (SEO == "yes") {
                                 $joinlink = group_link(array('details' => $group)) . '?join=yes"';
                             } else {
                                 $joinlink = group_link(array('details' => $group)) . '&join=yes"';
                             }
                             $farr['links'][] = array('link' => $joinlink, 'text' => lang('join'));
                         }
                     }
                     break;
                 case "signup":
                     $farr['action_title'] = sprintf(lang("user_joined_us"), $userlink, TITLE, $userlink);
                     $farr['icon'] = 'user.png';
                     break;
                 case "add_friend":
                     $friend = $userquery->get_user_details($object_id);
                     if (!$friend) {
                         $this->deleteFeed($uid, $feed['file']);
                         $remove_feed = true;
                     } else {
                         $friendlink = '<a href="' . $userquery->profile_link($friend) . '">' . $friend['username'] . '</a>';
                         $farr['action_title'] = sprintf(lang("user_is_now_friend_with_other"), $userlink, $friendlink);
                         $farr['icon'] = 'user_add.png';
                     }
                     break;
                 case "add_collection":
                     $collection = $cbcollection->get_collection($object_id);
                     if (!$collection) {
                         $this->deleteFeed($uid, $feed['file']);
                         $remove_feed = true;
                     } else {
                         $farr['action_title'] = sprintf(lang('user_has_created_new_collection'), $userlink);
                         $farr['thumb'] = $cbcollection->get_thumb($collection, 'small');
                         $farr['title'] = $collection['collection_name'];
                         $collection_link = $cbcollection->collection_links($collection, 'view');
                         $farr['link'] = $collection_link;
                         $farr['object_content'] = $collection['collection_description'] . '<br>' . $collection['total_objects'] . " " . $collection['type'];
                         $farr['icon'] = 'photos.png';
                         $farr['links'][] = array('link' => $collection_link, 'text' => lang('view_collection'));
                     }
             }
             if (!$remove_feed) {
                 $newFeeds[$feedArray['time']] = $farr;
             }
         }
     }
     return $newFeeds;
 }
示例#2
0
//Getting Video Key
$vkey = @$_GET['v'];
$slug = @$_GET['s'];
$slug = mysql_clean($slug);
if ($slug) {
    $slug = slug_exists($slug, 'v');
    if ($slug) {
        $vkey = $slug['object_id'];
    }
} else {
    $theslug = false;
}
$vdo = $cbvid->get_video($vkey, $theslug);
assign('vdo', $vdo);
assign('video', $vdo);
if (video_playable($vdo)) {
    $pid = $_GET['play_list'];
    /**
     * Please check http://code.google.com/p/clipbucket/issues/detail?id=168
     * for more details about following code
     */
    if (SEO == 'yes' && config('seo_vido_url') == '4' && $vdo['slug']) {
        //Now finally Checking if both are equal else redirect to new link
        if ($slug['slug'] != $vdo['slug']) {
            $vid_link = VideoLink($vdo);
            if ($pid) {
                $vid_link .= '?play_list=' . $pid;
            }
            //Redirect to valid link leaving mark 301 Permanent Redirect
            header('HTTP/1.1 301 Moved Permanently');
            header('Location: ' . $vid_link);
示例#3
0
 * Function : Download video
 * @author : Arslan Hassan
 * @Software : ClipBucket
 * @Since : 1 Feb, 2010
 *
 * @License : Attribution Assurance License -- http://www.opensource.org/licenses/attribution.php
 */
define("THIS_PAGE", 'download');
define("PARENT_PAGE", 'videos');
require 'includes/config.inc.php';
$userquery->perm_check('download_video', true);
$pages->page_redir();
//Getting Video Key
$vkey = @$_GET['v'];
$vdo = $cbvid->get_video($vkey);
if ($vdo && video_playable($vkey)) {
    //Calling Functions When Video Is going to download
    call_download_video_function($vdo);
    $file = get_video_file($vdo, false);
    if ($file) {
        $vdo['download_file'] = $file;
    } else {
        $Cbucket->show_page = false;
        e(lang("unable_find_download_file"));
    }
    assign('vdo', $vdo);
    subtitle("Download " . $vdo['title']);
}
//Displaying The Template
template_files('download.html');
display_it();