function validUserLog($array_user, $remember, $opid)
{
    global $db, $client_info, $crypt, $nv_Request;
    $remember = intval($remember);
    $checknum = nv_genpass(10);
    $checknum = $crypt->hash($checknum);
    $user = array('userid' => $array_user['userid'], 'checknum' => $checknum, 'current_agent' => $client_info['agent'], 'last_agent' => $array_user['last_agent'], 'current_ip' => $client_info['ip'], 'last_ip' => $array_user['last_ip'], 'current_login' => NV_CURRENTTIME, 'last_login' => intval($array_user['last_login']), 'last_openid' => $array_user['last_openid'], 'current_openid' => $opid);
    $user = nv_base64_encode(serialize($user));
    $db->sql_query("UPDATE `" . NV_USERS_GLOBALTABLE . "` SET \r\n    `checknum` = " . $db->dbescape($checknum) . ", \r\n    `last_login` = " . NV_CURRENTTIME . ", \r\n    `last_ip` = " . $db->dbescape($client_info['ip']) . ", \r\n    `last_agent` = " . $db->dbescape($client_info['agent']) . ", \r\n    `last_openid` = " . $db->dbescape($opid) . ", \r\n    `remember` = " . $remember . " \r\n    WHERE `userid`=" . $array_user['userid']);
    $live_cookie_time = $remember ? NV_LIVE_COOKIE_TIME : 0;
    $nv_Request->set_Cookie('nvloginhash', $user, $live_cookie_time);
}
Beispiel #2
0
/**
 * validUserLog()
 *
 * @param mixed $array_user
 * @param mixed $remember
 * @param mixed $opid
 * @return
 */
function validUserLog($array_user, $remember, $opid, $current_mode = 0)
{
    global $db, $db_config, $global_config, $nv_Request;
    $remember = intval($remember);
    $checknum = md5(nv_genpass(10));
    $user = array('userid' => $array_user['userid'], 'current_mode' => $current_mode, 'checknum' => $checknum, 'checkhash' => md5($array_user['userid'] . $checknum . $global_config['sitekey'] . NV_USER_AGENT), 'current_agent' => NV_USER_AGENT, 'last_agent' => $array_user['last_agent'], 'current_ip' => NV_CLIENT_IP, 'last_ip' => $array_user['last_ip'], 'current_login' => NV_CURRENTTIME, 'last_login' => intval($array_user['last_login']), 'last_openid' => $array_user['last_openid'], 'current_openid' => $opid);
    $user = nv_base64_encode(serialize($user));
    $stmt = $db->prepare("UPDATE " . NV_USERS_GLOBALTABLE . " SET\n\t\tchecknum = :checknum,\n\t\tlast_login = "******",\n\t\tlast_ip = :last_ip,\n\t\tlast_agent = :last_agent,\n\t\tlast_openid = :opid,\n\t\tremember = " . $remember . "\n\t\tWHERE userid=" . $array_user['userid']);
    $stmt->bindValue(':checknum', $checknum, PDO::PARAM_STR);
    $stmt->bindValue(':last_ip', NV_CLIENT_IP, PDO::PARAM_STR);
    $stmt->bindValue(':last_agent', NV_USER_AGENT, PDO::PARAM_STR);
    $stmt->bindValue(':opid', $opid, PDO::PARAM_STR);
    $stmt->execute();
    $live_cookie_time = $remember ? NV_LIVE_COOKIE_TIME : 0;
    $nv_Request->set_Cookie('nvloginhash', $user, $live_cookie_time);
}
/**
 * nv_html_site_js()
 *
 * @param bool $html
 * @return
 */
function nv_html_site_js($html = true)
{
    global $global_config, $module_info, $module_name, $module_file, $lang_global, $op, $client_info;
    $jsDef = "var nv_siteroot=\"" . NV_BASE_SITEURL . "\",nv_sitelang=\"" . NV_LANG_INTERFACE . "\",nv_name_variable=\"" . NV_NAME_VARIABLE . "\",nv_fc_variable=\"" . NV_OP_VARIABLE . "\",nv_lang_variable=\"" . NV_LANG_VARIABLE . "\",nv_module_name=\"" . $module_name . "\",nv_func_name=\"" . $op . "\",nv_is_user="******"NV_IS_USER") . ", nv_my_ofs=" . round(NV_SITE_TIMEZONE_OFFSET / 3600) . ",nv_my_abbr=\"" . nv_date("T", NV_CURRENTTIME) . "\",nv_cookie_prefix=\"" . $global_config['cookie_prefix'] . "\",nv_check_pass_mstime=" . (intval($global_config['user_check_pass_time']) - 62) * 1000 . ",nv_area_admin=0,theme_responsive=" . (int) ($global_config['current_theme_type'] == 'r');
    if (defined('NV_IS_DRAG_BLOCK')) {
        $jsDef .= ',drag_block=1,blockredirect="' . nv_base64_encode($client_info['selfurl']) . '",selfurl="' . $client_info['selfurl'] . '",block_delete_confirm="' . $lang_global['block_delete_confirm'] . '",block_outgroup_confirm="' . $lang_global['block_outgroup_confirm'] . '",blocks_saved="' . $lang_global['blocks_saved'] . '",blocks_saved_error="' . $lang_global['blocks_saved_error'] . '",post_url="' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=themes&' . NV_OP_VARIABLE . '=",func_id=' . $module_info['funcs'][$op]['func_id'] . ',module_theme="' . $global_config['module_theme'] . '"';
    }
    $jsDef .= ";";
    $return = array();
    $return[] = array('ext' => 0, 'content' => $jsDef);
    $return[] = array('ext' => 1, 'content' => NV_BASE_SITEURL . NV_ASSETS_DIR . "/js/jquery/jquery.min.js");
    $return[] = array('ext' => 1, 'content' => NV_BASE_SITEURL . NV_ASSETS_DIR . "/js/language/" . NV_LANG_INTERFACE . ".js");
    $return[] = array('ext' => 1, 'content' => NV_BASE_SITEURL . NV_ASSETS_DIR . "/js/global.js");
    if (defined('NV_IS_ADMIN')) {
        $return[] = array('ext' => 1, 'content' => NV_BASE_SITEURL . NV_ASSETS_DIR . "/js/admin.js");
    }
    // module js
    if (file_exists(NV_ROOTDIR . '/themes/' . $module_info['template'] . '/js/' . $module_file . '.js')) {
        $return[] = array('ext' => 1, 'content' => NV_BASE_SITEURL . 'themes/' . $module_info['template'] . '/js/' . $module_file . '.js');
    }
    if (defined('NV_EDITOR') and nv_function_exists('nv_add_editor_js')) {
        $editor_js = nv_add_editor_js();
        preg_match("/src\\s*=\\s*[\"']([^\"']+)[\"']/i", $editor_js, $matches);
        $return[] = array('ext' => 1, 'content' => $matches[1]);
    }
    if (defined('NV_IS_DRAG_BLOCK')) {
        $return[] = array('ext' => 1, 'content' => NV_BASE_SITEURL . NV_ASSETS_DIR . "/js/ui/jquery.ui.core.min.js");
        $return[] = array('ext' => 1, 'content' => NV_BASE_SITEURL . NV_ASSETS_DIR . "/js/ui/jquery.ui.sortable.min.js");
    }
    if (!$html) {
        return $return;
    }
    $res = "";
    foreach ($return as $js) {
        if ($js['ext'] == 1) {
            $res .= "<script src=\"" . $js['content'] . "\"></script>" . PHP_EOL;
        } else {
            $res .= "<script>" . PHP_EOL;
            $res .= $js['content'] . PHP_EOL;
            $res .= "</script>" . PHP_EOL;
        }
    }
    return $res;
}
Beispiel #4
0
 if (empty($array_register['first_name'])) {
     $array_register['first_name'] = $array_register['username'];
 }
 if ($global_config['allowuserreg'] == 2 or $global_config['allowuserreg'] == 3) {
     $sql = "INSERT INTO " . NV_USERS_GLOBALTABLE . "_reg (username, md5username, password, email, first_name, last_name, regdate, question, answer, checknum, users_info) VALUES (\n\t\t\t:username,\n\t\t\t:md5username,\n\t\t\t:password,\n\t\t\t:email,\n\t\t\t:first_name,\n\t\t\t:last_name,\n\t\t\t" . NV_CURRENTTIME . ",\n\t\t\t:your_question,\n\t\t\t:answer,\n\t\t\t:checknum,\n\t\t\t:users_info\n\t\t)";
     $data_insert = array();
     $data_insert['username'] = $array_register['username'];
     $data_insert['md5username'] = nv_md5safe($array_register['username']);
     $data_insert['password'] = $password;
     $data_insert['email'] = $array_register['email'];
     $data_insert['first_name'] = $array_register['first_name'];
     $data_insert['last_name'] = $array_register['last_name'];
     $data_insert['your_question'] = $your_question;
     $data_insert['answer'] = $array_register['answer'];
     $data_insert['checknum'] = $checknum;
     $data_insert['users_info'] = nv_base64_encode(serialize($query_field));
     $userid = $db->insert_id($sql, 'userid', $data_insert);
     if (!$userid) {
         die(reg_result(array('status' => 'error', 'input' => '', 'mess' => $lang_module['err_no_save_account'])));
     } else {
         if ($global_config['allowuserreg'] == 2) {
             $subject = $lang_module['account_active'];
             $message = sprintf($lang_module['account_active_info'], $array_register['first_name'], $global_config['site_name'], NV_MY_DOMAIN . NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=active&userid=' . $userid . '&checknum=' . $checknum, $array_register['username'], $array_register['email'], nv_date('H:i d/m/Y', NV_CURRENTTIME + 86400));
             $send = nv_sendmail($global_config['site_email'], $array_register['email'], $subject, $message);
             if ($send) {
                 $info = $lang_module['account_active_mess'];
             } else {
                 $info = $lang_module['account_active_mess_error_mail'];
             }
         } else {
             $info = $lang_module['account_register_to_admin'];
        $data_i = array_map("trim", explode("=", $data_i));
        $array[$data_i[0]] = $data_i[1];
    }
    if ($array['vpc_DRExists'] == "Y") {
        if ($array['vpc_TxnResponseCode'] == '0') {
            $nv_transaction_status = 4;
            // Giao dich thanh cong
        } else {
            $nv_transaction_status = 3;
            // Giao dich bi huy
        }
        $transaction_i = array();
        $transaction_i['nv_transaction_status'] = $nv_transaction_status;
        $transaction_i['amount'] = round((int) $array['vpc_Amount'] / 100);
        $transaction_i['created_time'] = $payment_data['created_time'];
        $transaction_i['vpc_MerchTxnRef'] = $array['vpc_MerchTxnRef'];
        $payment_data_new = nv_base64_encode(serialize($transaction_i));
        $payment_data_old = $order_data['payment_data'];
        if ($payment_data_new != $payment_data_old) {
            $payment_amount = $transaction_i['amount'];
            $payment_time = $payment_data['created_time'];
            $order_id = $array_order[$order_code]['order_id'];
            $payment_id = intval($array['vpc_TransactionNo']);
            $transaction_id = $db->insert_id("INSERT INTO " . $db_config['prefix'] . "_" . $module_data . "_transaction (transaction_id, transaction_time, transaction_status, order_id, userid, payment, payment_id, payment_time, payment_amount, payment_data) VALUES (NULL, " . NV_CURRENTTIME . ", '" . $nv_transaction_status . "', '" . $order_id . "', '0', '" . $payment . "', '" . $payment_id . "', '" . $payment_time . "', '" . $payment_amount . "', '" . $payment_data_new . "')");
            if ($transaction_id > 0) {
                $db->query("UPDATE " . $db_config['prefix'] . "_" . $module_data . "_orders SET transaction_status=" . $nv_transaction_status . " , transaction_id = " . $transaction_id . " , transaction_count = transaction_count+1 WHERE order_id=" . $order_id);
                $array_update_order[] = $order_code;
            }
        }
    }
}
Beispiel #6
0
    $xtpl->parse('listUsers');
    $xtpl->out('listUsers');
    exit;
}
//Danh sach thanh vien
if ($nv_Request->isset_request('userlist', 'get')) {
    $group_id = $nv_Request->get_int('userlist', 'get', 0);
    if (!isset($groupsList[$group_id]) or !($group_id < 4 or $group_id > 9)) {
        Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op);
        die;
    }
    $filtersql = ' userid NOT IN (SELECT userid FROM ' . NV_GROUPS_GLOBALTABLE . '_users WHERE group_id=' . $group_id . ')';
    if ($groupsList[$group_id]['idsite'] != $global_config['idsite'] and $groupsList[$group_id]['idsite'] == 0) {
        $filtersql .= ' AND idsite=' . $global_config['idsite'];
    }
    $xtpl->assign('FILTERSQL', nv_base64_encode($crypt->aes_encrypt($filtersql, md5($global_config['sitekey'] . $client_info['session_id']))));
    $xtpl->assign('GID', $group_id);
    if ($group_id > 9) {
        $xtpl->parse('userlist.adduser');
    }
    $xtpl->parse('userlist');
    $contents = $xtpl->text('userlist');
    include NV_ROOTDIR . '/includes/header.php';
    echo nv_admin_theme($contents);
    include NV_ROOTDIR . '/includes/footer.php';
}
//Them + sua nhom
if ($nv_Request->isset_request('add', 'get') or $nv_Request->isset_request('edit, id', 'get')) {
    if (defined('NV_IS_SPADMIN')) {
        $post = array();
        $post['id'] = $nv_Request->get_int('id', 'get');
Beispiel #7
0
/**
 * @param string $module
 * @param integer $area
 * @param integer $id
 * @param int $allowed_comm
 * @param string $checkss
 * @param string $comment
 * @param int $sortcomm
 * @param string $base_url
 * @param boolean $form_login
 * @param int $status_comment
 * @return string
 */
function nv_theme_comment_module($module, $area, $id, $allowed_comm, $checkss, $comment, $sortcomm, $base_url, $form_login, $status_comment = '')
{
    global $global_config, $module_file, $module_data, $module_config, $admin_info, $user_info, $lang_global, $client_info, $lang_module_comment, $module_name;
    $template = file_exists(NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/comment/main.tpl') ? $global_config['module_theme'] : 'default';
    $xtpl = new XTemplate('main.tpl', NV_ROOTDIR . '/themes/' . $template . '/modules/comment');
    $xtpl->assign('LANG', $lang_module_comment);
    $xtpl->assign('GLANG', $lang_global);
    $xtpl->assign('TEMPLATE', $template);
    $xtpl->assign('CHECKSS_COMM', $checkss);
    $xtpl->assign('MODULE_COMM', $module);
    $xtpl->assign('MODULE_DATA', $module_data);
    $xtpl->assign('AREA_COMM', $area);
    $xtpl->assign('ID_COMM', $id);
    $xtpl->assign('ALLOWED_COMM', $allowed_comm);
    $xtpl->assign('BASE_URL_COMM', $base_url);
    if (defined('NV_COMM_ID')) {
        // Check call module js file
        if (file_exists(NV_ROOTDIR . '/themes/' . $template . '/js/comment.js')) {
            $xtpl->parse('main.header.jsfile');
        }
        // Check call module css file
        if (file_exists(NV_ROOTDIR . '/themes/' . $template . '/css/comment.css')) {
            $xtpl->parse('main.header.cssfile');
        }
        $xtpl->parse('main.header');
    }
    // Order by comm
    for ($i = 0; $i <= 2; ++$i) {
        $xtpl->assign('OPTION', array('key' => $i, 'title' => $lang_module_comment['sortcomm_' . $i], 'selected' => $i == $sortcomm ? ' selected="selected"' : ''));
        $xtpl->parse('main.sortcomm');
    }
    if (!empty($comment)) {
        $xtpl->assign('COMMENTCONTENT', $comment);
        $xtpl->parse('main.showContent');
    }
    $allowed_comm = nv_user_in_groups($allowed_comm);
    if ($allowed_comm) {
        if (defined('NV_IS_USER')) {
            $xtpl->assign('NAME', $user_info['full_name']);
            $xtpl->assign('EMAIL', $user_info['email']);
            $xtpl->assign('DISABLED', ' disabled="disabled"');
        } else {
            $xtpl->assign('NAME', '');
            $xtpl->assign('EMAIL', '');
            $xtpl->assign('DISABLED', '');
        }
        $captcha = intval($module_config[$module]['captcha']);
        $show_captcha = true;
        if ($captcha == 0) {
            $show_captcha = false;
        } elseif ($captcha == 1 and defined('NV_IS_USER')) {
            $show_captcha = false;
        } elseif ($captcha == 2 and defined('NV_IS_MODADMIN')) {
            if (defined('NV_IS_SPADMIN')) {
                $show_captcha = false;
            } else {
                $adminscomm = explode(',', $module_config[$module]['adminscomm']);
                if (in_array($admin_info['admin_id'], $adminscomm)) {
                    $show_captcha = false;
                }
            }
        }
        if ($show_captcha) {
            $xtpl->assign('N_CAPTCHA', $lang_global['securitycode']);
            $xtpl->assign('CAPTCHA_REFRESH', $lang_global['captcharefresh']);
            $xtpl->assign('GFX_NUM', NV_GFX_NUM);
            $xtpl->assign('GFX_WIDTH', NV_GFX_WIDTH);
            $xtpl->assign('GFX_WIDTH', NV_GFX_WIDTH);
            $xtpl->assign('GFX_HEIGHT', NV_GFX_HEIGHT);
            $xtpl->assign('CAPTCHA_REFR_SRC', NV_BASE_SITEURL . NV_FILES_DIR . '/images/refresh.png');
            $xtpl->assign('SRC_CAPTCHA', NV_BASE_SITEURL . 'index.php?scaptcha=captcha&t=' . NV_CURRENTTIME);
            $xtpl->parse('main.allowed_comm.captcha');
        } else {
            $xtpl->assign('GFX_NUM', 0);
        }
        if (!empty($status_comment)) {
            $status_comment = nv_base64_decode($status_comment);
            $xtpl->assign('STATUS_COMMENT', $status_comment);
            $xtpl->parse('main.allowed_comm.comment_result');
        }
        $xtpl->parse('main.allowed_comm');
    } elseif ($form_login) {
        $link_login = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=users&amp;' . NV_OP_VARIABLE . '=login&amp;nv_redirect=' . nv_base64_encode($client_info['selfurl'] . '#formcomment');
        $xtpl->assign('COMMENT_LOGIN', '<a title="' . $lang_global['loginsubmit'] . '" href="' . $link_login . '">' . $lang_module_comment['comment_login'] . '</a>');
        $xtpl->parse('main.form_login');
    }
    $xtpl->parse('main');
    return $xtpl->text('main');
}
Beispiel #8
0
            //Ket noi voi cac op cua module de thuc hien
            require_once NV_ROOTDIR . "/modules/" . $module_file . "/funcs/" . $op . ".php";
            exit;
        } else {
            $db->sql_query("UPDATE `" . NV_MODULES_TABLE . "` SET `act`=2 WHERE `title`=" . $db->dbescape($module_name));
            nv_del_moduleCache('modules');
        }
    } else {
        $sql = "SELECT * FROM `" . NV_MODFUNCS_TABLE . "` AS f, `" . NV_MODULES_TABLE . "` AS m WHERE m.act = 1 AND f.in_module = m.title ORDER BY m.weight, f.subweight";
        $list = nv_db_cache($sql, '', 'modules');
        foreach ($list as $row) {
            if ($row['title'] == $module_name) {
                $groups_view = (string) $row['groups_view'];
                if (!defined('NV_IS_USER') and $groups_view == 1) {
                    // login users
                    Header("Location: " . NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=users&" . NV_OP_VARIABLE . "=login&nv_redirect=" . nv_base64_encode($client_info['selfurl']));
                    die;
                } else {
                    if (!defined('NV_IS_ADMIN') and $groups_view == "2") {
                        // login admin
                        nv_info_die($lang_global['error_404_title'], $lang_global['site_info'], $lang_global['module_for_admin']);
                        //$nv_Request->set_Session( 'admin_login_redirect', $client_info['selfurl'] );
                        //Header( "Location: " . NV_BASE_SITEURL . NV_ADMINDIR );
                        die;
                    }
                }
                break;
            }
        }
    }
}
Beispiel #9
0
function nv_site_theme($contents, $full = true)
{
    global $home, $array_mod_title, $lang_global, $language_array, $global_config, $site_mods, $module_name, $module_info, $op_file, $mod_title, $my_head, $my_footer, $client_info, $module_config, $op, $drag_block;
    // Determine tpl file, check exists tpl file
    $layout_file = $full ? 'layout.' . $module_info['layout_funcs'][$op_file] . '.tpl' : 'simple.tpl';
    if (!file_exists(NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/layout/' . $layout_file)) {
        nv_info_die($lang_global['error_layout_title'], $lang_global['error_layout_title'], $lang_global['error_layout_content']);
    }
    if (isset($global_config['sitetimestamp'])) {
        $global_config['timestamp'] += $global_config['sitetimestamp'];
    }
    $xtpl = new XTemplate($layout_file, NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/layout');
    $xtpl->assign('LANG', $lang_global);
    $xtpl->assign('TEMPLATE', $global_config['module_theme']);
    $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
    // System variables
    $xtpl->assign('THEME_PAGE_TITLE', nv_html_page_title(false));
    // Meta-tags
    $metatags = nv_html_meta_tags(false);
    $metatags[] = array('name' => 'name', 'value' => 'viewport', 'content' => 'width=device-width, initial-scale=1');
    foreach ($metatags as $meta) {
        $xtpl->assign('THEME_META_TAGS', $meta);
        $xtpl->parse('main.metatags');
    }
    //Links
    $html_links = array();
    $html_links[] = array('rel' => 'StyleSheet', 'href' => NV_BASE_SITEURL . 'themes/default/css/font-awesome.min.css');
    $html_links[] = array('rel' => 'StyleSheet', 'href' => NV_BASE_SITEURL . 'themes/' . $global_config['module_theme'] . '/css/bootstrap.min.css');
    $html_links[] = array('rel' => 'StyleSheet', 'href' => NV_BASE_SITEURL . 'themes/' . $global_config['module_theme'] . '/css/style.css');
    if (defined('NV_IS_ADMIN') and $full) {
        $html_links[] = array('rel' => 'StyleSheet', 'href' => NV_BASE_SITEURL . 'themes/' . $global_config['module_theme'] . '/css/admin.css');
    }
    $html_links += nv_html_links(false);
    // Customs Style
    if (isset($module_config['themes'][$global_config['module_theme']]) and !empty($module_config['themes'][$global_config['module_theme']])) {
        $config_theme = unserialize($module_config['themes'][$global_config['module_theme']]);
        if (isset($config_theme['css_content']) && !empty($config_theme['css_content'])) {
            $customFileName = $global_config['module_theme'] . '.' . NV_LANG_DATA . '.' . $global_config['idsite'];
            if (!file_exists(NV_ROOTDIR . '/' . NV_ASSETS_DIR . '/css/' . $customFileName . '.css')) {
                $replace = array('[body]' => 'body', '[a_link]' => 'a, a:link, a:active, a:visited', '[a_link_hover]' => 'a:hover', '[content]' => '.wraper', '[header]' => '#header', '[footer]' => '#footer', '[block]' => '.panel, .well, .nv-block-banners', '[block_heading]' => '.panel-default > .panel-heading');
                $css_content = str_replace(array_keys($replace), array_values($replace), $config_theme['css_content']);
                file_put_contents(NV_ROOTDIR . '/' . NV_ASSETS_DIR . '/css/' . $customFileName . '.css', $css_content);
            }
            $html_links[] = array('rel' => 'StyleSheet', 'href' => NV_BASE_SITEURL . NV_ASSETS_DIR . '/css/' . $customFileName . '.css?t=' . $global_config['timestamp']);
        }
        if (isset($config_theme['gfont']) && !empty($config_theme['gfont']) && isset($config_theme['gfont']['family']) && !empty($config_theme['gfont']['family'])) {
            $subset = isset($config_theme['gfont']['subset']) ? $config_theme['gfont']['subset'] : '';
            $gf = new Gfonts(array('fonts' => array($config_theme['gfont']), 'subset' => $subset), $client_info);
            $webFontFile = $gf->getUrlCss();
            array_unshift($html_links, array('rel' => 'StyleSheet', 'href' => $webFontFile));
        }
        unset($config_theme, $css_content, $webFontFile, $font, $subset, $gf);
    }
    foreach ($html_links as $links) {
        foreach ($links as $key => $value) {
            $xtpl->assign('LINKS', array('key' => $key, 'value' => $value));
            $xtpl->parse('main.links.attr');
        }
        $xtpl->parse('main.links');
    }
    $html_js = nv_html_site_js(false);
    $html_js[] = array('ext' => 1, 'content' => NV_BASE_SITEURL . 'themes/' . $global_config['module_theme'] . '/js/main.js');
    foreach ($html_js as $js) {
        if ($js['ext']) {
            $xtpl->assign('JS_SRC', $js['content']);
            $xtpl->parse('main.js.ext');
        } else {
            $xtpl->assign('JS_CONTENT', PHP_EOL . $js['content'] . PHP_EOL);
            $xtpl->parse('main.js.int');
        }
        $xtpl->parse('main.js');
    }
    if ($client_info['browser']['key'] == 'explorer' and $client_info['browser']['version'] < 9) {
        $xtpl->parse('main.lt_ie9');
    }
    // Module contents
    $xtpl->assign('MODULE_CONTENT', $contents);
    // Header variables
    $xtpl->assign('SITE_NAME', $global_config['site_name']);
    $xtpl->assign('SITE_DESCRIPTION', $global_config['site_description']);
    $xtpl->assign('THEME_SITE_HREF', NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA);
    $logo_small = preg_replace('/(\\.[a-z]+)$/i', '_small\\1', $global_config['site_logo']);
    $logo = file_exists(NV_ROOTDIR . '/' . $logo_small) ? $logo_small : $global_config['site_logo'];
    $size = @getimagesize(NV_ROOTDIR . '/' . $logo);
    $logo_svg = preg_replace('/\\.[a-z]+$/i', '.svg', $logo);
    file_exists(NV_ROOTDIR . '/' . $logo_svg) && ($logo = $logo_svg);
    $xtpl->assign('LOGO_SRC', NV_BASE_SITEURL . $logo);
    $xtpl->assign('LOGO_WIDTH', $size[0]);
    $xtpl->assign('LOGO_HEIGHT', $size[1]);
    if (isset($size['mime']) and $size['mime'] == 'application/x-shockwave-flash') {
        $xtpl->parse('main.swf');
    } else {
        $xtpl->parse('main.image');
    }
    // Only full theme
    if ($full) {
        // Search form variables
        $xtpl->assign('NV_MAX_SEARCH_LENGTH', NV_MAX_SEARCH_LENGTH);
        $xtpl->assign('NV_MIN_SEARCH_LENGTH', NV_MIN_SEARCH_LENGTH);
        $xtpl->assign('THEME_SEARCH_URL', NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=seek&q=');
        // Breadcrumbs
        if ($home != 1) {
            if ($global_config['rewrite_op_mod'] != $module_name) {
                $arr_cat_title_i = array('catid' => 0, 'title' => $module_info['custom_title'], 'link' => NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name);
                array_unshift($array_mod_title, $arr_cat_title_i);
            }
            if (!empty($array_mod_title)) {
                foreach ($array_mod_title as $arr_cat_title_i) {
                    $xtpl->assign('BREADCRUMBS', $arr_cat_title_i);
                    $xtpl->parse('main.breadcrumbs.loop');
                }
                $xtpl->parse('main.breadcrumbs');
            }
        }
        // Statistics image
        $theme_stat_img = '';
        if ($global_config['statistic'] and isset($site_mods['statistics'])) {
            $theme_stat_img .= "<a title=\"" . $lang_global['viewstats'] . "\" href=\"" . NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=statistics\"><img alt=\"" . $lang_global['viewstats'] . "\" src=\"" . NV_BASE_SITEURL . "index.php?second=statimg&amp;p=" . nv_genpass() . "\" width=\"88\" height=\"31\" /></a>\n";
        }
        $xtpl->assign('THEME_STAT_IMG', $theme_stat_img);
        // Change theme types
        foreach ($global_config['array_theme_type'] as $theme_type) {
            $xtpl->assign('STHEME_TYPE', NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;nv' . NV_LANG_DATA . 'themever=' . $theme_type . '&amp;nv_redirect=' . nv_base64_encode($client_info['selfurl']));
            $xtpl->assign('STHEME_TITLE', $lang_global['theme_type_' . $theme_type]);
            $xtpl->assign('STHEME_INFO', sprintf($lang_global['theme_type_chose'], $lang_global['theme_type_' . $theme_type]));
            if ($theme_type != $global_config['current_theme_type']) {
                $xtpl->parse('main.theme_type.loop.other');
            }
            $xtpl->parse('main.theme_type.loop');
        }
        $xtpl->parse('main.theme_type');
        if (defined('NV_IS_ADMIN')) {
            $xtpl->assign('ADMINTOOLBAR', nv_admin_menu());
        }
    }
    if (!$drag_block) {
        $xtpl->parse('main.no_drag_block');
    }
    $xtpl->parse('main');
    $sitecontent = $xtpl->text('main');
    // Only full theme
    if ($full) {
        $sitecontent = nv_blocks_content($sitecontent);
        $sitecontent = str_replace('[THEME_ERROR_INFO]', nv_error_info(), $sitecontent);
        if (defined('NV_IS_ADMIN')) {
            $my_footer .= $my_footer;
        }
    }
    if (!empty($my_head)) {
        $sitecontent = preg_replace('/(<\\/head>)/i', $my_head . '\\1', $sitecontent, 1);
    }
    if (!empty($my_footer)) {
        $sitecontent = preg_replace('/(<\\/body>)/i', $my_footer . '\\1', $sitecontent, 1);
    }
    return $sitecontent;
}
Beispiel #10
0
function detail_theme($news_contents, $related_new_array, $related_array, $topic_array, $commentenable)
{
    global $global_config, $module_info, $lang_module, $module_name, $module_file, $module_config, $global_array_cat, $my_head, $lang_global, $user_info, $admin_info, $catid;
    $my_head .= "<script type=\"text/javascript\" src=\"" . NV_BASE_SITEURL . "js/star-rating/jquery.rating.pack.js\"></script>\n";
    $my_head .= "<script src='" . NV_BASE_SITEURL . "js/star-rating/jquery.MetaData.js' type=\"text/javascript\"></script>\n";
    $my_head .= "<link href='" . NV_BASE_SITEURL . "js/star-rating/jquery.rating.css' type=\"text/css\" rel=\"stylesheet\"/>\n";
    $xtpl = new XTemplate("detail.tpl", NV_ROOTDIR . "/themes/" . $module_info['template'] . "/modules/" . $module_file);
    $xtpl->assign('LANG', $lang_module);
    $news_contents['addtime'] = nv_date("d-m-Y h:i:s", $news_contents['addtime']);
    $xtpl->assign('NEWSID', $news_contents['id']);
    $xtpl->assign('NEWSCHECKSS', $news_contents['newscheckss']);
    $xtpl->assign('DETAIL', $news_contents);
    $xtpl->assign('IMG_DIR', NV_BASE_SITEURL . 'themes/' . $module_info['template'] . '/images/' . $module_file . '/');
    if ($news_contents['allowed_send'] == 1) {
        $xtpl->assign('URL_SENDMAIL', $news_contents['url_sendmail']);
        $xtpl->parse('main.allowed_send');
    }
    if ($news_contents['allowed_print'] == 1) {
        $xtpl->assign('URL_PRINT', $news_contents['url_print']);
        $xtpl->parse('main.allowed_print');
    }
    if ($news_contents['allowed_save'] == 1) {
        $xtpl->assign('URL_SAVEFILE', $news_contents['url_savefile']);
        $xtpl->parse('main.allowed_save');
    }
    if ($news_contents['allowed_rating'] == 1) {
        $xtpl->assign('LANGSTAR', $news_contents['langstar']);
        $xtpl->assign('STRINGRATING', $news_contents['stringrating']);
        $xtpl->assign('NUMBERRATING', $news_contents['numberrating']);
        if ($news_contents['disablerating'] == 1) {
            $xtpl->parse('main.allowed_rating.disablerating');
        }
        $xtpl->parse('main.allowed_rating');
    }
    if ($news_contents['showhometext']) {
        if (!empty($news_contents['image']['src'])) {
            if ($news_contents['image']['position'] == 1) {
                $xtpl->parse('main.showhometext.imgthumb');
            } elseif ($news_contents['image']['position'] == 2) {
                $xtpl->parse('main.showhometext.imgfull');
            }
        }
        $xtpl->parse('main.showhometext');
    }
    if (!empty($news_contents['author']) or !empty($news_contents['source'])) {
        if (!empty($news_contents['author'])) {
            $xtpl->parse('main.author.name');
        }
        if (!empty($news_contents['source'])) {
            $xtpl->parse('main.author.source');
        }
        $xtpl->parse('main.author');
    }
    if ($news_contents['copyright'] == 1) {
        if (!empty($module_config[$module_name]['copyright'])) {
            $xtpl->assign('COPYRIGHT', $module_config[$module_name]['copyright']);
            $xtpl->parse('main.copyright');
        }
    }
    if (!empty($news_contents['keywords'])) {
        $news_contents['keywords'] = explode(',', $news_contents['keywords']);
        $count = sizeof($news_contents['keywords']);
        foreach ($news_contents['keywords'] as $i => $value) {
            $value = trim($value);
            $value = trim($value);
            $keyword = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $module_name . "&amp;" . NV_OP_VARIABLE . "=search&amp;q=" . urlencode($value);
            $xtpl->assign('KEYWORD', $value);
            $xtpl->assign('LINK_KEYWORDS', $keyword);
            $xtpl->assign('SLASH', $count - 1 == $i ? '' : ', ');
            $xtpl->parse('main.keywords.loop');
        }
        $xtpl->parse('main.keywords');
    }
    if (defined('NV_IS_MODADMIN')) {
        $xtpl->assign('ADMINLINK', nv_link_edit_page($news_contents['id']) . "&nbsp;-&nbsp;" . nv_link_delete_page($news_contents['id']));
        $xtpl->parse('main.adminlink');
    }
    $xtpl->assign('COMMENTCONTENT', $news_contents['comment']);
    $xtpl->assign('IMGSHOWCOMMENT', NV_BASE_SITEURL . "themes/" . $module_info['template'] . "/images/" . $module_file . "/comment.png");
    $xtpl->assign('IMGADDCOMMENT', NV_BASE_SITEURL . "themes/" . $module_info['template'] . "/images/" . $module_file . "/comment_add.png");
    if ($commentenable == 1) {
        if (defined('NV_IS_ADMIN')) {
            $xtpl->assign('NAME', $admin_info['full_name']);
            $xtpl->assign('EMAIL', $admin_info['email']);
            $xtpl->assign('DISABLED', " disabled=\"disabled\"");
        } elseif (defined('NV_IS_USER')) {
            $xtpl->assign('NAME', $user_info['full_name']);
            $xtpl->assign('EMAIL', $user_info['email']);
            $xtpl->assign('DISABLED', " disabled=\"disabled\"");
        } else {
            $xtpl->assign('NAME', "");
            $xtpl->assign('EMAIL', "");
            $xtpl->assign('DISABLED', "");
        }
        $xtpl->assign('N_CAPTCHA', $lang_global['securitycode']);
        $xtpl->assign('CAPTCHA_REFRESH', $lang_global['captcharefresh']);
        $xtpl->assign('GFX_NUM', NV_GFX_NUM);
        $xtpl->assign('GFX_WIDTH', NV_GFX_WIDTH);
        $xtpl->assign('GFX_WIDTH', NV_GFX_WIDTH);
        $xtpl->assign('GFX_HEIGHT', NV_GFX_HEIGHT);
        $xtpl->assign('CAPTCHA_REFR_SRC', NV_BASE_SITEURL . "images/refresh.png");
        $xtpl->assign('SRC_CAPTCHA', NV_BASE_SITEURL . "index.php?scaptcha=captcha");
        $xtpl->parse('main.comment.form');
    } elseif ($commentenable == 2) {
        global $client_info;
        $link_login = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=users&amp;" . NV_OP_VARIABLE . "=login&amp;nv_redirect=" . nv_base64_encode($client_info['selfurl'] . "#formcomment");
        $xtpl->assign('COMMENT_LOGIN', "<a title=\"" . $lang_global['loginsubmit'] . "\" href=\"" . $link_login . "\">" . $lang_module['comment_login'] . "</a>");
        $xtpl->parse('main.comment.form_login');
    }
    $xtpl->parse('main.comment');
    if (!empty($related_new_array)) {
        foreach ($related_new_array as $key => $related_new_array_i) {
            $xtpl->assign('RELATED_NEW', $related_new_array_i);
            $xtpl->parse('main.related_new.loop');
        }
        unset($key);
        $xtpl->parse('main.related_new');
    }
    if (!empty($related_array)) {
        foreach ($related_array as $related_array_i) {
            $xtpl->assign('RELATED', $related_array_i);
            $xtpl->parse('main.related.loop');
        }
        $xtpl->parse('main.related');
    }
    if (!empty($topic_array)) {
        foreach ($topic_array as $key => $topic_array_i) {
            $xtpl->assign('TOPIC', $topic_array_i);
            $xtpl->parse('main.topic.loop');
        }
        $xtpl->parse('main.topic');
    }
    $xtpl->parse('main');
    return $xtpl->text('main');
}
Beispiel #11
0
            if ($array_post_config[$group_id_i]['delcontent']) {
                $array_post_user['delcontent'] = 1;
            }
        }
    }
}
if ($array_post_user['postcontent']) {
    $array_post_user['addcontent'] = 1;
}
// check user post content
$base_url = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=' . $op;
if (!$array_post_user['addcontent']) {
    if (defined('NV_IS_USER')) {
        $array_temp['urlrefresh'] = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA;
    } else {
        $array_temp['urlrefresh'] = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=users&amp;' . NV_OP_VARIABLE . '=login&nv_redirect=' . nv_base64_encode($client_info['selfurl']);
    }
    $array_temp['content'] = $lang_module['error_addcontent'];
    $template = $module_info['template'];
    if (!file_exists(NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $module_file . '/content.tpl')) {
        $template = 'default';
    }
    $array_temp['urlrefresh'] = nv_url_rewrite($array_temp['urlrefresh'], true);
    $xtpl = new XTemplate('content.tpl', NV_ROOTDIR . '/themes/' . $template . '/modules/' . $module_file);
    $xtpl->assign('DATA', $array_temp);
    $xtpl->parse('mainrefresh');
    $contents = $xtpl->text('mainrefresh');
    include NV_ROOTDIR . '/includes/header.php';
    echo nv_site_theme($contents);
    include NV_ROOTDIR . '/includes/footer.php';
}
Beispiel #12
0
                     if (in_array($filename['name'], $check_files)) {
                         ++$a;
                     }
                 }
             }
             if ($a == sizeof($check_files)) {
                 $array_config['ftp_check_login'] = 1;
             } else {
                 $array_config['ftp_check_login'] = 2;
                 $error = $lang_global['ftp_error_path'];
             }
         }
         $ftp->close();
     }
     if (empty($error)) {
         $array_config['ftp_user_pass'] = nv_base64_encode($crypt->aes_encrypt($ftp_user_pass));
         $sth = $db->prepare("UPDATE " . NV_CONFIG_GLOBALTABLE . " SET config_value= :config_value WHERE config_name = :config_name AND lang = 'sys' AND module='global'");
         foreach ($array_config as $config_name => $config_value) {
             $sth->bindParam(':config_name', $config_name, PDO::PARAM_STR, 30);
             $sth->bindParam(':config_value', $config_value, PDO::PARAM_STR);
             $sth->execute();
         }
         nv_save_file_config_global();
         Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&rand=' . nv_genpass());
         exit;
     }
     $array_config['ftp_user_pass'] = $ftp_user_pass;
 }
 $xtpl->assign('VALUE', $array_config);
 $xtpl->assign('DETECT_FTP', NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op);
 if (!empty($error)) {
Beispiel #13
0
$contents['allow_modify_files'] = array($lang_module['allow_modify_files'], $allow_modify_files);
$contents['allow_create_subdirectories'] = array($lang_module['allow_create_subdirectories'], $allow_create_subdirectories);
$contents['allow_modify_subdirectories'] = array($lang_module['allow_modify_subdirectories'], $allow_modify_subdirectories);
$contents['mods'] = array($lang_module['if_level3_selected'], $mods);
$contents['position'] = array($lang_module['position'], $position, $lang_module['position_info']);
$contents['info'] = $lang_module['nv_admin_add_info'];
$contents['submit'] = $lang_module['nv_admin_add'];
//filtersql
$filtersql = ' userid NOT IN (SELECT admin_id FROM ' . NV_AUTHORS_GLOBALTABLE . ')';
// Parse content
$xtpl = new XTemplate('add.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $module_file);
$xtpl->assign('INFO', $contents['info']);
$xtpl->assign('LANG', $lang_module);
$xtpl->assign('NV_BASE_ADMINURL', NV_BASE_ADMINURL);
$xtpl->assign('RESULT_URL', NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=add&result=1&checksess=' . NV_CHECK_SESSION);
$xtpl->assign('FILTERSQL', nv_base64_encode($crypt->aes_encrypt($filtersql, NV_CHECK_SESSION)));
$xtpl->assign('ACTION', $contents['action']);
if (isset($contents['editor'])) {
    $xtpl->assign('EDITOR0', $contents['editor'][0]);
    $xtpl->assign('EDITOR3', $contents['editor'][3]);
    foreach ($contents['editor'][1] as $edt) {
        $xtpl->assign('SELECTED', $edt == $contents['editor'][2] ? ' selected="selected"' : '');
        $xtpl->assign('EDITOR', $edt);
        $xtpl->parse('add.editor.loop');
    }
    $xtpl->parse('add.editor');
}
if (isset($contents['allow_files_type'])) {
    $xtpl->assign('ALLOW_FILES_TYPE0', $contents['allow_files_type'][0]);
    foreach ($contents['allow_files_type'][1] as $tp) {
        $xtpl->assign('CHECKED', in_array($tp, $contents['allow_files_type'][2]) ? ' checked="checked"' : '');
Beispiel #14
0
$cookies = $array['cookies'];
$array = !empty($array['body']) ? is_serialized_string($array['body']) ? unserialize($array['body']) : array() : array();
$error = '';
if (!empty(NV_Http::$error)) {
    $error = nv_http_get_lang(NV_Http::$error);
} elseif (empty($array['status']) or !isset($array['error']) or !isset($array['data']) or !isset($array['pagination']) or !is_array($array['error']) or !is_array($array['data']) or !is_array($array['pagination']) or !empty($array['error']) and (!isset($array['error']['level']) or empty($array['error']['message']))) {
    $error = $lang_global['error_valid_response'];
} elseif (!empty($array['error']['message'])) {
    $error = $array['error']['message'];
}
// Show error
if (!empty($error)) {
    $xtpl->assign('ERROR', $error);
    $xtpl->parse('main.error');
} elseif ($array['status'] == 'notlogin') {
    $xtpl->assign('LOGIN_NOTE', sprintf($lang_module['login_require'], NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=login&amp;redirect=' . nv_base64_encode($client_info['selfurl'])));
    $xtpl->parse('main.login');
} elseif (empty($array['data'])) {
    $xtpl->parse('main.empty');
} else {
    // Save cookies
    nv_store_cookies(nv_object2array($cookies), $stored_cookies);
    foreach ($array['data'] as $row) {
        $row['rating_avg'] = ceil($row['rating_avg']);
        $row['type'] = $lang_module['types_' . intval($row['tid'])];
        $row['compatible_class'] = empty($row['compatible']) ? 'text-danger' : 'text-success';
        $row['compatible_title'] = empty($row['compatible']) ? $lang_module['incompatible'] : $lang_module['compatible'];
        if (empty($row['image_small'])) {
            $row['image_small'] = NV_BASE_SITEURL . 'themes/default/images/no_image.gif';
        }
        $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'];
Beispiel #15
0
/**
 * nv_redirect_encrypt()
 *
 * @param string $array
 * @return string
 *
 */
function nv_redirect_encrypt($url)
{
    global $crypt;
    return nv_base64_encode($crypt->aes_encrypt($url, NV_CHECK_SESSION));
}
Beispiel #16
0
/**
 * nv_html_site_js()
 *
 * @return
 */
function nv_html_site_js()
{
    global $global_config, $module_info, $module_name, $module_file, $lang_global, $op, $client_info;
    $return = "<script type=\"text/javascript\" src=\"" . NV_BASE_SITEURL . "js/language/" . NV_LANG_INTERFACE . ".js\"></script>\n";
    $return .= "<script type=\"text/javascript\" src=\"" . NV_BASE_SITEURL . "js/jquery/jquery.min.js\"></script>\n";
    $return .= "<script type=\"text/javascript\">\n//<![CDATA[\n";
    $return .= "var nv_siteroot=\"" . NV_BASE_SITEURL . "\",nv_sitelang=\"" . NV_LANG_INTERFACE . "\",nv_name_variable=\"" . NV_NAME_VARIABLE . "\",nv_fc_variable=\"" . NV_OP_VARIABLE . "\",nv_lang_variable=\"" . NV_LANG_VARIABLE . "\",nv_module_name=\"" . $module_name . "\",nv_my_ofs=" . round(NV_SITE_TIMEZONE_OFFSET / 3600) . ",nv_my_abbr=\"" . nv_date("T", NV_CURRENTTIME) . "\",nv_cookie_prefix=\"" . $global_config['cookie_prefix'] . "\",nv_area_admin=0;\n";
    $return .= "//]]>\n</script>\n";
    $return .= "<script type=\"text/javascript\" src=\"" . NV_BASE_SITEURL . "js/global.js\"></script>\n";
    if (defined('NV_IS_ADMIN')) {
        $return .= "<script type=\"text/javascript\" src=\"" . NV_BASE_SITEURL . "js/admin.js\"></script>\n";
    }
    if (file_exists(NV_ROOTDIR . "/modules/" . $module_file . "/js/user.js")) {
        $return .= "<script type=\"text/javascript\" src=\"" . NV_BASE_SITEURL . "modules/" . $module_file . "/js/user.js\"></script>\n";
    }
    if (defined('NV_EDITOR') and nv_function_exists('nv_add_editor_js')) {
        $return .= nv_add_editor_js();
    }
    if (defined('NV_IS_DRAG_BLOCK')) {
        if (!defined('SHADOWBOX')) {
            $return .= "<link type=\"text/css\" rel=\"Stylesheet\" href=\"" . NV_BASE_SITEURL . "js/shadowbox/shadowbox.css\" />\n";
            $return .= "<script type=\"text/javascript\" src=\"" . NV_BASE_SITEURL . "js/shadowbox/shadowbox.js\"></script>\n";
            $return .= "<script type=\"text/javascript\">Shadowbox.init();</script>";
            define('SHADOWBOX', true);
        }
        $return .= "<script type=\"text/javascript\" src=\"" . NV_BASE_SITEURL . "js/ui/jquery.ui.core.min.js\"></script>\n";
        $return .= "<script type=\"text/javascript\" src=\"" . NV_BASE_SITEURL . "js/ui/jquery.ui.sortable.min.js\"></script>\n";
        $return .= '<script type="text/javascript">
        			//<![CDATA[
					var blockredirect = "' . nv_base64_encode($client_info['selfurl']) . '";
					$(function() {
						$("a.delblock").click(function(){
							var bid = $(this).attr("name");
							if (confirm("' . $lang_global['block_delete_confirm'] . '")){
								$.post("' . NV_BASE_ADMINURL . 'index.php?' . NV_NAME_VARIABLE . '=themes&' . NV_OP_VARIABLE . '=blocks_del", "bid="+bid, function(theResponse){
									alert(theResponse);
									window.location.href = "' . $client_info['selfurl'] . '";
								});
							}
						});

						$("a.outgroupblock").click(function(){
							var bid = $(this).attr("name");
							if (confirm("' . $lang_global['block_outgroup_confirm'] . '")){
								$.post("' . NV_BASE_ADMINURL . 'index.php?' . NV_NAME_VARIABLE . '=themes&' . NV_OP_VARIABLE . '=front_outgroup", "func_id=' . $module_info['funcs'][$op]['func_id'] . '&bid="+bid, function(theResponse){
									alert(theResponse);
								});
							}
						});

						$("a.block_content").click(function(){
							var bid = $(this).attr("name");
							var tag = $(this).attr("id");
							Shadowbox.open(
						      {
						         content : "<iframe src=\'' . NV_BASE_ADMINURL . 'index.php?' . NV_NAME_VARIABLE . '=themes&' . NV_OP_VARIABLE . '=block_content&selectthemes=' . $global_config['module_theme'] . '&tag="+tag+"&bid="+bid+"&blockredirect="+blockredirect+"\' style=\'width:780px;height:450px\'></iframe>",
						         player : "html",
						         height : 450,
						         width : 780
						      }
						      );
	            		});

	            		var func_id = ' . $module_info['funcs'][$op]['func_id'] . ';
	            		var post_order = false;
						$(".column").sortable({
							connectWith: \'.column\',
							opacity: 0.8,
							cursor: \'move\',
							receive: function(){
									post_order = true;
									var position = $(this).attr("id");
									var order = $(this).sortable("serialize");
									$.post("' . NV_BASE_ADMINURL . 'index.php?' . NV_NAME_VARIABLE . '=themes&' . NV_OP_VARIABLE . '=sort_order", order+"&position="+position+"&func_id="+func_id, function(theResponse){
										if(theResponse=="OK_"+func_id){
					    					$("div#toolbar>ul.info").html("<li><span style=\'color:#ff0000;padding-left:150px;font-weight:700;\'>' . $lang_global['blocks_saved'] . '</span></li>").fadeIn(1000);
										}
										else{
											alert("' . $lang_global['blocks_saved_error'] . '");
										}
									});
							},
							stop: function() {
								if(post_order == false){
									var order = $(this).sortable("serialize");
									$.post("' . NV_BASE_ADMINURL . 'index.php?' . NV_NAME_VARIABLE . '=themes&' . NV_OP_VARIABLE . '=sort_order", order+"&func_id="+func_id, function(theResponse){
										if(theResponse=="OK_"+func_id){
					    					$("div#toolbar>ul.info").html("<span style=\'color:#ff0000;padding-left:150px;font-weight:700;\'>' . $lang_global['blocks_saved'] . '</span>").fadeIn(1000);
										}
										else{
											alert("' . $lang_global['blocks_saved_error'] . '");
										}
									});
								}
							}
						});
						$(".column").disableSelection();
					});
					//]]>
					</script>';
    }
    return $return;
}
Beispiel #17
0
     }
     $query_field = array();
     $query_field['userid'] = $userid;
     $result_field = $db->query('SELECT * FROM ' . NV_USERS_GLOBALTABLE . '_field ORDER BY fid ASC');
     while ($row_f = $result_field->fetch()) {
         $query_field[$row_f['field']] = $db->quote($row_f['default_value']);
     }
     $sql = "INSERT INTO " . NV_USERS_GLOBALTABLE . "_reg (username, md5username, password, email, first_name, last_name, regdate, question, answer, checknum, users_info, openid_info) VALUES (\n\t\t\t:username,\n\t\t\t:md5username,\n\t\t\t'',\n\t\t\t:email,\n\t\t\t:first_name,\n\t\t\t:last_name,\n\t\t\t" . NV_CURRENTTIME . ",\n\t\t\t'',\n\t\t\t'',\n\t\t\t'',\n\t\t\t:users_info,\n            :openid_info\n\t\t)";
     $data_insert = array();
     $data_insert['username'] = $reg_attribs['username'];
     $data_insert['md5username'] = nv_md5safe($reg_attribs['username']);
     $data_insert['email'] = $reg_attribs['email'];
     $data_insert['first_name'] = $reg_attribs['first_name'];
     $data_insert['last_name'] = $reg_attribs['last_name'];
     $data_insert['users_info'] = nv_base64_encode(serialize($query_field));
     $data_insert['openid_info'] = nv_base64_encode(serialize($reg_attribs));
     $userid = $db->insert_id($sql, 'userid', $data_insert);
     if (!$userid) {
         opidr(array('status' => 'error', 'mess' => $lang_module['err_no_save_account']));
         die;
     }
     opidr(array('status' => 'success', 'mess' => $lang_module['account_register_to_admin']));
     die;
 }
 $page_title = $lang_global['openid_login'];
 $key_words = $module_info['keywords'];
 $mod_title = $lang_global['openid_login'];
 $contents .= user_openid_login($gfx_chk, $attribs);
 include NV_ROOTDIR . '/includes/header.php';
 echo nv_site_theme($contents, false);
 include NV_ROOTDIR . '/includes/footer.php';
Beispiel #18
0
     echo $xtpl->text('error');
 }
 $array = $array['data'];
 // Ok co the download
 if ($array['fileInfo'] === 'ready') {
     $array['icon'] = 'fa-check';
     $array['message'] = $lang_module['extUpdCheckSuccess'];
     $array['class'] = 'success';
     $xtpl->assign('LINK', NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=update&eid=' . $eid . '&fid=' . $fid . '&checksess=' . md5('download' . $eid . $fid . $global_config['sitekey'] . session_id()));
     $xtpl->parse('check.ready');
 } elseif ($array['fileInfo'] == 'notlogin') {
     $array['icon'] = 'fa-frown-o';
     $array['message'] = $lang_module['extUpdNotLogin'];
     $array['class'] = 'warning';
     $redirect = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=update&eid=' . $eid . '&fid=' . $fid . '&checksess=' . md5($eid . $fid . $global_config['sitekey'] . session_id());
     $xtpl->assign('MESSAGE', sprintf($lang_module['extUpdLoginRequire'], NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=login&amp;redirect=' . nv_base64_encode($redirect)));
     $xtpl->parse('check.message');
 } elseif ($array['fileInfo'] == 'unpaid') {
     $array['icon'] = 'fa-frown-o';
     $array['message'] = $lang_module['extUpdUnpaid'];
     $array['class'] = 'warning';
     $xtpl->assign('MESSAGE', sprintf($lang_module['extUpdPaidRequire'], $array['link'] . '#tabs-1'));
     $xtpl->parse('check.message');
 } else {
     $array['icon'] = 'fa-frown-o';
     $array['message'] = $lang_module['extUpdInvalid'];
     $array['class'] = 'danger';
     $xtpl->assign('MESSAGE', $lang_module['extUpdInvalidNote']);
     $xtpl->parse('check.message');
 }
 $xtpl->assign('DATA', $array);
Beispiel #19
0
    $data_pay = $stmt->fetch();
}
if ($nv_Request->isset_request('saveconfigpaymentedit', 'post')) {
    $payment = $nv_Request->get_title('payment', 'post', '', 0);
    $paymentname = $nv_Request->get_title('paymentname', 'post', '', 0);
    $domain = $nv_Request->get_title('domain', 'post', '', 0);
    $images_button = $nv_Request->get_title('images_button', 'post', '', 0);
    $active = $nv_Request->get_int('active', 'post', 0);
    $array_config = $nv_Request->get_array('config', 'post', array());
    if (!nv_is_url($images_button) and file_exists(NV_DOCUMENT_ROOT . $images_button)) {
        $lu = strlen(NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/');
        $images_button = substr($images_button, $lu);
    } elseif (!nv_is_url($images_button)) {
        $images_button = '';
    }
    $stmt = $db->prepare("UPDATE " . $db_config['prefix'] . "_" . $module_data . "_payment SET paymentname = :paymentname, domain = :domain, active=" . $active . ", config = '" . nv_base64_encode(serialize($array_config)) . "',images_button= :images_button WHERE payment = :payment");
    $stmt->bindParam(':paymentname', $paymentname, PDO::PARAM_STR);
    $stmt->bindParam(':domain', $domain, PDO::PARAM_STR);
    $stmt->bindParam(':images_button', $images_button, PDO::PARAM_STR);
    $stmt->bindParam(':payment', $payment, PDO::PARAM_STR);
    $stmt->execute();
    nv_insert_logs(NV_LANG_DATA, $module_name, 'log_edit_product', "edit " . $paymentname, $admin_info['userid']);
    nv_del_moduleCache($module_name);
    Header("Location: " . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=" . $op);
}
$xtpl = new XTemplate("payport.tpl", NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/modules/" . $module_file);
$xtpl->assign('LANG', $lang_module);
$a = 0;
if (!empty($array_setting_payment) and empty($data_pay)) {
    $all_page = sizeof($array_setting_payment);
    foreach ($array_setting_payment as $value) {
Beispiel #20
0
        $catid_i = $listcatid;
    }
    // Xac dinh anh nho
    if ($homeimgthumb == 1) {
        $thumb = NV_BASE_SITEURL . NV_FILES_DIR . '/' . $module_upload . '/' . $homeimgfile;
        $imghome = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/' . $homeimgfile;
    } elseif ($homeimgthumb == 2) {
        $imghome = $thumb = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/' . $homeimgfile;
    } elseif ($homeimgthumb == 3) {
        $imghome = $thumb = $homeimgfile;
    } elseif (file_exists(NV_ROOTDIR . '/themes/' . $theme . '/images/' . $module_file . '/no-image.jpg')) {
        $imghome = $thumb = NV_BASE_SITEURL . 'themes/' . $theme . '/images/' . $module_file . '/no-image.jpg';
    } else {
        $imghome = $thumb = NV_BASE_SITEURL . 'themes/default/images/' . $module_file . '/no-image.jpg';
    }
    $xtpl->assign('ROW', array('id' => $id, 'link' => 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_i]['alias'] . '/' . $alias . $global_config['rewrite_exturl'], 'link_seller' => NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=seller&amp;pro_id=' . $id . '&amp;nv_redirect=' . nv_base64_encode($base_url), 'link_copy' => NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=content&amp;copy&amp;id=' . $id, 'link_warehouse' => NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=warehouse&amp;listid=' . $id . '&amp;checkss=' . md5($global_config['sitekey'] . session_id()), 'title' => $title, 'publtime' => $publtime, 'edittime' => $edittime, 'hitstotal' => $hitstotal, 'num_sell' => $num_sell, 'product_unit' => isset($array_unit[$product_unit]) ? $array_unit[$product_unit][NV_LANG_DATA . '_title'] : '', 'status' => $lang_module['status_' . $status], 'admin_id' => !empty($username) ? $username : '', 'product_number' => $product_number, 'product_price' => nv_number_format($product_price, nv_get_decimals($money_unit)), 'money_unit' => $money_unit, 'thumb' => $thumb, 'imghome' => $imghome, 'link_edit' => nv_link_edit_page($id), 'link_delete' => nv_link_delete_page($id)));
    if ($num_sell > 0) {
        $xtpl->parse('main.loop.seller');
    } else {
        $xtpl->parse('main.loop.seller_empty');
    }
    // Hien thi nhap kho
    if ($pro_config['active_warehouse']) {
        $xtpl->parse('main.loop.warehouse_icon');
    }
    $xtpl->parse('main.loop');
    ++$a;
}
$array_list_action = array('delete' => $lang_global['delete'], 'publtime' => $lang_module['publtime'], 'exptime' => $lang_module['exptime'], 'addtoblock' => $lang_module['addtoblock']);
if ($pro_config['active_warehouse']) {
    $array_list_action['warehouse'] = $lang_module['warehouse'];
Beispiel #21
0
function nv_site_theme($contents, $full = true)
{
    global $home, $array_mod_title, $lang_global, $language_array, $global_config, $site_mods, $module_name, $module_info, $op_file, $mod_title, $my_head, $my_footer, $client_info, $module_config, $op, $drag_block;
    // Determine tpl file, check exists tpl file
    $layout_file = $full ? 'layout.' . $module_info['layout_funcs'][$op_file] . '.tpl' : 'simple.tpl';
    if (!file_exists(NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/layout/' . $layout_file)) {
        nv_info_die($lang_global['error_layout_title'], $lang_global['error_layout_title'], $lang_global['error_layout_content']);
    }
    if (isset($global_config['sitetimestamp'])) {
        $global_config['timestamp'] += $global_config['sitetimestamp'];
    }
    $css = nv_html_css();
    // Css for admin
    if (defined('NV_IS_ADMIN') and $full) {
        $css .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . NV_BASE_SITEURL . "themes/" . $global_config['module_theme'] . "/css/admin.css\" />\n";
    }
    // Style config
    if (isset($module_config['themes'][$global_config['module_theme']])) {
        if (!file_exists(NV_ROOTDIR . '/' . SYSTEM_FILES_DIR . '/css/theme_' . $global_config['module_theme'] . '_' . $global_config['idsite'] . '.css')) {
            $config_theme = unserialize($module_config['themes'][$global_config['module_theme']]);
            $css_content = nv_css_setproperties('body', $config_theme['body']);
            $css_content .= nv_css_setproperties('a, a:link, a:active, a:visited', $config_theme['a_link']);
            $css_content .= nv_css_setproperties('a:hover', $config_theme['a_link_hover']);
            $css_content .= nv_css_setproperties('#wraper', $config_theme['content']);
            $css_content .= nv_css_setproperties('#header, #banner', $config_theme['header']);
            $css_content .= nv_css_setproperties('#footer', $config_theme['footer']);
            $css_content .= nv_css_setproperties('.panel, .well, .nv-block-banners', $config_theme['block']);
            $css_content .= nv_css_setproperties('.panel-default>.panel-heading', $config_theme['block_heading']);
            $css_content .= nv_css_setproperties('generalcss', $config_theme['generalcss']);
            // Không nên thay đổi "generalcss"
            file_put_contents(NV_ROOTDIR . '/' . SYSTEM_FILES_DIR . '/css/theme_' . $global_config['module_theme'] . '_' . $global_config['idsite'] . '.css', $css_content);
            unset($config_theme, $css_content);
        }
        $my_footer .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . NV_BASE_SITEURL . SYSTEM_FILES_DIR . "/css/theme_" . $global_config['module_theme'] . "_" . $global_config['idsite'] . ".css?t=" . $global_config['timestamp'] . "\" />\n";
    }
    $xtpl = new XTemplate($layout_file, NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/layout');
    $xtpl->assign('LANG', $lang_global);
    $xtpl->assign('TEMPLATE', $global_config['module_theme']);
    $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
    // System variables
    $xtpl->assign('THEME_PAGE_TITLE', nv_html_page_title());
    $xtpl->assign('THEME_META_TAGS', nv_html_meta_tags());
    $xtpl->assign('THEME_SITE_RSS', nv_html_site_rss());
    $xtpl->assign('THEME_CSS', $css);
    $xtpl->assign('THEME_SITE_JS', nv_html_site_js());
    // Module contents
    $xtpl->assign('MODULE_CONTENT', $contents);
    // Header variables
    $xtpl->assign('SITE_NAME', $global_config['site_name']);
    $xtpl->assign('THEME_SITE_HREF', NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA);
    $xtpl->assign('LOGO_SRC', NV_BASE_SITEURL . $global_config['site_logo']);
    $size = @getimagesize(NV_ROOTDIR . '/' . $global_config['site_logo']);
    $xtpl->assign('LOGO_WIDTH', $size[0]);
    $xtpl->assign('LOGO_HEIGHT', $size[1]);
    if (isset($size['mime']) and $size['mime'] == 'application/x-shockwave-flash') {
        $xtpl->parse('main.swf');
    } else {
        $xtpl->parse('main.image');
    }
    if ($op == 'main') {
        $xtpl->parse('main.main_h1');
    } else {
        $xtpl->parse('main.main_none_h1');
    }
    // Only full theme
    if ($full) {
        // Search form variables
        $xtpl->assign('THEME_SEARCH_QUERY_MAX_LENGTH', NV_MAX_SEARCH_LENGTH);
        $xtpl->assign('THEME_SEARCH_SUBMIT_ONCLICK', "nv_search_submit('topmenu_search_query', 'topmenu_search_submit', " . NV_MIN_SEARCH_LENGTH . ", " . NV_MAX_SEARCH_LENGTH . ");");
        // Breadcrumbs
        if ($home != 1) {
            if ($global_config['rewrite_op_mod'] != $module_name) {
                $arr_cat_title_i = array('catid' => 0, 'title' => $module_info['custom_title'], 'link' => NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name);
                array_unshift($array_mod_title, $arr_cat_title_i);
            }
            if (!empty($array_mod_title)) {
                foreach ($array_mod_title as $arr_cat_title_i) {
                    $xtpl->assign('BREADCRUMBS', $arr_cat_title_i);
                    $xtpl->parse('main.breadcrumbs.loop');
                }
                $xtpl->parse('main.breadcrumbs');
            }
        }
        // Statistics image
        $theme_stat_img = '';
        if ($global_config['statistic'] and isset($site_mods['statistics'])) {
            $theme_stat_img .= "<a title=\"" . $lang_global['viewstats'] . "\" href=\"" . NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=statistics\"><img alt=\"" . $lang_global['viewstats'] . "\" src=\"" . NV_BASE_SITEURL . "index.php?second=statimg&amp;p=" . nv_genpass() . "\" width=\"88\" height=\"31\" /></a>\n";
        }
        $xtpl->assign('THEME_STAT_IMG', $theme_stat_img);
        // Change theme types
        if (!empty($global_config['switch_mobi_des'])) {
            $mobile_theme = empty($module_info['mobile']) ? $global_config['mobile_theme'] : $module_info['mobile'];
            if (!empty($mobile_theme)) {
                $num_theme_type = sizeof($global_config['array_theme_type']) - 1;
                foreach ($global_config['array_theme_type'] as $i => $theme_type) {
                    $xtpl->assign('STHEME_TYPE', NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;nv' . NV_LANG_DATA . 'themever=' . $theme_type . '&amp;nv_redirect=' . nv_base64_encode($client_info['selfurl']));
                    $xtpl->assign('STHEME_TITLE', $lang_global['theme_type_' . $theme_type]);
                    $xtpl->assign('STHEME_INFO', sprintf($lang_global['theme_type_chose'], $lang_global['theme_type_' . $theme_type]));
                    if ($theme_type == $global_config['current_theme_type']) {
                        $xtpl->parse('main.theme_type.loop.current');
                    } else {
                        $xtpl->parse('main.theme_type.loop.other');
                    }
                    if ($i < $num_theme_type) {
                        $xtpl->parse('main.theme_type.loop.space');
                    }
                    $xtpl->parse('main.theme_type.loop');
                }
                $xtpl->parse('main.theme_type');
            }
        }
    }
    if (!$drag_block) {
        $xtpl->parse('main.no_drag_block');
    }
    $xtpl->parse('main');
    $sitecontent = $xtpl->text('main');
    // Only full theme
    if ($full) {
        $sitecontent = nv_blocks_content($sitecontent);
        $sitecontent = str_replace('[THEME_ERROR_INFO]', nv_error_info(), $sitecontent);
        if (defined('NV_IS_ADMIN')) {
            $my_footer = nv_admin_menu() . $my_footer;
        }
    }
    if (!empty($my_head)) {
        $sitecontent = preg_replace('/(<\\/head>)/i', $my_head . '\\1', $sitecontent, 1);
    }
    if (!empty($my_footer)) {
        $sitecontent = preg_replace('/(<\\/body>)/i', $my_footer . '\\1', $sitecontent, 1);
    }
    return $sitecontent;
}
Beispiel #22
0
function nv_site_theme($contents)
{
    global $home, $array_mod_title, $lang_global, $language_array, $global_config, $site_mods, $module_name, $module_info, $op, $mod_title, $my_head, $my_footer, $client_info;
    if (!file_exists(NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/layout/layout." . $module_info['layout_funcs'][$op] . ".tpl")) {
        nv_info_die($lang_global['error_layout_title'], $lang_global['error_layout_title'], $lang_global['error_layout_content']);
    }
    $css = nv_html_css();
    $js = nv_html_site_js();
    if ($client_info['browser']['key'] != "explorer") {
        if (!$client_info['is_bot']) {
            $css .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . NV_BASE_SITEURL . "themes/" . $global_config['module_theme'] . "/css/real.css\" />\n";
        }
    } else {
        if ($client_info['browser']['version'] == 6) {
            $css .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . NV_BASE_SITEURL . "themes/" . $global_config['module_theme'] . "/css/ie6.css\" />\n";
            $js .= "<script type=\"text/javascript\" src=\"" . NV_BASE_SITEURL . "js/fix-png-ie6.js\"></script>\n";
            $js .= "<script type=\"text/javascript\">DD_belatedPNG.fix('#');</script>\n";
        } else {
            $css .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . NV_BASE_SITEURL . "themes/" . $global_config['module_theme'] . "/css/gtie6.css\" />\n";
            if ($client_info['browser']['version'] >= 9) {
                $css .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . NV_BASE_SITEURL . "themes/" . $global_config['module_theme'] . "/css/ie9.css\" />\n";
            }
        }
    }
    if (defined('NV_IS_ADMIN')) {
        $css .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . NV_BASE_SITEURL . "themes/" . $global_config['module_theme'] . "/css/admin.css\" />\n";
    }
    if (defined('NV_DISPLAY_ERRORS_LIST') and NV_DISPLAY_ERRORS_LIST != 0) {
        $css .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . NV_BASE_SITEURL . "themes/" . $global_config['module_theme'] . "/css/tab_info.css\" />\n";
    }
    $xtpl = new XTemplate("layout." . $module_info['layout_funcs'][$op] . ".tpl", NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/layout/");
    $xtpl->assign('LANG', $lang_global);
    $xtpl->assign('TEMPLATE', $global_config['module_theme']);
    $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
    $xtpl->assign('THEME_META_TAGS', nv_html_meta_tags());
    $xtpl->assign('THEME_SITE_JS', $js);
    $xtpl->assign('THEME_CSS', $css);
    $xtpl->assign('THEME_PAGE_TITLE', nv_html_page_title());
    $xtpl->assign('NV_TOP_MENU_HOME', $lang_global['Home']);
    $xtpl->assign('MODULE_CONTENT', $contents . "&nbsp;");
    $xtpl->assign('THEME_NOJS', $lang_global['nojs']);
    $xtpl->assign('THEME_LOGO_TITLE', $global_config['site_name']);
    $xtpl->assign('THEME_SITE_HREF', NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA);
    $xtpl->assign('THEME_SITE_RSS', nv_html_site_rss());
    $xtpl->assign('THEME_DIGCLOCK_TEXT', nv_date("H:i T l, d/m/Y", NV_CURRENTTIME));
    $xtpl->assign('THEME_SEARCH_QUERY_MAX_LENGTH', NV_MAX_SEARCH_LENGTH);
    $xtpl->assign('THEME_SEARCH_SUBMIT_ONCLICK', "nv_search_submit('topmenu_search_query', 'topmenu_search_checkss', 'topmenu_search_submit', " . NV_MIN_SEARCH_LENGTH . ", " . NV_MAX_SEARCH_LENGTH . ");");
    $xtpl->assign('SITE_NAME', $global_config['site_name']);
    $xtpl->assign('LOGO_SRC', NV_BASE_SITEURL . $global_config['site_logo']);
    if ($global_config['lang_multi'] and sizeof($global_config['allow_sitelangs']) > 1) {
        $xtpl->assign('SELECTLANGSITE', $lang_global['langsite']);
        foreach ($global_config['allow_sitelangs'] as $lang_i) {
            $langname = $language_array[$lang_i]['name'];
            $xtpl->assign('LANGSITENAME', $langname);
            $xtpl->assign('LANGSITEURL', NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . $lang_i);
            if (NV_LANG_DATA != $lang_i) {
                $xtpl->parse('main.language.langitem');
            } else {
                $xtpl->parse('main.language.langcuritem');
            }
        }
        $xtpl->parse('main.language');
    }
    //Breakcolumn
    if ($home != 1) {
        $arr_cat_title_i = array('catid' => 0, 'title' => $module_info['custom_title'], 'link' => NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $module_name);
        $xtpl->assign('BREAKCOLUMN', $arr_cat_title_i);
        $xtpl->parse('main.mod_title.breakcolumn');
        foreach ($array_mod_title as $arr_cat_title_i) {
            $xtpl->assign('BREAKCOLUMN', $arr_cat_title_i);
            $xtpl->parse('main.mod_title.breakcolumn');
        }
        $xtpl->parse('main.mod_title');
    }
    $theme_stat_img = "";
    if ($global_config['statistic'] and isset($site_mods['statistics'])) {
        $theme_stat_img .= "<a title=\"" . $lang_global['viewstats'] . "\" href=\"" . NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=statistics\"><img alt=\"" . $lang_global['viewstats'] . "\" title=\"" . $lang_global['viewstats'] . "\" src=\"" . NV_BASE_SITEURL . "index.php?second=statimg&amp;p=" . nv_genpass() . "\" width=\"88\" height=\"31\" /></a>\n";
    }
    $theme_footer_js = "<script type=\"text/javascript\">\n";
    $theme_footer_js .= "nv_DigitalClock('digclock');\n";
    $theme_footer_js .= "</script>\n";
    if (NV_LANG_INTERFACE == 'vi') {
        $theme_footer_js .= "<script type=\"text/javascript\" src=\"" . NV_BASE_SITEURL . "js/mudim.js\"></script>";
    }
    $xtpl->assign('THEME_STAT_IMG', $theme_stat_img);
    $xtpl->assign('THEME_IMG_CRONJOBS', NV_BASE_SITEURL . "index.php?second=cronjobs&amp;p=" . nv_genpass());
    // Chuyen doi giao dien
    if (!empty($global_config['switch_mobi_des']) and !empty($module_info['mobile'])) {
        $num_theme_type = sizeof($global_config['array_theme_type']) - 1;
        foreach ($global_config['array_theme_type'] as $i => $theme_type) {
            $xtpl->assign('STHEME_TYPE', NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $module_name . "&amp;nv" . NV_LANG_DATA . "themever=" . $theme_type . "&amp;nv_redirect=" . nv_base64_encode($client_info['selfurl']));
            $xtpl->assign('STHEME_TITLE', $lang_global['theme_type_' . $i]);
            $xtpl->assign('STHEME_INFO', sprintf($lang_global['theme_type_chose'], $lang_global['theme_type_' . $i]));
            if ($theme_type == $global_config['current_theme_type']) {
                $xtpl->parse('main.theme_type.loop.current');
            } else {
                $xtpl->parse('main.theme_type.loop.other');
            }
            if ($i < $num_theme_type) {
                $xtpl->parse('main.theme_type.loop.space');
            }
            $xtpl->parse('main.theme_type.loop');
        }
        $xtpl->parse('main.theme_type');
    }
    unset($theme_type, $i, $num_theme_type);
    $xtpl->parse('main');
    $sitecontent = $xtpl->text('main');
    $sitecontent = nv_blocks_content($sitecontent);
    $sitecontent = str_replace('[THEME_ERROR_INFO]', nv_error_info(), $sitecontent);
    $my_footer = $theme_footer_js . $my_footer;
    if (defined('NV_IS_ADMIN')) {
        $my_footer = nv_admin_menu() . $my_footer;
    }
    if (!empty($my_head)) {
        $sitecontent = preg_replace('/(<\\/head>)/i', $my_head . "\\1", $sitecontent, 1);
    }
    if (!empty($my_footer)) {
        $sitecontent = preg_replace('/(<\\/body>)/i', $my_footer . "\\1", $sitecontent, 1);
    }
    return $sitecontent;
}
Beispiel #23
0
 * @Copyright (C) 2014 VINADES., JSC. All rights reserved
 * @License GNU/GPL version 2 or any later version
 * @Createdate 3-6-2010 0:14
 */
if (!defined('NV_IS_MOD_SHOPS')) {
    die('Stop!!!');
}
$page_title = $module_info['custom_title'];
$key_words = $module_info['keywords'];
if (!$pro_config['point_active']) {
    Header('Location: ' . nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name, true));
    die;
}
if (!defined('NV_IS_USER')) {
    $redirect = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=point';
    Header('Location: ' . NV_BASE_SITEURL . 'index.php?' . NV_NAME_VARIABLE . '=users&' . NV_OP_VARIABLE . '=login&nv_redirect=' . nv_base64_encode($redirect));
    die;
}
$data_content = array();
$point = 0;
$per_page = 20;
$page = $nv_Request->get_int('page', 'get', 1);
$base_url = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op;
// Lay so diem hien tai cua khach hang
$result = $db->query('SELECT point_total FROM ' . $db_config['prefix'] . '_' . $module_data . '_point WHERE userid = ' . $user_info['userid']);
if ($result->rowCount() > 0) {
    $point = $result->fetchColumn();
    $money = $point * $pro_config['point_conversion'];
}
if ($nv_Request->isset_request('paypoint', 'get')) {
    $order_id = $nv_Request->get_int('order_id', 'get', 0);
Beispiel #24
0
                nv_create_submenu();
            }
            // Ket noi voi cac op cua module de thuc hien
            if ($is_mobile and file_exists(NV_ROOTDIR . '/modules/' . $module_file . '/mobile/' . $op_file . '.php')) {
                require NV_ROOTDIR . '/modules/' . $module_file . '/mobile/' . $op_file . '.php';
            } else {
                require NV_ROOTDIR . '/modules/' . $module_file . '/funcs/' . $op_file . '.php';
            }
            exit;
        } elseif (isset($module_info['funcs']['main'])) {
            $sth = $db->prepare('UPDATE ' . NV_MODULES_TABLE . ' SET act=2 WHERE title= :title');
            $sth->bindParam(':title', $module_name, PDO::PARAM_STR);
            $sth->execute();
            nv_insert_notification('modules', 'auto_deactive_module', array('custom_title' => $site_mods[$module_name]['custom_title']));
            nv_del_moduleCache('modules');
        }
    } elseif (isset($sys_mods[$module_name])) {
        $groups_view = (string) $sys_mods[$module_name]['groups_view'];
        if (!defined('NV_IS_USER') and $groups_view == 4) {
            // Login users
            Header('Location: ' . NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=users&' . NV_OP_VARIABLE . '=login&nv_redirect=' . nv_base64_encode($client_info['selfurl']));
            die;
        } elseif (!defined('NV_IS_ADMIN') and ($groups_view == '2' or $groups_view == '1')) {
            // Exit
            nv_info_die($lang_global['error_404_title'], $lang_global['site_info'], $lang_global['module_for_admin']);
        } elseif (defined('NV_IS_USER') and !nv_user_in_groups($groups_view)) {
            nv_info_die($lang_global['error_404_title'], $lang_global['error_404_title'], $lang_global['error_404_content']);
        }
    }
}
nv_info_die($lang_global['error_404_title'], $lang_global['error_404_title'], $lang_global['error_404_content']);
Beispiel #25
0
        $xtpl->assign('USER_LOSTPASS', NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=users&amp;' . NV_OP_VARIABLE . '=lostpass');
        $xtpl->assign('LANG', $lang_global);
        if (in_array($global_config['gfx_chk'], array(2, 4, 5, 7))) {
            $xtpl->assign('N_CAPTCHA', $lang_global['securitycode']);
            $xtpl->assign('CAPTCHA_REFRESH', $lang_global['captcharefresh']);
            $xtpl->assign('GFX_WIDTH', NV_GFX_WIDTH);
            $xtpl->assign('GFX_HEIGHT', NV_GFX_HEIGHT);
            $xtpl->assign('CAPTCHA_REFR_SRC', NV_BASE_SITEURL . 'images/refresh.png');
            $xtpl->assign('SRC_CAPTCHA', NV_BASE_SITEURL . 'index.php?scaptcha=captcha&t=' . NV_CURRENTTIME);
            $xtpl->assign('GFX_MAXLENGTH', NV_GFX_NUM);
            $xtpl->parse('main.captcha');
        }
        if (defined('NV_OPENID_ALLOWED')) {
            $xtpl->assign('OPENID_IMG_SRC', NV_BASE_SITEURL . 'themes/' . $block_theme . '/images/users/openid_small.gif');
            $xtpl->assign('OPENID_IMG_WIDTH', 24);
            $xtpl->assign('OPENID_IMG_HEIGHT', 24);
            $assigns = array();
            foreach ($global_config['openid_servers'] as $server) {
                $assigns['href'] = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=users&amp;" . NV_OP_VARIABLE . "=oauth&amp;server=" . $server . "&amp;nv_redirect=" . nv_base64_encode($client_info['selfurl']);
                $assigns['title'] = ucfirst($server);
                $assigns['img_src'] = NV_BASE_SITEURL . "themes/" . $block_theme . "/images/users/" . $server . ".gif";
                $assigns['img_width'] = $assigns['img_height'] = 24;
                $xtpl->assign('OPENID', $assigns);
                $xtpl->parse('main.openid.server');
            }
            $xtpl->parse('main.openid');
        }
        $xtpl->parse('main');
        $content = $xtpl->text('main');
    }
}
Beispiel #26
0
$smtp_encrypted_array[2] = 'TSL';
$array_config = array();
$errormess = '';
$array_config['mailer_mode'] = nv_substr($nv_Request->get_title('mailer_mode', 'post', $global_config['mailer_mode'], 1), 0, 255);
$array_config['smtp_host'] = nv_substr($nv_Request->get_title('smtp_host', 'post', $global_config['smtp_host'], 1), 0, 255);
$array_config['smtp_port'] = nv_substr($nv_Request->get_title('smtp_port', 'post', $global_config['smtp_port'], 1), 0, 255);
$array_config['smtp_username'] = nv_substr($nv_Request->get_title('smtp_username', 'post', $global_config['smtp_username']), 0, 255);
$array_config['smtp_password'] = nv_substr($nv_Request->get_title('smtp_password', 'post', $global_config['smtp_password']), 0, 255);
if ($nv_Request->isset_request('mailer_mode', 'post')) {
    $array_config['smtp_ssl'] = $nv_Request->get_int('smtp_ssl', 'post', 0);
} else {
    $array_config['smtp_ssl'] = intval($global_config['smtp_ssl']);
}
if ($nv_Request->isset_request('mailer_mode', 'post')) {
    $smtp_password = $array_config['smtp_password'];
    $array_config['smtp_password'] = nv_base64_encode($crypt->aes_encrypt($smtp_password));
    $sth = $db->prepare("UPDATE " . NV_CONFIG_GLOBALTABLE . " SET config_value = :config_value WHERE lang = 'sys' AND module = 'site' AND config_name = :config_name");
    foreach ($array_config as $config_name => $config_value) {
        $sth->bindParam(':config_name', $config_name, PDO::PARAM_STR, 30);
        $sth->bindParam(':config_value', $config_value, PDO::PARAM_STR);
        $sth->execute();
    }
    nv_del_moduleCache('settings');
    if ($array_config['smtp_ssl'] == 1 and $array_config['mailer_mode'] == 'smtp') {
        require_once NV_ROOTDIR . '/includes/core/phpinfo.php';
        $array_phpmod = phpinfo_array(8, 1);
        if (!empty($array_phpmod) and !array_key_exists('openssl', $array_phpmod)) {
            $errormess = $lang_module['smtp_error_openssl'];
        }
    }
    if (empty($errormess)) {
Beispiel #27
0
        $xtpl->assign('ROW', array('class' => ++$a % 2 ? " class=\"second\"" : "", 'bid' => $row['bid'], 'title' => $row['title'], 'module' => $row['module'], 'file_name' => $row['file_name'], 'active' => $row['active'] ? $lang_global['yes'] : $lang_global['no']));
        $numposition = $blocks_positions[$row['position']];
        for ($i = 1; $i <= $numposition; ++$i) {
            $xtpl->assign('WEIGHT', array('key' => $i, 'selected' => $row['weight'] == $i ? ' selected="selected"' : ''));
            $xtpl->parse('main.loop.weight');
        }
        for ($i = 0, $count = sizeof($positions); $i < $count; ++$i) {
            $xtpl->assign('POSITION', array('key' => (string) $positions[$i]->tag, 'selected' => $row['position'] == $positions[$i]->tag ? ' selected="selected"' : '', 'title' => (string) $positions[$i]->name));
            $xtpl->parse('main.loop.position');
        }
        if ($row['all_func'] == 1) {
            $xtpl->parse('main.loop.all_func');
        } else {
            $result_func = $db->sql_query("SELECT a.func_id, a.in_module, a.func_custom_name FROM `" . NV_MODFUNCS_TABLE . "` AS a INNER JOIN `" . NV_BLOCKS_TABLE . "_weight` AS b ON a.func_id=b.func_id WHERE b.bid=" . $row['bid'] . "");
            while (list($funcid_inlist, $func_inmodule, $funcname_inlist) = $db->sql_fetchrow($result_func)) {
                $xtpl->assign('FUNCID_INLIST', $funcid_inlist);
                $xtpl->assign('FUNC_INMODULE', $func_inmodule);
                $xtpl->assign('FUNCNAME_INLIST', $funcname_inlist);
                $xtpl->parse('main.loop.func_inmodule');
            }
        }
        $xtpl->parse('main.loop');
    }
    $xtpl->assign('BLOCKREDIRECT', nv_base64_encode($client_info['selfurl']));
    $xtpl->assign('CHECKSS', md5($selectthemes . $global_config['sitekey'] . session_id()));
    $xtpl->parse('main');
    $contents = $xtpl->text('main');
}
include NV_ROOTDIR . "/includes/header.php";
echo nv_admin_theme($contents);
include NV_ROOTDIR . "/includes/footer.php";
Beispiel #28
0
        for ($i = 1; $i <= $rowscat['lev']; $i++) {
            $xtitle_i .= '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
        }
    }
    $rowscat['title'] = $xtitle_i . $rowscat['title'];
    $rowscat['selected'] = $catid_i == $rowcontent['listcatid'] ? ' selected="selected"' : '';
    $xtpl->assign('ROWSCAT', $rowscat);
    $xtpl->parse('main.rowscat');
}
// List group
if (!empty($rowcontent['group_id'])) {
    $array_groupid_in_row = $rowcontent['group_id'];
} else {
    $array_groupid_in_row = array();
}
$inrow = nv_base64_encode(serialize($array_groupid_in_row));
$xtpl->assign('url_load', NV_BASE_ADMINURL . 'index.php?' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=getgroup&cid=' . $rowcontent['listcatid'] . '&inrow=' . $inrow);
$xtpl->assign('inrow', $inrow);
$xtpl->parse('main.listgroup');
// Time update
$xtpl->assign('publ_date', $publ_date);
$select = '';
$_gift_from_h = $_gift_to_h = '';
for ($i = 0; $i <= 23; $i++) {
    $select .= "<option value=\"" . $i . "\"" . ($i == $phour ? " selected=\"selected\"" : "") . ">" . str_pad($i, 2, "0", STR_PAD_LEFT) . "</option>\n";
    $_gift_from_h .= "<option value=\"" . $i . "\"" . ($i == $gift_from_h ? " selected=\"selected\"" : "") . ">" . str_pad($i, 2, "0", STR_PAD_LEFT) . "</option>\n";
    $_gift_to_h .= "<option value=\"" . $i . "\"" . ($i == $gift_to_h ? " selected=\"selected\"" : "") . ">" . str_pad($i, 2, "0", STR_PAD_LEFT) . "</option>\n";
}
$xtpl->assign('phour', $select);
$xtpl->assign('gift_from_h', $_gift_from_h);
$xtpl->assign('gift_to_h', $_gift_to_h);
Beispiel #29
0
 $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'site', 'site_email', " . $db->quote($global_config['site_email']) . ")");
 $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'error_set_logs', " . $db->quote($global_config['error_set_logs']) . ")");
 $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'error_send_email', " . $db->quote($global_config['site_email']) . ")");
 $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'site_lang', '" . NV_LANG_DATA . "')");
 $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'my_domains', " . $db->quote(NV_SERVER_NAME) . ")");
 $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'cookie_prefix', " . $db->quote($global_config['cookie_prefix']) . ")");
 $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'session_prefix', " . $db->quote($global_config['session_prefix']) . ")");
 $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'site_timezone', " . $db->quote($global_config['site_timezone']) . ")");
 $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'proxy_blocker', " . $db->quote($global_config['proxy_blocker']) . ")");
 $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'str_referer_blocker', " . $db->quote($global_config['str_referer_blocker']) . ")");
 $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'lang_multi', " . $db->quote($global_config['lang_multi']) . ")");
 $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'lang_geo', " . $db->quote($global_config['lang_geo']) . ")");
 $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'ftp_server', " . $db->quote($global_config['ftp_server']) . ")");
 $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'ftp_port', " . $db->quote($global_config['ftp_port']) . ")");
 $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'ftp_user_name', " . $db->quote($global_config['ftp_user_name']) . ")");
 $ftp_user_pass = nv_base64_encode($crypt->aes_encrypt($global_config['ftp_user_pass']));
 $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'ftp_user_pass', " . $db->quote($ftp_user_pass) . ")");
 $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'ftp_path', " . $db->quote($global_config['ftp_path']) . ")");
 $db->query("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'ftp_check_login', " . $db->quote($global_config['ftp_check_login']) . ")");
 $db->query("UPDATE " . NV_CONFIG_GLOBALTABLE . " SET config_value = " . $db->quote($array_data['site_name']) . " WHERE module = 'global' AND config_name = 'site_name'");
 $result = $db->query("SELECT * FROM " . $db_config['prefix'] . "_authors_module ORDER BY weight ASC");
 while ($row = $result->fetch()) {
     $checksum = md5($row['module'] . "#" . $row['act_1'] . "#" . $row['act_2'] . "#" . $row['act_3'] . "#" . $global_config['sitekey']);
     $db->query("UPDATE " . $db_config['prefix'] . "_authors_module SET checksum = '" . $checksum . "' WHERE mid = " . $row['mid']);
 }
 if (!(nv_function_exists('finfo_open') or nv_class_exists('finfo', false) or nv_function_exists('mime_content_type') or substr($sys_info['os'], 0, 3) != 'WIN' and (nv_function_exists('system') or nv_function_exists('exec')))) {
     $db->query("UPDATE " . NV_CONFIG_GLOBALTABLE . " SET config_value = 'mild' WHERE lang='sys' AND module = 'global' AND config_name = 'upload_checking_mode'");
 }
 if (empty($array_data['lang_multi'])) {
     $global_config['rewrite_optional'] = 1;
     $global_config['lang_multi'] = 0;
 * @Project NUKEVIET 4.x
 * @Author VINADES., JSC (contact@vinades.vn)
 * @Copyright (C) 2014 VINADES ., JSC. All rights reserved
 * @License GNU/GPL version 2 or any later version
 * @Createdate Dec 29, 2010 10:42:00 PM
 */
if (!defined('NV_IS_MOD_SHOPS')) {
    die('Stop!!!');
}
require_once NV_ROOTDIR . "/modules/" . $module_file . "/payment/nganluong.class.php";
$nl = new NL_Checkout($payment_config['checkout_url'], $payment_config['merchant_site'], $payment_config['secure_pass']);
$data_orders_return = $nl->checkOrders($payment_config['public_api_url'], $array_order);
foreach ($data_orders_return as $data_transaction_id) {
    if ($data_transaction_id['TRANSACTION_ERROR_CODE'] == '00') {
        $order_code = $data_transaction_id['ORDER_CODE'];
        $payment_data = nv_base64_encode(serialize($data_transaction_id));
        $payment_data_old = $array_order[$order_code]['payment_data'];
        if ($payment_data != $payment_data_old) {
            $nv_transaction_status = intval($data_transaction_id['nv_transaction_status']);
            $payment_amount = intval($data_transaction_id['AMOUNT']);
            $payment_time = max($data_transaction_id['CREATED_TIME'], $data_transaction_id['PAID_TIME']);
            $order_id = $array_order[$order_code]['order_id'];
            $payment_id = intval($data_transaction_id['PAYMENT_ID']);
            $transaction_id = $db->insert_id("INSERT INTO " . $db_config['prefix'] . "_" . $module_data . "_transaction (transaction_id, transaction_time, transaction_status, order_id, userid, payment, payment_id, payment_time, payment_amount, payment_data) VALUES (NULL, " . NV_CURRENTTIME . ", '" . $nv_transaction_status . "', '" . $order_id . "', '0', '" . $payment . "', '" . $payment_id . "', '" . $payment_time . "', '" . $payment_amount . "', '" . $payment_data . "')");
            if ($transaction_id > 0) {
                $db->query("UPDATE " . $db_config['prefix'] . "_" . $module_data . "_orders SET transaction_status=" . $nv_transaction_status . " , transaction_id = " . $transaction_id . " , transaction_count = transaction_count+1 WHERE order_id=" . $order_id);
                $array_update_order[] = $order_code;
            }
        }
    }
}