From 517deb7b2c6574cf885d4859e59c4ad3771c85e4 Mon Sep 17 00:00:00 2001 From: Saqib Razzaq Date: Fri, 6 Jan 2017 13:17:51 +0500 Subject: [PATCH] Killed dozens of more notices --- upload/includes/classes/actions.class.php | 18 ++++---- upload/includes/classes/cbpage.class.php | 8 ++-- upload/includes/classes/collections.class.php | 35 ++++++++-------- upload/includes/classes/user.class.php | 42 +++++++++---------- upload/includes/functions.php | 17 ++++---- upload/includes/functions_photo.php | 14 +++---- upload/styles/global/head.html | 2 +- 7 files changed, 69 insertions(+), 67 deletions(-) diff --git a/upload/includes/classes/actions.class.php b/upload/includes/classes/actions.class.php index f28031a4..ee090bdf 100644 --- a/upload/includes/classes/actions.class.php +++ b/upload/includes/classes/actions.class.php @@ -1151,18 +1151,18 @@ class cbactions $condition .= ( $condition ) ? " AND " : ""; $condition .= "playlists.privacy = 'public'"; } else { - if ( $params[ 'privacy' ] ) { + if ( isset($params[ 'privacy' ]) ) { $condition .= ( $condition ) ? " AND " : ""; $condition .= " playlists.privacy = '".mysql_clean( $params[ 'privacy' ] )."' "; } } - if ( $params[ 'category' ] ) { + if ( isset($params[ 'category' ]) ) { $condition .= ( $condition ) ? " AND " : ""; $condition .= " playlists.category = '".$params[ 'category' ]."' "; } - if ( $params[ 'include' ] ) { + if ( isset($params[ 'include' ]) ) { $ids = is_array( $params[ 'include' ] ) ? $params[ 'include' ] : explode( ',', $params[ 'include' ] ); if ( is_array( $ids ) and !empty( $ids ) ) { @@ -1172,7 +1172,7 @@ class cbactions } } - if ( $params[ 'exclude' ] ) { + if ( isset($params[ 'exclude' ]) ) { $ids = is_array( $params[ 'exclude' ] ) ? $params[ 'exclude' ] : explode( ',', $params[ 'exclude' ] ); if ( is_array( $ids) and !empty( $ids ) ) { @@ -1182,29 +1182,29 @@ class cbactions } } - if ( $params[ 'date_span' ] ) { + if ( isset($params[ 'date_span' ]) ) { $condition .= ( $condition ) ? " AND " : ""; $column = ( $params[ 'date_span_column' ] ) ? trim( $params[ 'date_span_column' ] ) : 'playlists.date_added'; $condition .= cbsearch::date_margin( $column, $params['date_span'] ); } - if ( $params[ 'last_update' ] ) { + if ( isset($params[ 'last_update' ]) ) { $condition .= ( $condition ) ? " AND " : ""; $condition .= cbsearch::date_margin( 'playlists.last_update', $params['last_update'] ); } - if( $params[ 'user' ] ) { + if( isset($params[ 'user' ]) ) { $condition .= ( $condition ) ? " AND " : ""; $condition .= " playlists.userid = '".$params[ 'user' ]."' "; } - if ( $params[ 'has_items' ] ) { + if ( isset($params[ 'has_items' ]) ) { $condition .= ( $condition ) ? " AND " : ""; $condition .= " playlists.total_items > '0' "; } - if($params['count_only']){ + if(isset($params['count_only'])){ $result = $db->count( cb_sql_table('playlists') , 'playlist_id' ); return $result; } diff --git a/upload/includes/classes/cbpage.class.php b/upload/includes/classes/cbpage.class.php index 8c70e9dc..18dfcab5 100644 --- a/upload/includes/classes/cbpage.class.php +++ b/upload/includes/classes/cbpage.class.php @@ -71,21 +71,21 @@ class cbpage $limit = NULL; $conds = array(); $cond = false; - if($params['order']) + if(isset($params['order'])) { $order = $params['order']; } - if($params['limit']) + if(isset($params['limit'])) { $limit = $params['limit']; } - if($params['active']) + if(isset($params['active'])) { $conds[] = " active='".$params['active']."'"; } - if($params['display_only']) + if(isset($params['display_only'])) { $conds[] = " display='yes' "; } diff --git a/upload/includes/classes/collections.class.php b/upload/includes/classes/collections.class.php index 91677d43..896cbb91 100644 --- a/upload/includes/classes/collections.class.php +++ b/upload/includes/classes/collections.class.php @@ -294,16 +294,16 @@ class Collections extends CBCategory if(!has_access('admin_access',TRUE) && $p['user'] != userid()) $cond .= " ".tbl('collections.active')." = 'yes'"; - elseif($p['user'] == userid()) + elseif(isset($p['user']) && $p['user'] == userid()) $cond .= " ".tbl('collections.active')." = 'yes'"; else { - if($p['active']) + if(isset($p['active'])) { $cond .= " ".tbl('collections.active')." = '".$p['active']."'"; } - if($p['broadcast']) + if(isset($p['broadcast'])) { if($cond != '') $cond .= " AND "; @@ -311,7 +311,7 @@ class Collections extends CBCategory } } - if($p['category']) + if(isset($p['category'])) { $get_all = false; if(!is_array($p['category'])) @@ -341,13 +341,14 @@ class Collections extends CBCategory } } - if($p['date_span']) + if(isset($p['date_span'])) { if($cond!='') $cond .= ' AND '; $cond .= " ".cbsearch::date_margin("date_added",$p['date_span']); } - if($p['type']) + + if(isset($p['type'])) { if($cond != '') $cond .= " AND "; @@ -355,7 +356,7 @@ class Collections extends CBCategory } - if($p['user']) + if(isset($p['user'])) { if($cond != '') $cond .= " AND "; @@ -366,7 +367,7 @@ class Collections extends CBCategory } - if($p['featured']) + if(isset($p['featured'])) { if($cond != '') $cond .= " AND "; @@ -374,7 +375,7 @@ class Collections extends CBCategory } //$user_public_upload = - if($p['public_upload']) + if(isset($p['public_upload'])) { if($cond != '') $cond .= " OR "; @@ -385,14 +386,14 @@ class Collections extends CBCategory } - if($p['exclude']) + if(isset($p['exclude'])) { if($cond != '') $cond .= " AND "; $cond .= " ".tbl('collections.collection_id')." <> '".$p['exclude']."'"; } - if($p['cid']) + if(isset($p['cid'])) { if($cond != '') $cond .= " AND "; @@ -402,7 +403,7 @@ class Collections extends CBCategory /** Get only with those who have items **/ - if($p['has_items'] ) + if(isset($p['has_items'])) { if($cond != '') $cond .= " AND "; @@ -418,12 +419,12 @@ class Collections extends CBCategory $title_tag = ''; - if($p['name']) + if(isset($p['name'])) { $title_tag .= " ".tbl('collections.collection_name')." LIKE '%".$p['name']."%'"; } - if($p['tags']) + if(isset($p['tags'])) { $tags = explode(",",$p['tags']); if(count($tags)>0) @@ -454,7 +455,7 @@ class Collections extends CBCategory } - if(!$p['count_only']) + if(!isset($p['count_only'])) { if($cond != "") $cond .= " AND "; @@ -467,13 +468,13 @@ class Collections extends CBCategory } - if($p['count_only']) + if(isset($p['count_only'])) { return $result = $db->count(tbl("collections"),"collection_id",$cond); //echo $db->db_query; } - if($p['assign']) + if(isset($p['assign'])) assign($p['assign'],$result); else return $result; diff --git a/upload/includes/classes/user.class.php b/upload/includes/classes/user.class.php index b8ea8481..cf52d714 100644 --- a/upload/includes/classes/user.class.php +++ b/upload/includes/classes/user.class.php @@ -1622,7 +1622,7 @@ class userquery extends CBCategory{ $thumb = USER_THUMBS_URL.'/'.$file.'-'.$size.'.'.$ext; $thumb_path = $file.'.'.$ext; } - elseif(!$thumb) + elseif(!isset($thumb) || !$thumb) { $thumb = USER_THUMBS_URL.'/'.$file.'.'.$ext; $thumb_path = ""; @@ -3892,18 +3892,18 @@ class userquery extends CBCategory{ { global $db; - $limit = $params['limit']; - $order = $params['order']; + $limit = isset($params['limit']); + $order = isset($params['order']); $cond = ""; if(!has_access('admin_access',TRUE) && !$force_admin) $cond .= " users.usr_status='Ok' AND users.ban_status ='no' "; else { - if($params['ban']) + if(isset($params['ban'])) $cond .= " users.ban_status ='".$params['ban']."'"; - if($params['status']) + if(isset($params['status'])) { if($cond!='') $cond .=" AND "; @@ -3913,17 +3913,17 @@ class userquery extends CBCategory{ } //Setting Category Condition - if(!is_array($params['category'])) + if(isset($params['category']) && !is_array($params['category'])) $is_all = strtolower($params['category']); - if($params['category'] && $is_all!='all') + if(isset($params['category']) && $is_all!='all') { if($cond!='') $cond .= ' AND '; $cond .= " ("; - if(!is_array($params['category'])) + if(isset($params['category']) && !is_array($params['category'])) { $cats = explode(',',$params['category']); }else @@ -3943,7 +3943,7 @@ class userquery extends CBCategory{ } //date span - if($params['date_span']) + if(isset($params['date_span'])) { if($cond!='') $cond .= ' AND '; @@ -4001,7 +4001,7 @@ class userquery extends CBCategory{ }*/ //FEATURED - if($params['featured']) + if(isset($params['featured'])) { if($cond!='') $cond .= ' AND '; @@ -4009,7 +4009,7 @@ class userquery extends CBCategory{ } //Email - if($params['username']) + if(isset($params['username'])) { if($cond!='') $cond .= ' AND '; @@ -4017,7 +4017,7 @@ class userquery extends CBCategory{ } //Email - if($params['email']) + if(isset($params['email'])) { if($cond!='') $cond .= ' AND '; @@ -4025,7 +4025,7 @@ class userquery extends CBCategory{ } //Exclude Users - if($params['exclude']) + if(isset($params['exclude'])) { if($cond!='') $cond .= ' AND '; @@ -4033,7 +4033,7 @@ class userquery extends CBCategory{ } //Getting specific User - if($params['userid']) + if(isset($params['userid'])) { if($cond!='') $cond .= ' AND '; @@ -4041,7 +4041,7 @@ class userquery extends CBCategory{ } //Sex - if($params['gender']) + if(isset($params['gender'])) { if($cond!='') $cond .= ' AND '; @@ -4049,14 +4049,14 @@ class userquery extends CBCategory{ } //Level - if($params['level']) + if(isset($params['level'])) { if($cond!='') $cond .= ' AND '; $cond .= " users.level = '".$params['level']."' "; } - if($params['cond']) + if(isset($params['cond'])) { if($cond!='') $cond .= ' AND '; @@ -4066,7 +4066,7 @@ class userquery extends CBCategory{ - if(!$params['count_only']) + if(isset($params['count_only']) && !$params['count_only']) { $fields = array( @@ -4095,17 +4095,17 @@ class userquery extends CBCategory{ } - if($params['count_only']){ + if(isset($params['count_only'])){ //$cond= substr($cond,8); $result = $db->count(tbl('users')." AS users ",'userid',$cond); //echo $cond; //return $result; } - if($params['assign']) + if(isset($params['assign'])) assign($params['assign'],$result); else - return $result; + return isset($result) ? $result : false; } /** diff --git a/upload/includes/functions.php b/upload/includes/functions.php index 3cb73421..cc885353 100644 --- a/upload/includes/functions.php +++ b/upload/includes/functions.php @@ -269,8 +269,8 @@ } //for srever thumb files $parts = parse_url($file); - parse_str($parts['query'], $query); - $get_file_name = $query['src']; + $query = isset($query) ? parse_str($parts['query'], $query) : false; + $get_file_name = isset($query['src']) ? $query['src'] : false; $path = explode('.',$get_file_name); $server_thumb_name = $path[0]; if (!empty($server_thumb_name)) { @@ -665,10 +665,10 @@ function getAd($params) { global $adsObj; $data = ''; - if($params['style'] || $params['class'] || $params['align']) + if(isset($params['style']) || isset($params['class']) || isset($params['align'])) $data .= '
'; $data .= ad($adsObj->getAd($params['place'])); - if($params['style'] || $params['class'] || $params['align']) + if(isset($params['style']) || isset($params['class']) || isset($params['align'])) $data .= '
'; return $data; } @@ -867,8 +867,9 @@ */ function cbRocks() { - define("isCBSecured",TRUE); - //echo cbSecured(CB_SIGN); + if (!defined('isCBSecured')) { + define("isCBSecured",TRUE); + } } /** @@ -1664,7 +1665,7 @@ function get_form_val($val,$filter=false) { if($filter) { - return form_val($_GET[$val]); + return isset($_GET[$val]) ? form_val($_GET[$val]) : false; } else { return $_GET[$val]; } @@ -1742,7 +1743,7 @@ if(getArrayValue($param, 'assign')=='') { return lang($param['code'],getArrayValue($param, 'sprintf')); } else { - assign($param['assign'],lang($param['code'],$param['sprintf'])); + assign($param['assign'],lang($param['code'],isset($param['sprintf']) ? $param['sprintf'] : false)); } } diff --git a/upload/includes/functions_photo.php b/upload/includes/functions_photo.php index 7688f1e4..57210851 100644 --- a/upload/includes/functions_photo.php +++ b/upload/includes/functions_photo.php @@ -156,9 +156,9 @@ function get_image_file( $params ) { global $cbphoto, $Cbucket; //var_dump($params); $details = $params[ 'details' ]; - $output = $params[ 'output' ]; + $output = isset($params[ 'output' ]) ? $params[ 'output' ] : false; $size = $params[ 'size' ]; - $static = $params['static']; + $static = isset($params['static']) ? $params['static'] : false; $default = array( 't', 'm', 'l', 'o' ); $thumbs = array(); if( !$details ) { @@ -187,7 +187,7 @@ function get_image_file( $params ) { $params[ 'photo' ] = $photo; - if( count( $Cbucket->custom_get_photo_funcs ) > 0 ) { + if( isset($Cbucket->custom_get_photo_funcs) && count( $Cbucket->custom_get_photo_funcs ) > 0 ) { $functions = $Cbucket->custom_get_photo_funcs; foreach( $functions as $func ) { if( function_exists( $func ) ) { @@ -202,7 +202,7 @@ 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; - $with_original = $params[ 'with_orig' ]; + $with_original = isset($params[ 'with_orig' ]) ? $params[ 'with_orig' ] : false; $size = ( !in_array( $size, $default ) or !$size ) ? 't' : $size; @@ -235,9 +235,9 @@ function get_image_file( $params ) { if ( empty( $output ) or $output == 'non_html' ) { - if ( $params[ 'assign' ] and $params[ 'multi' ] ) { + if ( isset($params[ 'assign' ]) && isset($params[ 'multi' ]) ) { assign( $params[ 'assign' ], $thumbs ); - } else if( ( $params[ 'multi' ] ) ) { + } else if( ( isset($params[ 'multi' ]) ) ) { return $thumbs; } else { @@ -249,7 +249,7 @@ function get_image_file( $params ) { return get_photo_default_thumb( $size, $output ); } else { - if( $params[ 'assign' ] ) { + if( isset($params[ 'assign' ]) ) { assign( $params[ 'assign' ], $return_thumb ); } else { return $return_thumb; diff --git a/upload/styles/global/head.html b/upload/styles/global/head.html index 9b963e73..48aef521 100644 --- a/upload/styles/global/head.html +++ b/upload/styles/global/head.html @@ -40,7 +40,7 @@ function switchEmbedCode(type) -{if $__devmsgs} +{if isset($__devmsgs)} {else}