示例#1
0
 /**
  * __Constructor of CBVideo
  */
 function init()
 {
     global $Cbucket;
     $this->cat_tbl = 'video_categories';
     $this->section_tbl = 'video';
     $this->use_sub_cats = TRUE;
     $this->init_actions();
     $this->init_collections();
     if (config('vid_cat_height')) {
     }
     $this->cat_thumb_height = config('vid_cat_height');
     if (config('vid_cat_width')) {
     }
     $this->cat_thumb_width = config('vid_cat_width');
     if (isSectionEnabled('videos')) {
         $Cbucket->search_types['videos'] = "cbvid";
     }
     $Cbucket->clipbucket_footer[] = 'check_cbvideo';
     $this->video_delete_functions[] = 'delete_video_from_collection';
     register_object('v', 'cbvideo');
     register_object('video', 'cbvideo');
     /**
      * Setting up the playlists..
      */
     if (userid()) {
         //THis can be improved by saving
         //Playlists ids in users table
         //so that a query can be minimized.
         //@todo : Save IDs in Users table
         $this->builtin_playlists = $this->action->builtin_plugins(userid(), true);
     }
 }
示例#2
0
 /**
  * Setting up Photos Section
  */
 function init_photos()
 {
     global $Cbucket;
     $this->init_actions();
     $this->init_collections();
     $this->photos_admin_menu();
     $this->setting_other_things();
     $this->set_photo_max_size();
     $this->thumb_dimensions = array('t' => array('name' => lang('Thumb'), 'width' => config('photo_thumb_width'), 'height' => config('photo_thumb_height'), 'crop' => config('photo_crop') == 0 ? -1 : 5, 'watermark' => false, 'sharpit' => true), 'm' => array('name' => lang('Medium'), 'width' => config('photo_med_width'), 'height' => config('photo_med_height'), 'crop' => config('photo_crop') == 0 ? -1 : 5, 'watermark' => false, 'sharpit' => false), 'l' => array('name' => lang('Large'), 'width' => config('photo_lar_width'), 'height' => 0, 'crop' => -1, 'watermark' => config('watermark_photo'), 'sharpit' => false), 'o' => array('name' => lang('Original'), 'width' => 0, 'height' => 0, 'crop' => -1, 'watermark' => config('watermark_photo'), 'sharpit' => false));
     $this->default_thumb_dimensions = array('t', 'm', 'l', 'o');
     register_object('p', 'cbphoto');
     register_object('photo', 'cbphoto');
 }
示例#3
0
 function init()
 {
     global $sess, $Cbucket;
     //		$this->user_sess = $sess->get('user_sess');
     $this->sess_salt = $sess->get('sess_salt');
     $this->sessions = $this->get_sessions();
     if ($this->sessions['smart_sess']) {
         $this->userid = $this->sessions['smart_sess']['session_user'];
     }
     //$this->level = $sess->get('level');
     //Setting Access
     //Get list Of permission
     //$perms = $this->get_permissions();
     //foreach($perms as $perm)
     //{
     //	$this->add_access_type($perm['permission_code'],$perm['permission_name']);
     //}
     /* $this->add_access_type('admin_access','Admin Access');
        $this->add_access_type('upload_access','Upload Access');
        $this->add_access_type('channel_access','Channel Access');
        $this->add_access_type('mod_access','Moderator Access'); */
     //Fetching List Of User Levels
     $levels = $this->get_levels();
     foreach ($levels as $level) {
         $this->usr_levels[$level['user_level_id']] = $level["user_level_name"];
     }
     $udetails = "";
     if ($this->userid) {
         $udetails = $this->get_user_details($this->userid, true);
     }
     if ($udetails) {
         $this->udetails = $udetails;
         $this->username = $udetails['username'];
         $this->level = $this->udetails['level'];
         $this->permission = $this->get_user_level(userid());
         //exit();
         //Calling Logout Functions
         $funcs = $this->init_login_functions;
         if (is_array($funcs) && count($funcs) > 0) {
             foreach ($funcs as $func) {
                 if (function_exists($func)) {
                     $func();
                 }
             }
         }
         if ($sess->get("dummy_username") == "") {
             $this->UpdateLastActive(userid());
         }
     } else {
         $this->permission = $this->get_user_level(4, TRUE);
     }
     //Adding Actions such Report, share,fav etc
     $this->action = new cbactions();
     $this->action->type = 'u';
     $this->action->name = 'user';
     $this->action->obj_class = 'userquery';
     $this->action->check_func = 'user_exists';
     $this->action->type_tbl = $this->dbtbl['users'];
     $this->action->type_id_field = 'userid';
     define('AVATAR_SIZE', config('max_profile_pic_width'));
     define('AVATAR_SMALL_SIZE', 40);
     define('BG_SIZE', config('max_bg_width'));
     define('BACKGROUND_URL', config('background_url'));
     define("USE_GAVATAR", config('gravatars') ? config('gravatars') : false);
     //Use Gavatar
     define('BACKGROUND_COLOR', config('background_color'));
     if (isSectionEnabled('channels')) {
         $Cbucket->search_types['users'] = "userquery";
     }
     register_object('u', 'userquery');
     register_object('user', 'userquery');
     /**
      * get user latest notifications counts
      */
     $new_notifications = $this->get_new_notifications();
     $this->new_messages = $new_notifications['new_messages'];
     $this->new_notifications = $new_notifications['new_notifications'];
     $this->new_friend_requests = $new_notifications['new_friend_requests'];
 }
示例#4
0
 function init()
 {
     register_object('g', 'cbgroup');
     register_object('group', 'cbgroup');
 }