'tmp_name'];
$src_name = $_FILES['categorynew_thumb']['name'];
$src_size = $_FILES['categorynew_thumb']['size'];
if ( !empty( $tmp_name ) )
{
if ( !$src_name || MAX_UP_CATEGORY_FILE < $src_size )
{
cpmsg( "涓婁紶鏂囦欢閿欒锛屾垨鑰呮枃浠跺ぇ灏忚秴杩?.MAX_UP_CATEGORY_FILE."瀛楄妭" );
}
$ext = substr( strrchr( $src_name, "." ), 1 );
$ext = strtolower( $ext );
if ( substr( $ext, 0, 3 ) != "jpg" && $ext != "gif" && $ext != "png" )
{
cpmsg( "涓婁紶鏂囦欢閿欒" );
}
if ( !empty( $tmp_name ) )
{
$save_name = "c_custme".$cid.".".$ext;
if ( !copy( $tmp_name, CATETHUMBPATH.$save_name ) )
{
cpmsg( "涓婁紶鏂囦欢閿欒" );
}
}
else
{
cpmsg( "涓婁紶鏂囦欢閿欒" );
}
}
$thumb_sql = $save_name ? ", thumb='".$save_name."' " : "";
$sql = "update {$tablepre}categories set\r\n\t\t\t\tsubject='".$categorynew['subject']."',description='".$categorynew['description']."', ispublishvideo='".$categorynew['ispublishvideo']."'\r\n\t\t\t\t, ispublishspecial='".$categorynew['ispublishspecial']."', insenz_category='".$categorynew['insenz_category']."'".$thumb_sql."\r\n\t\t\t\t where cid={$cid}";
$res = $db->query( $sql );
updatesyscache( "common" );
cpmsg( "鎿嶄綔鎴愬姛銆?, "?script=category&action=edit&cid=".$cid );
}
}
else if ( $action == "add" )
{
if ( !submitcheck( "submitbtn" ) )
{
showpanel_start( $lang['addcate'] );
showsetting( "cate_subject", "categorynew[subject]", "", "text" );
showsetting( "cate_description", "categorynew[description]", "", "textarea" );
$ispublish = array( "鍙栧叏灞璁剧疆", "蹇呴』瀹℃牳", "涓嶉渶瀹℃牳" );
$ispublishvideo = array(
"checked" => 0,
"list" => $ispublish
);
showsetting( "ispublishvideo", "categorynew[ispublishvideo]", $ispublishvideo, "radio" );
$ispublishspecial = array(
"checked" => 0,
"list" => $ispublish
);
showsetting( "ispublishspecial", "categorynew[ispublishspecial]", $ispublishspecial, "radio" );
showsetting( "insenz_category", "categorynew[insenz_category]", model_select( "", $video_categories['categorys'] ), "select" );
showsetting( "thumb", "categorynew[thumb]", "", "file" );
showpanel_end( );
}
else
{
$cid = intval( $cid );
$save_name = "";
if ( empty( $categorynew['insenz_category'] ) )
{
cpmsg( "Insenz璇剧▼涓嶈兘绌? );
}
$tmp_name = $_FILES['categorynew_thumb']['tmp_name'];
$src_name = $_FILES['categorynew_thumb']['name'];
$src_size = $_FILES['categorynew_thumb']['size'];
if ( !empty( $tmp_name ) )
{
if ( !$src_name || MAX_UP_CATEGORY_FILE < $src_size )
{
cpmsg( "涓婁紶鏂囦欢閿欒锛屾垨鑰呮枃浠跺ぇ灏忚秴杩?.MAX_UP_CATEGORY_FILE."瀛楄妭" );
}
$ext = substr( strrchr( $src_name, "." ), 1 );
$ext = strtolower( $ext );
if ( substr( $ext, 0, 3 ) != "jpg" && $ext != "gif" && $ext != "png" )
{
cpmsg( "涓婁紶鏂囦欢閿欒" );
}
if ( !empty( $tmp_name ) )
{
$save_name = "c_custme".$cid.".".$ext;
if ( !copy( $tmp_name, CATETHUMBPATH.$save_name ) )
{
cpmsg( "涓婁紶鏂囦欢閿欒" );
}
}
else
{
cpmsg( "涓婁紶鏂囦欢閿欒" );
}
}
$thumb_sql = $save_name ? ", thumb='".$save_name."' " : "";
$sql = "insert into {$tablepre}categories set\r\n\t\t\t\tsubject='".$categorynew['subject']."',description='".$categorynew['description']."', ispublishvideo='".$categorynew['ispublishvideo']."'\r\n\t\t\t\t,