From 7fee6942f6c35343f0fe3ee04b139c880d445c56 Mon Sep 17 00:00:00 2001 From: Mohammad Shoaib Date: Tue, 23 Sep 2014 12:07:50 +0000 Subject: [PATCH] updated: design fixes and error removes --- upload/actions/file_uploader.php | 3 +- upload/admin_area/flagged_collections.php | 3 +- .../styles/cb_2014/layout/add_members.html | 4 +- .../styles/cb_2014/layout/flagged_groups.html | 1 + upload/admin_area/upload_thumbs.php | 4 +- upload/admin_area/user_levels.php | 8 +- upload/groups.php | 1 + upload/includes/classes/image.class.php | 7 +- upload/includes/classes/upload.class.php | 2 +- upload/includes/classes/user.class.php | 15 +- upload/includes/classes/video.class.php | 2 - upload/includes/common.php | 9 +- upload/includes/functions_db.php | 1 + upload/includes/functions_photo.php | 3 - upload/manage_photos.php | 1 + .../layout/blocks/manage/account_photo.html | 46 ++--- .../layout/blocks/manage/userMenuLeft.html | 6 +- upload/styles/cb_27/layout/edit_photo.html | 7 +- upload/styles/cb_27/layout/manage_photos.html | 111 +++++++++--- upload/styles/cb_27/layout/view_photo.html | 168 +----------------- upload/upload.php | 5 + upload/videos.php | 1 + upload/view_channel.php | 6 - 23 files changed, 174 insertions(+), 240 deletions(-) diff --git a/upload/actions/file_uploader.php b/upload/actions/file_uploader.php index 273d383f..4c29cc9d 100644 --- a/upload/actions/file_uploader.php +++ b/upload/actions/file_uploader.php @@ -153,8 +153,9 @@ switch($mode) exit(0); } - + move_uploaded_file($tempFile,$targetFile); + $Upload->add_conversion_queue($targetFileName); $quick_conv = config('quick_conv'); diff --git a/upload/admin_area/flagged_collections.php b/upload/admin_area/flagged_collections.php index 1a71f7b7..708d372f 100644 --- a/upload/admin_area/flagged_collections.php +++ b/upload/admin_area/flagged_collections.php @@ -38,7 +38,7 @@ if(isset($_POST['delete_selected'])) e("Selected collections have been deleted","m"); } -if(isset($_REQUEST['delete_flags'])) +if(isset($_GET['delete_flags'])) { $collect = mysql_clean($_GET['delete_flags']); $cbcollection->action->delete_flags($collect); @@ -64,6 +64,7 @@ switch($mode) $page = mysql_clean($_GET['page']); $get_limit = create_query_limit($page,5); $collects = $cbcollection->action->get_flagged_objects($get_limit); + assign('cl', $collects); //Collecting Data for Pagination diff --git a/upload/admin_area/styles/cb_2014/layout/add_members.html b/upload/admin_area/styles/cb_2014/layout/add_members.html index 3143197a..e14ab61e 100644 --- a/upload/admin_area/styles/cb_2014/layout/add_members.html +++ b/upload/admin_area/styles/cb_2014/layout/add_members.html @@ -4,8 +4,10 @@

Add New User

-

Required Member Details

+ +

Required Member Details

+
diff --git a/upload/admin_area/styles/cb_2014/layout/flagged_groups.html b/upload/admin_area/styles/cb_2014/layout/flagged_groups.html index add2b8a7..8bcfebdb 100644 --- a/upload/admin_area/styles/cb_2014/layout/flagged_groups.html +++ b/upload/admin_area/styles/cb_2014/layout/flagged_groups.html @@ -2,6 +2,7 @@

Flagged Groups Manager

+
diff --git a/upload/admin_area/upload_thumbs.php b/upload/admin_area/upload_thumbs.php index 56e9730f..58f60aba 100644 --- a/upload/admin_area/upload_thumbs.php +++ b/upload/admin_area/upload_thumbs.php @@ -33,9 +33,11 @@ if($myquery->VideoExists($video)){ $vid_file = VIDEOS_DIR.'/'.$data['file_directory'].'/'.get_video_file($data,false,false); # Uploading Thumbs if(isset($_POST['upload_thumbs'])){ - + if($data['files_thumbs_path']!=''){ + + $files_thumbs_path= $data['files_thumbs_path']; $serverApi = str_replace('/files/thumbs', '', $files_thumbs_path); $serverApi = $serverApi.'/actions/custom_thumb_upload.php'; diff --git a/upload/admin_area/user_levels.php b/upload/admin_area/user_levels.php index 0b07ac62..d915b685 100644 --- a/upload/admin_area/user_levels.php +++ b/upload/admin_area/user_levels.php @@ -64,7 +64,8 @@ switch($mode) //GettinG Level Permission $level_perms = $userquery->get_level_permissions($lid); - + //pr($level_perms, true); + $plugin_perms = $level_perms['plugins_perms']; $plugin_perms = json_decode($plugin_perms,true); @@ -88,6 +89,11 @@ switch($mode) } } +//$lev = $userquery->get_level_types(); + +//$per = $userquery->get_permissions(2); +//pr($per, true); + subtitle("User levels"); template_files('user_levels.html'); display_it(); diff --git a/upload/groups.php b/upload/groups.php index f32bdb35..10456c1c 100644 --- a/upload/groups.php +++ b/upload/groups.php @@ -54,6 +54,7 @@ $glist = $g_cond; $glist['limit'] = $get_limit; $groups = $cbgroup->get_groups($glist); + Assign('groups', $groups); //Collecting Data for Pagination diff --git a/upload/includes/classes/image.class.php b/upload/includes/classes/image.class.php index a6c987d1..a1250159 100644 --- a/upload/includes/classes/image.class.php +++ b/upload/includes/classes/image.class.php @@ -59,13 +59,16 @@ class ResizeImage function ValidateImage($file,$ext=NULL){ $array = getimagesize($file); - if($ext == 'jpg' || $ext == 'JPG' ||$ext == 'JPEG' || $ext == 'gif' || $ext == 'GIF' || $ext == 'PNG' || $ext == 'png'){ + if($ext == 'jpg' || $ext == 'JPG' ||$ext == 'JPEG' || $ext == 'gif' || $ext == 'GIF' || $ext == 'PNG' || $ext == 'png') + { if(empty($array[0]) || empty($array[1])){ $validate = false; }else{ $validate = true; } - }else{ + } + else + { $validate = false; } return $validate; diff --git a/upload/includes/classes/upload.class.php b/upload/includes/classes/upload.class.php index 1071b04f..e8d2d19c 100644 --- a/upload/includes/classes/upload.class.php +++ b/upload/includes/classes/upload.class.php @@ -313,7 +313,7 @@ class Upload{ $file_path = THUMBS_DIR.'/'.$file_name.'-'.$file_num.'.'.$ext; $big_file_path = THUMBS_DIR.'/'.$file_name.'-big-'.$file_num.'.'.$ext; } - + move_uploaded_file($file['tmp_name'][$key],$file_path); $imgObj->CreateThumb($file_path,$big_file_path,config('big_thumb_width'),$ext,config('big_thumb_height'),false); diff --git a/upload/includes/classes/user.class.php b/upload/includes/classes/user.class.php index e4a0f795..4d6282f3 100644 --- a/upload/includes/classes/user.class.php +++ b/upload/includes/classes/user.class.php @@ -366,15 +366,16 @@ class userquery extends CBCategory{ { global $LANG,$Cbucket,$sess; - if($verify_logged_user) { //First check weather userid is here or not if(!userid()) { + if(!$check_only) e(lang('you_not_logged_in')); return false; + } elseif(!$this->session_auth(userid())) { @@ -405,6 +406,7 @@ class userquery extends CBCategory{ { //$access_details = $this->get_user_level(userid()); $access_details = $this->permission; + if(is_numeric($access)) { if($access_details['level_id'] == $access) @@ -1923,6 +1925,8 @@ class userquery extends CBCategory{ //First Checking Level $level = $this->get_level_details($id); + + if($level) { foreach($this->get_access_type_list() as $access => $name) @@ -1930,6 +1934,8 @@ class userquery extends CBCategory{ $fields_array[] = $access; $value_array[] = $array[$access]; } + + //Checking level Name if(!empty($array['level_name'])) @@ -1939,12 +1945,14 @@ class userquery extends CBCategory{ $db->update(tbl("user_levels"),array("user_level_name"),array($level_name)," user_level_id = '$id'"); } + if(isset($_POST['plugin_perm'])) { $fields_array[] = 'plugins_perms'; $value_array[] = '|no_mc|'.json_encode($_POST['plugin_perm']); } + //Updating Permissions $db->update(tbl("user_levels_permissions"),$fields_array,$value_array," user_level_id = '$id'"); @@ -3385,13 +3393,14 @@ class userquery extends CBCategory{ 'title' => lang('user_date_of_birth'), 'type' => 'textfield', 'name' => 'dob', + 'readonly' => 'true', 'id' => 'dob', 'anchor_after' => 'date_picker', 'value'=> $dob, - 'validate_function' => 'verify_age', + 'validate_function' => 'verify_age', 'db_field'=>'dob', 'required'=>'yes', - 'invalid_err'=>lang('You must be atleast '.config('min_age_reg').' to register'), + 'invalid_err'=>lang('You must be atleast '.config('min_age_reg').' to register'), ), 'cat' => array('title'=> lang('Category'), diff --git a/upload/includes/classes/video.class.php b/upload/includes/classes/video.class.php index a99c03ec..5eb43429 100644 --- a/upload/includes/classes/video.class.php +++ b/upload/includes/classes/video.class.php @@ -942,8 +942,6 @@ class CBvideo extends CBCategory if(!$params['count_only'] && !$params['show_related']) { - - $query = "SELECT $fields FROM ".cb_sql_table( 'video' ); $query .= " LEFT JOIN ".cb_sql_table( 'users' )." ON video.userid = users.userid"; diff --git a/upload/includes/common.php b/upload/includes/common.php index b7ef52a1..81a16175 100644 --- a/upload/includes/common.php +++ b/upload/includes/common.php @@ -168,7 +168,7 @@ if(!@$in_bg_cron) - //Setting Time Zone date_default_timezone_set + //Setting Time Zone date_default_timezone_set require_once('classes/search.class.php'); @@ -196,7 +196,7 @@ if(!@$in_bg_cron) require_once('classes/photos.class.php'); require_once('classes/menuhandler.class.php'); require_once('classes/cbfeeds.class.php'); - require_once('classes/resizer.class.php'); + require_once('classes/resizer.class.php'); //Adding Gravatar require_once('classes/gravatar.class.php'); @@ -564,7 +564,7 @@ if(!@$in_bg_cron) Assign('lang_count',(isset($languages)) ? count($languages) : false); //Configration of time formate - $config['date'] = '%I:%M %p'; + $config['date'] = '%I:%M %p'; $config['time'] = '%H:%M'; assign('config', $config); //Assign Player Div Id @@ -589,7 +589,8 @@ $Smarty->assign_by_ref('cbgroup', $cbgroup); $Smarty->assign_by_ref('db', $db); $Smarty->assign_by_ref('adsObj', $adsObj); $Smarty->assign_by_ref('formObj', $formObj); -$Smarty->assign_by_ref('Cbucket', $Cbucket);$Smarty->assign_by_ref('ClipBucket', $Cbucket); +$Smarty->assign_by_ref('Cbucket', $Cbucket); +$Smarty->assign_by_ref('ClipBucket', $Cbucket); $Smarty->assign_by_ref('eh', $eh); $Smarty->assign_by_ref('lang_obj', $lang_obj); $Smarty->assign_by_ref('cbvid', $cbvid); diff --git a/upload/includes/functions_db.php b/upload/includes/functions_db.php index 305dd507..87e51b1a 100644 --- a/upload/includes/functions_db.php +++ b/upload/includes/functions_db.php @@ -262,6 +262,7 @@ function cb_select( $query ) { * @return mixed */ function select( $query ) { + return cb_select( $query ); } diff --git a/upload/includes/functions_photo.php b/upload/includes/functions_photo.php index afbe8c0a..4c814f81 100644 --- a/upload/includes/functions_photo.php +++ b/upload/includes/functions_photo.php @@ -153,7 +153,6 @@ function get_photo_default_thumb( $size = null, $output = null ) { function get_image_file( $params ) { - global $cbphoto, $Cbucket; //var_dump($params); $details = $params[ 'details' ]; @@ -197,8 +196,6 @@ function get_image_file( $params ) { } } - - $path = PHOTOS_DIR; $directory = get_photo_date_folder( $photo ); $with_path = $params['with_path'] = ( $params['with_path'] === false ) ? false : true; diff --git a/upload/manage_photos.php b/upload/manage_photos.php index 9d45a79d..d7e59faf 100644 --- a/upload/manage_photos.php +++ b/upload/manage_photos.php @@ -71,6 +71,7 @@ switch($mode) $photo_arr['title'] = mysql_clean(get('query')); $photo_arr['tags'] = mysql_clean(get('query')); } + $photos = get_photos($photo_arr); assign('photos',$photos); diff --git a/upload/styles/cb_27/layout/blocks/manage/account_photo.html b/upload/styles/cb_27/layout/blocks/manage/account_photo.html index ec7410db..5bac426f 100644 --- a/upload/styles/cb_27/layout/blocks/manage/account_photo.html +++ b/upload/styles/cb_27/layout/blocks/manage/account_photo.html @@ -27,43 +27,43 @@ {/if} {if $control == "partail"} - + {/if} {if $control == 'orphan'} - + {/if} \ No newline at end of file diff --git a/upload/styles/cb_27/layout/blocks/manage/userMenuLeft.html b/upload/styles/cb_27/layout/blocks/manage/userMenuLeft.html index 0ecf94ae..7c8c9f32 100644 --- a/upload/styles/cb_27/layout/blocks/manage/userMenuLeft.html +++ b/upload/styles/cb_27/layout/blocks/manage/userMenuLeft.html @@ -1,8 +1,9 @@ -{$topMenuLinks = array_slice($myAccountLinks, 0, 6)} - +{*$topMenuLinks = array_slice($myAccountLinks, 0, 6)*} +{$topMenuLinks = $myAccountLinks}
diff --git a/upload/styles/cb_27/layout/edit_photo.html b/upload/styles/cb_27/layout/edit_photo.html index 6998ac93..a24a410d 100644 --- a/upload/styles/cb_27/layout/edit_photo.html +++ b/upload/styles/cb_27/layout/edit_photo.html @@ -1,11 +1,12 @@ -
+{$myAccountLinks = $userquery->my_account_links()} +
{include file="$style_dir/blocks/manage/account_menu.html"} -
+
-
+
{*include file="$style_dir/blocks/manage/account_head.html" user=$user*}

Edit Photo

diff --git a/upload/styles/cb_27/layout/manage_photos.html b/upload/styles/cb_27/layout/manage_photos.html index de0d0487..9cf89266 100644 --- a/upload/styles/cb_27/layout/manage_photos.html +++ b/upload/styles/cb_27/layout/manage_photos.html @@ -1,5 +1,13 @@ -
-
+{$myAccountLinks = $userquery->my_account_links()} +
+{include file="$style_dir/blocks/manage/account_menu.html"} +
+ +
+ + {if $mode == 'uploaded'}

{lang code="Manage Photos"}

@@ -24,6 +32,7 @@
+
@@ -47,19 +60,35 @@ {if $mode == "favorite"}

{lang code="manage_favorite_photos"}

-
+
+
- - - - +
+
+ + +
+
+ +
+
+ + +
+
+
+
+ + +
- +
- +
+ -
@@ -70,20 +99,25 @@ {lang code='comments'} {lang code='favorites'}
+ {section name=p_list loop=$photos} {include file="$style_dir/blocks/manage/account_photo.html" photo=$photos[p_list] control='partail'} {sectionelse} -
{lang code='You dont have any favorite photos'}
- {/section} + + +
{lang code='You dont have any favorite photos'}
+ + + {/section} +
{/if} {if $mode == 'orphan'} -

{lang code="manage_my_album"}

+

{lang code="manage_my_album"}

- Make my album + Make my album @@ -96,20 +130,36 @@

All the photos uploaded are dependent on their collections/albums. When you remove some photo from collection/album, this will not delete photo permenently. It will move photo here. You can also use this to make your photos private. Direct link is available for you to share with your friends.

-
+ +
+
- - - -
+
+
+ + +
+
+ +
+
+ + +
+
+
+
+ +
- +
+
- +
@@ -119,17 +169,24 @@ -
{lang code='comments'} {lang code='favorites'}
+ {section name=p_list loop=$photos} - {include file="$style_dir/blocks/manage/account_photo.html" photo=$photos[p_list] control='orphan'} + {include file="$style_dir/blocks/manage/account_photo.html" photo=$photos[p_list] control='orphan'} {sectionelse} -
{lang code='you_dont_have_orphan_photos'}
- {/section} + + +
{lang code='you_dont_have_orphan_photos'}
+ + + {/section} +
{/if} - + +
+
-
+
diff --git a/upload/styles/cb_27/layout/view_photo.html b/upload/styles/cb_27/layout/view_photo.html index 52f297eb..2210a38c 100644 --- a/upload/styles/cb_27/layout/view_photo.html +++ b/upload/styles/cb_27/layout/view_photo.html @@ -20,22 +20,12 @@
- -
-
- -
+ +
+
+
+
@@ -51,23 +41,7 @@ - +
@@ -86,84 +60,14 @@ -
{*show_video_rating rating=$photo.rating ratings=$photo.rated_by total='10' id=$photo.photo_id type=photo*}
- - - - - - - - - - - - - - +
- - - - - - - - - - - - - - - - - - - - - - - - -
@@ -183,30 +87,7 @@ - -
+
@@ -260,36 +141,6 @@
- - - - - - - - - - -
{show_share_form id=$photo.photo_id type=Photo}
@@ -315,8 +166,7 @@
{AD place='ad_320x250'}
- - +

{lang code='Most Popular'}

{section name=p_list loop=$photos} {include file="$style_dir/blocks/PopularPhotos.html" photo=$photos[p_list]} diff --git a/upload/upload.php b/upload/upload.php index 611446e5..41164b23 100644 --- a/upload/upload.php +++ b/upload/upload.php @@ -21,6 +21,8 @@ define("PARENT_PAGE","upload"); require 'includes/config.inc.php'; //var_dump($_POST);die(); +//$userquery->logincheck(); + $pages->page_redir(); subtitle('upload'); @@ -30,8 +32,11 @@ if(userid()) else $verify_logged_user = false; +//dump(has_access('allow_video_upload',false,$verify_logged_user)); + if(has_access('allow_video_upload',false,$verify_logged_user)) { + $file_name = time().RandomString(5); assign('file_name',$file_name); diff --git a/upload/videos.php b/upload/videos.php index b4ed966b..aad7726e 100644 --- a/upload/videos.php +++ b/upload/videos.php @@ -86,6 +86,7 @@ $vlist = $vid_cond; $count_query = $vid_cond; $vlist['limit'] = $get_limit; $videos = get_videos($vlist); + Assign('videos', $videos); diff --git a/upload/view_channel.php b/upload/view_channel.php index 502cf1f8..557c6e98 100644 --- a/upload/view_channel.php +++ b/upload/view_channel.php @@ -203,12 +203,6 @@ $pages->paginate($total_pages,$page,$link,$extra_params,$tag); } add_js(array('jquery_plugs/compressed/jquery.jCarousel.js'=>'view_channel')); - - - - - - if($Cbucket->show_page){ template_files('view_channel.html'); display_it();