Beispiel #1
0
                    $subchilds = $childs = $cbvid->get_sub_categories($child['category_id']);
                    if ($subchilds) {
                        foreach ($subchilds as $subchild) {
                            $child_ids[] = $subchild['category_id'];
                        }
                    }
                }
            }
            $child_ids[] = mysql_clean($category);
        }
    }
    $search->category = $child_ids;
}
$search->date_margin = mysql_clean($_GET['datemargin']);
$search->sort_by = mysql_clean($_GET['sort']);
$search->limit = create_query_limit($page, $search->results_per_page);
$results = $search->search();
//echo $db->db_query;
//Collecting Data for Pagination
$total_rows = $search->total_results;
$total_pages = count_pages($total_rows, $search->results_per_page);
//Pagination
$pages->paginate($total_pages, $page);
Assign('results', $results);
Assign('template_var', $search->template_var);
Assign('display_template', $search->display_template);
if (empty($search->key)) {
    Assign('search_type_title', $search->search_type[$type]['title']);
} else {
    Assign('search_type_title', sprintf(lang('searching_keyword_in_obj'), mysql_clean(get('query')), $search->search_type[$type]['title']));
}
 ****************************************************************
*/
define("THIS_PAGE", "view_group_videos");
define("PARENT_PAGE", "videos");
require 'includes/config.inc.php';
$pages->page_redir();
$url = mysql_clean($_GET['url']);
$details = $cbgroup->group_details_url($url);
//Group links
$group_links = $cbgroup->group_links($details);
assign('group_links', $group_links);
assign('group', $details);
if ($details) {
    $group_videos_limit = 18;
    $group_videos_limit = apply_filters($group_videos_limit, 'group_videos_limit');
    ///Getting User Videos
    $page = mysql_clean($_GET['page']);
    $get_limit = create_query_limit($page, $group_videos_limit);
    //Getting List of all videos
    $videos = $cbgroup->get_group_videos($details['group_id'], "yes", $get_limit);
    $total_rows = $details['total_videos'];
    $total_pages = count_pages($total_rows, $group_videos_limit);
    //Pagination
    $pages->paginate($total_pages, $page);
    assign('total_pages', $total_pages);
    assign("videos", $videos);
    assign("mode", "view_videos");
    subtitle($details['group_name']);
}
template_files('view_group.html');
display_it();
Beispiel #3
0
 private function getFeeds()
 {
     $request = $_REQUEST;
     $page = $request['page'];
     if (!$page || !is_numeric($page) || $page < 1) {
         $page = 1;
     }
     $id = mysql_clean($request['id']);
     $page = mysql_clean($page);
     $type = mysql_clean($request['type']);
     $limit = 20;
     $get_limit = create_query_limit($page, $limit);
     $params = array('id' => $id, 'limit' => $get_limit, 'type' => $type);
     global $cbfeeds;
     $feeds = array();
     $feeds = $cbfeeds->get_feeds($params);
     $the_feeds = array();
     if (!empty($feeds)) {
         foreach ($feeds as $feed) {
             $feed['comments'] = json_encode($feed['comments']);
             $the_feeds[] = $feed;
         }
         //echo json_encode($the_feeds);
         $data = array('code' => "200", 'status' => "success", "msg" => "Success", "data" => $the_feeds);
         $this->response($this->json($data));
     } else {
         //echo json_encode(array('err' => error()));
         $data = array('code' => "204", 'status' => "success", "msg" => "No Record Found", "data" => "");
         $this->response($this->json($data));
     }
 }
Beispiel #4
0
            echo json_encode($cond);
            break;
            /**
             * Getting comments along with template
             */
        /**
         * Getting comments along with template
         */
        case "getComments":
            $params = array();
            $limit = config('comments_per_page');
            $page = $_POST['page'];
            $params['type'] = mysql_clean($_POST['type']);
            $params['type_id'] = mysql_clean($_POST['type_id']);
            $params['last_update'] = mysql_clean($_POST['last_update']);
            $params['limit'] = create_query_limit($page, $limit);
            $admin = "";
            if ($_POST['admin'] == 'yes' && has_access('admin_access', true)) {
                $params['cache'] = 'no';
                $admin = "yes";
            }
            $comments = $myquery->getComments($params);
            //Adding Pagination
            $total_pages = count_pages($_POST['total_comments'], $limit);
            assign('object_type', mysql_clean($_POST['object_type']));
            //Pagination
            $pages->paginate($total_pages, $page, NULL, NULL, '<a href="javascript:void(0)"
			onClick="getComments(\'' . $params['type'] . '\',\'' . $params['type_id'] . '\',\'' . $params['last_update'] . '\',
			\'#page#\',\'' . $_POST['total_comments'] . '\',\'' . mysql_clean($_POST['object_type']) . '\',\'' . $admin . '\')">#page#</a>');
            assign('comments', $comments);
            assign('type', $params['type']);
Beispiel #5
0
    e($total . " photos has been deleted successfully", "m");
}
if (isset($_POST['move_to_selected'])) {
    $total = count($_POST['check_photo']);
    for ($i = 0; $i < $total; $i++) {
        $id_array[] = $_POST['check_photo'][$i];
    }
    //$eh->flush();
}
if (isset($_GET['search'])) {
    $array = array('title' => $_GET['title'], 'pid' => $_GET['photoid'], 'key' => $_GET['photokey'], 'tags' => $_GET['tags'], 'featured' => $_GET['featured'], 'active' => $_GET['active'], 'user' => $_GET['userid'], 'extension' => $_GET['extension'], 'order' => $_GET['order']);
}
$parr = $array;
// Creating Limit
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page, RESULTS);
$parr['limit'] = $get_limit;
if (!$parr['order']) {
    $parr['order'] = " date_added DESC ";
} else {
    $parr['order'] = $parr['order'] . " DESC";
}
$collections = $cbcollection->get_collections(array("type" => "photos"));
$photos = $cbphoto->get_photos($parr);
Assign('photos', $photos);
assign('c', $collections);
$pcount = $parr;
$pcount['count_only'] = true;
$total_rows = $cbphoto->get_photos($pcount);
$total_pages = count_pages($total_rows, RESULTS);
$pages->paginate($total_pages, $page);
Beispiel #6
0
     }
     break;
 case "getMessages":
 case "get_messages":
     $get_limit = create_query_limit($page, $content_limit);
     $request['limit'] = $get_limit;
     $messages = $cbpm->get_messages($request);
     if ($messages) {
         echo json_encode($messages);
     } else {
         echo json_encode(array('err' => 'No Messages were Found'));
     }
     break;
 case "getNewMessages":
 case "get_new_messages":
     $get_limit = create_query_limit($page, $content_limit);
     $request['limit'] = $get_limit;
     $messages = $cbpm->get_new_messages($request);
     if ($messages) {
         echo json_encode($messages);
     } else {
         echo json_encode(array('err' => 'No New Messages were Found'));
     }
     break;
 case "sendMessage":
 case "send_message":
 case "send_msg":
 case "sndMsg":
     //recipients[]=11
     //message=tessttttinggggg
     //thread_id=xyz
Beispiel #7
0
        $topics_limit = 20;
        $get_limit = create_query_limit($page, $topics_limit);
        $params = array('group' => $gid, 'limit' => $get_limit);
        $topics = $cbgroup->get_group_topics($params);
        if ($topics) {
            echo json_encode($topics);
        } else {
            echo json_encode(array('err' => error()));
        }
        break;
    case "get_feeds":
    case "getFeeds":
        $id = mysql_clean($request['id']);
        $page = mysql_clean($request['page']);
        $type = mysql_clean($request['type']);
        $limit = 20;
        $get_limit = create_query_limit($page, $limit);
        $params = array('id' => $id, 'limit' => $get_limit, 'type' => $type);
        $feeds = $cbfeeds->get_feeds($params);
        $the_feeds = array();
        if ($feeds) {
            foreach ($feeds as $feed) {
                $feed['comments'] = json_encode($feed['comments']);
                $the_feeds[] = $feed;
            }
            echo json_encode($the_feeds);
        } else {
            echo json_encode(array('err' => error()));
        }
        break;
}
Beispiel #8
0
    $cbphoto->action->delete_flags($photo);
}
//Deleting Multiple Videos
if (isset($_POST['delete_flags'])) {
    for ($id = 0; $id <= count($_POST['check_photo']); $id++) {
        $eh->flush();
        $cbphoto->action->delete_flags($_POST['check_photo'][$id]);
    }
}
switch ($mode) {
    case "view":
    default:
        assign("mode", "view");
        //Getting Video List
        $page = mysql_clean($_GET['page']);
        $get_limit = create_query_limit($page, 5);
        $photos = $cbphoto->action->get_flagged_objects($get_limit);
        assign('photos', $photos);
        //Collecting Data for Pagination
        $total_rows = $cbphoto->action->count_flagged_objects();
        $total_pages = count_pages($total_rows, 5);
        //Pagination
        $pages->paginate($total_pages, $page);
        break;
    case "view_flags":
        assign("mode", "view_flags");
        $pid = mysql_clean($_GET['pid']);
        $pdetails = $cbphoto->get_photo($pid);
        if ($pdetails) {
            $flags = $cbphoto->action->get_flags($pid);
            assign('flags', $flags);
Beispiel #9
0
 }
 //Calling all functions when a topic is called
 call_view_group_functions($details);
 switch ($mode) {
     case 'view_topics':
         if ($_GET['topic_action'] == "delete") {
             if (!empty($_GET['topic_id'])) {
                 $tid = $_GET['topic_id'];
                 $cbgroup->delete_topic($tid);
             }
         }
         break;
 }
 $topics_limit = 10;
 $page = mysql_clean($_GET['page']);
 $get_limit = create_query_limit($page, $topics_limit);
 //Getting list of topics
 $topics = $cbgroup->get_topics(array('group' => $details['group_id'], 'limit' => $get_limit));
 $total_pages = count_pages($details['total_topics'], $topics_limit);
 $pages->paginate($total_pages, $page);
 //Group feeds
 $feeds = $cbgroup->get_group_feeds($details['group_id']);
 assign('feeds', $feeds);
 //Group links
 $group_links = $cbgroup->group_links($details);
 assign('group_links', $group_links);
 assign('total_topic_pages', $total_pages);
 assign('topics', $topics);
 assign('mode', $mode);
 assign('group', $details);
 //$cbgroup->add_group_status($details['group_id'],'Yar ye kamal chiz lag rae a?');
function cb_get_user_favorite_collections()
{
    global $usercontent, $pages, $cbcollection, $db;
    $user = $usercontent->get_current_user();
    $page = mysql_clean(get('page'));
    $limit = create_query_limit($page, config('collection_user_favorites'));
    $favC = array("userid" => $user['userid'], "limit", $limit);
    $collections = $cbcollection->action->get_favorites($favC);
    $favC['count_only'] = true;
    $total_rows = $cbcollection->action->get_favorites($favC);
    $total_pages = count_pages($total_rows, config('collection_user_favorites'));
    $pages->paginate($total_pages, $page);
    $params['file'] = 'user_collections.html';
    $params['the_title'] = $params['heading'] = name($user) . " " . lang('favorite') . " " . lang('collections');
    $params['collections'] = $collections;
    $params['mode'] = 'favorite';
    $params['total_collections'] = $total_rows;
    return fetch_template_file($params);
}
Beispiel #11
0
    assign('p', $userquery->get_user_profile($udetails['userid']));
    $mode = $_GET['mode'];
    switch ($mode) {
        case "photos":
        case "uploaded":
        default:
            $limit = create_query_limit($page, config('photo_user_photos'));
            assign("the_title", $user['username'] . " " . lang('photos'));
            $photos = get_photos(array("limit" => $limit, "user" => $user['userid']));
            $total_rows = get_photos(array("count_only" => true, "user" => $user['userid']));
            $total_pages = count_pages($total_rows, config('photo_user_photos'));
            break;
        case "favorites":
        case "fav_photos":
        case "favorite":
            $limit = create_query_limit($page, config('photo_user_favorites'));
            assign("the_title", $user['username'] . " " . lang('Favorite') . " " . lang('photos'));
            $favP = array("user" => $user['userid'], "limit", $limit);
            $photos = $cbphoto->action->get_favorites($favP);
            $favP['count_only'] = true;
            $total_rows = $cbphoto->action->get_favorites($favP);
            $total_pages = count_pages($total_rows, config('photo_user_favorites'));
            break;
    }
    assign('photos', $photos);
    $pages->paginate($total_pages, $page);
} else {
    e(lang("usr_exist_err"));
    $Cbucket->show_page = false;
}
if ($Cbucket->show_page) {
Beispiel #12
0
    assign("u", $udetails);
    assign('p', $userquery->get_user_profile($udetails['userid']));
    switch ($mode) {
        case 'uploads':
        case 'videos':
        default:
            $get_limit = create_query_limit($page, config('videos_items_uvid_page'));
            assign("the_title", $udetails['username'] . " videos");
            $videos = get_videos(array('user' => $udetails['userid'], 'limit' => $get_limit));
            $total_rows = get_videos(array('user' => $udetails['userid'], 'count_only' => true));
            subtitle(sprintf(lang("users_videos"), name($udetails)));
            $total_pages = count_pages($total_rows, config('videos_items_uvid_page'));
            assign('mode', 'uploaded');
            break;
        case 'favorites':
            $get_limit = create_query_limit($page, config('videos_items_ufav_page'));
            assign("the_title", $udetails['username'] . " favorites");
            $params = array('userid' => $udetails['userid'], 'limit' => $get_limit);
            $videos = $cbvid->action->get_favorites($params);
            $params['count_only'] = "yes";
            $total_rows = $cbvid->action->get_favorites($params);
            subtitle(sprintf(lang("title_usr_fav_vids"), name($udetails)));
            $total_pages = count_pages($total_rows, config('videos_items_ufav_page'));
            assign('mode', 'favorite');
    }
    Assign('videos', $videos);
    //Pagination
    $pages->paginate($total_pages, $page);
} else {
    e(lang("usr_exist_err"));
    $Cbucket->show_page = false;
Beispiel #13
0
//Group links
$group_links = $cbgroup->group_links($details);
assign('group_links', $group_links);
assign('group', $details);
if (!$details) {
    e(lang("grp_exist_error"));
} elseif (!$cbgroup->is_viewable($details)) {
    $Cbucket->show_page = false;
} elseif (!$cbgroup->is_member(userid(), $details['group_id'])) {
    e(lang("you_not_allowed_add_grp_vids"));
} else {
    $add_group_videos = 24;
    $add_group_videos = apply_filters($add_group_videos, 'add_group_videos_limit');
    ///Getting User Videos
    $page = mysql_clean($_GET['page']);
    $get_limit = create_query_limit($page, $add_group_videos);
    $array = array('user' => userid(), 'limit' => $get_limit);
    $usr_vids = get_videos($array);
    //echo $db->db_query;
    assign('usr_vids', $usr_vids);
    assign('videos', $usr_vids);
    $array['count_only'] = true;
    $total_rows = get_videos($array);
    $total_pages = count_pages($total_rows, $add_group_videos);
    //Pagination
    $pages->paginate($total_pages, $page);
    //Adding videos to group
    if (isset($_POST['add_videos'])) {
        $total = count($usr_vids);
        for ($i = 0; $i < $total; $i++) {
            $videoid = $usr_vids[$i]['videoid'];
    assign('p', $userquery->get_user_profile($udetails['userid']));
    $mode = $_GET['mode'];
    switch ($mode) {
        case "collections":
        case "uploaded":
        default:
            $limit = create_query_limit($page, config('collection_user_collections'));
            assign("the_title", $user['username'] . " " . lang('collections'));
            $collections = get_collections(array("limit" => $limit, "user" => $user['userid']));
            $total_rows = get_collections(array("count_only" => true, "user" => $user['userid']));
            $total_pages = count_pages($total_rows, config('collection_user_collections'));
            break;
        case "favorites":
        case "fav_collections":
        case "favorite":
            $limit = create_query_limit($page, config('collection_user_favorites'));
            assign("the_title", $user['username'] . " " . lang('favorite') . " " . lang('collections'));
            $favC = array("user" => $user['userid'], "limit", $limit);
            $collections = $cbcollection->action->get_favorites($favC);
            $favC['count_only'] = true;
            $total_rows = $cbcollection->action->get_favorites($favC);
            $total_pages = count_pages($total_rows, config('collection_user_favorites'));
            break;
    }
    assign('collections', $collections);
    $pages->paginate($total_pages, $page);
} else {
    e(lang("usr_exist_err"));
    $Cbucket->show_page = false;
}
if ($Cbucket->show_page) {
Beispiel #15
0
<?php

/* 
 ***********************************************************************
 | Copyright (c) 2007-2010 Clip-Bucket.com. All rights reserved.		
 | @ Author 	: ArslanHassan												
 | @ Software 	: ClipBucket , © PHPBucket.com							
 *************************************************************************
*/
require '../includes/admin_config.php';
$userquery->admin_login_check();
$pages->page_redir();
if ($_GET['kick']) {
    if ($sess->kick(mysql_clean($_GET['kick']))) {
        e("User has been kicked out", "m");
    }
}
$results = 30;
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page, $results);
$online_users = $userquery->get_online_users(false, false, $get_limit);
$total_rows = $userquery->get_online_users(false, true);
$total_pages = count_pages($total_rows, $results);
$pages->paginate($total_pages, $page);
assign('total', count($online_users));
assign('online_users', $online_users);
assign('queryString', queryString(NULL, 'kick'));
subtitle("View online users");
template_files('online_users.html');
display_it();
Beispiel #16
0
<?php

$limit = defined('PHOTOS_RSS_LIMIT') ? PHOTOS_RSS_LIMIT : 20;
$page = $_GET['page'];
if ($page < 1 || !is_numeric) {
    $page = 1;
}
$sqlLimit = create_query_limit($page, $limit);
$mode = $_GET['mode'];
switch ($mode) {
    case "recent":
    default:
        $photos = get_photos(array('limit' => $sqlLimit, 'order' => 'date_added DESC'));
        $title = lang('Recently Added Photos');
        break;
    case "featured":
        $photos = get_photos(array('limit' => $sqlLimit, 'featured' => 'yes'));
        $title = lang('Featured Photos');
        break;
    case "user":
        $user = mysql_clean($_GET['username']);
        //Get userid from username
        $u = $userquery->get_user_details($user);
        $uid = $u['userid'] ? $u['userid'] : 'x';
        if ($uid != 'x') {
            $photos = get_photos(array('limit' => $sqlLimit, 'user' => $uid, 'order' => 'date_added DESC'));
            $total_photos = $u['total_photos'];
            $title = "Photos uploaded by " . $user;
        }
        break;
    case "views":
Beispiel #17
0
    case "featured":
        $cond['featured'] = "yes";
        break;
    case "most_viewed":
        $cond['order'] = $table_name . ".views DESC";
        break;
    case "most_commented":
        $cond['order'] = $table_name . ".total_comments DESC";
        break;
    case "top_rated":
        $cond['order'] = $table_name . ".rating DESC, " . $table_name . ".rated_by DESC";
        break;
}
//Getting Photo List
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page, MAINPLIST);
$clist = $cond;
$clist['limit'] = $get_limit;
$photos = get_photos($clist);
Assign('photos', $photos);
$collections = $cbcollection->get_collections($clist);
Assign('collections', $collections);
//Collecting Data for Pagination
$ccount = $cond;
$ccount['count_only'] = true;
$total_rows = get_photos($ccount);
$total_pages = count_pages($total_rows, MAINPLIST);
//Pagination
$link == NULL;
$extra_params = NULL;
$tag = '<li><a #params#>#page#</a><li>';
Beispiel #18
0
        break;
    case "most_items":
        $cond['order'] = " total_objects DESC";
        break;
}
switch ($content) {
    case "videos":
        $cond['type'] = "videos";
        break;
    case "photos":
        $cond['type'] = "photos";
}
//$cond['has_items'] = true;
//Getting Collection List
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page, COLLPP);
$clist = $cond;
$clist['limit'] = $get_limit;
$collections = $cbcollection->get_collections($clist);
Assign('collections', $collections);
//Collecting Data for Pagination
$ccount = $cond;
$ccount['count_only'] = true;
$total_rows = $cbcollection->get_collections($ccount);
$total_pages = count_pages($total_rows, COLLPP);
//Pagination
$pages->paginate($total_pages, $page);
subtitle(lang('collections'));
//Displaying The Template
template_files('collections.html');
display_it();
Beispiel #19
0
/**
 * Api Put method to Search
 * on ClipBucket website
 */
include '../includes/config.inc.php';
include 'global.php';
$request = $_REQUEST;
$type = $request['type'];
$page = mysql_clean($request['page']);
$limit = 20;
if (!$type) {
    $type = 'video';
}
$search = cbsearch::init_search($type);
$search->limit = create_query_limit($page, $limit);
$search->key = mysql_clean($request['query']);
$results = $search->search();
if ($results) {
    $the_results = array();
    switch ($type) {
        case "video":
        default:
            if ($results) {
                foreach ($results as $video) {
                    $hq_file = get_hq_video_file($video);
                    $video['title'] = title($video['title']);
                    $video['description'] = mob_description($video['description']);
                    $video['thumbs'] = array('default' => get_thumb($video), 'big' => getSmartyThumb(array('vdetails' => $video, 'size' => 'big')));
                    $video['videos'] = array('mobile' => get_mob_video(array('video' => $video)));
                    $video['url'] = $video['video_link'] = $video['videoLink'] = videoLink($video);
Beispiel #20
0
    case "most_viewed":
        $u_cond['order'] = " profile_hits DESC ";
        break;
    case "featured":
        $u_cond['featured'] = "yes";
        break;
    case "top_rated":
        $u_cond['order'] = " rating DESC";
        break;
    case "most_commented":
        $u_cond['order'] = " total_comments DESC";
        break;
}
//Getting User List
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page, CLISTPP);
$count_query = $ulist = $u_cond;
$ulist['limit'] = $get_limit;
$users = get_users($ulist);
Assign('users', $users);
if ($_GET['cat']) {
    $category = $userquery->get_category_field(mysql_clean(get('cat')), 'category_name');
    assign('category', $category);
}
if ($_GET['sort']) {
    $vsort = mysql_clean(get('sort'));
    $vsort = str_replace('most_comment', 'comment', $vsort);
    $sort = lang($vsort);
    if ($sort != $vsort) {
        assign('sort', $vsort);
    } else {
Beispiel #21
0
     $total = count($_POST['check_vid']);
     for ($i = 0; $i < $total; $i++) {
         if ($_POST['check_vid'][$i] != '') {
             $cbgroup->video_actions($gid, $_POST['check_vid'][$i], 'delete');
         }
     }
     if (!error() && msg()) {
         $eh->flush_msg();
         e(lang('Selected videos have removed from this group'), 'm');
     }
 }
 if ($gdetails) {
     $video_limit = 20;
     $video_limit = apply_filters($video_limit, 'manage_group_videos_limit');
     $page = mysql_clean($_GET['page']);
     $get_limit = create_query_limit($page, $video_limit);
     assign("group", $gdetails);
     //Getting Group Videos (Active Only)
     $grp_vids = $cbgroup->get_group_videos($gid, NULL, $get_limit);
     assign('grp_vids', $grp_vids);
     assign('videos', $grp_vids);
     //Getting pending videos
     $pending_videos = $cbgroup->get_group_videos($gid, 'no', $get_limit);
     assign('pending_videos', $pending_videos);
     $group_videos = array('all_videos' => $grp_vids, 'pending_videos' => $pending_videos);
     assign('group_videos', $group_videos);
     $total_pages = count_pages($gdetails['total_videos'], $video_limit);
     //Pagination
     $pages->paginate($total_pages, $page);
 } else {
     e(lang("grp_exist_err"));