get_var("SELECT CustomSettings FROM Sub_Class WHERE Sub_Class_ID=$cc"); ( $res ? eval("\$cc_settings = $res") : $cc_settings = NULL ); // значения визуальных настроек по умолчанию $res = $db->get_var("SELECT CustomSettingsTemplate FROM Class WHERE Class_ID=$classID"); eval("\$default_cc_settings = $res"); $j = sizeof($cc_settings); for($i=0; $i<$j; $i++) if(!$cc_settings[$i]) $cc_settings[$i] = $default_cc_settings[$i]; if($cc_settings['ThumbsOn']){ $ImgFields = array_merge($SmallImgField,$LargeImgField); for($i=0; $iget_results( "SELECT Field_ID,Field_Name FROM Field WHERE Class_ID=$Class_ID AND (Field_Name IN('".join("', '",$ImgFields)."'))", ARRAY_N); foreach($res As $v) $Field_ID[$v[1]] = $v[0]; foreach($ResizeImgFields As $v) $ResizeField_ID[$v] = $Field_ID[$v]; for($i=0; $iget_results("SELECT Real_Name,File_Path,Virt_Name,Field_ID FROM Filetable WHERE Message_ID=$message AND (Field_ID IN(".join(", ",$ResizeField_ID)."))", ARRAY_A); foreach($res As $row){ $SmallImg['Real_Name'] = 'small_'.$row['Real_Name']; $SmallImg['Virt_Name'] = md5(time().$SmallImg['Real_Name']); $SmallImg['File_Path'] = $row['File_Path']; if( nc_img_resize("$DOCUMENT_ROOT/netcat_files$row[File_Path]$row[Virt_Name]", "$DOCUMENT_ROOT/netcat_files$SmallImg[File_Path]$SmallImg[Virt_Name]", (int)$cc_settings['ImgWidth'], (int)$cc_settings['ImgHeight'], hexdec('0x'.$cc_settings['ImgFillColor']), (int)$cc_settings['ImgQuality']) ){ $SmallImg['File_Size'] = filesize("$DOCUMENT_ROOT/netcat_files$SmallImg[File_Path]$SmallImg[Virt_Name]"); $SmallImg['Field_ID'] = $LargeToSmallFielID[$row['Field_ID']]; $db->query("DELETE FROM Filetable WHERE Message_ID=$message AND Field_ID=$SmallImg[Field_ID]"); $db->query("INSERT INTO Filetable(Real_Name,Virt_Name,File_Path,File_Type,File_Size,Message_ID,Field_ID) VALUES('$SmallImg[Real_Name]','$SmallImg[Virt_Name]','$SmallImg[File_Path]','image/jpeg',$SmallImg[File_Size],$message,$SmallImg[Field_ID])"); $sql[] = $IDToName[$SmallImg['Field_ID']]."='$SmallImg[Real_Name]:image/jpeg:$SmallImg[File_Size]'"; } } $db->query("UPDATE Message$Class_ID SET ".join(', ', $sql)." WHERE Message_ID=$message" ); } } ob_end_clean(); header("Location: $goBackLink&inside_admin=$inside_admin"); ?>