예제 #1
0
파일: smiles.php 프로젝트: visavi/rotorcms4
         if (!preg_match('/[А-Яа-яЁё]/u', $code)) {
             $handle->file_new_name_body = substr($code, 1);
         }
         //$handle -> file_overwrite = true;
         $handle->ext_check = array('jpg', 'jpeg', 'gif', 'png', 'bmp');
         $handle->file_max_size = $config['smilemaxsize'];
         // byte
         $handle->image_max_width = $config['smilemaxweight'];
         // px
         $handle->image_max_height = $config['smilemaxweight'];
         // px
         $handle->image_min_width = $config['smileminweight'];
         // px
         $handle->image_min_height = $config['smileminweight'];
         // px
         $handle->process(BASEDIR . '/images/smiles/');
         if ($handle->processed) {
             $smile = DBM::run()->insert('smiles', array('smiles_cats' => 1, 'smiles_name' => $handle->file_dst_name, 'smiles_code' => $code));
             $handle->clean();
             clearCache();
             notice('Смайл успешно загружен!');
             redirect("smiles.php");
         } else {
             show_error($handle->error);
         }
     } else {
         show_error($handle->error);
     }
 } else {
     show_error($validation->getErrors());
 }