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


PHP nv_convertfromBytes函数代码示例

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


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

示例1: die

 * @Copyright (C) 2014 VINADES.,JSC. All rights reserved
 * @License GNU/GPL version 2 or any later version
 * @Createdate 31/05/2010, 00:36
 */
if (!defined('NV_SYSTEM') and !defined('NV_ADMIN') or !defined('NV_MAINFILE')) {
    die('Stop!!!');
}
unset($lang_module, $language_array, $nv_parse_ini_timezone, $countries, $module_info, $site_mods);
global $db, $nv_Request, $nv_plugin_area;
$contents = ob_get_contents();
ob_end_clean();
$contents = nv_url_rewrite($contents);
if (!defined('NV_IS_AJAX')) {
    $contents = nv_change_buffer($contents);
    if (defined('NV_IS_SPADMIN')) {
        $contents = str_replace('[MEMORY_TIME_USAGE]', sprintf($lang_global['memory_time_usage'], nv_convertfromBytes(memory_get_usage()), number_format(microtime(true) - NV_START_TIME, 3, '.', '')), $contents);
    }
}
if (isset($nv_plugin_area[3])) {
    // Kết nối với các plugin Trước khi website gửi nội dung tới trình duyệt
    foreach ($nv_plugin_area[3] as $_fplugin) {
        include NV_ROOTDIR . '/includes/plugin/' . $_fplugin;
    }
}
$db = null;
unset($lang_global, $global_config, $client_info);
//Nen trang
if (defined('NV_IS_GZIP')) {
    $http_accept_encoding = $nv_Request->get_string('HTTP_ACCEPT_ENCODING', 'server', '');
    if (!empty($http_accept_encoding)) {
        $compress_list = array();
开发者ID:anhtunguyen,项目名称:vietnamguide,代码行数:31,代码来源:footer.php

示例2: nv_show_tab

function nv_show_tab()
{
    global $db, $db_config, $module_name, $page_title, $lang_global, $lang_module, $nv_Request;
    $tab = filter_text_input('tab', 'get');
    $result = $db->sql_query("SHOW TABLE STATUS WHERE `Name`=" . $db->dbescape($tab));
    $item = $db->sql_fetch_assoc($result);
    $db->sql_freeresult($result);
    if (empty($item)) {
        Header("Location: " . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name);
        die;
    }
    if (in_array(filter_text_input('show_highlight', 'post'), array('php', 'sql'))) {
        $content = nv_highlight_string($tab, filter_text_input('show_highlight', 'post'));
        include NV_ROOTDIR . "/includes/header.php";
        echo $content;
        include NV_ROOTDIR . "/includes/footer.php";
    }
    $tablename = substr($item['Name'], strlen($db_config['prefix']) + 1);
    $contents = array();
    $contents['table']['caption'] = sprintf($lang_module['table_caption'], $tablename);
    $contents['table']['info']['name'] = array($lang_module['table_name'], $tablename);
    $contents['table']['info']['engine'] = array($lang_module['table_type'], isset($item['Engine']) ? $item['Engine'] : $item['Type']);
    $contents['table']['info']['row_format'] = array($lang_module['row_format'], $item['Row_format']);
    $contents['table']['info']['data_length'] = array($lang_module['table_size'], nv_convertfromBytes(intval($item['Data_length']) + intval($item['Index_length'])));
    $contents['table']['info']['max_data_length'] = array($lang_module['table_max_size'], !empty($item['Max_data_length']) ? nv_convertfromBytes(floatval($item['Max_data_length'])) : 'n/a');
    $contents['table']['info']['data_free'] = array($lang_module['table_datafree'], !empty($item['Data_free']) ? nv_convertfromBytes(intval($item['Data_free'])) : 0);
    $contents['table']['info']['rows'] = array($lang_module['table_numrow'], $item['Rows']);
    $contents['table']['info']['auto_increment'] = array($lang_module['table_auto_increment'], isset($item['Auto_increment']) ? intval($item['Auto_increment']) : "n/a");
    $contents['table']['info']['create_time'] = array($lang_module['table_create_time'], !empty($item['Create_time']) ? strftime("%H:%M:%S %d/%m/%Y", strtotime($item['Create_time'])) : "n/a");
    $contents['table']['info']['update_time'] = array($lang_module['table_update_time'], !empty($item['Update_time']) ? strftime("%H:%M:%S %d/%m/%Y", strtotime($item['Update_time'])) : "n/a");
    $contents['table']['info']['check_time'] = array($lang_module['table_check_time'], !empty($item['Check_time']) ? strftime("%H:%M:%S %d/%m/%Y", strtotime($item['Check_time'])) : "n/a");
    $contents['table']['info']['collation'] = array($lang_module['table_charset'], !empty($item['Collation']) && preg_match("/^([a-z0-9]+)_/i", $item['Collation'], $m) ? $m[1] : "");
    $contents['table']['show'] = nv_highlight_string($tab, "php");
    $contents['table']['show_lang'] = array($lang_module['php_code'], $lang_module['sql_code']);
    $contents['table']['row']['caption'] = sprintf($lang_module['table_row_caption'], $tablename);
    $contents['table']['row']['columns'] = array($lang_module['field_name'], $lang_module['field_type'], $lang_module['field_null'], $lang_module['field_key'], $lang_module['field_default'], $lang_module['field_extra']);
    $contents['table']['row']['detail'] = array();
    $result = $db->sql_query("SHOW COLUMNS FROM `" . $tab . "`");
    while ($row = $db->sql_fetch_assoc($result)) {
        $row['Null'] = $row['Null'] == "NO" ? "NOT NULL" : "NULL";
        $row['Key'] = empty($row['Key']) ? "" : ($row['Key'] == 'PRI' ? "PRIMARY KEY" : ($row['Key'] == 'UNI' ? "UNIQUE KEY" : "KEY"));
        $contents['table']['row']['detail'][] = $row;
    }
    $db->sql_freeresult($result);
    $contents = call_user_func("nv_show_tab_theme", $contents);
    $page_title = sprintf($lang_module['nv_show_tab'], $tablename);
    include NV_ROOTDIR . "/includes/header.php";
    echo nv_admin_theme($contents);
    include NV_ROOTDIR . "/includes/footer.php";
}
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:50,代码来源:functions.php

示例3: array

$xtpl->assign('LANG', $lang_module);
$xtpl->assign('GLANG', $lang_global);
$array_content = $array_time = array();
$files = scandir($log_dir);
foreach ($files as $file) {
    if (preg_match("/^([a-zA-Z0-9]+)\\_([a-zA-Z0-9\\-\\_]+)\\.(sql|sql\\.gz)+\$/", $file, $mc)) {
        $filesize = filesize($log_dir . '/' . $file);
        $filetime = intval(filemtime($log_dir . '/' . $file));
        $array_time[] = $filetime;
        $array_content[$filetime] = array("file" => $file, 'mc' => $mc, "filesize" => $filesize);
    }
}
sort($array_time);
$a = 0;
$count = sizeof($array_time) - 1;
for ($index = $count; $index >= 0; --$index) {
    $filetime = $array_time[$index];
    $value = $array_content[$filetime];
    $file = $value['file'];
    $mc = $value['mc'];
    $link_getfile = NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=getfile&filename=" . $file . "&checkss=" . md5($file . $client_info['session_id'] . $global_config['sitekey']);
    $link_delete = NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=delfile&filename=" . $file . "&checkss=" . md5($file . $client_info['session_id'] . $global_config['sitekey']);
    $xtpl->assign('ROW', array('class' => ++$a % 2 == 0 ? "" : " class=\"second\"", 'stt' => $a, 'name' => $mc[2] . "." . $mc[3], 'filesize' => nv_convertfromBytes($value['filesize']), 'filetime' => nv_date("l d-m-Y h:i:s A", $filetime), 'link_getfile' => $link_getfile, 'link_delete' => $link_delete));
    $xtpl->parse('main.loop');
}
$page_title = $lang_module['file_backup'];
$xtpl->parse('main');
$contents = $xtpl->text('main');
include NV_ROOTDIR . "/includes/header.php";
echo nv_admin_theme($contents);
include NV_ROOTDIR . "/includes/footer.php";
开发者ID:atarubi,项目名称:nuke-viet,代码行数:31,代码来源:file.php

示例4: nv_dump_save

             $contents['tables'][] = $item[0];
         }
         $res->closeCursor();
         $contents['type'] = 'all';
         include NV_ROOTDIR . '/includes/core/dump.php';
         $dump = nv_dump_save($contents);
         // Ghi log
         $NvUpdate->log($nv_update_config, $lang_module['update_dump'] . ' ' . $contents['savetype'], $dump);
         if ($dump == false) {
             die($lang_module['update_dump_error']);
         } else {
             $file = str_replace(NV_ROOTDIR . '/' . NV_LOGS_DIR . '/dump_backup/', '', $dump[0]);
             // Danh dau da sao luu CSDL
             $nv_update_config['updatelog']['data_backuped'] = NV_CURRENTTIME;
             $NvUpdate->set_data_log($nv_update_config['updatelog']);
             die($lang_module['update_dump_ok'] . ' ' . nv_convertfromBytes($dump[1]) . '<br /><a href="' . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=database&amp;" . NV_OP_VARIABLE . "=getfile&amp;filename=" . $file . "&amp;checkss=" . md5($file . $client_info['session_id'] . $global_config['sitekey']) . '" title="' . $lang_module['update_dump_download'] . '">' . $lang_module['update_dump_download'] . '</a>');
         }
     } else {
         die($lang_module['update_dump_exist']);
     }
 }
 // Download CODE thay doi
 if ($nv_Request->isset_request('downfile', 'get')) {
     $checksess = $nv_Request->get_title('checksess', 'get', '');
     if ($checksess != md5($global_config['sitekey'] . session_id())) {
         die('Error!!!');
     }
     $file = $nv_Request->get_title('downfile', 'get', '');
     if (!file_exists(NV_ROOTDIR . '/' . NV_LOGS_DIR . '/data_logs/' . $file)) {
         $NvUpdate->log($nv_update_config, $lang_module['update_log_dump_file_down'], false);
         die('Error Access!!!');
开发者ID:nukeplus,项目名称:nuke,代码行数:31,代码来源:update.php

示例5: addcslashes

    if (!empty($key)) {
        $keyword = '%' . addcslashes($key, '_%') . '%';
        $sth->bindParam(':keyword1', $keyword, PDO::PARAM_STR);
        $sth->bindParam(':keyword2', $keyword, PDO::PARAM_STR);
        $sth->bindParam(':keyword3', $keyword, PDO::PARAM_STR);
    }
    $sth->execute();
    while ($row = $sth->fetch()) {
        $cattitle = '<a href="' . NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=' . $list_cats[$row['catid']]['alias'] . '">' . $list_cats[$row['catid']]['title'] . '</a>';
        $uploadtime = (int) $row['uploadtime'];
        if ($uploadtime >= $today) {
            $uploadtime = $lang_module['today'] . ', ' . date('H:i', $row['uploadtime']);
        } elseif ($uploadtime >= $yesterday) {
            $uploadtime = $lang_module['yesterday'] . ', ' . date('H:i', $row['uploadtime']);
        } else {
            $uploadtime = nv_date('d/m/Y H:i', $row['uploadtime']);
        }
        $array[$row['id']] = array('id' => $row['id'], 'title' => $row['title'], 'cattitle' => $cattitle, 'introtext' => $row['introtext'], 'uploadtime' => $uploadtime, 'author_name' => $row['author_name'], 'filesize' => !empty($row['filesize']) ? nv_convertfromBytes($row['filesize']) : '', 'imagesrc' => !empty($row['fileimage']) ? NV_BASE_SITEURL . NV_FILES_DIR . $row['fileimage'] : '', 'view_hits' => $row['view_hits'], 'download_hits' => $row['download_hits'], 'more_link' => NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=' . $list_cats[$row['catid']]['alias'] . '/' . $row['alias'] . $global_config['rewrite_exturl'], 'edit_link' => defined('NV_IS_MODADMIN') ? NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;edit=1&amp;id=' . $row['id'] : '', 'del_link' => defined('NV_IS_MODADMIN') ? NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name : '');
    }
    $generate_page = nv_alias_page($page_title, $base_url, $num_items, $per_page, $page);
    $contents = theme_viewcat_list($array, $generate_page);
    if ($page > 1) {
        $page_title .= ' ' . NV_TITLEBAR_DEFIS . ' ' . $lang_global['page'] . ' ' . $page;
    }
} else {
    $contents = $lang_module['search_noresult'];
}
$key_words = $description = 'no';
include NV_ROOTDIR . '/includes/header.php';
echo nv_site_theme($contents);
include NV_ROOTDIR . '/includes/footer.php';
开发者ID:ThinhNguyenVB,项目名称:module-download,代码行数:31,代码来源:search.php

示例6: md5

        }
        if (file_exists(NV_ROOTDIR . '/themes/' . $themename . '/images/' . $modulename . '/')) {
            $allowfolder[] = NV_ROOTDIR . '/themes/' . $themename . '/images/' . $modulename . '/';
        }
        $file_src = NV_ROOTDIR . '/' . NV_TEMP_DIR . '/' . NV_TEMPNAM_PREFIX . 'theme_' . $themename . '_' . $modulename . '_' . md5(nv_genpass(10) . session_id()) . '.zip';
        require_once NV_ROOTDIR . '/includes/class/pclzip.class.php';
        $zip = new PclZip($file_src);
        $zip->create($allowfolder, PCLZIP_OPT_REMOVE_PATH, NV_ROOTDIR . '/themes');
        $filesize = filesize($file_src);
        $file_name = basename($file_src);
        nv_insert_logs(NV_LANG_DATA, $module_name, $lang_module['autoinstall_method_packet_module'], 'file name : ' . $themename . '_' . $modulename . ".zip", $admin_info['userid']);
        $linkgetfile = NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&amp;" . NV_OP_VARIABLE . "=getfile&amp;mod=nv3_theme_" . $themename . "_" . $modulename . ".zip&amp;checkss=" . md5($file_name . $client_info['session_id'] . $global_config['sitekey']) . "&amp;filename=" . $file_name;
        $xtpl->assign('LINKGETFILE', $linkgetfile);
        $xtpl->assign('THEMENAME', $themename);
        $xtpl->assign('MODULENAME', $modulename);
        $xtpl->assign('FILESIZE', nv_convertfromBytes($filesize));
        $xtpl->parse('complete');
        $contents = $xtpl->text('complete');
    }
    include NV_ROOTDIR . "/includes/header.php";
    echo $contents;
    include NV_ROOTDIR . "/includes/footer.php";
} else {
    $op = $nv_Request->get_string(NV_OP_VARIABLE, 'get', '');
    $theme_list = nv_scandir(NV_ROOTDIR . "/themes", array($global_config['check_theme'], $global_config['check_theme_mobile']));
    foreach ($theme_list as $themes_i) {
        if (file_exists(NV_ROOTDIR . '/themes/' . $themes_i . '/config.ini')) {
            $xtpl->assign('THEME', $themes_i);
            $xtpl->parse('main.theme');
        }
    }
开发者ID:atarubi,项目名称:nuke-viet,代码行数:31,代码来源:package_theme_module.php

示例7: FOUND_ROWS

     $query = $db->sql_query("SELECT FOUND_ROWS()");
     list($all_page) = $db->sql_fetchrow($query);
     if ($all_page) {
         $array_item = array();
         while ($row = $db->sql_fetchrow($result)) {
             $uploadtime = (int) $row['uploadtime'];
             if ($uploadtime >= $today) {
                 $uploadtime = $lang_module['today'] . ", " . date("H:i", $row['uploadtime']);
             } elseif ($uploadtime >= $yesterday) {
                 $uploadtime = $lang_module['yesterday'] . ", " . date("H:i", $row['uploadtime']);
             } else {
                 $uploadtime = nv_date("d/m/Y H:i", $row['uploadtime']);
             }
             $img = substr($row['fileimage'], strlen(NV_BASE_SITEURL));
             $imageinfo = nv_ImageInfo(NV_ROOTDIR . '/' . $img, 400, true, NV_UPLOADS_REAL_DIR . '/' . $module_name . '/thumb');
             $array_item[$row['id']] = array('id' => (int) $row['id'], 'title' => $row['title'], 'introtext' => $row['introtext'], 'uploadtime' => $uploadtime, 'author_name' => !empty($row['author_name']) ? $row['author_name'] : $lang_module['unknown'], 'filesize' => !empty($row['filesize']) ? nv_convertfromBytes($row['filesize']) : "", 'fileimage' => $imageinfo, 'view_hits' => (int) $row['view_hits'], 'download_hits' => (int) $row['download_hits'], 'more_link' => NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $module_name . "&amp;" . NV_OP_VARIABLE . "=" . $list_cats[$row['catid']]['alias'] . "/" . $row['alias'], 'edit_link' => defined('NV_IS_MODADMIN') ? NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&amp;edit=1&amp;id=" . (int) $row['id'] : "", 'del_link' => defined('NV_IS_MODADMIN') ? NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name : "");
             //
             if ($row['comment_allow']) {
                 $array_item[$row['id']]['comment_hits'] = (int) $row['comment_hits'];
             }
         }
         $array_cats[$catid_i] = array();
         $array_cats[$catid_i]['id'] = $value['id'];
         $array_cats[$catid_i]['title'] = $value['title'];
         $array_cats[$catid_i]['link'] = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $module_name . "&amp;" . NV_OP_VARIABLE . "=" . $value['alias'];
         $array_cats[$catid_i]['description'] = $list_cats[$value['id']]['description'];
         $array_cats[$catid_i]['subcats'] = $list_cats[$value['id']]['subcats'];
         //$array_cats[$catid_i]['image'] = $list_cats[$value['id']]['image'];
         $array_cats[$catid_i]['items'] = $array_item;
     }
 }
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:31,代码来源:main.php

示例8: array

$xtpl->assign('GLANG', $lang_global);
$array_content = $array_time = array();
$files = scandir($log_dir);
foreach ($files as $file) {
    if (preg_match('/^([a-zA-Z0-9]+)\\_([a-zA-Z0-9\\-\\_]+)\\.(sql|sql\\.gz)+$/', $file, $mc)) {
        $filesize = filesize($log_dir . '/' . $file);
        $filetime = intval(filemtime($log_dir . '/' . $file));
        $array_time[] = $filetime;
        $array_content[$filetime] = array('file' => $file, 'mc' => $mc, 'filesize' => $filesize);
    }
}
sort($array_time);
$a = 0;
$count = sizeof($array_time) - 1;
for ($index = $count; $index >= 0; --$index) {
    $filetime = $array_time[$index];
    $value = $array_content[$filetime];
    $file = $value['file'];
    $mc = $value['mc'];
    $link_getfile = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=getfile&amp;filename=' . $file . '&amp;checkss=' . md5($file . $client_info['session_id'] . $global_config['sitekey']);
    $link_delete = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=delfile&amp;filename=' . $file . '&amp;checkss=' . md5($file . $client_info['session_id'] . $global_config['sitekey']);
    $xtpl->assign('ROW', array('stt' => ++$a, 'name' => $mc[2] . '.' . $mc[3], 'filesize' => nv_convertfromBytes($value['filesize']), 'filetime' => nv_date('l d/m/Y h:i:s A', $filetime), 'link_getfile' => $link_getfile, 'link_delete' => $link_delete));
    $xtpl->parse('main.loop');
}
$xtpl->assign('BACKUPNOW', NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=download&amp;checkss=' . md5($client_info['session_id'] . $global_config['sitekey']));
$page_title = $lang_module['file_backup'];
$xtpl->parse('main');
$contents = $xtpl->text('main');
include NV_ROOTDIR . '/includes/header.php';
echo nv_admin_theme($contents);
include NV_ROOTDIR . '/includes/footer.php';
开发者ID:nukeplus,项目名称:nuke,代码行数:31,代码来源:file.php

示例9: nv_avatar

/**
 * nv_avatar()
 *
 * @param mixed $array
 * @return void
 */
function nv_avatar($array)
{
    global $module_info, $module_file, $module_name, $lang_module, $lang_global, $global_config;
    $xtpl = new XTemplate('avatar.tpl', NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $module_file);
    $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
    $xtpl->assign('TEMPLATE', $global_config['module_theme']);
    $xtpl->assign('MODULE_FILE', $module_file);
    $xtpl->assign('NV_AVATAR_WIDTH', $global_config['avatar_width']);
    $xtpl->assign('NV_AVATAR_HEIGHT', $global_config['avatar_height']);
    $xtpl->assign('NV_MAX_WIDTH', NV_MAX_WIDTH);
    $xtpl->assign('NV_MAX_HEIGHT', NV_MAX_HEIGHT);
    $xtpl->assign('NV_UPLOAD_MAX_FILESIZE', NV_UPLOAD_MAX_FILESIZE);
    $form_action = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=avatar';
    if (!empty($array['u'])) {
        $form_action .= '/' . $array['u'];
    }
    $xtpl->assign('NV_AVATAR_UPLOAD', $form_action);
    $lang_module['avatar_bigfile'] = sprintf($lang_module['avatar_bigfile'], nv_convertfromBytes(NV_UPLOAD_MAX_FILESIZE));
    $lang_module['avatar_bigsize'] = sprintf($lang_module['avatar_bigsize'], NV_MAX_WIDTH, NV_MAX_HEIGHT);
    $lang_module['avatar_smallsize'] = sprintf($lang_module['avatar_smallsize'], $global_config['avatar_width'], $global_config['avatar_height']);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('GLANG', $lang_global);
    if ($array['error']) {
        $xtpl->assign('ERROR', $array['error']);
        $xtpl->parse('main.error');
    }
    if ($array['success'] == 1) {
        $xtpl->assign('FILENAME', $array['filename']);
        $xtpl->parse('main.complete');
    } elseif ($array['success'] == 2) {
        $xtpl->parse('main.complete2');
    } elseif ($array['success'] == 3) {
        $xtpl->assign('FILENAME', $array['filename']);
        $xtpl->parse('main.complete3');
    } else {
        $xtpl->parse('main.init');
    }
    $xtpl->parse('main');
    return $xtpl->text('main');
}
开发者ID:hongoctrien,项目名称:nukeviet,代码行数:46,代码来源:theme.php

示例10: nv_avatar

/**
 * nv_avatar()
 *
 * @param mixed $array
 * @return void
 */
function nv_avatar($array)
{
    global $module_info, $module_file, $module_name, $lang_module, $global_config, $my_head;
    // Include JS and CSS
    $my_head .= "<script src=\"" . NV_BASE_SITEURL . "js/jquery/jquery.Jcrop.min.js\" type=\"text/javascript\"></script>" . NV_EOL;
    $my_head .= "<link href=\"" . NV_BASE_SITEURL . "js/jquery/jquery.Jcrop.min.css\" rel=\"stylesheet\" type=\"text/css\" />" . NV_EOL;
    $xtpl = new XTemplate('avatar.tpl', NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $module_file);
    $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
    $xtpl->assign('TEMPLATE', $global_config['module_theme']);
    $xtpl->assign('MODULE_FILE', $module_file);
    $xtpl->assign('NV_AVATAR_WIDTH', $global_config['avatar_width']);
    $xtpl->assign('NV_AVATAR_HEIGHT', $global_config['avatar_height']);
    $xtpl->assign('NV_MAX_WIDTH', NV_MAX_WIDTH);
    $xtpl->assign('NV_MAX_HEIGHT', NV_MAX_HEIGHT);
    $xtpl->assign('NV_UPLOAD_MAX_FILESIZE', NV_UPLOAD_MAX_FILESIZE);
    $xtpl->assign('NV_AVATAR_UPLOAD', NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=avatar');
    $lang_module['avata_bigfile'] = sprintf($lang_module['avata_bigfile'], nv_convertfromBytes(NV_UPLOAD_MAX_FILESIZE));
    $lang_module['avata_bigsize'] = sprintf($lang_module['avata_bigsize'], NV_MAX_WIDTH, NV_MAX_HEIGHT);
    $lang_module['avata_smallsize'] = sprintf($lang_module['avata_smallsize'], $global_config['avatar_width'], $global_config['avatar_height']);
    $xtpl->assign('LANG', $lang_module);
    if ($array['error']) {
        $xtpl->assign('ERROR', $array['error']);
        $xtpl->parse('main.error');
    }
    if (!$array['success']) {
        $xtpl->parse('main.init');
    } else {
        $xtpl->assign('FILENAME', $array['filename']);
        $xtpl->parse('main.complete');
    }
    $xtpl->parse('main');
    return $xtpl->text('main');
}
开发者ID:volong1012,项目名称:nukeviet,代码行数:39,代码来源:theme.php

示例11: join

        $where = join(" OR ", $where_conditions);
    }
    $sql1 = "SELECT * FROM `" . NV_PREFIXLANG . "_" . $module_data . "` WHERE " . $where . $allcat . " AND `status`=1";
    $sql2 = "SELECT * FROM `" . NV_PREFIXLANG . "_" . $module_data . "` WHERE " . $where . $allcat . " AND `status`=1 ORDER BY `uploadtime` DESC LIMIT " . $page . ", " . $per_page;
} else {
    $sql1 = "SELECT * FROM `" . NV_PREFIXLANG . "_" . $module_data . "` WHERE `status`=1";
    $sql2 = "SELECT * FROM `" . NV_PREFIXLANG . "_" . $module_data . "` WHERE `status`=1 ORDER BY `uploadtime` DESC LIMIT " . $page . ", " . $per_page;
}
$result = $db->sql_query($sql1);
list($all_page) = $db->sql_fetchrow($result);
if (!empty($all_page)) {
    $result = $db->sql_query($sql2);
    $imageinfo = array();
    while ($row = $db->sql_fetchrow($result)) {
        list($catalias) = $db->sql_fetchrow($db->sql_query("SELECT alias FROM `" . NV_PREFIXLANG . "_" . $module_data . "_categories` WHERE id=" . $row['catid'] . ""));
        $row['filesize'] = !empty($row['filesize']) ? nv_convertfromBytes($row['filesize']) : "";
        $row['view_hits'] = (int) $row['view_hits'];
        $row['download_hits'] = (int) $row['download_hits'];
        $row['more_link'] = NV_BASE_SITEURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=" . $catalias . '/' . $row['alias'];
        $xtpl->assign('ROW', $row);
        $imageinfo['src'] = $row['fileimage'];
        if (!empty($row['fileimage'])) {
            $xtpl->assign('FILEIMAGE', $imageinfo);
            $xtpl->parse('main.row.is_image');
        }
        $xtpl->parse('main.row');
    }
    $generate_page = nv_generate_page($base_url, $all_page, $per_page, $page);
    if (!empty($generate_page)) {
        $xtpl->assign('GENERATE_PAGE', $generate_page);
        $xtpl->parse('main.generate_page');
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:31,代码来源:search.php

示例12: min

$contents .= "<tr>";
$contents .= "<td align=\"right\"><strong>" . $lang_module['nv_max_size'] . ": </strong></td>\n";
$contents .= "<td>";
$contents .= "<select name=\"nv_max_size\">\n";
$sys_max_size = min(nv_converttoBytes(ini_get('upload_max_filesize')), nv_converttoBytes(ini_get('post_max_size')));
$p_size = $sys_max_size / 100;
for ($index = 100; $index > 0; $index--) {
    $size = floor($index * $p_size);
    $sl = "";
    if ($size == $global_config['nv_max_size']) {
        $sl = " selected=\"selected\"";
    }
    $contents .= "<option value=\"" . $size . "\" " . $sl . ">" . nv_convertfromBytes($size) . "</option>\n";
}
$contents .= "</select> \n";
$contents .= " (" . $lang_module['sys_max_size'] . ": " . nv_convertfromBytes($sys_max_size) . ")";
$contents .= "</td>";
$contents .= "</tr>";
$contents .= "</tbody>";
$contents .= "<tbody>\n";
$contents .= "<tr>\n";
$contents .= "<td colspan='2' style='text-align:center'>";
$contents .= "<input type='submit' value='" . $lang_module['banip_confirm'] . "' name='submit'/>\n";
$contents .= "</td>\n";
$contents .= "</tr>\n";
$contents .= "</tbody>\n";
$contents .= "</table>\n";
$contents .= "</form>\n";
include NV_ROOTDIR . "/includes/header.php";
echo nv_admin_theme($contents);
include NV_ROOTDIR . "/includes/footer.php";
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:31,代码来源:uploadconfig.php

示例13: XTemplate

}
if ($type != 'image' and $type != 'flash') {
    $type = 'file';
}
$xtpl = new XTemplate('main.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $module_file);
if ($popup) {
    $lang_module['browse_file'] = $lang_global['browse_file'];
    $sys_max_size = min($global_config['nv_max_size'], nv_converttoBytes(ini_get('upload_max_filesize')), nv_converttoBytes(ini_get('post_max_size')));
    $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
    $xtpl->assign('ADMIN_THEME', $global_config['module_theme']);
    $xtpl->assign('NV_OP_VARIABLE', NV_OP_VARIABLE);
    $xtpl->assign('NV_NAME_VARIABLE', NV_NAME_VARIABLE);
    $xtpl->assign('MODULE_NAME', $module_name);
    $xtpl->assign('NV_LANG_INTERFACE', NV_LANG_INTERFACE);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('NV_MAX_SIZE', nv_convertfromBytes($sys_max_size));
    $xtpl->assign('NV_MAX_SIZE_BYTES', $sys_max_size);
    $xtpl->assign('NV_MAX_WIDTH', NV_MAX_WIDTH);
    $xtpl->assign('NV_MAX_HEIGHT', NV_MAX_HEIGHT);
    $xtpl->assign('NV_MIN_WIDTH', 10);
    $xtpl->assign('NV_MIN_HEIGHT', 10);
    $xtpl->assign('CURRENTPATH', $currentpath);
    $xtpl->assign('PATH', $path);
    $xtpl->assign('TYPE', $type);
    $xtpl->assign('AREA', $area);
    $xtpl->assign('ALT', $alt);
    $xtpl->assign('FUNNUM', $nv_Request->get_int('CKEditorFuncNum', 'get', 0));
    $sfile = $type == 'file' ? ' selected="selected"' : '';
    $simage = $type == 'image' ? ' selected="selected"' : '';
    $sflash = $type == 'flash' ? ' selected="selected"' : '';
    $xtpl->assign('SFLASH', $sflash);
开发者ID:nukeplus,项目名称:nuke,代码行数:31,代码来源:main.php

示例14: explode

        $sel = '';
        $selid = '';
    }
    $arr_temp = explode('.', $imglist[$i]);
    $ext = strtolower(end($arr_temp));
    echo '<td style="width:170px; padding-bottom:10px; text-align:center;"><div style="width:150px" ' . $selid . '>';
    if (in_array($ext, $array_images)) {
        echo '<img class="previewimg" title="' . $imglist[$i] . '" src="' . NV_BASE_SITEURL . $pathimg . '/' . $imglist[$i] . '" style="padding:5px' . $sel . '" width="100" height="100"/><br />';
    } elseif (in_array($ext, $array_archives)) {
        echo '<img class="previewimg" title="' . $imglist[$i] . '" src="' . NV_BASE_SITEURL . 'images/zip.gif" style="padding:5px' . $sel . '" width="32" height="32"/><br />';
    } elseif (in_array($ext, $array_documents)) {
        echo '<img class="previewimg" title="' . $imglist[$i] . '" src="' . NV_BASE_SITEURL . 'images/doc.gif" style="padding:5px' . $sel . '" width="32" height="32"/><br />';
    } else {
        echo '<img class="previewimg" title="' . $imglist[$i] . '" src="' . NV_BASE_SITEURL . 'images/file.gif" style="padding:5px' . $sel . '" width="32" height="32"/><br />';
    }
    $filesize = nv_convertfromBytes(@filesize(NV_ROOTDIR . '/' . $pathimg . '/' . $imglist[$i]));
    //$filetime = date( "d-m-Y H:i:s", filemtime( NV_ROOTDIR . '/' . $pathimg . '/' . $imglist[$i] ) );
    echo '</div><div style="width:150px;overflow:hidden;font-size:12px;font-family:tahoma;">' . $imglist[$i] . '<br/>';
    //echo $filetime.'<br/>';
    echo $filesize . '</div>';
    echo '</td>';
    if (($i + 1) % 4 == 0 && $i != 0) {
        echo '</tr><tr>';
    }
}
echo '</table>';
echo '
<script type="text/javascript" src="' . NV_BASE_SITEURL . 'js/jquery/jquery.min.js"></script>
<link rel="StyleSheet" href="' . NV_BASE_SITEURL . 'themes/' . $global_config['admin_theme'] . '/css/admin.css" type="text/css" />	
<link type="text/css" href="' . NV_BASE_SITEURL . 'js/ui/jquery.ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="' . NV_BASE_SITEURL . 'js/ui/jquery-ui-1.8.2.custom.js"></script>	
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:31,代码来源:imglist.php

示例15: nv_filesList

 $results = nv_filesList($pathimg, $refresh);
 if (!empty($results)) {
     $xtpl = new XTemplate("listimg.tpl", NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/modules/" . $module_file);
     $xtpl->assign("NV_BASE_SITEURL", NV_BASE_SITEURL);
     $author = $author === true ? $admin_info['userid'] : 0;
     foreach ($results as $title => $file) {
         if ($type == "file" or $type != "file" and $file[2] == $type) {
             if (!$author or $author == $file[8]) {
                 $file = array_combine(array('name0', 'ext', 'type', 'filesize', 'src', 'srcWidth', 'srcHeight', 'name', 'author', 'mtime'), $file);
                 $file['title'] = $title;
                 if ($file['type'] == "image" or $file['ext'] == "swf") {
                     $file['size'] = str_replace("|", " x ", $file['name']) . " pixels";
                 } else {
                     $file['size'] = nv_convertfromBytes($file['filesize']);
                 }
                 $file['name'] .= "|" . $file['ext'] . "|" . $file['type'] . "|" . nv_convertfromBytes($file['filesize']) . "|" . $file['author'] . "|" . nv_date("l, d F Y, H:i:s P", $file['mtime']);
                 $file['sel'] = $selectfile == $title ? " imgsel" : "";
                 $file['src'] = NV_BASE_SITEURL . $file['src'] . '?' . $file['mtime'];
                 $xtpl->assign("IMG", $file);
                 $xtpl->parse('main.loopimg');
             }
         }
     }
     if (!empty($selectfile)) {
         $xtpl->assign("NV_CURRENTTIME", NV_CURRENTTIME);
         $xtpl->parse('main.imgsel');
     }
     $xtpl->parse('main');
     $contents = $xtpl->text('main');
     include NV_ROOTDIR . "/includes/header.php";
     echo $contents;
开发者ID:atarubi,项目名称:nuke-viet,代码行数:31,代码来源:imglist.php


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