/**
 * 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;
}
Example #2
0
/**
 * 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');
}
Example #3
0
/**
 * 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);
    }
}
Example #4
0
/**
 * 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;
}
Example #5
0
/**
 * 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);
}
Example #6
0
/**
 * 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');
}
    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";
Example #8
0
$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';
Example #9
0
/**
 * 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');
}
Example #10
0
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');
}
Example #11
0
/**
 * 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;
}
Example #12
0
        $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()));
}
$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";
                                    $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']);
}
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;
}
Example #16
0
function search_result_theme($key, $numRecord, $per_pages, $pages, $array_content, $url_link, $catid)
{
    global $module_file, $module_info, $global_config, $lang_global, $lang_module, $db, $module_name, $global_array_cat;
    $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_modul_title']);
    if (!empty($array_content)) {
        foreach ($array_content as $value) {
            $catid_i = $catid > 0 ? $catid : end(explode(",", $value['listcatid']));
            $url = $global_array_cat[$catid_i]['link'] . '/' . $value['alias'] . "-" . $value['id'];
            $xtpl->assign('LINK', $url);
            $xtpl->assign('TITLEROW', BoldKeywordInStr($value['title'], $key));
            $xtpl->assign('CONTENT', BoldKeywordInStr($value['hometext'], $key) . "...");
            $xtpl->assign('AUTHOR', date('d/m/Y', $value['publtime']) . " - " . BoldKeywordInStr($value['author'], $key));
            $xtpl->assign('SOURCE', BoldKeywordInStr(GetSourceNews($value['sourceid']), $key));
            $img = "uploads/" . $module_name . "/" . $value['homeimgfile'];
            if (file_exists(NV_ROOTDIR . "/" . $img)) {
                if (is_file(NV_ROOTDIR . "/" . $img)) {
                    $xtpl->assign('IMG_SRC', NV_BASE_SITEURL . $img);
                    $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) {
        // show 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');
}
/**
 * shops_show_location_list()
 *
 * @param integer $parentid
 * @return
 */
function shops_show_location_list($parentid = 0, $page, $per_page, $base_url)
{
    global $db, $db_config, $lang_module, $lang_global, $module_name, $module_data, $op, $array_viewcat_nosub, $module_file, $global_config;
    $xtpl = new XTemplate("location_lists.tpl", NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/modules/" . $module_file);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('GLANG', $lang_global);
    $xtpl->assign('NV_BASE_ADMINURL', NV_BASE_ADMINURL);
    $xtpl->assign('NV_NAME_VARIABLE', NV_NAME_VARIABLE);
    $xtpl->assign('NV_OP_VARIABLE', NV_OP_VARIABLE);
    $xtpl->assign('MODULE_NAME', $module_name);
    $xtpl->assign('OP', $op);
    if ($parentid > 0) {
        $parentid_i = $parentid;
        $array_location_title = array();
        $a = 0;
        while ($parentid_i > 0) {
            list($id_i, $parentid_i, $title_i) = $db->query("SELECT id, parentid, title FROM " . $db_config['prefix'] . "_" . $module_data . "_location WHERE id=" . intval($parentid_i))->fetch(3);
            $array_location_title[] = "<a href=\"" . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=location&amp;parentid=" . $id_i . "\"><strong>" . $title_i . "</strong></a>";
            ++$a;
        }
        $array_location_title[] = "<a href=\"" . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=location\"><strong>" . $lang_module['location'] . "</strong></a>";
        for ($i = $a; $i >= 0; $i--) {
            $xtpl->assign('LOCATION_NAV', $array_location_title[$i] . ($i > 0 ? " &raquo; " : ""));
            $xtpl->parse('main.locationnav.loop');
        }
        $xtpl->parse('main.locationnav');
    }
    // Fetch Limit
    $db->sqlreset()->select('COUNT(*)')->from($db_config['prefix'] . '_' . $module_data . '_location')->where('parentid = ' . $parentid);
    $all_page = $db->query($db->sql())->fetchColumn();
    $db->select('id, parentid, title, weight, numsub')->order('weight ASC')->limit($per_page)->offset(($page - 1) * $per_page);
    $result = $db->query($db->sql());
    if ($result->rowCount()) {
        while (list($id, $parentid, $title, $weight, $numsub) = $result->fetch(3)) {
            $xtpl->assign('ROW', array("id" => $id, "location_link" => NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&amp;" . NV_OP_VARIABLE . "=location&amp;parentid=" . $id, "title" => $title, "numsub" => $numsub > 0 ? " <span style=\"color:#FF0101;\">(" . $numsub . ")</span>" : "", "parentid" => $parentid));
            for ($i = 1; $i <= $all_page; $i++) {
                $xtpl->assign('OPTION', array("key" => $i, "title" => $i, "selected" => $i == $weight ? " selected=\"selected\"" : ""));
                $xtpl->parse('main.data.loop.weight');
            }
            $xtpl->parse('main.data.loop');
        }
        $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.data.generate_page');
        }
        $xtpl->parse('main.data');
    }
    $result->closeCursor();
    unset($sql, $result);
    $xtpl->parse('main');
    return $xtpl->text('main');
}
Example #18
0
$page = $nv_Request->get_int('page', 'get', 1);
$per_page = 50;
$db->where('*')->order('click_time DESC')->limit($per_page)->offset(($page - 1) * $per_page);
$result = $db->query($db->sql());
$contents = array();
$replacement = '';
$a = 0;
while ($row = $result->fetch()) {
    $contents['rows'][$a][] = nv_date('d/m/Y H:i', $row['click_time']);
    $contents['rows'][$a][] = $row['click_ip'];
    $contents['rows'][$a][] = isset($countries[$row['click_country']]) ? $countries[$row['click_country']][1] : $row['click_country'];
    $contents['rows'][$a][] = $row['click_browse_name'];
    $contents['rows'][$a][] = $row['click_os_name'];
    $contents['rows'][$a][] = !empty($row['click_ref']) ? "<a href=\"" . $row['click_ref'] . "\">" . $lang_module['select'] . "</a>" : "";
    if ($data_ext == 'browse' and empty($replacement)) {
        $replacement = $row['click_browse_name'];
    } elseif ($data_ext == 'os' and empty($replacement)) {
        $replacement = $row['click_os_name'];
    }
    ++$a;
}
if (!empty($replacement)) {
    $caption = preg_replace('/\\{pattern\\}/', $replacement, $caption);
}
$contents['caption'] = $caption;
$contents['thead'] = array($lang_module['click_date'], $lang_module['click_ip'], $lang_module['click_country'], $lang_module['click_browse'], $lang_module['click_os'], $lang_module['click_ref']);
$contents['generate_page'] = nv_generate_page($base_url, $num_items, $per_page, $page, true, true, 'nv_urldecode_ajax', 'statistic');
$contents = nv_show_list_stat_theme($contents);
include NV_ROOTDIR . '/includes/header.php';
echo $contents;
include NV_ROOTDIR . '/includes/footer.php';
Example #19
0
            $file['data'] .= '|' . $file['ext'] . '|' . $file['type'] . '|' . nv_convertfromBytes($file['filesize']) . '|' . $file['userid'] . '|' . nv_date('l, d F Y, H:i:s P', $file['mtime']) . '|';
            $file['data'] .= empty($q) ? '' : $file['dirname'];
            $file['data'] .= '|' . $file['mtime'];
            $file['is_img'] = $file['type'] == 'image' ? 'true' : 'false';
            $file['sel'] = in_array($file['title'], $selectfile) ? ' imgsel' : '';
            $file['src'] = NV_BASE_SITEURL . $file['src'] . '?' . $file['mtime'];
            $file['nameLong'] = substr($file['title'], 0, 0 - strlen($file['ext']) - 1);
            if (strlen($file['nameLong']) >= 30) {
                $file['nameLong'] = substr($file['nameLong'], 0, 28) . '..';
            }
            $file['nameLong'] = $file['nameLong'] . '.' . $file['ext'];
            $xtpl->assign('IMG', $file);
            $xtpl->parse('main.loopimg');
        }
        if (!empty($selectfile)) {
            $xtpl->assign('NV_CURRENTTIME', NV_CURRENTTIME);
            $xtpl->parse('main.imgsel');
        }
        if ($num_items > $per_page) {
            $generate_page = nv_generate_page($base_url, $num_items, $per_page, $page, true, true, 'nv_urldecode_ajax', 'imglist');
            $xtpl->assign('GENERATE_PAGE', $generate_page);
            $xtpl->parse('main.generate_page');
        }
        $xtpl->parse('main');
        $contents = $xtpl->text('main');
        include NV_ROOTDIR . '/includes/header.php';
        echo $contents;
        include NV_ROOTDIR . '/includes/footer.php';
    }
}
exit;
Example #20
0
    if (!nv_is_url($rs['thumb_name']) && $rs['thumb_name'] != "") {
        $rs['thumb_name'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . "/" . $module_name . "/" . $rs['thumb_name'];
        $rs['path'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . "/" . $module_name . "/" . $rs['path'];
    } else {
        $rs['thumb_name'] = NV_BASE_SITEURL . "themes/" . $global_config['site_theme'] . "/images/" . $module_name . "/no_image.gif";
    }
    for ($j = 0; $j < $num; $j++) {
        $xtpl->assign('VAL', $j + 1);
        if ($j == $i) {
            $xtpl->assign('SELECT', 'selected="selected"');
        } else {
            $xtpl->assign('SELECT', '');
        }
        $xtpl->parse('main.row.sel.sel_op');
    }
    $xtpl->assign('SEL_W', $rs['weight']);
    $xtpl->parse('main.row.sel');
    $xtpl->assign('SRC', $rs['thumb_name']);
    $xtpl->assign('SRC_LAGE', $rs['path']);
    $xtpl->assign('URL_DEL_ONE', $link_del_one . "&id=" . $rs['pictureid']);
    $xtpl->assign('URL_EDIT', $link_edit . "&id=" . $rs['pictureid']);
    $xtpl->parse('main.row');
    $i++;
}
$list_pages = nv_generate_page($base_url, $all_page, $per_page, $page);
$xtpl->assign('PAGES', $list_pages);
$xtpl->parse('main');
$contents = $xtpl->text('main');
include NV_ROOTDIR . "/includes/header.php";
echo nv_admin_theme($contents);
include NV_ROOTDIR . "/includes/footer.php";
Example #21
0
    $db->select('*')->order('weight ASC')->limit($per_page)->offset(($page - 1) * $per_page);
    $sth = $db->prepare($db->sql());
    $sth->execute();
}
if ($show_view) {
    if ($num_items > 0) {
        while ($row = $sth->fetch()) {
            $language = unserialize($row['language']);
            $xtpl->assign('ROW', array('fid' => $row['fid'], 'field' => $row['field'], 'field_lang' => isset($language[NV_LANG_DATA]) ? $language[NV_LANG_DATA][0] : '', 'field_type' => $array_field_type[$row['field_type']]));
            for ($i = 1; $i <= $num_items; ++$i) {
                $xtpl->assign('WEIGHT', array('key' => $i, 'title' => $i, 'selected' => $i == $row['weight'] ? ' selected="selected"' : ''));
                $xtpl->parse('main.data.loop.weight');
            }
            $xtpl->parse('main.data.loop');
        }
        $xtpl->assign('NV_GENERATE_PAGE', nv_generate_page($base_url, $num_items, $per_page, $page));
        $xtpl->parse('main.data');
    }
}
$fid = $nv_Request->get_int('fid', 'get,post', 0);
if (!isset($dataform)) {
    if ($fid) {
        $dataform = $db->query('SELECT * FROM ' . $db_config['prefix'] . '_' . $module_data . '_field WHERE fid=' . $fid)->fetch();
        if (!empty($dataform['field_choices'])) {
            $field_choices = unserialize($dataform['field_choices']);
        }
        if (!empty($dataform['language'])) {
            $language = unserialize($dataform['language']);
            if (isset($language[NV_LANG_DATA])) {
                $dataform['title'] = $language[NV_LANG_DATA][0];
                $dataform['description'] = $language[NV_LANG_DATA][1];
Example #22
0
$id = $nv_Request->get_int('id', 'get,post', 0);
$showdata = $nv_Request->get_int('showdata', 'get,post', 0);
if ($showdata == 1) {
    $contents = '';
    $array_data = array();
    $page = $nv_Request->get_int('page', 'get', 1);
    $per_page = 4;
    $base_url = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=review&amp;id=' . $id . '&amp;showdata=1';
    $db->sqlreset()->select('COUNT(*)')->from($db_config['prefix'] . "_" . $module_data . "_review")->where("product_id=" . $id . " AND status=1");
    $all_page = $db->query($db->sql())->fetchColumn();
    $db->select('*')->order('review_id DESC')->limit($per_page)->offset(($page - 1) * $per_page);
    $_query = $db->query($db->sql());
    while ($row = $_query->fetch()) {
        $array_data[$row['review_id']] = $row;
    }
    $generate_page = nv_generate_page($base_url, $all_page, $per_page, $page, true, true, 'nv_urldecode_ajax', 'rate_list');
    $xtpl = new XTemplate("review_list.tpl", NV_ROOTDIR . "/themes/" . $module_info['template'] . "/modules/" . $module_file);
    $xtpl->assign('LANG', $lang_module);
    if (!empty($array_data)) {
        foreach ($array_data as $data) {
            $data['add_time'] = nv_date('H:i d/m/Y', $data['add_time']);
            $xtpl->assign('DATA', $data);
            for ($i = 1; $i <= $data['rating']; $i++) {
                $xtpl->parse('main.rate_data.loop.star');
            }
            if (!empty($data['content'])) {
                $xtpl->parse('main.rate_data.loop.content');
            }
            $xtpl->parse('main.rate_data.loop');
        }
        if (!empty($generate_page)) {
Example #23
0
        }
        $row['install_link'] = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=install&amp;id=' . $row['id'];
        $row['detail_link'] = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=detail&amp;id=' . $row['id'];
        $row['detail_title'] = sprintf($lang_module['detail_title'], $row['title']);
        $xtpl->assign('ROW', $row);
        // Parse rating
        for ($i = 1; $i <= 5; $i++) {
            $xtpl->assign('STAR', $row['rating_avg'] == $i ? " active" : "");
            $xtpl->parse('main.data.loop.star');
        }
        // Tuong thich moi cho cai dat
        if (!empty($row['compatible'])) {
            $xtpl->parse('main.data.loop.install');
        }
        $xtpl->parse('main.data.loop');
    }
    if (!empty($array['pagination']['all_page'])) {
        $base_url = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;mode=' . $request['mode'] . '&amp;q=' . urlencode($request['q']);
        $generate_page = nv_generate_page($base_url, intval($array['pagination']['all_page']), $request['per_page'], $request['page']);
        if (!empty($generate_page)) {
            $xtpl->assign('GENERATE_PAGE', $generate_page);
            $xtpl->parse('main.data.generate_page');
        }
    }
    $xtpl->parse('main.data');
}
$xtpl->parse('main');
$contents = $xtpl->text('main');
include NV_ROOTDIR . '/includes/header.php';
echo nv_admin_theme($contents);
include NV_ROOTDIR . '/includes/footer.php';
Example #24
0
            $array_cat = array();
            $array_cat = GetCatidInParent($catid, true);
            $where = ' t1.listcatid IN (' . implode(',', $array_cat) . ')';
        }
        if ($array_url_group or !empty($array_id_group)) {
            $db->sqlreset()->select('COUNT(*)')->from($db_config['prefix'] . '_' . $module_data . '_rows t1')->where($where . ' AND t1.status =1' . $_sql);
        } else {
            $db->sqlreset()->select('COUNT(*)')->from($db_config['prefix'] . '_' . $module_data . '_rows t1')->where($where . ' AND t1.status =1');
        }
        $num_items = $db->query($db->sql())->fetchColumn();
        $db->select('t1.id, t1.listcatid, t1.publtime, t1.' . NV_LANG_DATA . '_title, t1.' . NV_LANG_DATA . '_alias, t1.' . NV_LANG_DATA . '_hometext, t1.homeimgalt, t1.homeimgfile, t1.homeimgthumb, t1.product_code, t1.product_number, t1.product_price, t1.money_unit, t1.discount_id, t1.showprice, t1.' . NV_LANG_DATA . '_gift_content, t1.gift_from, t1.gift_to, t2.newday, t2.image')->join('INNER JOIN ' . $db_config['prefix'] . '_' . $module_data . '_catalogs t2 ON t2.catid = t1.listcatid')->order($orderby)->limit($per_page)->offset(($page - 1) * $per_page);
        $result = $db->query($db->sql());
        $data_content = GetDataIn($result, $catid);
        $data_content['count'] = $num_items;
        $base_url = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=' . $op . '&amp;ajax=1&amp;catid=' . $catid . '&amp;listgroupid=' . $listgroupid;
        $pages = nv_generate_page($base_url, $num_items, $per_page, $page, true, true, 'nv_urldecode_ajax', 'category');
        if (empty($array_url_group) and !$ajax) {
            $base_url = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=' . $global_array_shops_cat[$catid]['alias'];
            $pages = nv_alias_page($page_title, $base_url, $num_items, $per_page, $page);
        }
        if (sizeof($data_content['data']) < 1 and $page > 1) {
            Header('Location: ' . nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name, true));
            exit;
        }
        $contents = call_user_func($global_array_shops_cat[$catid]['viewcat'], $data_content, $compare_id, $pages, $sorts, $viewtype);
    }
    if (!defined('NV_IS_MODADMIN') and $contents != '' and $cache_file != '' and !$ajax) {
        $nv_Cache->setItem($module_name, $cache_file, $contents);
    }
}
if ($page > 1) {
Example #25
0
function search_result_theme($key, $numRecord, $per_pages, $page, $array_content, $catid)
{
    global $module_file, $module_info, $lang_module, $module_name, $global_array_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('IMG_WIDTH', $module_config[$module_name]['homewidth']);
    $xtpl->assign('TITLE_MOD', $lang_module['search_modul_title']);
    if (!empty($array_content)) {
        foreach ($array_content as $value) {
            $catid_i = $value['catid'];
            $xtpl->assign('LINK', $global_array_cat[$catid_i]['link'] . '/' . $value['alias'] . "-" . $value['id'] . $global_config['rewrite_exturl']);
            $xtpl->assign('TITLEROW', strip_tags(BoldKeywordInStr($value['title'], $key)));
            $xtpl->assign('CONTENT', BoldKeywordInStr($value['hometext'], $key) . "...");
            $xtpl->assign('TIME', date('d/m/Y h:i:s A', $value['publtime']));
            $xtpl->assign('AUTHOR', BoldKeywordInStr($value['author'], $key));
            $xtpl->assign('SOURCE', BoldKeywordInStr(GetSourceNews($value['sourceid']), $key));
            if (!empty($value['homeimgfile'])) {
                $xtpl->assign('IMG_SRC', $value['homeimgfile']);
                $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');
}
Example #26
0
 while ($row = $result->fetch()) {
     $array_userid[$row['userid']] = $row;
 }
 $idsite = $global_config['idsite'] == $groupsList[$group_id]['idsite'] ? 0 : $global_config['idsite'];
 foreach ($group_users as $_type => $arr_userids) {
     $xtpl->assign('PTITLE', sprintf($lang_module[$_type . '_in_group_caption'], $title, number_format($array_number[$_type], 0, ',', '.')));
     foreach ($arr_userids as $_userid) {
         $row = $array_userid[$_userid];
         $row['full_name'] = nv_show_name_user($row['first_name'], $row['last_name'], $row['username']);
         $xtpl->assign('LOOP', $row);
         if ($group_id > 3 and ($idsite == 0 or $idsite == $row['idsite'])) {
             $xtpl->parse('listUsers.' . $_type . '.loop.tools');
         }
         $xtpl->parse('listUsers.' . $_type . '.loop');
     }
     $generate_page = nv_generate_page($base_url . '&type=' . $_type, $array_number[$_type], $per_page, $page, 'true', 'false', 'nv_urldecode_ajax', 'id_' . $_type);
     if (!empty($generate_page)) {
         $xtpl->assign('PAGE', $generate_page);
         $xtpl->parse('listUsers.' . $_type . '.page');
     }
     $xtpl->parse('listUsers.' . $_type);
 }
 if (empty($type) or $type == 'leaders') {
     // Đánh số lại số thành viên
     $numberusers = 0;
     if (isset($array_number['members'])) {
         $numberusers += $array_number['members'];
     }
     if (isset($array_number['leaders'])) {
         $numberusers += $array_number['leaders'];
     }
Example #27
0
                $db->query("UPDATE " . $db_config['prefix'] . "_" . $module_data . "_orders SET transaction_status=" . $transaction_status . ", transaction_id=" . $transaction_id . ", transaction_count=transaction_count+1 WHERE order_id=" . $order_id);
                // Cap nhat diem tich luy
                UpdatePoint($order_data);
                $db->query("UPDATE " . $db_config['prefix'] . "_" . $module_data . "_point SET point_total=point_total - " . $order_point . " WHERE userid=" . $userid);
                $db->query("INSERT INTO " . $db_config['prefix'] . "_" . $module_data . "_point_history(userid, order_id, point, time) VALUES (" . $userid . ", " . $order_id . ", -" . $order_point . ", " . NV_CURRENTTIME . ")");
            }
            nv_del_moduleCache($module_name);
            die('OK_' . $lang_module['payment_complete']);
        }
    }
}
$data_content['point'] = $point;
$data_content['money'] = $point * $pro_config['point_conversion'];
$data_content['money'] = nv_number_format($data_content['money'], nv_get_decimals($pro_config['money_unit']));
$data_content['money_unit'] = $pro_config['money_unit'];
// Lich su thuc hien
$db->sqlreset()->select('COUNT(*)')->from($db_config['prefix'] . '_' . $module_data . '_point_history t1')->join('INNER JOIN ' . $db_config['prefix'] . '_' . $module_data . '_orders t2 ON t1.order_id = t2.order_id')->where('userid = ' . $user_info['userid']);
$all_page = $db->query($db->sql())->fetchColumn();
$db->select('t1.*, t2.order_code')->order('id DESC')->limit($per_page)->offset(($page - 1) * $per_page);
$_query = $db->query($db->sql());
$link_module = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $module_name;
while ($row = $_query->fetch()) {
    $checkss = md5($row['order_id'] . $global_config['sitekey'] . session_id());
    $row['link'] = $link_module . "&amp;" . NV_OP_VARIABLE . "=payment&amp;order_id=" . $row['order_id'] . "&checkss=" . $checkss;
    $data_content['history'][] = $row;
}
$generate_page = nv_generate_page($base_url, $all_page, $per_page, $page);
$contents = call_user_func('point_info', $data_content, $generate_page);
include NV_ROOTDIR . '/includes/header.php';
echo nv_site_theme($contents);
include NV_ROOTDIR . '/includes/footer.php';
    die(error_info_theme($lang_module['error_group_not_found']));
}
$row = $db->sql_fetchrow($result);
$group_title = $row['title'];
if (!empty($row['users'])) {
    $page = $nv_Request->get_int('page', 'get', 0);
    $all_page = count(explode(",", $row['users']));
    $per_page = 10;
    $users_in_group = array();
    $users_in_group['caption'] = sprintf($lang_module['users_in_group_caption'], $group_title, $all_page);
    $users_in_group['thead'] = array("UserId", $lang_global['nickname'], $lang_global['full_name'], $lang_global['email'], $lang_global['regdate'], $lang_global['last_login']);
    $users_in_group['action'] = NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&amp;" . NV_OP_VARIABLE . "=edit&amp;userid=";
    $base_url = NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&amp;" . NV_OP_VARIABLE . "=groups_users&amp;group_id=" . $group_id;
    $query = "SELECT `userid`, `username`, `email`, `full_name`, `regdate`, `last_login` \r\n        FROM `" . NV_USERS_GLOBALTABLE . "` \r\n        WHERE `userid` IN (" . $row['users'] . ") \r\n        ORDER BY `username` ASC \r\n        LIMIT " . $page . "," . $per_page;
    $result = $db->sql_query($query);
    while ($row = $db->sql_fetchrow($result)) {
        $users_in_group['row'][$row['userid']]['username'] = $row['username'];
        $users_in_group['row'][$row['userid']]['full_name'] = $row['full_name'];
        $users_in_group['row'][$row['userid']]['email'] = nv_EncodeEmail($row['email']);
        $users_in_group['row'][$row['userid']]['regdate'] = nv_date("l, d/m/Y H:i", $row['regdate']);
        $users_in_group['row'][$row['userid']]['last_login'] = !empty($row['last_login']) ? nv_date("l, d/m/Y H:i", $row['last_login']) : $lang_global['never'];
        $users_in_group['row'][$row['userid']]['onclick'] = array("nv_group_exclude_user(" . $group_id . ", " . $row['userid'] . ")", sprintf($lang_module['exclude_user'], $row['full_name'], $group_title));
    }
    $users_in_group['generate_page'] = nv_generate_page($base_url, $all_page, $per_page, $page, true, true, 'nv_urldecode_ajax', 'list_users');
    $contents = main_list_users_theme($users_in_group);
    include NV_ROOTDIR . "/includes/header.php";
    echo $contents;
    include NV_ROOTDIR . "/includes/footer.php";
} else {
    die(error_info_theme($lang_module['error_users_not_found']));
}
Example #29
0
}
$a = 0;
foreach ($data as $data_i) {
    if (!empty($data_users[$data_i['userid']])) {
        $data_i['username'] = $data_users[$data_i['userid']];
    } else {
        $data_i['username'] = '******';
    }
    $data_i['custom_title'] = isset($site_mods[$data_i['module_name']]) ? $site_mods[$data_i['module_name']]['custom_title'] : (isset($admin_mods[$data_i['module_name']]) ? $admin_mods[$data_i['module_name']]['custom_title'] : $data_i['module_name']);
    $xtpl->assign('DATA', $data_i);
    if ($logs_del) {
        $xtpl->assign('DEL_URL', NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=log&amp;' . NV_OP_VARIABLE . '=logs_del&amp;id=' . $data_i['id']);
        $xtpl->parse('main.row.delete');
    }
    $xtpl->parse('main.row');
    ++$a;
}
if ($logs_del) {
    $xtpl->parse('main.foot_delete');
    $xtpl->parse('main.head_delete');
}
$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');
include NV_ROOTDIR . '/includes/header.php';
echo nv_admin_theme($contents);
include NV_ROOTDIR . '/includes/footer.php';
Example #30
0
    Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=coupons');
    die;
}
if ($nv_Request->isset_request('coupons_history', 'post,get')) {
    $page = $nv_Request->get_int('page', 'get', 1);
    $per_page = 20;
    $base_url = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=' . $op . '&coupons_history=1&id=' . $id;
    $array_history = array();
    $db->sqlreset()->select('COUNT(*)')->from($db_config['prefix'] . '_' . $module_data . '_coupons_history t1')->join('INNER JOIN ' . $db_config['prefix'] . '_' . $module_data . '_orders t2 ON t1.order_id = t2.order_id')->where('cid=' . $id);
    $all_page = $db->query($db->sql())->fetchColumn();
    $db->select('*')->order('date_added DESC')->limit($per_page)->offset(($page - 1) * $per_page);
    $_query = $db->query($db->sql());
    while ($row = $_query->fetch()) {
        $array_history[] = $row;
    }
    $generate_page = nv_generate_page($base_url, $all_page, $per_page, $page, true, true, 'nv_urldecode_ajax', 'coupons_history');
    $xtpl = new XTemplate($op . '.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $module_file);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('MONEY_UNIT', $pro_config['money_unit']);
    if (!empty($array_history)) {
        foreach ($array_history as $history) {
            $history['date_added'] = nv_date('H:i d/m/Y', $history['date_added']);
            $history['order_view'] = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=or_view&order_id=' . $history['order_id'];
            $xtpl->assign('DATA', $history);
            $xtpl->parse('coupons_history.loop');
        }
    }
    if (!empty($generate_page)) {
        $xtpl->assign('NV_GENERATE_PAGE', $generate_page);
        $xtpl->parse('coupons_history.generate_page');
    }