Exemple #1
0
                $err = $file->StrError();
                if (!$err && $type == 'work_prev' && (!in_array($file->getext(), $GLOBALS['graf_array']) || strtolower($file->getext()) == 'swf' || strtolower($file->getext()) == 'flv')) {
                    $err = 'Недопустимый тип файла';
                }
                if ($type == 'photo' || $type == 'logo') {
                    if (!$err && !$file->img_to_small('sm_' . $filename, array('width' => 50, 'height' => 50))) {
                        $err .= 'Невозможно уменьшить картинку.';
                    }
                }
            }
        } elseif (!$err) {
            // логотип проекта
            require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects.php';
            $tmpPrj = new tmp_project($pkey);
            $prj = $tmpPrj->init(1);
            $err = $tmpPrj->setLogo($file);
            $tmpPrj->fix();
            $logo = $tmpPrj->getLogo();
            $logourl = WDCPREFIX . '/' . $logo['path'] . $logo['name'];
        }
    }
}
?>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<?php 
$stc->Add('/css/projects3.css');
$stc->Add('/scripts/warning.js');
$stc->Send();
Exemple #2
0
     break;
 case 2:
     if (!$tmpPrj->isEdit() && ($project['descr'] === '' || $project['name'] === '')) {
         // сразу на шаг 2 нельзя, когда публикуется.
         header("Location: /public/?step=" . (isset($project['kind']) ? 1 : 0)) . "{$pprm}";
         exit;
     }
     if ($action == 'save' || $action == 'bill' || $action == 'prev' || $action == 'reload') {
         $tmpPrj->setProjectField('is_color', __paramInit('bool', NULL, 'is_color') ? 't' : 'f');
         $tmpPrj->setProjectField('is_bold', __paramInit('bool', NULL, 'is_bold') ? 't' : 'f');
         $tmpPrj->setProjectField('link', substr(__paramInit('string', NULL, 'link'), 0, 100));
         $tmpPrj->setAddedTopDays(__paramInit('bool', NULL, 'top_ok') ? __paramInit('int', NULL, 'top_days', 0) : 0);
         if (__paramInit('bool', NULL, 'logo_ok')) {
             if (!$_FILES['logo']['size']) {
                 $error['logo'] = 'Необходимо выбрать файл';
             } elseif ($err = $tmpPrj->setLogo(new CFile($_FILES['logo']))) {
                 $error['logo'] = $err;
             }
         }
         if (!$error && $action != 'prev' && $action != 'reload') {
             //для пользователя
             $price = $tmpPrj->getPrice($payedItems);
             $account_sum = $account->sum;
             $account_bonus_sum = $account->bonus_sum;
             //для модератора
             $view_user_login = '';
             if (hasPermissions("projects")) {
                 $uid = $tmpPrj->getAuthorId();
                 $view_account = new account();
                 $view_account->GetInfo($uid);
                 $account_sum = $view_account->sum;