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


PHP nv_generate_page函数代码示例

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


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

示例1: nv_show_sources_list

/**
 * nv_show_sources_list()
 *
 * @return
 *
 */
function nv_show_sources_list()
{
    global $db, $lang_module, $lang_global, $module_name, $module_data, $nv_Request, $module_file, $global_config;
    $num = $db->query('SELECT COUNT(*) FROM ' . NV_PREFIXLANG . '_' . $module_data . '_sources')->fetchColumn();
    $base_url = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_data . '&' . NV_OP_VARIABLE . '=sources';
    $num_items = $num > 1 ? $num : 1;
    $per_page = 15;
    $page = $nv_Request->get_int('page', 'get', 1);
    $xtpl = new XTemplate('sources_list.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $module_file);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('GLANG', $lang_global);
    if ($num > 0) {
        $db->sqlreset()->select('*')->from(NV_PREFIXLANG . '_' . $module_data . '_sources')->order('weight')->limit($per_page)->offset(($page - 1) * $per_page);
        $result = $db->query($db->sql());
        while ($row = $result->fetch()) {
            $xtpl->assign('ROW', array('sourceid' => $row['sourceid'], 'title' => $row['title'], 'link' => $row['link'], 'url_edit' => NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=sources&sourceid=' . $row['sourceid'] . '#edit'));
            for ($i = 1; $i <= $num; ++$i) {
                $xtpl->assign('WEIGHT', array('key' => $i, 'title' => $i, 'selected' => $i == $row['weight'] ? ' selected="selected"' : ''));
                $xtpl->parse('main.loop.weight');
            }
            $xtpl->parse('main.loop');
        }
        $result->closeCursor();
        $generate_page = nv_generate_page($base_url, $num_items, $per_page, $page);
        if (!empty($generate_page)) {
            $xtpl->assign('GENERATE_PAGE', $generate_page);
            $xtpl->parse('main.generate_page');
        }
        $xtpl->parse('main');
        $contents = $xtpl->text('main');
    } else {
        $contents = '&nbsp;';
    }
    return $contents;
}
开发者ID:hongoctrien,项目名称:module-code,代码行数:41,代码来源:admin.functions.php

示例2: result_theme

/**
 * result_theme()
 * 
 * @param mixed $result_array
 * @param mixed $mod
 * @param mixed $mod_custom_title
 * @param mixed $search
 * @param mixed $is_generate_page
 * @param mixed $limit
 * @param mixed $all_page
 * @return
 */
function result_theme($result_array, $mod, $mod_custom_title, $search, $is_generate_page, $limit, $all_page)
{
    global $module_info, $module_file, $global_config, $lang_global, $lang_module, $db, $module_name;
    $xtpl = new XTemplate("result.tpl", NV_ROOTDIR . "/themes/" . $module_info['template'] . "/modules/" . $module_file);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('SEARCH_RESULT_NUM', $all_page);
    $xtpl->assign('MODULE_CUSTOM_TITLE', $mod_custom_title);
    $xtpl->assign('HIDDEN_KEY', $search['key']);
    foreach ($result_array as $result) {
        $xtpl->assign('RESULT', $result);
        $xtpl->parse('main.result');
    }
    $base_url = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name . "&q=" . urlencode($search['key']);
    if ($mod != "all") {
        $base_url .= "&m=" . $mod;
    }
    $base_url .= "&l=" . $search['logic'];
    if ($is_generate_page) {
        $generate_page = nv_generate_page($base_url, $all_page, $limit, $search['page']);
        if (!empty($generate_page)) {
            $xtpl->assign('GENERATE_PAGE', $generate_page);
            $xtpl->parse('main.generate_page');
        }
    } else {
        if ($all_page > $limit) {
            $xtpl->assign('MORE', $base_url);
            $xtpl->parse('main.more');
        }
    }
    $xtpl->parse('main');
    return $xtpl->text('main');
}
开发者ID:atarubi,项目名称:nuke-viet,代码行数:44,代码来源:theme.php

示例3: nv_comment_data

/**
 * nv_comment_module()
 *
 * @param mixed $id
 * @param mixed $module
 * @param mixed $page
 * @return
 */
function nv_comment_data($module, $area, $id, $allowed, $page, $sortcomm, $base_url)
{
    global $db, $global_config, $module_config, $db_config, $per_page_comment;
    $comment_array = array();
    $_where = 'a.module=' . $db->quote($module);
    if ($area) {
        $_where .= ' AND a.area= ' . $area;
    }
    $_where .= ' AND a.id= ' . $id . ' AND a.status=1 AND a.pid=0';
    $db->sqlreset()->select('COUNT(*)')->from(NV_PREFIXLANG . '_comment a')->join('LEFT JOIN ' . NV_USERS_GLOBALTABLE . ' b ON a.userid =b.userid')->where($_where);
    $num_items = $db->query($db->sql())->fetchColumn();
    if ($num_items) {
        $emailcomm = $module_config[$module]['emailcomm'];
        $db->select('a.cid, a.pid, a.content, a.post_time, a.post_name, a.post_email, a.likes, a.dislikes, b.userid, b.email, b.first_name, b.last_name, b.photo, b.view_mail')->limit($per_page_comment)->offset(($page - 1) * $per_page_comment);
        if ($sortcomm == 1) {
            $db->order('a.cid ASC');
        } elseif ($sortcomm == 2) {
            $db->order('a.likes DESC, a.cid DESC');
        } else {
            $db->order('a.cid DESC');
        }
        $session_id = session_id() . '_' . $global_config['sitekey'];
        $result = $db->query($db->sql());
        $comment_list_id = array();
        while ($row = $result->fetch()) {
            $comment_list_id[] = $row['cid'];
            if ($row['userid'] > 0) {
                $row['post_email'] = $row['email'];
                $row['post_name'] = $row['first_name'];
            }
            $row['check_like'] = md5($row['cid'] . '_' . $session_id);
            $row['post_email'] = $emailcomm ? $row['post_email'] : '';
            $comment_array[$row['cid']] = $row;
        }
        if (!empty($comment_list_id)) {
            foreach ($comment_list_id as $cid) {
                $comment_array[$cid]['subcomment'] = nv_comment_get_reply($cid, $module, $session_id, $sortcomm);
            }
            $result->closeCursor();
            unset($row, $result);
            $generate_page = nv_generate_page($base_url, $num_items, $per_page_comment, $page, true, true, 'nv_urldecode_ajax', 'idcomment');
        } else {
            $generate_page = '';
        }
        return array('comment' => $comment_array, 'page' => $generate_page);
    }
}
开发者ID:anhtunguyen,项目名称:vietnamguide,代码行数:55,代码来源:comment.php

示例4: nv_show_tags_list

/**
 * nv_show_tags_list()
 *
 * @param string $q
 * @param integer $incomplete
 * @return
 */
function nv_show_tags_list($q = '', $incomplete = false)
{
    global $db, $lang_module, $lang_global, $module_name, $module_data, $op, $module_file, $global_config, $module_info, $module_config, $nv_Request;
    $base_url = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op;
    $db->sqlreset()->select('*')->from(NV_PREFIXLANG . '_' . $module_data . '_tags')->order('alias ASC');
    if (!empty($q)) {
        $q = strip_punctuation($q);
        $db->where('keywords LIKE %' . $q . '%');
    }
    if ($incomplete === true) {
        $db->where('description = \'\'');
    }
    $num_items = $db->query($db->sql())->fetchColumn();
    $page = $nv_Request->get_int('page', 'post,get', 1);
    $per_page = 20;
    $db->select('*')->order('alias ASC')->limit($per_page)->offset(($page - 1) * $per_page);
    $result2 = $db->query($db->sql());
    $xtpl = new XTemplate('tags_lists.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $module_file);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('GLANG', $lang_global);
    $number = 0;
    while ($row = $result2->fetch()) {
        $row['number'] = ++$number;
        $row['link'] = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=tag/' . $row['alias'];
        $row['url_edit'] = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=' . $op . '&amp;did=' . $row['did'] . ($incomplete === true ? '&amp;incomplete=1' : '') . '#edit';
        $xtpl->assign('ROW', $row);
        if (empty($row['description']) and $incomplete === false) {
            $xtpl->parse('main.loop.incomplete');
        }
        $xtpl->parse('main.loop');
    }
    if (empty($q) and $number >= 20) {
        $xtpl->parse('main.other');
    }
    $generate_page = nv_generate_page($base_url, $num_items, $per_page, $page);
    if (!empty($generate_page)) {
        $xtpl->assign('GENERATE_PAGE', $generate_page);
        $xtpl->parse('main.generate_page');
    }
    $xtpl->parse('main');
    $contents = $xtpl->text('main');
    if (empty($contents)) {
        $contents = '&nbsp;';
    }
    return $contents;
}
开发者ID:NukeVlad,项目名称:module-download,代码行数:53,代码来源:tags.php

示例5: np_comment

/**
 * np_comment()
 * 
 * @param mixed $type
 * @param mixed $id
 * @param mixed $page
 * @return
 */
function np_comment($type, $id, $commentenable, $page)
{
    global $db, $module_name, $module_data, $global_config, $module_config, $per_page_comment;
    $comment_array = array();
    $per_page = $per_page_comment = 20;
    $sql = "SELECT SQL_CALC_FOUND_ROWS a.cid, a.level, a.cmcount, a.content, a.like, a.dislike, a.user_like, a.user_dislike, a.post_time, a.post_name, a.post_email, b.userid, b.email, b.full_name, b.photo, b.view_mail FROM `" . NV_PREFIXLANG . "_" . $module_data . "_comment_" . $type . "` as a LEFT JOIN `" . NV_USERS_GLOBALTABLE . "` as b ON a.userid =b.userid  WHERE a.id= '" . $id . "' AND a.status=1 ORDER BY a.level ASC LIMIT " . $page . "," . $per_page;
    $comment = $db->sql_query($sql);
    $result_all = $db->sql_query("SELECT FOUND_ROWS()");
    list($all_page) = $db->sql_fetchrow($result_all);
    $commentid = 0;
    while (list($cid, $level, $cmcount, $content, $like, $dislike, $user_like, $user_dislike, $post_time, $post_name, $post_email, $userid, $user_email, $user_full_name, $photo, $view_mail) = $db->sql_fetchrow($comment)) {
        if ($userid > 0) {
            $post_email = $user_email;
            $post_name = $user_full_name;
        }
        //$post_email = ( $module_config[$module_name]['emailcomm'] and $view_mail ) ? $post_email : "";
        $comment_array[] = array("cid" => $cid, "level" => $level, "cmcount" => $cmcount, "content" => $content, "like" => $like, "dislike" => $dislike, "user_like" => $user_like, "user_dislike" => $user_dislike, "post_time" => $post_time, "userid" => $userid, "post_name" => $post_name, "post_email" => $post_email, "photo" => $photo);
    }
    $db->sql_freeresult($comment);
    unset($row, $comment);
    $base_url = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name . "&amp;" . NV_OP_VARIABLE . "=comment&amp;type=" . $type . "&amp;id=" . $id . "&cmable=" . $commentenable . "&checkss=" . md5($id . session_id() . $global_config['sitekey']);
    $generate_page = nv_generate_page($base_url, $all_page, $per_page, $page, true, true, 'nv_urldecode_ajax', 'showcomment');
    return array("comment" => $comment_array, "page" => $generate_page);
}
开发者ID:hoangvtien,项目名称:nphoto,代码行数:32,代码来源:global.functions.php

示例6: result_theme

/**
 * result_theme()
 * 
 * @param mixed $result_array
 * @param mixed $mod
 * @param mixed $mod_custom_title
 * @param mixed $key
 * @param mixed $ss
 * @param mixed $is_generate_page
 * @param mixed $pages
 * @param mixed $limit
 * @param mixed $all_page
 * @return
 */
function result_theme($result_array, $mod, $mod_custom_title, $key, $logic, $ss, $is_generate_page, $pages, $limit, $all_page)
{
    global $module_info, $module_file, $global_config, $lang_global, $lang_module, $db, $module_name;
    $xtpl = new XTemplate("result.tpl", NV_ROOTDIR . "/themes/" . $module_info['template'] . "/modules/" . $module_file);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('HIDDEN_KEY', $key);
    $xtpl->assign('SEARCH_RESULT_NUM', $all_page);
    $xtpl->assign('MODULE_CUSTOM_TITLE', $mod_custom_title);
    foreach ($result_array as $result) {
        $xtpl->assign('RESULT', $result);
        $xtpl->parse('main.result');
    }
    $base_url = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $module_name . "&amp;" . NV_OP_VARIABLE . "=adv&amp;search_query=" . rawurlencode($key) . "&amp;search_mod=" . $mod . "&amp;search_ss=" . $ss . "&amp;logic=" . $logic;
    if ($is_generate_page) {
        $generate_page = nv_generate_page($base_url, $all_page, $limit, $pages, true, true, 'nv_urldecode_ajax', 'search_result');
        if (!empty($generate_page)) {
            $xtpl->assign('GENERATE_PAGE', $generate_page);
            $xtpl->parse('main.generate_page');
        }
    } else {
        if ($all_page > $limit) {
            $xtpl->assign('MORE', "nv_search_viewall('" . $mod . "', " . NV_MIN_SEARCH_LENGTH . ", " . NV_MAX_SEARCH_LENGTH . ")");
            $xtpl->parse('main.more');
        }
    }
    $xtpl->parse('main');
    return $xtpl->text('main');
}
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:42,代码来源:theme.php

示例7: die

    die('Stop!!!');
}
$page_title = $lang_module['browser'];
$key_words = $module_info['keywords'];
$mod_title = $lang_module['browser'];
$sql = "SELECT COUNT(*), MAX(`c_count`) FROM `" . NV_COUNTER_TABLE . "` WHERE `c_type`='browser' AND `c_count`!=0";
$result = $db->sql_query($sql);
list($all_page, $max) = $db->sql_fetchrow($result);
if ($all_page) {
    $page = $nv_Request->get_int('page', 'get', 0);
    $per_page = 50;
    $base_url = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $module_name . "&amp;" . NV_OP_VARIABLE . "=allbrowsers";
    $sql = "SELECT `c_val`,`c_count`, `last_update` FROM `" . NV_COUNTER_TABLE . "` WHERE `c_type`='browser' AND `c_count`!=0 ORDER BY `c_count` DESC LIMIT " . $page . "," . $per_page;
    $result = $db->sql_query($sql);
    $browsers_list = array();
    while (list($browser, $count, $last_visit) = $db->sql_fetchrow($result)) {
        $last_visit = !empty($last_visit) ? nv_date("l, d F Y H:i", $last_visit) : "";
        $browsers_list[$browser] = array($count, $last_visit);
    }
    if (!empty($browsers_list)) {
        $cts = array();
        $cts['thead'] = array($lang_module['browser'], $lang_module['hits'], $lang_module['last_visit']);
        $cts['rows'] = $browsers_list;
        $cts['max'] = $max;
        $cts['generate_page'] = nv_generate_page($base_url, $all_page, $per_page, $page);
    }
}
$contents = call_user_func("allbrowsers");
include NV_ROOTDIR . "/includes/header.php";
echo nv_site_theme($contents);
include NV_ROOTDIR . "/includes/footer.php";
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:31,代码来源:allbrowsers.php

示例8: COUNT

$key_words = $module_info['keywords'];
$mod_title = $lang_module['os'];
$sql = "SELECT COUNT(*), MAX(c_count) FROM " . NV_COUNTER_GLOBALTABLE . " WHERE c_type='os' AND c_count!=0";
$result = $db->query($sql);
list($num_items, $max) = $result->fetch(3);
if ($num_items) {
    $page = $nv_Request->get_int('page', 'get', 1);
    $per_page = 50;
    $base_url = NV_BASE_MOD_URL . '&amp;' . NV_OP_VARIABLE . '=' . $module_info['alias']['allos'];
    $db->sqlreset()->select('c_val,c_count, last_update')->from(NV_COUNTER_GLOBALTABLE)->where("c_type='os' AND c_count!=0")->order('c_count DESC')->limit($per_page)->offset(($page - 1) * $per_page);
    $result = $db->query($db->sql());
    $os_list = array();
    while (list($os, $count, $last_visit) = $result->fetch(3)) {
        $last_visit = !empty($last_visit) ? nv_date('l, d F Y H:i', $last_visit) : '';
        $os_list[$os] = array($count, $last_visit);
    }
    if (!empty($os_list)) {
        $cts = array();
        $cts['thead'] = array($lang_module['os'], $lang_module['hits'], $lang_module['last_visit']);
        $cts['rows'] = $os_list;
        $cts['max'] = $max;
        $cts['generate_page'] = nv_generate_page($base_url, $num_items, $per_page, $page);
    }
    if ($page > 1) {
        $page_title .= ' ' . NV_TITLEBAR_DEFIS . ' ' . $lang_global['page'] . ' ' . $page;
    }
    $contents = nv_theme_statistics_allos($num_items, $os_list, $cts);
}
include NV_ROOTDIR . '/includes/header.php';
echo nv_site_theme($contents);
include NV_ROOTDIR . '/includes/footer.php';
开发者ID:nukeplus,项目名称:nuke,代码行数:31,代码来源:allos.php

示例9: search_result_theme

/**
 * search_result_theme()
 *
 * @param mixed $key
 * @param mixed $numRecord
 * @param mixed $per_pages
 * @param mixed $pages
 * @param mixed $array_content
 * @param mixed $url_link
 * @param mixed $catid
 * @return
 */
function search_result_theme($key, $numRecord, $per_pages, $pages, $array_content, $url_link, $catid)
{
    global $module_file, $module_info, $lang_module, $global_array_shops_cat, $pro_config;
    $xtpl = new XTemplate("search.tpl", NV_ROOTDIR . "/themes/" . $module_info['template'] . "/modules/" . $module_file);
    $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('KEY', $key);
    $xtpl->assign('TITLE_MOD', $lang_module['search_modul_title']);
    if (!empty($array_content)) {
        foreach ($array_content as $value) {
            $listcatid = explode(",", $value['listcatid']);
            $catid_i = $catid > 0 ? $catid : end($listcatid);
            $url = $global_array_shops_cat[$catid_i]['link'] . '/' . $value['alias'] . "-" . $value['id'];
            $value['hometext'] = nv_clean60($value['hometext'], 170);
            $xtpl->assign('LINK', $url);
            $xtpl->assign('TITLEROW', BoldKeywordInStr($value['title'], $key));
            $xtpl->assign('CONTENT', BoldKeywordInStr($value['hometext'], $key) . "...");
            $xtpl->assign('height', $pro_config['homeheight']);
            $xtpl->assign('width', $pro_config['homewidth']);
            $xtpl->assign('IMG_SRC', $value['homeimgthumb']);
            $xtpl->parse('results.result.result_img');
            if (defined('NV_IS_MODADMIN')) {
                $xtpl->assign('ADMINLINK', nv_link_edit_page($value['id']) . "&nbsp;-&nbsp;" . nv_link_delete_page($value['id']));
                $xtpl->parse('results.result.adminlink');
            }
            $xtpl->parse('results.result');
        }
    }
    if ($numRecord == 0) {
        $xtpl->assign('KEY', $key);
        $xtpl->assign('INMOD', $lang_module['search_modul_title']);
        $xtpl->parse('results.noneresult');
    }
    if ($numRecord > $per_pages) {
        $url_link = $_SERVER['REQUEST_URI'];
        $in = strpos($url_link, '&page');
        if ($in != 0) {
            $url_link = substr($url_link, 0, $in);
        }
        $generate_page = nv_generate_page($url_link, $numRecord, $per_pages, $pages);
        $xtpl->assign('VIEW_PAGES', $generate_page);
        $xtpl->parse('results.pages_result');
    }
    $xtpl->assign('MY_DOMAIN', NV_MY_DOMAIN);
    $xtpl->assign('NUMRECORD', $numRecord);
    $xtpl->parse('results');
    return $xtpl->text('results');
}
开发者ID:nukeplus,项目名称:shops,代码行数:60,代码来源:theme.php

示例10: search_result_theme

function search_result_theme($key, $numRecord, $per_pages, $page, $array_content, $catid)
{
    global $module_file, $module_info, $lang_module, $module_name, $module_upload, $global_photo_cat, $module_config, $global_config;
    $xtpl = new XTemplate('search.tpl', NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $module_file);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('KEY', $key);
    $xtpl->assign('TITLE_MOD', $lang_module['search_module_title']);
    if (!empty($array_content)) {
        foreach ($array_content as $value) {
            $xtpl->assign('LINK', $global_photo_cat[$value['category_id']]['link'] . '/' . $value['alias'] . "-" . $value['album_id'] . $global_config['rewrite_exturl']);
            $xtpl->assign('TITLEROW', strip_tags(BoldKeywordInStr($value['name'], $key)));
            if (!empty($value['description'])) {
                $xtpl->assign('CONTENT', BoldKeywordInStr($value['description'], $key) . "...");
            }
            $xtpl->assign('TIME', nv_date('H:i d/m/Y', $value['date_added']));
            $value['src'] = photos_thumbs($value['album_id'], $value['file'], $module_upload, $module_config[$module_name]['cr_thumb_width'], $module_config[$module_name]['cr_thumb_height'], $module_config[$module_name]['cr_thumb_quality']);
            if (!empty($value['src'])) {
                $xtpl->assign('IMG_SRC', $value['src']);
                $xtpl->parse('results.result.result_img');
            }
            $xtpl->parse('results.result');
        }
    }
    if ($numRecord == 0) {
        $xtpl->assign('KEY', $key);
        $xtpl->assign('INMOD', $lang_module['search_modul_title']);
        $xtpl->parse('results.noneresult');
    }
    if ($numRecord > $per_pages) {
        $url_link = $_SERVER['REQUEST_URI'];
        if (strpos($url_link, '&page=') > 0) {
            $url_link = substr($url_link, 0, strpos($url_link, '&page='));
        } elseif (strpos($url_link, '?page=') > 0) {
            $url_link = substr($url_link, 0, strpos($url_link, '?page='));
        }
        $_array_url = array('link' => $url_link, 'amp' => '&page=');
        $generate_page = nv_generate_page($_array_url, $numRecord, $per_pages, $page);
        $xtpl->assign('VIEW_PAGES', $generate_page);
        $xtpl->parse('results.pages_result');
    }
    $xtpl->assign('NUMRECORD', $numRecord);
    $xtpl->assign('MY_DOMAIN', NV_MY_DOMAIN);
    $xtpl->parse('results');
    return $xtpl->text('results');
}
开发者ID:hoangvtien,项目名称:module-photos,代码行数:45,代码来源:theme.php

示例11: nv_show_sources_list

/**
 * nv_show_sources_list()
 * 
 * @return
 */
function nv_show_sources_list()
{
    global $db, $lang_module, $lang_global, $module_name, $module_data, $nv_Request, $module_file, $global_config;
    $num = $db->sql_numrows($db->sql_query("SELECT * FROM `" . NV_PREFIXLANG . "_" . $module_data . "_sources` ORDER BY `weight` ASC"));
    $base_url = NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_data . "&amp;" . NV_OP_VARIABLE . "=sources";
    $all_page = $num > 1 ? $num : 1;
    $per_page = 15;
    $page = $nv_Request->get_int('page', 'get', 0);
    $xtpl = new XTemplate("sources_list.tpl", NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/modules/" . $module_file);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('GLANG', $lang_global);
    if ($num > 0) {
        $a = 0;
        $result = $db->sql_query("SELECT * FROM `" . NV_PREFIXLANG . "_" . $module_data . "_sources` ORDER BY `weight` LIMIT {$page}, {$per_page}");
        while ($row = $db->sql_fetchrow($result)) {
            $xtpl->assign('ROW', array("class" => $a % 2 ? " class=\"second\"" : "", "sourceid" => $row['sourceid'], "title" => $row['title'], "link" => $row['link'], "url_edit" => NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&amp;" . NV_OP_VARIABLE . "=sources&amp;sourceid=" . $row['sourceid'] . "#edit"));
            for ($i = 1; $i <= $num; ++$i) {
                $xtpl->assign('WEIGHT', array("key" => $i, "title" => $i, "selected" => $i == $row['weight'] ? " selected=\"selected\"" : ""));
                $xtpl->parse('main.loop.weight');
            }
            $xtpl->parse('main.loop');
            ++$a;
        }
        $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');
        }
        $xtpl->parse('main');
        $contents = $xtpl->text('main');
    } else {
        $contents = "&nbsp;";
    }
    $db->sql_freeresult();
    return $contents;
}
开发者ID:atarubi,项目名称:nuke-viet,代码行数:41,代码来源:admin.functions.php

示例12: md5

        $xtpl->assign('link_del', NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=or_del&order_id=" . $row['order_id'] . "&checkss=" . md5($row['order_id'] . $global_config['sitekey'] . session_id()));
        $xtpl->parse('main.data.row.delete');
        $xtpl->assign('DIS', '');
    } else {
        $xtpl->assign('DIS', 'disabled="disabled"');
    }
    if ($row['order_view'] == '0') {
        $xtpl->parse('main.data.row.bgview');
    }
    $xtpl->parse('main.data.row');
    ++$count;
}
$xtpl->assign('URL_CHECK_PAYMENT', NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=checkpayment");
$xtpl->assign('URL_DEL', NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=or_del");
$xtpl->assign('URL_DEL_BACK', NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=" . $op);
$xtpl->assign('PAGES', nv_generate_page($base_url, $num_items, $per_page, $page));
$xtpl->parse('main.data');
foreach ($transaction_status as $key => $lang_status) {
    $xtpl->assign('TRAN_STATUS', array('key' => $key, 'title' => $lang_status, 'selected' => (isset($search['order_payment']) and $key == $search['order_payment']) ? 'selected="selected"' : ''));
    $xtpl->parse('main.transaction_status');
}
if (!empty($search['date_from'])) {
    $search['date_from'] = nv_date('d/m/Y', $search['date_from']);
}
if (!empty($search['date_to'])) {
    $search['date_to'] = nv_date('d/m/Y', $search['date_to']);
}
$order_info['sum_unit'] = $pro_config['money_unit'];
$order_info['sum_price'] = nv_number_format($order_info['sum_price'], nv_get_decimals($pro_config['money_unit']));
$xtpl->assign('ORDER_INFO', $order_info);
$xtpl->assign('CHECKSESS', md5(session_id()));
开发者ID:hoangvtien,项目名称:module-shops,代码行数:31,代码来源:order.php

示例13: switch

}
$page = $nv_Request->get_int('page', 'get', 0);
$per_page = 10;
switch ($search_option) {
    case 1:
        $query .= " ORDER BY `email` ASC LIMIT " . $page . "," . $per_page;
        break;
    case 2:
        $query .= " ORDER BY `userid` ASC LIMIT " . $page . "," . $per_page;
        break;
    default:
        $query .= " ORDER BY `username` ASC LIMIT " . $page . "," . $per_page;
}
$result = $db->sql_query($query);
$search_result = array();
$search_result['caption'] = $lang_module['search_result_caption'];
$search_result['thead'] = array("UserId", $lang_global['nickname'], $lang_global['full_name'], $lang_global['email'], $lang_global['regdate'], $lang_global['last_login']);
$search_result['action'] = NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&amp;" . NV_OP_VARIABLE . "=edit&amp;userid=";
while ($row = $db->sql_fetchrow($result)) {
    $search_result['row'][$row['userid']]['username'] = $row['username'];
    $search_result['row'][$row['userid']]['full_name'] = $row['full_name'];
    $search_result['row'][$row['userid']]['email'] = nv_EncodeEmail($row['email']);
    $search_result['row'][$row['userid']]['regdate'] = nv_date("l, d/m/Y H:i", $row['regdate']);
    $search_result['row'][$row['userid']]['last_login'] = !empty($row['last_login']) ? nv_date("l, d/m/Y H:i", $row['last_login']) : $lang_global['never'];
    $search_result['row'][$row['userid']]['onclick'] = array("nv_group_add_user(" . $group_id . "," . $row['userid'] . ")", sprintf($lang_module['add_user'], $row['full_name'], $group_title));
}
$search_result['generate_page'] = nv_generate_page($base_url, $all_page, $per_page, $page, true, true, 'nv_urldecode_ajax', 'search_users_result');
$contents = nv_admin_search_users_theme($search_result);
include NV_ROOTDIR . "/includes/header.php";
echo $contents;
include NV_ROOTDIR . "/includes/footer.php";
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:31,代码来源:groups_search_users.php

示例14: array_keys

                                    $array[$id]['post_name'] .= " (" . $array[$id]['post_email'] . ", " . $array[$id]['post_ip'] . ")";
                                } else {
                                    $array[$id]['post_email'] = "";
                                }
                            }
                        }
                    }
                }
                if (!empty($admins)) {
                    $in = array_keys($admins);
                    $in = array_unique($in);
                    $in = implode(",", $in);
                    $query = "SELECT `userid` AS admin_id, `username` AS admin_login, `full_name` AS admin_name FROM `" . NV_USERS_GLOBALTABLE . "` WHERE `userid` IN (" . $in . ")";
                    $result = $db->sql_query($query);
                    while (list($admin_id, $admin_login, $admin_name) = $db->sql_fetchrow($result)) {
                        $admin_name = !empty($admin_name) ? $admin_name : $admin_login;
                        if (isset($admins[$admin_id])) {
                            foreach ($admins[$admin_id] as $id) {
                                $array[$id]['admin_reply'] = $lang_module['comment_admin_note'] . " <a href=\"" . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=authors&amp;id=" . $admin_id . "\">" . $admin_name . "</a>: " . $array[$id]['admin_reply'];
                            }
                        }
                    }
                }
                $generate_page = nv_generate_page($base_url, $all_page, $per_page, $page, true, true, 'nv_urldecode_ajax', 'list_comments');
            }
            $contents = show_comment($array, $generate_page);
            die($contents);
        }
    }
    die($lang_module['comment_error7']);
}
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:31,代码来源:getcomment.php

示例15: nv_show_sources_list

function nv_show_sources_list()
{
    global $db, $db_config, $lang_module, $lang_global, $module_name, $module_data, $op, $nv_Request;
    $contents = "";
    $num = $db->sql_numrows($db->sql_query("SELECT * FROM `" . NV_PREFIXLANG . "_" . $module_data . "_sources` ORDER BY `weight` ASC"));
    $base_url = NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_data . "&" . NV_OP_VARIABLE . "=sources";
    $all_page = $num > 1 ? $num : 1;
    $per_page = 15;
    $page = $nv_Request->get_int('page', 'get', 0);
    if ($num > 0) {
        $contents .= "<table class=\"tab1\">\n";
        $contents .= "<thead>\n";
        $contents .= "<tr align=\"center\">\n";
        $contents .= "<td style=\"width:60px;\">" . $lang_module['weight'] . "</td>\n";
        $contents .= "<td>" . $lang_module['name'] . "</td>\n";
        $contents .= "<td>" . $lang_module['link'] . "</td>\n";
        $contents .= "<td style=\"width:120px;\"></td>\n";
        $contents .= "</tr>\n";
        $contents .= "</thead>\n";
        $a = 0;
        $result = $db->sql_query("SELECT * FROM `" . NV_PREFIXLANG . "_" . $module_data . "_sources` ORDER BY `weight` LIMIT {$page}, {$per_page}");
        while ($row = $db->sql_fetchrow($result)) {
            $class = $a % 2 ? " class=\"second\"" : "";
            $contents .= "<tbody" . $class . ">\n";
            $contents .= "<tr>\n";
            $contents .= "<td align=\"center\"><select id=\"id_weight_" . $row['sourceid'] . "\" onchange=\"nv_chang_sources('" . $row['sourceid'] . "','weight');\">\n";
            for ($i = 1; $i <= $num; $i++) {
                $contents .= "<option value=\"" . $i . "\"" . ($i == $row['weight'] ? " selected=\"selected\"" : "") . ">" . $i . "</option>\n";
            }
            $contents .= "</select></td>\n";
            $contents .= "<td>" . $row['title'] . "</td>\n";
            $contents .= "<td>" . $row['link'] . "</td>\n";
            $contents .= "<td align=\"center\"><span class=\"edit_icon\"><a href=\"" . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=sources&amp;sourceid=" . $row['sourceid'] . "#edit\">" . $lang_global['edit'] . "</a></span>\n";
            $contents .= "&nbsp;-&nbsp;<span class=\"delete_icon\"><a href=\"javascript:void(0);\" onclick=\"nv_del_source(" . $row['sourceid'] . ")\">" . $lang_global['delete'] . "</a></span></td>\n";
            $contents .= "</tr>\n";
            $contents .= "</tbody>\n";
            $a++;
        }
        $contents .= "</table>\n";
        $contents .= nv_generate_page($base_url, $all_page, $per_page, $page);
    }
    $db->sql_freeresult();
    return $contents;
}
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:44,代码来源:admin.functions.php


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