当前位置: 首页>>代码示例>>PHP>>正文


PHP CFile::getext方法代码示例

本文整理汇总了PHP中CFile::getext方法的典型用法代码示例。如果您正苦于以下问题:PHP CFile::getext方法的具体用法?PHP CFile::getext怎么用?PHP CFile::getext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CFile的用法示例。


在下文中一共展示了CFile::getext方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: JS_Obj

function JS_Obj($login, $files)
{
    $CFile = new CFile();
    $result = '';
    if (is_array($files)) {
        for ($i = 0; $i < count($files); $i++) {
            $CFile->GetInfo('users/' . substr($login, 0, 2) . '/' . $login . '/upload/' . $files[$i]['fname']);
            $result .= ',{name: "' . addslashes($CFile->fname) . '", path: "' . addslashes($CFile->path) . '", user: "' . $login . '", size: ' . $CFile->size . ', mb_size: "' . ConvertBtoMB($CFile->size) . '", ';
            $result .= 'ftype: "' . addslashes($CFile->getext()) . '", id: ' . intval($files[$i]['id']) . ' }';
        }
    } elseif ($files) {
        $CFile->GetInfo('users/' . substr($login, 0, 2) . '/' . $login . '/upload/' . $files);
        $result .= ',{name: "' . addslashes($CFile->fname) . '", path: "' . addslashes($CFile->path) . '", user: "' . $login . '", size: ' . $CFile->size . ', mb_size: "' . ConvertBtoMB($CFile->size) . '", ';
        $result .= 'ftype: "' . addslashes($CFile->getext()) . '", id: ' . intval($CFile->id) . ' }';
    }
    return $result ? '[' . substr($result, 1) . ']' : '[]';
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:17,代码来源:view_cnt.php

示例2: viewattachExternal

 /**
  * Выводит икону и задданный внешний URL для определенного файла
  *
  * @param string  $ulogin   	Логин пользователя
  * @param string  $filename 	Имя файла 
  * @param string  $dir      	Папка файла
  * @param string  $url		 	Ссылка на файл
  * @param integer $bigtext  	Вместо иконкки будет большой текст расширения файла(TXT, PDF, etc...) если переменная принимает значение 1
  * @return string HTML-code
  */
 function viewattachExternal($ulogin, $filename, $dir, $url, $bigtext = 0)
 {
     $l_dir = substr($ulogin, 0, 2) . "/" . $ulogin;
     $cfile = new CFile("users/{$l_dir}/" . $dir . "/" . $filename);
     if (!$cfile->size) {
         return "";
     }
     $ext = $cfile->getext($filename);
     $ico = getICOFile($ext, true);
     echo $ico;
     $fsize = ConvertBtoMB($cfile->size);
     return '<p><img src="/pda/images/mime/' . $ico . '.png" alt="' . $ext . '" width="18" height="16"> <a href="' . $url . '" target="_blank">Скачать</a> | ' . ucfirst($ext) . ', ' . $fsize . ' </p>';
 }
开发者ID:amage,项目名称:fl-ru-damp,代码行数:23,代码来源:pda.php

示例3: intval

 if (!preg_match("/^[a-zA-Z0-9_-]*\$/", $frl->lj_1)) {
     $error_flag = 1;
     $alert[71] = "Поле заполнено некорректно";
 }
 $frl->lj_2 = change_q(substr(trim($_POST['lj_2']), 0, 64), true);
 if (!preg_match("/^[a-zA-Z0-9_-]*\$/", $frl->lj_2)) {
     $error_flag = 1;
     $alert[72] = "Поле заполнено некорректно";
 }
 $frl->lj_3 = change_q(substr(trim($_POST['lj_3']), 0, 64), true);
 if (!preg_match("/^[a-zA-Z0-9_-]*\$/", $frl->lj_3)) {
     $error_flag = 1;
     $alert[73] = "Поле заполнено некорректно";
 }
 // more lj
 $ext = $resume->getext();
 $frl->blocks = '1' . intval(trim($_POST['showkonk'])) . intval(trim($_POST['showcls'])) . intval(trim($_POST['showempl'])) . intval(trim($_POST['showfrl'])) . intval(trim($_POST['showmyrec'])) . intval(trim($_POST['showcommune'])) . intval(trim($_POST['showjoincommune']));
 //данные об языках пользователя
 $user_langs = array();
 if (is_array($_POST["langs"])) {
     foreach ($_POST["langs"] as $key => $item) {
         $user_lang["id"] = (int) $item;
         if ($user_lang["id"] == 0) {
             continue;
         }
         if (is_array($_POST["lang-q"])) {
             $user_lang["quality"] = (int) $_POST["lang-q"][$key] > 0 ? (int) $_POST["lang-q"][$key] : 2;
         }
         $user_langs[$user_lang["id"]] = $user_lang;
     }
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:index.php

示例4: addAttachedFiles

 /**
  *  Добавление/удаление файлов к рассылке
  * @param array   $files   Список файлов
  * @param integer $id      Ид рассылки
  */
 public function addAttachedFiles($files, $id)
 {
     if ($files) {
         foreach ($files as $file) {
             switch ($file['status']) {
                 case 4:
                     // Удаляем файл
                     $this->delAttach($file['id']);
                     break;
                 case 1:
                     // Добавляем файл
                     $cFile = new CFile($file['id']);
                     $cFile->table = 'file_mailer';
                     $ext = $cFile->getext();
                     $tmp_name = $cFile->secure_tmpname(self::FILE_DIR, '.' . $ext);
                     $tmp_name = substr_replace($tmp_name, "", 0, strlen(self::FILE_DIR));
                     $cFile->_remoteCopy(self::FILE_DIR . $tmp_name, true);
                     $this->insertAttachedFile($cFile->id, $id);
                     break;
             }
         }
     }
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:28,代码来源:mailer.php

示例5: getAttachedFiles

 /**
  * Получает список приатаченных файлов к сообщению.
  *
  * @return array Информация о файлах
  */
 public function getAttachedFiles()
 {
     global $DB;
     $fList = array();
     if ($_SESSION['attachedfiles_contacts']['added']) {
         $login = $_SESSION['login'];
         $files = $_SESSION['attachedfiles_contacts']['added'] ? preg_split('/ /', trim($_SESSION['attachedfiles_contacts']['added'])) : array();
         $dfiles = $_SESSION['attachedfiles_contacts']['deleted'] ? preg_split('/ /', trim($_SESSION['attachedfiles_contacts']['deleted'])) : array();
         if (count($files)) {
             $sql = 'SELECT * FROM file WHERE MD5(id::text || fname) IN (?l);';
             $aFiles = $DB->rows($sql, $files);
             foreach ($aFiles as $f) {
                 $cFile = new CFile('users/' . substr($login, 0, 2) . '/' . $login . '/contacts/' . $f['fname']);
                 if ($cFile->id) {
                     if (in_array(md5($cFile->id . $cFile->name), $dfiles)) {
                         $is_deleted = 't';
                     } else {
                         $is_deleted = 'f';
                     }
                     array_push($fList, array('file_id' => $cFile->id, 'name' => $cFile->name, 'path' => $cFile->path, 'size' => $cFile->size, 'ftype' => $cFile->getext(), 'is_del' => $is_deleted));
                 }
             }
         }
     }
     return $fList;
 }
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:31,代码来源:messages.php

示例6: array

">
                                                            <input type="hidden" id="imain_file" name="main_file" value="<?php 
echo $work['pict'];
?>
">
                                                            <?php 
if ($work['pict']) {
    if ($width && $height && $cfile->image_size['type'] != 13 && $cfile->image_size['type'] != 4) {
        print view_image_file($work['pict'], $_SESSION['login'], "upload", array('max_dim' => 200, 'class' => 'b-prev__pic', 'id' => 'work_image'));
    } else {
        ?>
                                                                <div id="work_image" class="b-layout b-layout_padtop_20 b-layout_padlr_10">
                                                                    <table cellspacing="0" cellpadding="0" border="0" class="b-layout__table b-layout__table_width_full">
                                                                            <tr class="b-layout__tr">
                                                                                <td class="b-icon-layout__icon"><i class="b-icon b-icon_attach_<?php 
        echo getICOFile($cfile->getext());
        ?>
"></i></td>
                                                                                <td class="b-icon-layout__files"><div class="b-layout__txt b-layout__txt_padtop_5"><a href="<?php 
        echo WDCPREFIX . '/' . $cfile->path . $cfile->name;
        ?>
" class="b-icon-layout__link b-icon-layout__link_fontsize_13"><?php 
        echo uploader::cutNameFile($cfile->original_name, portfolio::FILE_NAME_LENGTH_EDIT);
        ?>
</a></div></td>
                                                                                <td class="b-icon-layout__size" style="padding-right:0;"><div class="b-layout__txt b-layout__txt_padtop_5">,<?php 
        echo ConvertBtoMB($cfile->size);
        ?>
</div></td>
                                                                            </tr>
                                                                    </table>
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:tpl.portfolio-work-edit.php

示例7: transferFiles

 /**
  * Перенос файлов в рабочие папки сайта
  * 
  * @param array  $files   Массив файлов
  * @param string $table   Таблица для переноса
  * @param string $dir     Директория для переноса
  * @param bool = true $newName  Генерировать новое имя файла
  * @return array 
  */
 function transferFiles($files, $table, $dir, $newName = true)
 {
     foreach ($files as $key => $file) {
         $objFile = new CFile($file['id']);
         $ext = $objFile->getext();
         if (!$newName) {
             $tmp_name = $objFile->name;
         } else {
             $tmp_name = $objFile->secure_tmpname($dir, '.' . $ext);
             $tmp_name = substr_replace($tmp_name, "", 0, strlen($dir));
         }
         $objFile->table = $table;
         $copy = $objFile->_remoteCopy($dir . $tmp_name);
         $data[] = array('fname' => $objFile->name, 'id' => $objFile->id, 'orig_name' => $objFile->original_name, 'file_id' => $objFile->id);
         unset($objFile);
     }
     return $data;
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:27,代码来源:step_wizard_registration.php

示例8: array

 $dir = "wizard/";
 $img->max_size = 5242880;
 $img->proportional = 1;
 $img->server_root = 1;
 $pictname = $img->MoveUploadedFile($dir);
 $id_upload = $img->id;
 if (!isNulArray($img->error)) {
     if (is_array($img->error)) {
         $err = $img->error[0];
     } else {
         $err = $img->error;
     }
     $error = true;
     $pictname = $prevname = '';
 } else {
     if (in_array($img->getext(), $GLOBALS['disallowed_array'])) {
         $err = 'Недопустимый тип файла';
         $error = true;
     } else {
         if (in_array($img->getext(), $GLOBALS['graf_array']) && strtolower($img->getext()) != "swf" && strtolower($img->getext()) != "flv") {
             // Делаем превью.
             $pict_added = $img->img_to_small("sm_" . $pictname, array('width' => 200, 'height' => 200, 'less' => 0));
             if (!isNulArray($img->error)) {
                 $error = true;
                 $pictname = $prevname = '';
             } elseif ($pict_added) {
                 $prevname = 'sm_' . $pictname;
             }
         } else {
             $pict_added = true;
         }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:upload.php

示例9: billingOperation


//.........这里部分代码省略.........
             }
             if ($project['country'] == null) {
                 $project['country'] = 'null';
             }
             if ($project['city'] == null) {
                 $project['city'] = 'null';
             }
             $project['name'] = addslashes($project['name']);
             $project['descr'] = addslashes($project['descr']);
             if ($project['logo_id'] <= 0) {
                 $project['logo_id'] = 'null';
             }
             $project['folder_id'] = 'null';
             $items = array();
             switch ($option['option']) {
                 case 'top':
                     $project['top_days'] = $option['op_count'];
                     break;
                 case 'color':
                     $is_pay = $project['payed_items'] & '010';
                     if ($is_pay != '010') {
                         $project['payed_items'] = $project['payed_items'] | '010';
                         $project['is_color'] = 't';
                         $items['color'] = true;
                         if (is_pro()) {
                             $is_payed = true;
                             $prj->SavePayedInfo($items, $project['id'], null, $project['top_days']);
                             $prj->editPrj($project, false);
                         }
                     } else {
                         $is_payed = true;
                     }
                     break;
                 case 'bold':
                     $is_pay = $project['payed_items'] & '001';
                     if ($is_pay != '001') {
                         $project['payed_items'] = $project['payed_items'] | '001';
                         $project['is_bold'] = 't';
                         $items['bold'] = true;
                     } else {
                         $is_payed = true;
                     }
                     break;
                 case 'logo':
                     $is_pay = $project['payed_items'] & '100';
                     if ($is_pay != '100') {
                         $key = md5(microtime());
                         $prj = new tmp_project($key);
                         $prj->init(1);
                         $fu = new CFile($option['src_id']);
                         $ext = $fu->getext();
                         $tmp_dir = $prj->getDstAbsDir();
                         $tmp_name = $fu->secure_tmpname($tmp_dir, '.' . $ext);
                         $tmp_name = substr_replace($tmp_name, "", 0, strlen($tmp_dir));
                         $fu->table = 'file_projects';
                         $r = $fu->_remoteCopy($tmp_dir . $tmp_name);
                         $project['payed_items'] = $project['payed_items'] | '100';
                         $project['logo_id'] = $fu->id;
                         $items['logo'] = true;
                         if ($option['extra']) {
                             $project['link'] = $option['extra'];
                         }
                     } else {
                         $is_payed = true;
                     }
                     break;
             }
             if (!$is_payed) {
                 $error = $account->Buy($bill_id, $transaction_id, $option['op_code'], $this->uid, $option['descr'], $option['comment'], $option['ammount'], 0);
                 $ok = $bill_id > 0;
                 $project['billing_id'] = $bill_id;
                 $prj->SavePayedInfo($items, $project['id'], $bill_id, $project['top_days']);
                 $prj->editPrj($project, false);
             } else {
                 $ok = true;
             }
             break;
             // Платные ответы на проекты
         // Платные ответы на проекты
         case 61:
             $answers = new projects_offers_answers();
             $error = $answers->BuyByFM($this->uid, $option['op_count'], $transaction_id, 0);
             if (!$error) {
                 $ok = true;
                 $_SESSION['answers_ammount'] = $option['op_count'];
                 // Публикуем ответы
                 $step_frl = new step_freelancer();
                 $offers = $step_frl->getWizardOffers($this->uid, $option['op_count']);
                 if ($offers) {
                     require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/users.php";
                     $step_frl->log = $this->log;
                     $step_frl->user = new users();
                     $step_frl->user->GetUserByUID($this->uid);
                     $step_frl->transferOffers($offers);
                 }
             }
             break;
     }
     return $ok;
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:101,代码来源:wizard_billing.php

示例10: _new_getAttach

 /**
  * Возвращает все вложения текущего этапа по переданным идентификаторам.
  *
  * @param integer|string $attach_id   один или несколько ид., разделенных запятыми. Если NULL, то вернуть все.
  * @param boolean $get_deleted   взять удаленные?
  * @return array   массив объектов CFile, индексированный ид. аттачей.
  */
 function _new_getAttach($attach_id = NULL, $get_deleted = false)
 {
     $ret = NULL;
     $where = "sa.stage_id = {$this->data['id']}" . ($attach_id == NULL ? '' : " AND sa.id IN ({$attach_id})");
     $where_deleted = $get_deleted !== NULL ? " AND sa.is_deleted = '" . (int) $get_deleted . "'" : '';
     $sql = "\n          SELECT sa.stage_id, sa.file_id as id, f.original_name as name, f.fname as file_name, f.path as file_path, f.size as file_size, f.modified as sign_time\n          FROM sbr_stages_attach sa\n          INNER JOIN file_sbr f ON f.id = sa.file_id\n          WHERE {$where} {$where_deleted}\n          \n          UNION \n\n          SELECT sm.stage_id, sma.file_id as id, f.original_name as name, f.fname as file_name, f.path as file_path, f.size as file_size, f.modified as sign_time\n          FROM sbr_stages_msgs sm\n          INNER JOIN sbr_stages_msgs_attach sma ON sma.msg_id = sm.id\n          INNER JOIN file_sbr f ON f.id = sma.file_id\n          WHERE sm.stage_id = {$this->data['id']}\n          \n          ORDER BY sign_time ASC\n        ";
     if (($res = pg_query(DBConnect(), $sql)) && pg_num_rows($res)) {
         while ($row = pg_fetch_assoc($res)) {
             $row['ftype'] = CFile::getext($row['name']);
             $ret[$row['id']] = $row;
         }
     }
     return $ret;
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:21,代码来源:sbr_stages.php

示例11: viewattachListNew

/**
 * Генерирует список файлов с иконками для комментариев (новая версия)
 *
 * @param array $attaches Массив с информацией о файле/файлах (напр. результат выборки из таблицы file)
 * @return string HTML код
 */
function viewattachListNew($attaches)
{
    if (!$attaches || !count($attaches)) {
        return '';
    }
    $thumbs = '';
    $list = '';
    if (isset($attaches['id'])) {
        $attaches = array($attaches);
    }
    foreach ($attaches as $attach) {
        $cfile = new CFile();
        $ext = $cfile->getext($attach['fname']);
        $ico = getICOFile($ext);
        $fsize = ConvertBtoMB($attach['size']);
        $path = WDCPREFIX . "/{$attach['path']}{$attach['fname']}";
        if ($attach['size'] < 300 * 1024 && in_array($ext, $GLOBALS['graf_array']) && $ext != 'swf') {
            $path_th = WDCPREFIX . "/{$attach['path']}sm_{$attach['fname']}";
            $th = new CFile("{$attach['path']}sm_{$attach['fname']}");
            if (!$th->id) {
                $path_th = $path;
            }
            $thumbs .= "<li class='afl-img c'><a href='{$path}' title='{$ext}, {$fsize}'><img src='{$path_th}' alt='{$ext}, {$fsize}' /></a></li>\n";
        } else {
            $list .= "<li class='{$ico}'><a href='{$path}'>{$ext}, {$fsize}</a></li>\n";
        }
    }
    return "<ul class='added-files-list c'>{$thumbs}{$list}</ul>";
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:35,代码来源:stdf.php

示例12:

                                    ?>
 <?php 
                                    echo $aData['file_size_str'];
                                    ?>
&nbsp;&nbsp;</div>
                                                                </div>
                                                                <?php 
                                } else {
                                    echo '<div>';
                                    if ($value['portf_id' . $i] == 0) {
                                        ?>
                                                                            
                                                                            
                                                                            
                                                                                <?php 
                                        if (in_array(CFile::getext($value['pict' . $i]), $GLOBALS['graf_array']) || strtolower(CFile::getext($value['pict' . $i])) == "mp3") {
                                            ?>
                                                                                    <?php 
                                            if ($value['prev_pict' . $i] != '') {
                                                ?>
                                                                            <div ><a href="/projects/viewwork.php?pid=<?php 
                                                echo $value['project_id'];
                                                ?>
&user=<?php 
                                                echo $value['login'];
                                                ?>
&wid=<?php 
                                                echo $i;
                                                ?>
" target="_blank" class="blue" title="" style="text-decoration:none"><?php 
                                                echo view_preview($value['login'], $value['prev_pict' . $i], "upload", $align, false, true);
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:content_personal_emp.php

示例13: saveAction

 function saveAction()
 {
     $db = front::og("db");
     $form = front::$_req["form"];
     $id_comm = front::$_req["comment"];
     $parent = front::$_req["parent"];
     if (!$id_comm) {
         $id_comm = false;
     }
     //    global $session;
     $validate_errors = array();
     $save = array();
     if (($str = trim($form['title'])) && mb_strlen($str) >= 3) {
         $save['title'] = change_q_x_a(antispam($str), 0, 96);
     } else {
         $validate_errors['title'] = 'Заголовок короче 3 символов';
     }
     if (($str = trim($form['msg'])) && mb_strlen($str) >= 3) {
         $save['msg'] = change_q_x_a(antispam($str), false, false);
     } else {
         $validate_errors['msg'] = 'Текст короче 3 символов';
     }
     if (strlen($form['msg']) > blogs::MAX_DESC_CHARS) {
         $validate_errors['msg'] = "Максимальный размер сообщения " . blogs::MAX_DESC_CHARS . " символов!";
     } else {
         $save['msg'] = change_q_x_a(antispam($form['msg']), false, false);
     }
     $yt_link = substr(change_q_x(antispam(str_replace('watch?v=', 'v/', $form['yt_link'])), true), 0, 128);
     if ($yt_link != '') {
         if (strpos($yt_link, 'http://ru.youtube.com/v/') !== 0 && strpos($yt_link, 'http://youtube.com/v/') !== 0 && strpos($yt_link, 'http://www.youtube.com/v/') !== 0) {
             $validate_errors['yt_link'] = "Неверная ссылка.";
         }
     }
     if (sizeof($validate_errors) > 0) {
         echo json_encode(array("success" => 0, "validate" => $validate_errors));
         exit(1);
     }
     $save = front::toWin(array("title" => $form["title"], "msg" => $form["msg"], "yt_link" => $yt_link));
     $id = intval($id = front::$_req["id"]);
     if ($id_comm) {
         // if($parent > 0) {
         //
         //  } else {
         $save["id_blog"] = $parent;
         $save["id_reply"] = $id;
         $save["id_user"] = get_uid();
         $id = $db->insert("corporative_blog", $save);
         //  }
         //if($id_comm && $id > 0) {
         //  $save["id_blog"] = $id;
         //      $save["id_reply"] = $id;
         //                }
     } else {
         if ($id > 0) {
             $save["id_modified"] = get_uid();
             $save["id_deleted"] = 0;
             $save["date_change"] = date("Y-m-d H:i:s");
             $aff = $db->update("UPDATE corporative_blog SET ?s WHERE (id = ?n)", $save, $id);
         } else {
             $save["id_user"] = get_uid();
             $id = $db->insert("corporative_blog", $save);
         }
     }
     if ($form["files_deleted"] != "") {
         $form["files_deleted"] = preg_replace('/\\\\\\"/', '"', $form["files_deleted"]);
         $filesBefore = json_decode($form["files_deleted"]);
         $login = $_SESSION['login'];
         foreach ($filesBefore as $file) {
             if (!$file->db_id) {
                 continue;
             }
             front::og("db")->delete("DELETE FROM corporative_blog_attach WHERE id = ?n", $file->db_id);
         }
     }
     if ($form["files"] != "") {
         //$filesBefore = explode(";", $form["files"]);
         //  vardump($form["files"]);
         $form["files"] = preg_replace('/\\\\\\"/', '"', $form["files"]);
         $filesBefore = json_decode($form["files"]);
         if ($group == 7) {
             $max_image_size = array('width' => 400, 'height' => 600, 'less' => 0);
         } else {
             $max_image_size = array('width' => 470, 'height' => 1000, 'less' => 0);
         }
         $login = $_SESSION["login"];
         if ($filesBefore) {
             foreach ($filesBefore as $file) {
                 if (!$file->temp) {
                     continue;
                 }
                 $b_file = new CFile("temp/" . $file->id);
                 if ($b_file->id > 0) {
                     $b_file->Rename("users/" . substr($login, 0, 2) . "/" . $login . "/upload" . "/" . $file->id);
                     $ext = $b_file->getext();
                     if (in_array($ext, $GLOBALS['graf_array'])) {
                         $is_image = TRUE;
                     } else {
                         $is_image = FALSE;
                     }
                     $b_file->max_size = blogs::MAX_FILE_SIZE;
//.........这里部分代码省略.........
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:101,代码来源:page_mycorp.class.php

示例14: set_loaded_attach

 function set_loaded_attach($type, $id, $name, $link = false)
 {
     global $_attached;
     $_attached['ids'][$type] = $id;
     $_attached['ext'][$type] = getICOFile(CFile::getext($name));
     if (strlen($name) > 40) {
         $name = substr($name, 0, 18) . '...' . substr($name, strlen($name) - 18, 18);
     }
     $_attached['name'][$type] = $name;
     $_attached['link'][$type] = $link;
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:11,代码来源:opinions.action.php

示例15: elseif

         $file->prefix_file_name = 'sm_';
         $file->max_size = 102400;
     }
     // если заданы типы графических файлов
     if ($imageTypes) {
         // то файл должен быть графическим
         $file->_getImageSize($file->tmp_name);
         if (!$file->image_size['type'] || !in_array($file->image_size['type'], $imageTypes)) {
             $err = 'Недопустимый формат файла';
         }
     }
     if (!$err) {
         $filename = $file->MoveUploadedFile($sFullDir);
         $fileid = $file->id;
         $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();
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:31,代码来源:upload.php


注:本文中的CFile::getext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。