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


PHP GetFileSize函数代码示例

本文整理汇总了PHP中GetFileSize函数的典型用法代码示例。如果您正苦于以下问题:PHP GetFileSize函数的具体用法?PHP GetFileSize怎么用?PHP GetFileSize使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: build_page

function build_page()
{
    global $mystep, $setting, $script;
    $tpl_info = array("idx" => "attachment", "style" => "../plugin/" . basename(realpath(dirname(__FILE__))) . "/tpl/", "path" => ROOT_PATH . "/" . $setting['path']['template']);
    $tpl = $mystep->getInstance("MyTpl", $tpl_info);
    $Max_size = ini_get('upload_max_filesize');
    $tpl->Set_Variable('script', $script);
    $tpl->Set_Variable('Max_size', $Max_size);
    $tpl->Set_Variable('MaxSize', GetFileSize($Max_size));
    $tpl->Set_Variable('path_admin', $setting['path']['admin']);
    $mystep->show($tpl);
    return;
}
开发者ID:laiello,项目名称:mystep-cms,代码行数:13,代码来源:attachment.php

示例2: GetFolderList

function GetFolderList($d, $dir = '', $type = '')
{
    $sDir = trim($d);
    $type = strtolower($type);
    strpos($sDir, '.') !== false && exit('What are you doing?');
    $s_Url = "";
    $FDir = iPATH . $dir . '/';
    $sCurrDir = $FDir;
    if ($sDir != "") {
        if (is_dir($FDir . $sDir)) {
            $sCurrDir = $FDir . $sDir . "/";
        } else {
            $sDir = "";
        }
        $s_Url = strrpos($sDir, "/") !== false ? substr($sDir, 0, strrpos($sDir, "/")) : "";
        $parentfolder = $s_Url;
    }
    if ($handle = opendir($sCurrDir)) {
        while (false !== ($file = readdir($handle))) {
            $sFileType = filetype($sCurrDir . "/" . $file);
            switch ($sFileType) {
                case "dir":
                    if ($file != '.' && $file != '..' && $file != 'admin') {
                        $oDirs[] = $file;
                    }
                    break;
                case "file":
                    $oFiles[] = $file;
                    break;
                default:
            }
        }
    }
    if (isset($oDirs)) {
        foreach ($oDirs as $oDir) {
            $s_Url = $sDir == "" ? $oDir : $sDir . "/" . $oDir;
            $folder[] = array('path' => $s_Url, 'dir' => $oDir);
        }
    }
    $nFileNum = isset($oFiles) ? count($oFiles) : 0;
    if ($nFileNum > 0) {
        foreach ($oFiles as $oFile) {
            $sFileName = $sCurrDir . $oFile;
            if (getext($oFile)) {
                $s_Url = $sDir == "" ? $oFile : $sDir . "/" . $oFile;
                if ($type && strstr($type, getext($oFile)) !== false) {
                    $FileList[] = array('path' => $s_Url, 'name' => $oFile, 'time' => get_date(filemtime($sFileName), "Y-m-d H:i"), 'icon' => geticon($oFile), 'ext' => getext($oFile), 'size' => GetFileSize(filesize($sFileName)));
                } elseif (empty($type)) {
                    $FileList[] = array('path' => $s_Url, 'name' => $oFile, 'time' => get_date(filemtime($sFileName), "Y-m-d H:i"), 'icon' => geticon($oFile), 'ext' => getext($oFile), 'size' => GetFileSize(filesize($sFileName)));
                }
            }
        }
    }
    $s_Url = $sDir == "" ? "/" : "/" . $sDir . "/";
    $R['FileList'] = $FileList;
    $R['parentfolder'] = $parentfolder;
    $R['folder'] = $folder;
    return $R;
}
开发者ID:jonycookie,项目名称:projectm2,代码行数:59,代码来源:common.php

示例3: build_page


//.........这里部分代码省略.........
        $cat_id = $record['cat_id'];
        $setop = (int) $record['setop'];
        foreach ($top_list as $key => $value) {
            $key = (int) $key;
            $tpl_tmp->Set_Loop('setop', array("key" => $key, "value" => $value, "checked" => ($setop & $key) == $key ? "checked" : ""));
            if (($setop & $key) == $key) {
                $setop -= $key;
            }
        }
        $setop /= 1024;
        foreach ($top_mode_list as $key => $value) {
            $key = (int) $key;
            $tpl_tmp->Set_Loop('setop_mode', array("key" => $key, "value" => $value, "checked" => $setop == $key ? "checked" : ""));
        }
        $theStyle = explode(",", $record['style']);
        $max_count = count($theStyle);
        for ($i = 0; $i < $max_count; $i++) {
            if ($theStyle[$i] == "i") {
                $check_i = "checked";
            } elseif ($theStyle[$i] == "b") {
                $check_b = "checked";
            } else {
                $check_c = $theStyle[$i];
            }
        }
        $content = array();
        $db->select($setting['db']['pre_sub'] . "news_detail", "*", array("news_id", "n=", $news_id), array("order" => "page"));
        while ($record = $db->GetRS()) {
            $record['content'] = str_replace("&", "&#38;", $record['content']);
            HtmlTrans(&$record);
            $record['content'] = "<span class=\"mceSubtitle\">" . $record['sub_title'] . "</span>\n" . $record['content'];
            $content[] = $record['content'];
        }
        $Max_size = round(GetFileSize(ini_get('upload_max_filesize')) / 1024 / 1024, 2);
        $tpl_tmp->Set_Variable('MaxSize', $Max_size);
        $tpl_tmp->Set_Variable('record_content', implode("\n<p><img src=\"../script/tinymce/plugins/pagebreak/img/trans.gif\" class=\"mcePageBreak mceItemNoResize\" /></p>\n", $content));
        $tpl_tmp->Set_Variable('title', $setting['language']['admin_art_content_edit']);
    } else {
        $checked = "checked";
        foreach ($top_mode_list as $key => $value) {
            $key = (int) $key;
            $tpl_tmp->Set_Loop('setop_mode', array("key" => $key, "value" => $value, "checked" => $checked));
            $checked = "";
        }
        foreach ($top_list as $key => $value) {
            $key = (int) $key;
            $tpl_tmp->Set_Loop('setop', array("key" => $key, "value" => $value, "checked" => ""));
        }
        $record = array();
        $record['news_id'] = 0;
        $record['cat_id'] = $cat_id;
        $record['web_id'] = $web_id;
        $record['subject'] = "";
        $record['style'] = "";
        $record['describe'] = "";
        $record['original'] = "";
        $record['link'] = "";
        $record['tag'] = "";
        $record['image'] = "";
        $record['content'] = "";
        $record['pages'] = 1;
        $record['order'] = 0;
        if (!empty($cat_id) && ($cat_info = getParaInfo("news_cat", "cat_id", $cat_id))) {
            $record['view_lvl'] = $cat_info['view_lvl'];
            $record['notice'] = $cat_info['notice'];
        } else {
开发者ID:laiello,项目名称:mystep-cms,代码行数:67,代码来源:art_content.php

示例4: GetFileSize

    $value_use_html = 1;
}
$use_html .= " value='{$value_use_html}' onclick='check_use_html(this)'><ZeroBoard";
// 비밀글 사용;;
if (!$setup[use_secret]) {
    $hide_secret_start = "<!--";
    $hide_secret_end = "-->";
}
// 공지기능 사용하는지 않하는지 표시;;
if (!$is_admin && $member[level] > $setup[grant_notice] || $mode == "reply") {
    $hide_notice_start = "<!--";
    $hide_notice_end = "-->";
}
// 최고 업로드 가능 용량
if ($setup[use_pds]) {
    $upload_limit = GetFileSize($setup[max_upload_size]);
}
// 이미지 창고 버튼
if ($member[no] && $setup[grant_imagebox] >= $member[level]) {
    $a_imagebox = "<a onfocus=blur() href='javascript:showImageBox(\"{$id}\")'>";
} else {
    $a_imagebox = "<Zeroboard ";
}
if ($mode == "modify" && $data[ismember] != $member[no]) {
    $a_imagebox = "<Zeroboard";
}
// 미리보기 버튼
$a_preview = "<a onfocus=blur() href='javascript:view_preview()'>";
// HTML 출력
head(" onload=unlock() onunload=hideImageBox() ", "script_write.php");
include $dir . "/write.php";
开发者ID:minyounglee85,项目名称:Personal-Website,代码行数:31,代码来源:write.php

示例5: build_page

function build_page($method = "")
{
    global $mystep, $req, $tpl, $tpl_info, $setting, $idx, $tpl_path, $method;
    $fso = $mystep->getInstance("MyFSO");
    $tpl_info['idx'] = "web_template";
    if ($method != "show") {
        $tpl_info['idx'] .= $method == "list" ? "_list" : "_input";
    }
    $tpl_tmp = $mystep->getInstance("MyTpl", $tpl_info);
    if ($method == "show") {
        $tpl_tmp->Set_Variable('title', $setting['language']['admin_web_template_title']);
        $tpl_tmp->Set_Variable('tpl_idx', $idx);
        $tpl_list = $fso->Get_List($tpl_path);
        $max_count = count($tpl_list['dir']);
        $the_list = array();
        for ($i = 0; $i < $max_count; $i++) {
            $tpl_list['dir'][$i] = basename($tpl_list['dir'][$i]);
            if ($tpl_list['dir'][$i] == "cache" || strpos($tpl_list['dir'][$i], "admin") !== false) {
                continue;
            }
            $tpl_tmp->Set_Loop("tpl_list", array("idx" => $tpl_list['dir'][$i], "img" => is_file($tpl_path . $tpl_list['dir'][$i] . "/sample.jpg") ? "/" . $setting['path']['template'] . "/" . $tpl_list['dir'][$i] . "/sample.jpg" : "/images/noimage.gif"));
            $the_list[] = $tpl_list['dir'][$i];
        }
        $tpl_tmp->Set_Variable('tpl_list', toJson($the_list, $setting['gen']['charset']));
        $max_count = count($GLOBALS['website']);
        for ($i = 0; $i < $max_count; $i++) {
            $setting_sub = getSubSetting($GLOBALS['website'][$i]['web_id']);
            $GLOBALS['website'][$i]['tpl'] = $setting_sub['gen']['template'];
            $tpl_tmp->Set_Loop("website", $GLOBALS['website'][$i]);
        }
    } elseif ($method == "list") {
        $tpl_tmp->Set_Variable('title', $setting['language']['admin_web_template_title']);
        $tpl_tmp->Set_Variable('tpl_idx', $idx);
        $tpl_list = $fso->Get_List($tpl_path);
        $max_count = count($tpl_list['dir']);
        for ($i = 0; $i < $max_count; $i++) {
            $tpl_list['dir'][$i] = basename($tpl_list['dir'][$i]);
            if ($tpl_list['dir'][$i] == "cache") {
                continue;
            }
            $tpl_tmp->Set_Loop("tpl_list", array("idx" => $tpl_list['dir'][$i], "selected" => $tpl_list['dir'][$i] == $idx ? "selected" : ""));
        }
        $css_file = ROOT_PATH . "/images/" . $idx . "/style.css";
        if (is_file($css_file)) {
            $tpl_tmp->Set_Loop("file", array("name" => "style.css", "size" => GetFileSize(filesize($css_file)), "attr" => $fso->Get_Attrib(substr(DecOct(fileperms($css_file)), -3)), "time" => date("Y/m/d H:i:s", filemtime($css_file))));
        }
        $file_list = $fso->Get_Tree($tpl_path . $idx, false, ".tpl");
        foreach ($file_list as $key => $value) {
            $curFile = $value;
            $curFile['name'] = $key;
            $tpl_tmp->Set_Loop("file", $curFile);
        }
    } else {
        $file = array();
        $file['idx'] = $idx;
        $file['content'] = "";
        if ($method == "edit") {
            $file['name'] = $req->getGet("file");
            if ($file['name'] == "style.css") {
                $the_file = ROOT_PATH . "/images/" . $idx . "/style.css";
                $file['type'] = "css";
            } else {
                $the_file = $tpl_path . $idx . "/" . $file['name'];
                $file['type'] = "htmlmixed";
            }
            if (is_file($the_file)) {
                $file['content'] = file_get_contents($the_file);
                $file['content'] = htmlspecialchars($file['content']);
                $file['content'] = str_replace("\t", "  ", $file['content']);
            }
            $tpl_tmp->Set_Variable('title', $setting['language']['admin_web_template_edit']);
        } else {
            $file['name'] = "";
            $tpl_tmp->Set_Variable('title', $setting['language']['admin_web_template_add']);
        }
        $tpl_tmp->Set_Variable('readonly', $method == "edit" ? "readonly" : "");
        $tpl_tmp->Set_Variables($file, "file");
    }
    $tpl_tmp->Set_Variable('back_url', $req->getServer("HTTP_REFERER"));
    $tpl_tmp->Set_Variable('method', $method);
    $tpl->Set_Variable('main', $tpl_tmp->Get_Content('$db, $setting'));
    unset($tpl_tmp);
    $mystep->show($tpl);
    return;
}
开发者ID:laiello,项目名称:mystep-cms,代码行数:85,代码来源:web_template.php

示例6: build_page

function build_page($method)
{
    global $mystep, $req, $db, $tpl, $tpl_info, $setting, $id, $web_id;
    $tpl_info['idx'] = "art_info_" . ($method == "list" ? "list" : "input");
    $tpl_tmp = $mystep->getInstance("MyTpl", $tpl_info);
    if ($method == "list") {
        $condition = array();
        if (!empty($web_id)) {
            $condition = array("web_id", "n=", $web_id);
        }
        $db->select($setting['db']['pre'] . "info_show", "*", $condition, array("order" => "id asc"));
        $n = 0;
        while ($record = $db->GetRS()) {
            $n++;
            if ($webInfo = getParaInfo("website", "web_id", $record['web_id'])) {
                $record['web_id'] = $webInfo['name'];
            } else {
                $record['web_id'] = "ALL";
            }
            $tpl_tmp->Set_Loop('record', $record);
        }
        $tpl_tmp->Set_If('empty', $n == 0);
        $tpl_tmp->Set_Variable('title', $setting['language']['admin_art_info_title']);
        $tpl_tmp->Set_Variable('web_id', $web_id);
    } else {
        if ($method == "edit") {
            $record = $db->record($setting['db']['pre'] . "info_show", "*", array("id", "n=", $id));
            if ($record === false) {
                $tpl->Set_Variable('main', showInfo($setting['language']['admin_art_info_error'], 0));
                $mystep->show($tpl);
                $mystep->pageEnd(false);
            }
            $web_id = $record['web_id'];
            HtmlTrans(&$record);
        } else {
            $record = array();
            $record['id'] = 0;
            $record['web_id'] = $web_id;
            $record['subject'] = "";
            $record['content'] = "";
            $record['attach_list'] = "|";
        }
        $tpl_tmp->Set_Variables($record);
        $Max_size = round(GetFileSize(ini_get('upload_max_filesize')) / 1024 / 1024, 2);
        $tpl_tmp->Set_Variable('title', $method == 'add' ? $setting['language']['admin_art_info_add'] : $setting['language']['admin_art_info_edit']);
        $tpl_tmp->Set_Variable('method', $method);
        $tpl_tmp->Set_Variable('MaxSize', $Max_size);
        $tpl_tmp->Set_Variable('back_url', $req->getServer("HTTP_REFERER"));
    }
    $max_count = count($GLOBALS['website']);
    for ($i = 0; $i < $max_count; $i++) {
        $GLOBALS['website'][$i]['selected'] = $GLOBALS['website'][$i]['web_id'] == $web_id ? "selected" : "";
        $tpl_tmp->Set_Loop("website", $GLOBALS['website'][$i]);
    }
    $db->Free();
    $tpl->Set_Variable('main', $tpl_tmp->Get_Content('$db, $setting'));
    unset($tpl_tmp);
    $mystep->show($tpl);
    return;
}
开发者ID:laiello,项目名称:mystep-cms,代码行数:60,代码来源:art_info.php

示例7: write_log

            }
        } else {
            $record = $db->GetSingleRecord("repair table " . $setting['db']['name'] . "." . $table_name);
            $op_info .= $record['Table'] . " - <i>" . $record['Msg_text'] . "</i>";
        }
    }
    write_log($log_info);
    if ($method == "export") {
        $mystep->pageEnd(false);
    }
}
$tpl_info['idx'] = "func_backup";
$tpl_tmp = $mystep->getInstance("MyTpl", $tpl_info);
$Max_size = ini_get('upload_max_filesize');
$tpl_tmp->Set_Variable('max_size', $Max_size);
$Max_size = GetFileSize($Max_size);
if ($Max_size == 0) {
    $Max_size = 1024 * 1024;
}
$tbl_list = $db->GetTabs($setting_sub['db']['name']);
$max_count = count($tbl_list);
for ($i = 0; $i < $max_count; $i++) {
    $tpl_tmp->Set_Loop('tbls', array("name" => $tbl_list[$i]));
}
$db->Free();
$max_count = count($GLOBALS['website']);
for ($i = 0; $i < $max_count; $i++) {
    $GLOBALS['website'][$i]['selected'] = $GLOBALS['website'][$i]['idx'] == $web_idx ? "selected" : "";
    $tpl_tmp->Set_Loop("website", $GLOBALS['website'][$i]);
}
$db->Free();
开发者ID:laiello,项目名称:mystep-cms,代码行数:31,代码来源:func_backup.php

示例8: array

</span>
			</div>
		
			<ul class="attachment">
				<?php 
    for ($i = 0, $loop = count($attachments); $i < $loop; $i++) {
        $fileIcon = array('image' => 'fa-file-image-o');
        ?>
				<li><a href="<?php 
        echo $attachments[$i]->download;
        ?>
" download="<?php 
        echo $attachments[$i]->name;
        ?>
"><span class="filesize">(<?php 
        echo GetFileSize($attachments[$i]->size);
        ?>
)</span><i class="fa <?php 
        echo empty($fileIcon[$attachments[$i]->type]) == true ? 'fa-file-o' : $fileIcon[$attachments[$i]->type];
        ?>
"></i> <?php 
        echo $attachments[$i]->name;
        ?>
</a></li>
				<?php 
    }
    ?>
			</ul>
			<?php 
}
?>
开发者ID:JRevirthuum,项目名称:iModule,代码行数:31,代码来源:ment.item.php

示例9: Error

        } else {
            if (!move_uploaded_file($file1, "data/{$id}/" . $s_file_name1)) {
                Error("파일업로드가 제대로 되지 않았습니다");
            }
            $file_name1 = "data/{$id}/" . $s_file_name1;
            @chmod($file_name1, 0706);
        }
    }
}
if ($file2_size > 0 && $setup[use_pds] && $file2) {
    if (!is_uploaded_file($file2)) {
        Error("정상적인 방법으로 업로드 해주세요");
    }
    $file2_size = filesize($file2);
    if ($setup[max_upload_size] < $file2_size && !$is_admin) {
        error("파일 업로드는 최고 " . GetFileSize($setup[max_upload_size]) . " 까지 가능합니다");
    }
    if ($file2_size > 0) {
        $s_file_name2 = $file2_name;
        if (eregi("\\.inc", $s_file_name2) || eregi("\\.pht", $s_file_name2) || eregi("\\.htm", $s_file_name2) || eregi("\\.shtml", $s_file_name2) || eregi("\\.ztx", $s_file_name2) || eregi("\\.php", $s_file_name2) || eregi("\\.dot", $s_file_name1) || eregi("\\.asp", $s_file_name2) || eregi("\\.cgi", $s_file_name2) || eregi("\\.pl", $s_file_name2)) {
            Error("Html, PHP 관련파일은 업로드할수 없습니다");
        }
        //확장자 검사
        if ($setup[pds_ext2]) {
            $temp = explode(".", $s_file_name2);
            $s_point = count($temp) - 1;
            $upload_check = $temp[$s_point];
            if (!eregi($upload_check, $setup[pds_ext2]) || !$upload_check) {
                Error("업로드는 {$setup['pds_ext2']} 확장자만 가능합니다");
            }
        }
开发者ID:minyounglee85,项目名称:Personal-Website,代码行数:31,代码来源:write_chobo_ok.php

示例10: set_time_limit

set_time_limit(0);
$script = "";
if (count($_POST) > 0) {
    $path_upload = $setting['path']['upload'] . "/pic/" . date("Ym") . "/";
    $upload = new MyUploader();
    $upload->init("../" . $path_upload, true);
    $upload->DoIt();
    if ($upload->upload_result[0]['error'] == 0) {
        $the_file = $path_upload . "/" . $upload->upload_result[0]['new_name'];
        if (!empty($width) && !empty($height)) {
            img_thumb(ROOT_PATH . "/" . $the_file, $width, $height, ROOT_PATH . "/" . $the_file . ".thumb");
            unlink(ROOT_PATH . "/" . $the_file);
            rename(ROOT_PATH . "/" . $the_file . ".thumb", ROOT_PATH . "/" . $the_file);
        }
        $script = "\r\n\t\t\tvar theOLE = null;\r\n\t\t\ttheOLE = parent.parent || parent.dialogArguments || parent.opener;\r\n\t\t\ttheOLE.document.forms[0].{$parent_element}.value = '" . $web_url . "/" . $the_file . "';\r\n\t\t\talert('" . $setting['language']['admin_upload_img_ok'] . "');\r\n\t\t\tif(parent.parent==null){parent.close();}else{parent.parent.\$.closePopupLayer();}\r\n\t\t\treturn;\r\n\t\t";
    } else {
        $script = "\r\n\t\t\talert('" . $upload->upload_result[0]['message'] . "');\r\n\t\t\tif(parent.parent==null){parent.close();}else{parent.parent.\$.closePopupLayer();}\r\n\t\t";
    }
}
$tpl_info['idx'] = "upload_img";
$tpl_tmp = $mystep->getInstance("MyTpl", $tpl_info);
$tpl_tmp->Set_Variable('script', $script);
$tpl_tmp->Set_Variable('para', implode("|", $para));
$tpl_tmp->Set_Variable('self', $setting['info']['self']);
$Max_size = ini_get('upload_max_filesize');
$tpl_tmp->Set_Variable('Max_size', $Max_size);
$tpl_tmp->Set_Variable('MaxSize', GetFileSize($Max_size));
$tpl->Set_Variable('main', $tpl_tmp->Get_Content('$db, $setting'));
unset($tpl_tmp);
$mystep->show($tpl);
$mystep->pageEnd(false);
开发者ID:laiello,项目名称:mystep-cms,代码行数:31,代码来源:upload_img.php

示例11: GetFileSize

for ($i = 0, $loop = count($versions); $i < $loop; $i++) {
    ?>
			<tr<?php 
    echo $i == 0 ? ' class="opened"' : '';
    ?>
>
				<td class="title" onclick="$(this).parents('tr').toggleClass('opened');"><div><i class="fa fa-caret-right"></i><i class="fa fa-caret-down"></i> <?php 
    echo $versions[$i]->file->name;
    ?>
</div></td>
				<td class="version"><div><?php 
    echo $versions[$i]->version;
    ?>
</div></td>
				<td class="size"><div><?php 
    echo GetFileSize($versions[$i]->file->size);
    ?>
</div></td>
				<td class="reg_date"><div><?php 
    echo GetTime('F d, Y', $versions[$i]->reg_date);
    ?>
</div></td>
				<td class="hit"><div><?php 
    echo number_format($versions[$i]->file->hit);
    ?>
</div></td>
				<td class="download">
					<button type="button" class="btn btnRed" onclick="Dataroom.download(<?php 
    echo $idx;
    ?>
,'<?php 
开发者ID:JRevirthuum,项目名称:iModule,代码行数:31,代码来源:view.php

示例12: array

$tpl = $mystep->getInstance("MyTpl", $tpl_info);
if (empty($tbl)) {
    $title = $setting['language']['plugin_db_info_db'] . " - " . $db_name;
    $db->select("information_schema.tables", "table_name as Name, Engine, table_rows as Rows, (data_length+index_length) as Data_length, Create_time, table_collation as Collation, table_comment as Comment", array("table_schema", "=", $db_name));
    $root_mode = true;
    if ($db->CheckError()) {
        $db->free();
        $db->clearError();
        $db->Query("SHOW TABLE STATUS FROM " . $db_name);
        $root_mode = false;
    }
    $n = 1;
    while ($record = $db->GetRS()) {
        HtmlTrans(&$record);
        $record['no'] = $n++;
        $record['Data_length'] = $root_mode ? GetFileSize($record['Data_length']) : "--";
        $tpl->Set_Loop('record', $record);
    }
    $db_list = $db->GetDBs();
    $max_count = count($db_list);
    for ($i = 0; $i < $max_count; $i++) {
        $tpl->Set_Loop("db", array("name" => $db_list[$i], "selected" => $db_list[$i] == $db_name ? "selected" : ""));
    }
} else {
    $title = $setting['language']['plugin_db_info_tbl'] . " - " . $db_name . " - " . $tbl;
    $tbl_info = $db->GetTabSetting($tbl, $db_name);
    $db->Query("describe " . $db_name . "." . $tbl);
    $n = 1;
    while ($record = $db->GetRS()) {
        HtmlTrans(&$record);
        $record['no'] = $n++;
开发者ID:laiello,项目名称:mystep-cms,代码行数:31,代码来源:db_info.php

示例13: build_page


//.........这里部分代码省略.........
        if (empty($order_type)) {
            $order_type = "desc";
        }
        $condition = array();
        if (!empty($keyword)) {
            $condition[] = array("subject", "like", $keyword);
        }
        $counter = $db->result($setting['db']['pre'] . "news_snatch", "count(*)", $condition);
        list($page_arr, $page_start, $page_size) = GetPageList($counter, "?method=news&keyword={$keyword}&order={$order}&order_type={$order_type}", $page);
        $tpl_tmp->Set_Variables($page_arr);
        if ($counter > 0) {
            if (empty($order)) {
                $order = "id";
            }
            $the_order = array();
            $the_order[] = "{$order} {$order_type}";
            if ($order != "id") {
                $the_order[] = "id desc";
            }
            $db->select($setting['db']['pre'] . "news_snatch", "id, idx, url, original, subject", $condition, array("order" => $the_order, "limit" => "{$page_start}, {$page_size}"));
            while ($record = $db->GetRS()) {
                HtmlTrans(&$record);
                $tpl_tmp->Set_Loop('record', $record);
            }
        }
        $tpl_tmp->Set_Variable('keyword', $keyword);
        $tpl_tmp->Set_Variable('order_type_org', $order_type);
        $order_type = $order_type == "asc" ? "desc" : "asc";
        $tpl_tmp->Set_Variable('order_type', $order_type);
        $tpl_tmp->Set_Variable('keyword', $keyword);
    } elseif ($method == "news_edit") {
        $record = $db->record($setting['db']['pre'] . "news_snatch", "*", array("id", "n=", $id));
        if ($record === false) {
            $tpl->Set_Variable('main', showInfo($setting['language']['admin_art_content_error'], 0));
            echo $tpl->Read_Cache();
            return;
        }
        HtmlTrans(&$record);
        $tpl_tmp->Set_Variables($record, "record");
    } elseif ($method == "snatch") {
        $refresh = 600;
        if (isset($rules[$id]['para']['refresh'])) {
            $refresh = $rules[$id]['para']['refresh'];
        }
        if (false && file_exists($info_snatch) && time() - filemtime($info_snatch) < $refresh && $req->getReq("f") == "") {
            $show = $setting['language']['plugin_news_snatch_interrupt'];
        } else {
            $show = "";
            if (file_exists($info_snatch)) {
                unlink($info_snatch);
            }
        }
        $tpl_tmp->Set_Variable('id', $id);
        $tpl_tmp->Set_Variable('refresh', $refresh);
        $tpl_tmp->Set_Variable('info_file', $info_snatch);
        $tpl_tmp->Set_Variable('show', addslashes($show));
    } elseif ($method == "import") {
        $idx = $req->getReq("idx");
        $para = array();
        for ($i = 0, $m = count($rules); $i < $m; $i++) {
            if ($rules[$i]['idx'] == $idx) {
                $para = $rules[$i]['para'];
                break;
            }
        }
        $refresh = 600;
        if (isset($para['refresh'])) {
            $refresh = $para['refresh'];
        }
        if (false && file_exists($info_import) && time() - filemtime($info_import) < $refresh && $req->getReq("f") == "") {
            $show = $setting['language']['plugin_news_import_interrupt'];
        } else {
            $show = "";
            if (file_exists($info_import)) {
                unlink($info_import);
            }
        }
        $tpl_tmp->Set_Variable('id', $id);
        $tpl_tmp->Set_Variable('idx', $idx);
        $tpl_tmp->Set_Variable('refresh', $refresh);
        $tpl_tmp->Set_Variable('info_file', $info_import);
        $tpl_tmp->Set_Variable('show', addslashes($show));
    } elseif ($method == "upload") {
        global $script;
        $tpl_tmp->Set_Variable('script', $script);
        $tpl_tmp->Set_Variable('self', $setting['info']['self']);
        $Max_size = ini_get('upload_max_filesize');
        $tpl_tmp->Set_Variable('Max_size', $Max_size);
        $tpl_tmp->Set_Variable('MaxSize', GetFileSize($Max_size));
    }
    $tpl_tmp->Set_Variable('title', $setting['language']['plugin_news_snatch_title_' . $method]);
    $tpl_tmp->Set_Variable('id', $id);
    $tpl_tmp->Set_Variable('method', $method);
    $tpl->Set_Variable('path_admin', $setting['path']['admin']);
    $tpl->Set_Variable('main', $tpl_tmp->Get_Content('$setting'));
    $db->Free();
    unset($tpl_tmp);
    $mystep->show($tpl);
    return;
}
开发者ID:laiello,项目名称:mystep-cms,代码行数:101,代码来源:news_snatch.php

示例14: build_page


//.........这里部分代码省略.........
                    } else {
                        if ($plugin_info_remote = json_decode(GetRemoteContent($info['update_url'] . "/plugin.php?l=" . $setting['gen']['language']))) {
                            $update_info_hash[md5($info['update_url'])] = $plugin_info_remote;
                        } else {
                            $plugin_info_remote = new stdClass();
                        }
                    }
                    if (isset($plugin_info_remote->{$info}['idx'])) {
                        $update_info[$info['idx']] = array();
                        $update_info[$info['idx']]['idx'] = $info['idx'];
                        $update_info[$info['idx']]['name'] = getString($plugin_info_remote->{$info}['idx']->name);
                        $update_info[$info['idx']]['ver'] = $plugin_info_remote->{$info}['idx']->ver;
                        $update_info[$info['idx']]['intro'] = getString($plugin_info_remote->{$info}['idx']->intro);
                    }
                }
                if (isset($update_info[$info['idx']]) && $info['ver'] < $update_info[$info['idx']]['ver']) {
                    $info['ver_new'] = $update_info[$info['idx']]['ver'];
                    $info['update'] = "";
                } else {
                    $info['ver_new'] = "";
                    $info['update'] = "none";
                }
                if ($plugin_info = getParaInfo("plugin", "idx", $info['idx'])) {
                    $info['order'] = $plugin_info['order'];
                    $info['active'] = $plugin_info['active'] ? $setting['language']['close'] : $setting['language']['open'];
                    $tpl_tmp->Set_Loop("plugin_list_1", $info);
                } else {
                    $n++;
                    $tpl_tmp->Set_Loop("plugin_list_2", $info);
                }
                unset($update_info[$info['idx']]);
            }
        }
        foreach ($update_info as $key => $value) {
            $tpl_tmp->Set_Loop("plugin_list_3", $value);
        }
        $tpl_tmp->Set_If('empty_2', $n == 0);
        $tpl_tmp->Set_If('empty_3', count($update_info) == 0);
        $tpl_tmp->Set_Variable('self', $setting['info']['self']);
        $tpl_tmp->Set_Variable('title', $setting['language']['admin_web_plugin_title']);
        global $db;
        $db->select($setting['db']['pre'] . "admin_cat", "file, count(*) as counter", array("file", "!=", "###"), array("group" => "file", "having" => array("counter", "n>", 1)));
        $dp_list = "";
        while ($cur = $db->getRS()) {
            $dp_list .= $cur['file'] . "  (" . $cur['counter'] . ")\\n";
        }
        $tpl_tmp->Set_Variable('dp_list', $dp_list);
    } elseif ($method == "setting") {
        $tpl_tmp->Set_Variable('title', $setting['language']['admin_web_plugin_setup']);
        $plugin_info = getParaInfo("plugin", "idx", $idx);
        include $plugin_path . $idx . "/info.php";
        if ($plugin_info === false) {
            $tpl->Set_Variable('main', showInfo($setting['language']['admin_web_plugin_err'], 0));
            $mystep->show($tpl);
            $mystep->pageEnd(false);
        }
        $max_count = count($website);
        for ($i = 0; $i < $max_count; $i++) {
            $tpl_tmp->Set_Loop('subweb', array("web_id" => $website[$i]['web_id'], "name" => $website[$i]['name'], "checked" => strpos($plugin_info['subweb'], "," . $website[$i]['web_id'] . ",") !== false ? "checked" : ""));
        }
        $info['description'] = nl2br($info['description']);
        $tpl_tmp->Set_Variable('idx', $plugin_info['idx']);
        $tpl_tmp->Set_Variable('name', $plugin_info['name']);
        $tpl_tmp->Set_Variable('subweb', $plugin_info['subweb']);
        $tpl_tmp->Set_Variable('description', $info['description']);
        $tpl_tmp->Set_Variable('back_url', $req->getServer("HTTP_REFERER"));
    } elseif ($method == "upload") {
        global $script;
        $tpl_tmp->Set_Variable('script', $script);
        $tpl_tmp->Set_Variable('self', $setting['info']['self']);
        $Max_size = ini_get('upload_max_filesize');
        $tpl_tmp->Set_Variable('Max_size', $Max_size);
        $tpl_tmp->Set_Variable('MaxSize', GetFileSize($Max_size));
    } else {
        $tpl_tmp->Set_Variable('title', $setting['language']['admin_web_plugin_install']);
        include $plugin_path . $idx . "/info.php";
        $info['description'] = nl2br($info['description']);
        $tpl_tmp->Set_Variables($info);
        $tpl_tmp->Set_Variable('back_url', $req->getServer("HTTP_REFERER"));
        $max_count = count($website);
        for ($i = 0; $i < $max_count; $i++) {
            $tpl_tmp->Set_Loop('subweb', array("web_id" => $website[$i]['web_id'], "name" => $website[$i]['name'], "checked" => ""));
        }
        include $plugin_path . $idx . "/class.php";
        $check_info = call_user_func(array($info['class'], "check"));
        $color = "black";
        $info = $check_info;
        if (empty($check_info)) {
            $color = "green";
            $info = $setting['language']['admin_web_plugin_check_ok'];
        }
        $check_info = '<span style="color:' . $color . '">' . $info . '</span>';
        $tpl_tmp->Set_Variable('check', $check_info);
        $tpl_tmp->Set_Variable('subweb', "");
    }
    $tpl->Set_Variable('main', $tpl_tmp->Get_Content('$db, $setting, $idx'));
    unset($tpl_tmp);
    $mystep->show($tpl);
    return;
}
开发者ID:laiello,项目名称:mystep-cms,代码行数:101,代码来源:web_plugin.php

示例15:

}
if ($sitelink2) {
    $sitelink2 = "<a href={$sitelink2} target=_blank>{$sitelink2}</a>";
}
$file_name1 = $reply_data[s_file_name1];
$file_name2 = $reply_data[s_file_name2];
$file_download1 = $reply_data[download1];
$file_download2 = $reply_data[download2];
if ($file_name1) {
    $file_size1 = @GetFileSize(filesize($reply_data[file_name1]));
    $a_file_link1 = "<a href=download.php?{$href}{$sort}&no={$reply_data['no']}&filenum=1>";
} else {
    $a_file_link = "<Zeroboard";
}
if ($file_name2) {
    $file_size2 = @GetFileSize(filesize($reply_data[file_name2]));
    $a_file_link2 = "<a href=download.php?{$href}{$sort}&no={$reply_data['no']}&filenum=2>";
} else {
    $a_file_link = "Zeroboard";
}
if ($comment_num == 0) {
    $comment_num = "";
}
$upload_image1 = $upload_image2 = "";
if (eregi("\\.jpg", $file_name1) || eregi("\\.gif", $file_name1) || eregi("\\.png", $file_name1)) {
    $upload_image1 = "<img src={$reply_data['file_name1']} border=0><br>";
}
if (eregi("\\.jpg", $file_name2) || eregi("\\.gif", $file_name2) || eregi("\\.png", $file_name2)) {
    $upload_image2 = "<img src={$reply_data['file_name2']} border=0><br>";
}
// 카테고리의 이름을 구함
开发者ID:kkskipper,项目名称:KNOWME,代码行数:31,代码来源:reply_check.php


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