예제 #1
0
/**
 * createDataFolders()
 *
 * create date folders with respect to date. so that no folder gets overloaded
 * with number of files.
 *
 * @param string FOLDER, if set to null, sub-date-folders will be created in
 * all data folders
 * @return string
 */
function createDataFolders($headFolder = NULL, $custom_date = NULL)
{
    $time = time();
    if ($custom_date) {
        if (!is_numeric($custom_date)) {
            $time = strtotime($custom_date);
        } else {
            $time = $custom_date;
        }
    }
    $year = date("Y", $time);
    $month = date("m", $time);
    $day = date("d", $time);
    $folder = $year . '/' . $month . '/' . $day;
    $data = cb_call_functions('dated_folder');
    if ($data) {
        return $data;
    }
    if (!$headFolder) {
        @mkdir(VIDEOS_DIR . '/' . $folder, 0777, true);
        @mkdir(THUMBS_DIR . '/' . $folder, 0777, true);
        @mkdir(ORIGINAL_DIR . '/' . $folder, 0777, true);
        @mkdir(PHOTOS_DIR . '/' . $folder, 0777, true);
        @mkdir(LOGS_DIR . '/' . $folder, 0777, true);
    } else {
        if (!file_exists($headFolder . '/' . $folder)) {
            @mkdir($headFolder . '/' . $folder, 0777, true);
        }
    }
    $folder = apply_filters($folder, 'dated_folder');
    return $folder;
}
예제 #2
0
파일: auth.php 프로젝트: Coding110/cbvideo
            $userDetails['sess_id'] = $_COOKIE['PHPSESSID'];
            $userDetails['avatar'] = $video['user_photo'] = $video['displayPic'] = $userquery->avatar($userDetails);
            exit(json_encode(array('status' => 'ok', 'userid' => $userquery->userid, 'sess_id' => $_COOKIE['PHPSESSID'], 'details' => $userDetails)));
        }
        break;
    case "getuser":
    case "check_auth":
    case "is_logged_in":
    case "checkauth":
    case "isloggedin":
        $userid = userid();
        if (!userid()) {
            exit(json_encode(array('status' => 'failed', 'msg' => 'User is not logged in', 'session' => $_COOKIE['PHPSESSID'])));
        } else {
            $uDetails = array('username', 'userid', 'email', 'total_videos', 'total_photos', 'total_collections', 'total_groups');
            $userDetails = array();
            foreach ($uDetails as $ud) {
                $userDetails[$ud] = $userquery->udetails[$ud];
            }
            $userDetails['sess_id'] = $_COOKIE['PHPSESSID'];
            $userDetails['avatar'] = $video['user_photo'] = $video['displayPic'] = $userquery->avatar($userDetails);
            exit(json_encode($userDetails));
        }
        break;
    case "logout":
        $userquery->logout();
        if (cb_get_functions('logout')) {
            cb_call_functions('logout');
        }
        setcookie('is_logout', 'yes', time() + 3600, '/');
}
예제 #3
0
/**
 * function get file_upload_url 
 * 
 */
function get_file_upload_url()
{
    $url = BASEURL . '/actions/file_uploader.php';
    $new_url = cb_call_functions('get_file_upload_url');
    if ($new_url) {
        return $new_url;
    }
    return $url;
}
예제 #4
0
            }
        }
    }
}
//Login User
if (isset($_POST['login'])) {
    $username = $_POST['username'];
    $username = mysql_clean(clean($username));
    $password = mysql_clean(clean($_POST['password']));
    $remember = false;
    if ($_POST['rememberme']) {
        $remember = true;
    }
    if ($userquery->login_user($username, $password, $remember)) {
        if (cb_get_functions('login_success')) {
            cb_call_functions('login_success');
        }
        if ($_COOKIE['pageredir']) {
            redirect_to($_COOKIE['pageredir']);
        } else {
            redirect_to(cblink(array('name' => 'my_account')));
        }
    }
}
//Checking Ban Error
if (!isset($_POST['login']) && !isset($_POST['signup'])) {
    if (@$_GET['ban'] == true) {
        $msg = lang('usr_ban_err');
    }
}
subtitle(lang("signup"));
예제 #5
0
/**
 * Displays the rating in the template in an ajax request 
 * @todo Write Documentation
 * 
 * filters isliye lagay hain take array main radobadal ki ja skay
 * cb_call_functions baad main issy array ko istemal kr k rating
 * show krwa dega, is k liye pehle cb_register_function krwana
 * parre ga.
 * 
 * return isliye kuch nhin krwaya kion k cb_call_funcion b kuch return
 * nhin kr ra hai wo ilsye k ye content ko format nhin krta
 * balke jitne registered functions hote hain unko call krta aur bich
 * me hi echo hota
 */
function showRating($rating)
{
    $rating = apply_filters($rating, 'show-rating');
    cb_call_functions('show_rating', $rating);
}
예제 #6
0
define('TEMPLATEDIR', BASEDIR . '/' . ADMINDIR . '/' . TEMPLATEFOLDER . '/' . ADMIN_TEMPLATE);
define('SITETEMPLATEDIR', BASEDIR . '/' . TEMPLATEFOLDER . '/' . $row['template_dir']);
define('TEMPLATEURL', BASEURL . '/' . ADMINDIR . '/' . TEMPLATEFOLDER . '/' . ADMIN_TEMPLATE);
define('LAYOUT', TEMPLATEDIR . '/layout');
define('TEMPLATE', $row['template_dir']);
/*
 * Calling this function to check server configs
 * Checks : MEMORY_LIMIT, UPLOAD_MAX_FILESIZE, POST_MAX_SIZE, MAX_EXECUTION_TIME
 * If any of these configs are less than required value, warning is shown
 */
check_server_confs();
Assign('baseurl', BASEURL);
Assign('admindir', ADMINDIR);
Assign('imageurl', TEMPLATEURL . '/images');
Assign('image_url', TEMPLATEURL . '/layout');
Assign('layout', TEMPLATEURL . '/layout');
Assign('layout_url', TEMPLATEURL . '/layout');
Assign('theme', TEMPLATEURL . '/theme');
Assign('theme_url', TEMPLATEURL . '/theme');
Assign('style_dir', LAYOUT);
Assign('layout_dir', LAYOUT);
Assign('logged_user', @$_SESSION['username']);
Assign('superadmin', @$_SESSION['superadmin']);
$AdminArea = true;
//Including Plugins
include 'plugins.php';
//Including Flv Players
include 'flv_player.php';
$Smarty->assign_by_ref('cbmass', $cbmass);
cb_call_functions('clipbucket_init_completed');
예제 #7
0
 | @ Author	   : ArslanHassan								
 | @ Software  : ClipBucket , © PHPBucket.com
 | $Id: signup.php 596 2011-04-21 14:41:57Z ahzulfi $				
 *************************************************************
*/
define("THIS_PAGE", "signup");
define("PARENT_PAGE", "signup");
require 'includes/config.inc.php';
if ($userquery->login_check('', true)) {
    redirect_to(BASEURL);
}
/**
 * Function used to call all signup functions
 */
if (cb_get_functions('signup_page')) {
    cb_call_functions('signup_page');
}
/**
 * Signing up new user
 */
if (!config('allow_registeration')) {
    assign('allow_registeration', lang('usr_reg_err'));
    //
}
if (isset($_POST['signup'])) {
    if (!config('allow_registeration')) {
        e(lang('usr_reg_err'));
    } else {
        $signup = $userquery->signup_user($_POST, true);
        if ($signup) {
            $udetails = $userquery->get_user_details($signup);
예제 #8
0
<?php

/**
 * This class is used to update clipbucket daily stats
 */
$in_bg_cron = true;
//including config file..
include dirname(__FILE__) . "/../includes/config.inc.php";
//Calling Cron Functions
cb_call_functions('update_cb_stats_cron');
//Now Gathering All Data
$date = date("Y-m-d H:i:s");
//Videos
$videos['uploads'] = $cbvid->get_videos(array("count_only" => true, "date_span" => "today"), TRUE);
$videos['processing'] = $cbvid->get_videos(array("count_only" => true, "status" => "Processing", "date_span" => "today"), TRUE);
$videos['active'] = $cbvid->get_videos(array("count_only" => true, "active" => "yes", "date_span" => "today"), TRUE);
//Views
$vid_views = $db->select(tbl("video"), "SUM(views) as total_views", " date_added LIKE '%{$date}%'");
$videos['views'] = $vid_views[0]['total_views'];
//Total Comments
$vid_comments = $db->select(tbl("video"), "SUM(comments_count) as total_comments", " date_added LIKE '%{$date}%'");
$videos['comments'] = $vid_comments[0]['total_comments'];
/**
 * Testing
 * * PASSED
 *  echo json_encode($videos);
 */
//Users
$users['signups'] = $userquery->get_users(array("count_only" => true, "date_span" => "today"));
$users['inactive'] = $userquery->get_users(array("count_only" => true, "date_span" => "today", "status" => 'ToActivate'));
$users['active'] = $userquery->get_users(array("count_only" => true, "date_span" => "today", "status" => 'Ok'));
예제 #9
0
<?php

/**
 * This file is used to verify weather video is converted or not
 * if it is converted then activate it and let it go
 */
//Sleeping..
//sometimes video is inserted after video conversion so in this case, video can get lost
$in_bg_cron = true;
include dirname(__FILE__) . "/../includes/config.inc.php";
cb_call_functions('verify_converted_videos_cron');
if ($argv[1]) {
    $fileName = $argv[1];
} else {
    $fileName = false;
}
if (isset($_GET['filename'])) {
    $fileName = $_GET['filename'];
}
$files = get_video_being_processed($fileName);
if (is_array($files)) {
    foreach ($files as $file) {
        $file_details = get_file_details($file['cqueue_name'], true);
        //Thanks to pandusetiawan @ forums.clip-bucket.com
        if ($file_details['conversion_status'] == 'failed' or strpos($file_details['conversion_log'], 'conversion_status : failed') > 0) {
            update_processed_video($file, 'Failed', $ffmpeg->failed_reason);
            $db->update(tbl("conversion_queue"), array("cqueue_conversion"), array("yes"), " cqueue_id = '" . $file['cqueue_id'] . "'");
            /**
             * Calling Functions after converting Video
             */
            if (get_functions('after_convert_functions')) {
예제 #10
0
/**
 * Function for loading 
 * uploader file url & other configurations
 */
function uploaderDetails()
{
    global $uploaderType;
    $uploaderDetails = array('uploadSwfPath' => JS_URL . '/uploadify/uploadify.swf', 'uploadScriptPath' => BASEURL . '/actions/file_uploader.php');
    $photoUploaderDetails = array('uploadSwfPath' => JS_URL . '/uploadify/uploadify.swf', 'uploadScriptPath' => BASEURL . '/actions/photo_uploader.php');
    assign('uploaderDetails', $uploaderDetails);
    assign('photoUploaderDetails', $photoUploaderDetails);
    //Calling Custom Functions
    cb_call_functions('uploaderDetails');
}