Ejemplo n.º 1
0
<?php

/**
 * @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 3-6-2010 0:14
 */
if (!defined('NV_IS_MOD_SHOPS')) {
    die('Stop!!!');
}
if (!defined('NV_IS_USER')) {
    $redirect = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=cart";
    Header("Location: " . NV_BASE_SITEURL . "index.php?" . NV_NAME_VARIABLE . "=users&" . NV_OP_VARIABLE . "=login&nv_redirect=" . nv_redirect_encrypt($redirect));
    die;
}
$data_content = array();
$sql = "SELECT order_id, order_code, order_note, user_id, unit_total, order_total, order_time, transaction_status, transaction_id, transaction_count FROM " . $db_config['prefix'] . "_" . $module_data . "_orders WHERE user_id = " . $user_info["userid"] . " ORDER BY order_id DESC";
$result = $db->query($sql);
$link_module = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $module_name;
while (list($order_id, $order_code, $order_note, $user_id, $unit_total, $order_total, $order_time, $transaction_status, $transaction_id, $transaction_count) = $result->fetch(3)) {
    $checkss = md5($order_id . $global_config['sitekey'] . session_id());
    $data_content[] = array("order_id" => $order_id, "order_code" => $order_code, "transaction_status" => $transaction_status, "transaction_id" => $transaction_id, "transaction_count" => $transaction_count, "order_note" => $order_note, "user_id" => $user_id, "unit_total" => $unit_total, "order_total" => $order_total, "order_time" => $order_time, "link" => $link_module . "&amp;" . NV_OP_VARIABLE . "=payment&amp;order_id=" . $order_id . "&checkss=" . $checkss, "link_remove" => $link_module . "&amp;" . NV_OP_VARIABLE . "=delhis&amp;order_id=" . $order_id . "&checkss=" . $checkss);
}
$link_check_order = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=checkorder&checkss=" . md5($user_info["userid"] . $global_config['sitekey'] . session_id());
$contents = call_user_func("history_order", $data_content, $link_check_order);
$page_title = $lang_module['history_title'];
include NV_ROOTDIR . '/includes/header.php';
echo nv_site_theme($contents);
include NV_ROOTDIR . '/includes/footer.php';
Ejemplo n.º 2
0
$cookies = $array['cookies'];
$array = !empty($array['body']) ? is_serialized_string($array['body']) ? unserialize($array['body']) : array() : array();
$error = '';
if (!empty(NukeViet\Http\Http::$error)) {
    $error = nv_http_get_lang(NukeViet\Http\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_redirect_encrypt($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'];
Ejemplo n.º 3
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_redirect_encrypt($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';
}
Ejemplo n.º 4
0
if (file_exists(NV_ROOTDIR . '/themes/' . $selectthemes . '/config.ini')) {
    $page_title = $lang_module['blocks'] . ':' . $selectthemes;
    $xtpl = new XTemplate('blocks.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $module_file);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('GLANG', $lang_global);
    $xtpl->assign('MODULE_NAME', $module_name);
    $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
    $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('SELECTTHEMES', $selectthemes);
    $new_drag_block = $nv_Request->get_int('drag_block', 'session', 0) ? 0 : 1;
    $lang_drag_block = $new_drag_block ? $lang_global['drag_block'] : $lang_global['no_drag_block'];
    $url_dblock = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;drag_block=' . $new_drag_block;
    if (empty($new_drag_block)) {
        $url_dblock .= '&amp;nv_redirect=' . nv_redirect_encrypt(NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=blocks&selectthemes=' . $selectthemes);
    }
    $xtpl->assign('URL_DBLOCK', $url_dblock);
    $xtpl->assign('LANG_DBLOCK', $lang_drag_block);
    $result = $db->query('SELECT title, custom_title FROM ' . NV_MODULES_TABLE . ' ORDER BY weight ASC');
    while (list($m_title, $m_custom_title) = $result->fetch(3)) {
        $xtpl->assign('MODULE', array('key' => $m_title, 'title' => $m_custom_title));
        $xtpl->parse('main.module');
    }
    $a = 0;
    //load position file
    $xml = simplexml_load_file(NV_ROOTDIR . '/themes/' . $selectthemes . '/config.ini');
    $content = $xml->xpath('positions');
    $positions = $content[0]->position;
    $blocks_positions = array();
    $sth = $db->prepare('SELECT position, COUNT(*) FROM ' . NV_BLOCKS_TABLE . '_groups WHERE theme = :theme GROUP BY position');
Ejemplo n.º 5
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 . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=point';
    Header('Location: ' . NV_BASE_SITEURL . 'index.php?' . NV_NAME_VARIABLE . '=users&' . NV_OP_VARIABLE . '=login&nv_redirect=' . nv_redirect_encrypt($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);
Ejemplo n.º 6
0
 /**
  * nv_block_login()
  *
  * @param mixed $block_config
  * @return void
  */
 function nv_block_login($block_config)
 {
     global $client_info, $global_config, $module_name, $user_info, $lang_global, $my_head, $admin_info, $blockID, $db, $module_info, $site_mods, $db_config;
     $content = '';
     if ($global_config['allowuserlogin']) {
         if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/users/block.login.tpl')) {
             $block_theme = $global_config['module_theme'];
         } elseif (file_exists(NV_ROOTDIR . '/themes/' . $global_config['site_theme'] . '/modules/users/block.login.tpl')) {
             $block_theme = $global_config['site_theme'];
         } else {
             $block_theme = 'default';
         }
         $xtpl = new XTemplate('block.login.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/modules/users');
         if (file_exists(NV_ROOTDIR . '/modules/users/language/' . NV_LANG_DATA . '.php')) {
             include NV_ROOTDIR . '/modules/users/language/' . NV_LANG_DATA . '.php';
         } else {
             include NV_ROOTDIR . '/modules/users/language/vi.php';
         }
         $xtpl->assign('LANG', $lang_module);
         $xtpl->assign('GLANG', $lang_global);
         $xtpl->assign('BLOCKID', $blockID);
         if (defined('NV_IS_USER')) {
             if (file_exists(NV_ROOTDIR . '/' . $user_info['photo']) and !empty($user_info['photo'])) {
                 $avata = NV_BASE_SITEURL . $user_info['photo'];
             } else {
                 $avata = NV_BASE_SITEURL . 'themes/' . $block_theme . '/images/users/no_avatar.png';
             }
             $user_info['current_login_txt'] = nv_date('d/m, H:i', $user_info['current_login']);
             $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
             $xtpl->assign('NV_LANG_VARIABLE', NV_LANG_VARIABLE);
             $xtpl->assign('NV_LANG_DATA', NV_LANG_DATA);
             $xtpl->assign('URL_LOGOUT', defined('NV_IS_ADMIN') ? 'nv_admin_logout' : 'bt_logout');
             $xtpl->assign('MODULENAME', $module_info['custom_title']);
             $xtpl->assign('AVATA', $avata);
             $xtpl->assign('USER', $user_info);
             $xtpl->assign('WELCOME', defined('NV_IS_ADMIN') ? $lang_global['admin_account'] : $lang_global['your_account']);
             $xtpl->assign('LEVEL', defined('NV_IS_ADMIN') ? $admin_info['level'] : 'user');
             $xtpl->assign('URL_MODULE', NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=users');
             $xtpl->assign('URL_AVATAR', nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=users&amp;' . NV_OP_VARIABLE . '=avatar/upd', true));
             $xtpl->assign('URL_HREF', NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=users&amp;' . NV_OP_VARIABLE . '=');
             if (defined('NV_OPENID_ALLOWED')) {
                 $xtpl->parse('signed.allowopenid');
             }
             if (defined('NV_IS_ADMIN')) {
                 $new_drag_block = defined('NV_IS_DRAG_BLOCK') ? 0 : 1;
                 $lang_drag_block = $new_drag_block ? $lang_global['drag_block'] : $lang_global['no_drag_block'];
                 $xtpl->assign('NV_ADMINDIR', NV_ADMINDIR);
                 $xtpl->assign('URL_DBLOCK', NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;drag_block=' . $new_drag_block);
                 $xtpl->assign('LANG_DBLOCK', $lang_drag_block);
                 $xtpl->assign('URL_ADMINMODULE', NV_BASE_SITEURL . NV_ADMINDIR . '/index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name);
                 $xtpl->assign('URL_AUTHOR', NV_BASE_SITEURL . NV_ADMINDIR . '/index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=authors&amp;id=' . $admin_info['admin_id']);
                 if (defined('NV_IS_SPADMIN')) {
                     $xtpl->parse('signed.admintoolbar.is_spadadmin');
                 }
                 if (defined('NV_IS_MODADMIN') and !empty($module_info['admin_file'])) {
                     $xtpl->parse('signed.admintoolbar.is_modadmin');
                 }
                 $xtpl->parse('signed.admintoolbar');
             }
             $xtpl->parse('signed');
             $content = $xtpl->text('signed');
         } else {
             $xtpl->assign('USER_LOGIN', NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=users&amp;' . NV_OP_VARIABLE . '=login');
             $xtpl->assign('USER_REGISTER', NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=users&amp;' . NV_OP_VARIABLE . '=register');
             $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('NICK_MAXLENGTH', NV_UNICKMAX);
             $xtpl->assign('NICK_MINLENGTH', NV_UNICKMIN);
             $xtpl->assign('PASS_MAXLENGTH', NV_UPASSMAX);
             $xtpl->assign('PASS_MINLENGTH', NV_UPASSMIN);
             $xtpl->assign('GFX_WIDTH', NV_GFX_WIDTH);
             $xtpl->assign('GFX_HEIGHT', NV_GFX_HEIGHT);
             $xtpl->assign('GFX_MAXLENGTH', NV_GFX_NUM);
             $xtpl->assign('N_CAPTCHA', $lang_global['securitycode']);
             $xtpl->assign('CAPTCHA_REFRESH', $lang_global['captcharefresh']);
             $xtpl->assign('SRC_CAPTCHA', NV_BASE_SITEURL . 'index.php?scaptcha=captcha&t=' . NV_CURRENTTIME);
             $xtpl->assign('NV_HEADER', '');
             $xtpl->assign('NV_REDIRECT', '');
             $username_rule = empty($global_config['nv_unick_type']) ? sprintf($lang_global['username_rule_nolimit'], NV_UNICKMIN, NV_UNICKMAX) : sprintf($lang_global['username_rule_limit'], $lang_global['unick_type_' . $global_config['nv_unick_type']], NV_UNICKMIN, NV_UNICKMAX);
             $password_rule = empty($global_config['nv_upass_type']) ? sprintf($lang_global['password_rule_nolimit'], NV_UPASSMIN, NV_UPASSMAX) : sprintf($lang_global['password_rule_limit'], $lang_global['upass_type_' . $global_config['nv_upass_type']], NV_UPASSMIN, NV_UPASSMAX);
             $display_layout = empty($block_config['display_mode']) ? 'display_form' : 'display_button';
             $xtpl->assign('USERNAME_RULE', $username_rule);
             $xtpl->assign('PASSWORD_RULE', $password_rule);
             if (in_array($global_config['gfx_chk'], array(2, 4, 5, 7))) {
                 $xtpl->parse('main.' . $display_layout . '.captcha');
             }
             if (in_array($global_config['gfx_chk'], array(3, 4, 6, 7))) {
                 $xtpl->parse('main.allowuserreg.reg_captcha');
             }
             if (defined('NV_OPENID_ALLOWED')) {
                 foreach ($global_config['openid_servers'] as $server) {
                     $assigns = array();
                     $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_redirect_encrypt($client_info['selfurl']);
                     $assigns['title'] = $lang_global['openid_login'] . ' ' . ucfirst($server);
                     $assigns['img_src'] = NV_BASE_SITEURL . 'themes/' . $block_theme . '/images/users/' . $server . '.png';
                     $assigns['img_width'] = $assigns['img_height'] = 24;
                     $xtpl->assign('OPENID', $assigns);
                     $xtpl->parse('main.' . $display_layout . '.openid.server');
                 }
                 $xtpl->parse('main.' . $display_layout . '.openid');
             }
             if ($global_config['allowuserreg']) {
                 if (empty($block_config['popup_register'])) {
                     !empty($block_config['display_mode']) ? $xtpl->parse('main.' . $display_layout . '.allowuserreg_link') : $xtpl->parse('main.' . $display_layout . '.allowuserreg_linkform');
                 } else {
                     $data_questions = array();
                     $sql = "SELECT qid, title FROM " . $db_config['prefix'] . "_" . $site_mods[$block_config['module']]['module_data'] . "_question WHERE lang='" . NV_LANG_DATA . "' ORDER BY weight ASC";
                     $result = $db->query($sql);
                     while ($row = $result->fetch()) {
                         $data_questions[$row['qid']] = array('qid' => $row['qid'], 'title' => $row['title']);
                     }
                     foreach ($data_questions as $array_question_i) {
                         $xtpl->assign('QUESTION', $array_question_i['title']);
                         $xtpl->parse('main.allowuserreg.frquestion');
                     }
                     $datepicker = false;
                     $array_field_config = array();
                     $result_field = $db->query('SELECT * FROM ' . $db_config['prefix'] . '_' . $site_mods[$block_config['module']]['module_data'] . '_field ORDER BY weight ASC');
                     while ($row_field = $result_field->fetch()) {
                         $language = unserialize($row_field['language']);
                         $row_field['title'] = isset($language[NV_LANG_DATA]) ? $language[NV_LANG_DATA][0] : $row['field'];
                         $row_field['description'] = isset($language[NV_LANG_DATA]) ? nv_htmlspecialchars($language[NV_LANG_DATA][1]) : '';
                         if (!empty($row_field['field_choices'])) {
                             $row_field['field_choices'] = unserialize($row_field['field_choices']);
                         } elseif (!empty($row_field['sql_choices'])) {
                             $row_field['sql_choices'] = explode('|', $row_field['sql_choices']);
                             $query = 'SELECT ' . $row_field['sql_choices'][2] . ', ' . $row_field['sql_choices'][3] . ' FROM ' . $row_field['sql_choices'][1];
                             $result = $db->query($query);
                             $weight = 0;
                             while (list($key, $val) = $result->fetch(3)) {
                                 $row_field['field_choices'][$key] = $val;
                             }
                         }
                         $array_field_config[] = $row_field;
                     }
                     if (!empty($array_field_config)) {
                         $userid = 0;
                         foreach ($array_field_config as $_k => $row) {
                             $row['customID'] = $_k;
                             if ($row['show_register'] and $userid == 0 or $userid > 0) {
                                 if ($userid == 0 and empty($custom_fields)) {
                                     if (!empty($row['field_choices'])) {
                                         if ($row['field_type'] == 'date') {
                                             $row['value'] = $row['field_choices']['current_date'] ? NV_CURRENTTIME : $row['default_value'];
                                         } elseif ($row['field_type'] == 'number') {
                                             $row['value'] = $row['default_value'];
                                         } else {
                                             $temp = array_keys($row['field_choices']);
                                             $tempkey = intval($row['default_value']) - 1;
                                             $row['value'] = isset($temp[$tempkey]) ? $temp[$tempkey] : '';
                                         }
                                     } else {
                                         $row['value'] = $row['default_value'];
                                     }
                                 } else {
                                     $row['value'] = isset($custom_fields[$row['field']]) ? $custom_fields[$row['field']] : $row['default_value'];
                                 }
                                 $row['required'] = $row['required'] ? 'required' : '';
                                 $xtpl->assign('FIELD', $row);
                                 if ($row['required']) {
                                     $xtpl->parse('main.allowuserreg.field.loop.required');
                                 }
                                 if ($row['field_type'] == 'textbox' or $row['field_type'] == 'number') {
                                     $xtpl->parse('main.allowuserreg.field.loop.textbox');
                                 } elseif ($row['field_type'] == 'date') {
                                     $row['value'] = empty($row['value']) ? '' : date('d/m/Y', $row['value']);
                                     $xtpl->assign('FIELD', $row);
                                     $xtpl->parse('main.allowuserreg.field.loop.date');
                                     $datepicker = true;
                                 } elseif ($row['field_type'] == 'textarea') {
                                     $row['value'] = nv_htmlspecialchars(nv_br2nl($row['value']));
                                     $xtpl->assign('FIELD', $row);
                                     $xtpl->parse('main.allowuserreg.field.loop.textarea');
                                 } elseif ($row['field_type'] == 'editor') {
                                     $row['value'] = htmlspecialchars(nv_editor_br2nl($row['value']));
                                     if (defined('NV_EDITOR') and nv_function_exists('nv_aleditor')) {
                                         $array_tmp = explode('@', $row['class']);
                                         $edits = nv_aleditor('custom_fields[' . $row['field'] . ']', $array_tmp[0], $array_tmp[1], $row['value']);
                                         $xtpl->assign('EDITOR', $edits);
                                         $xtpl->parse('main.allowuserreg.field.loop.editor');
                                     } else {
                                         $row['class'] = '';
                                         $xtpl->assign('FIELD', $row);
                                         $xtpl->parse('main.allowuserreg.field.loop.textarea');
                                     }
                                 } elseif ($row['field_type'] == 'select') {
                                     foreach ($row['field_choices'] as $key => $value) {
                                         $xtpl->assign('FIELD_CHOICES', array('key' => $key, 'selected' => $key == $row['value'] ? ' selected="selected"' : '', 'value' => $value));
                                         $xtpl->parse('main.allowuserreg.field.loop.select.loop');
                                     }
                                     $xtpl->parse('main.allowuserreg.field.loop.select');
                                 } elseif ($row['field_type'] == 'radio') {
                                     $number = 0;
                                     foreach ($row['field_choices'] as $key => $value) {
                                         $xtpl->assign('FIELD_CHOICES', array('id' => $row['fid'] . '_' . $number++, 'key' => $key, 'checked' => $key == $row['value'] ? ' checked="checked"' : '', 'value' => $value));
                                         $xtpl->parse('main.allowuserreg.field.loop.radio.loop');
                                     }
                                     $xtpl->parse('main.allowuserreg.field.loop.radio');
                                 } elseif ($row['field_type'] == 'checkbox') {
                                     $number = 0;
                                     $valuecheckbox = !empty($row['value']) ? explode(',', $row['value']) : array();
                                     foreach ($row['field_choices'] as $key => $value) {
                                         $xtpl->assign('FIELD_CHOICES', array('id' => $row['fid'] . '_' . $number++, 'key' => $key, 'checked' => in_array($key, $valuecheckbox) ? ' checked="checked"' : '', 'value' => $value));
                                         $xtpl->parse('main.allowuserreg.field.loop.checkbox.loop');
                                     }
                                     $xtpl->parse('main.allowuserreg.field.loop.checkbox');
                                 } elseif ($row['field_type'] == 'multiselect') {
                                     $valueselect = !empty($row['value']) ? explode(',', $row['value']) : array();
                                     foreach ($row['field_choices'] as $key => $value) {
                                         $xtpl->assign('FIELD_CHOICES', array('key' => $key, 'selected' => in_array($key, $valueselect) ? ' selected="selected"' : '', 'value' => $value));
                                         $xtpl->parse('main.allowuserreg.field.loop.multiselect.loop');
                                     }
                                     $xtpl->parse('main.allowuserreg.field.loop.multiselect');
                                 }
                                 $xtpl->parse('main.allowuserreg.field.loop');
                             }
                         }
                         $xtpl->parse('main.allowuserreg.field');
                     }
                     $xtpl->parse('main.allowuserreg');
                     !empty($block_config['display_mode']) ? $xtpl->parse('main.' . $display_layout . '.allowuserreg2') : $xtpl->parse('main.' . $display_layout . '.allowuserreg2_form');
                     if ($datepicker) {
                         $xtpl->parse('main.datepicker');
                     }
                 }
             }
             $xtpl->parse('main.' . $display_layout);
             $xtpl->parse('main');
             $content = $xtpl->text('main');
         }
     }
     return $content;
 }
Ejemplo n.º 7
0
/**
 * nv_download_content
 *
 * @param mixed $data_content
 * @param mixed $linktab
 * @return
 */
function nv_download_content($data_content)
{
    global $module_info, $lang_module, $lang_global, $module_name, $module_data, $module_file, $pro_config, $op;
    $xtpl = new XTemplate('download_content.tpl', NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $module_file);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('proid', $data_content['id']);
    if (!empty($data_content['files'])) {
        $login = 0;
        foreach ($data_content['files'] as $files) {
            if (file_exists(NV_ROOTDIR . '/themes/' . $module_info['template'] . '/images/' . $module_file . '/icon_files/' . $files['extension'] . '.png')) {
                $files['extension_icon'] = NV_BASE_SITEURL . 'themes/' . $module_info['template'] . '/images/' . $module_file . '/icon_files/' . $files['extension'] . '.png';
            } else {
                $files['extension_icon'] = NV_BASE_SITEURL . 'themes/' . $module_info['template'] . '/images/' . $module_file . '/icon_files/document.png';
            }
            $xtpl->assign('FILES', $files);
            if ($files['download_groups'] == '-1') {
                $files['download_groups'] = $pro_config['download_groups'];
            }
            if (!nv_user_in_groups($files['download_groups'])) {
                $xtpl->assign('NOTE', $lang_module['download_file_no']);
                $xtpl->parse('main.files_content.loop.disabled');
            } else {
                $xtpl->assign('NOTE', $lang_module['download_file']);
            }
            $xtpl->parse('main.files_content.loop');
        }
        if ($login > 0) {
            $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_redirect_encrypt($client_info['selfurl'] . '#' . $linktab);
            $xtpl->assign('DOWNLOAD_LOGIN', '<a title="' . $lang_global['loginsubmit'] . '" href="' . $link_login . '">' . $lang_module['download_login'] . '</a>');
            $xtpl->parse('main.form_login');
        }
        $xtpl->parse('main.files_content');
        $xtpl->parse('main');
        return $xtpl->text('main');
    }
}
Ejemplo n.º 8
0
/**
 * nv_admin_menu()
 *
 * @return
 */
function nv_admin_menu()
{
    global $lang_global, $admin_info, $module_info, $module_name, $global_config, $client_info;
    if ($module_info['theme'] == $module_info['template'] and file_exists(NV_ROOTDIR . '/themes/' . $module_info['template'] . '/system/admin_toolbar.tpl')) {
        $block_theme = $module_info['template'];
    } elseif (file_exists(NV_ROOTDIR . '/themes/' . $global_config['site_theme'] . '/system/admin_toolbar.tpl')) {
        $block_theme = $global_config['site_theme'];
    } else {
        $block_theme = 'default';
    }
    $xtpl = new XTemplate('admin_toolbar.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/system');
    $xtpl->assign('GLANG', $lang_global);
    $xtpl->assign('NV_ADMINDIR', NV_BASE_SITEURL . NV_ADMINDIR . '/index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA);
    $xtpl->assign('URL_AUTHOR', NV_BASE_SITEURL . NV_ADMINDIR . '/index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=authors&amp;id=' . $admin_info['admin_id']);
    if (defined('NV_IS_SPADMIN')) {
        $new_drag_block = defined('NV_IS_DRAG_BLOCK') ? 0 : 1;
        $lang_drag_block = $new_drag_block ? $lang_global['drag_block'] : $lang_global['no_drag_block'];
        $xtpl->assign('URL_DBLOCK', NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;drag_block=' . $new_drag_block . '&amp;nv_redirect=' . nv_redirect_encrypt($client_info['selfurl']));
        $xtpl->assign('LANG_DBLOCK', $lang_drag_block);
        $xtpl->parse('main.is_spadmin');
    }
    if (defined('NV_IS_MODADMIN') and !empty($module_info['admin_file'])) {
        $xtpl->assign('URL_MODULE', NV_BASE_SITEURL . NV_ADMINDIR . '/index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name);
        $xtpl->assign('MODULENAME', $module_info['custom_title']);
        $xtpl->parse('main.is_modadmin');
    }
    $xtpl->parse('main');
    return $xtpl->text('main');
}
Ejemplo n.º 9
0
 $xtpl->assign('CHECKSS', md5($client_info['session_id'] . $global_config['sitekey']));
 $xtpl->assign('N_CAPTCHA', $lang_global['securitycode']);
 $xtpl->assign('CAPTCHA_REFRESH', $lang_global['captcharefresh']);
 $xtpl->assign('SRC_CAPTCHA', NV_BASE_SITEURL . 'index.php?scaptcha=captcha&t=' . NV_CURRENTTIME);
 $xtpl->assign('NV_HEADER', '');
 $xtpl->assign('NV_REDIRECT', '');
 if (in_array($global_config['gfx_chk'], array(2, 4, 5, 7))) {
     $xtpl->parse('main.captcha');
 }
 if (in_array($global_config['gfx_chk'], array(3, 4, 6, 7))) {
     $xtpl->parse('main.allowuserreg.reg_captcha');
 }
 if (defined('NV_OPENID_ALLOWED')) {
     foreach ($global_config['openid_servers'] as $server) {
         $assigns = array();
         $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_redirect_encrypt($client_info['selfurl']);
         $assigns['title'] = $lang_global['openid_login'] . " " . ucfirst($server);
         $assigns['img_src'] = NV_BASE_SITEURL . 'themes/' . $block_theme . '/images/users/' . $server . '.png';
         $assigns['img_width'] = $assigns['img_height'] = 24;
         $xtpl->assign('OPENID', $assigns);
         $xtpl->parse('main.openid.server');
     }
     $xtpl->parse('main.openid');
 }
 if ($global_config['allowuserreg']) {
     $data_questions = array();
     $sql = "SELECT qid, title FROM " . NV_USERS_GLOBALTABLE . "_question WHERE lang='" . NV_LANG_DATA . "' ORDER BY weight ASC";
     $result = $db->query($sql);
     while ($row = $result->fetch()) {
         $data_questions[$row['qid']] = array('qid' => $row['qid'], 'title' => $row['title']);
     }
Ejemplo n.º 10
0
            if (!defined('NV_IS_AJAX')) {
                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_Cache->delMod('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') {
            Header('Location: ' . nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=users&' . NV_OP_VARIABLE . '=login&nv_redirect=' . nv_redirect_encrypt($client_info['selfurl']), true));
            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'], 404);
        } 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'], 404);
        }
    }
}
nv_info_die($lang_global['error_404_title'], $lang_global['error_404_title'], $lang_global['error_404_content'], 404);
Ejemplo n.º 11
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_redirect_encrypt($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);
Ejemplo n.º 12
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)) {
        $layout_file = 'body';
    }
    if (isset($global_config['sitetimestamp'])) {
        $global_config['timestamp'] += $global_config['sitetimestamp'];
    }
    $site_favicon = NV_BASE_SITEURL . 'favicon.ico';
    if (!empty($global_config['site_favicon']) and file_exists(NV_ROOTDIR . '/' . $global_config['site_favicon'])) {
        $site_favicon = NV_BASE_SITEURL . $global_config['site_favicon'];
    }
    $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);
    $xtpl->assign('SITE_FAVICON', $site_favicon);
    // 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 . NV_ASSETS_DIR . '/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 = array_merge_recursive($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 NukeViet\Client\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
        if ($global_config['switch_mobi_des']) {
            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_redirect_encrypt($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 (!$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);
    }
    if (defined('NV_IS_ADMIN') && $full) {
        $sitecontent = preg_replace('/(<\\/body>)/i', PHP_EOL . nv_admin_menu() . PHP_EOL . '\\1', $sitecontent, 1);
    }
    return $sitecontent;
}
Ejemplo n.º 13
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_redirect_encrypt($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, 'imghome_info' => nv_is_image(NV_ROOTDIR . '/' . $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'];
Ejemplo n.º 14
0
$page_title = sprintf($lang_module['seller_list'], $pro_info['title']);
$db->sqlreset()->select('COUNT(*)')->from($db_config['prefix'] . '_' . $module_data . '_orders_id t1')->join(' INNER JOIN ' . $db_config['prefix'] . '_' . $module_data . '_orders t2 ON t1.order_id = t2.order_id')->where('t1.proid = ' . $pro_id);
$num_items = $db->query($db->sql())->fetchColumn();
if (!$num_items) {
    Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=items');
    exit;
}
$xtpl = new XTemplate('seller.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);
$xtpl->assign('C_LIST', nv_redirect_encrypt($nv_redirect));
$db->select('t2.order_name, t2.order_email, t2.order_phone, t2.order_address, t2.unit_total, t2.order_time, t1.num, t1.price')->order('t1.order_id DESC')->limit($per_page)->offset(($page - 1) * $per_page);
$sth = $db->prepare($db->sql());
$sth->execute();
$i = $page == 1 ? 0 : $page;
$array_total = array('price' => 0, 'num' => 0, 'pro_unit' => $pro_config['money_unit'], 'product_unit' => $pro_info['product_unit']);
while (list($order_name, $order_email, $order_phone, $order_address, $unit_total, $order_time, $num, $price) = $sth->fetch(3)) {
    $i++;
    $price = $price * $num;
    $array_total['price'] += $price;
    $array_total['num'] += $num;
    $xtpl->assign('ROW', array('no' => $i, 'order_name' => $order_name, 'order_email' => $order_email, 'order_phone' => $order_phone, 'order_address' => $order_address, 'num' => $num, 'price' => nv_number_format($price, nv_get_decimals($unit_total)), 'price_unit' => $unit_total, 'order_time' => nv_date('H:i d/m/Y', $order_time)));
    $xtpl->parse('main.loop');
}
$generate_page = nv_generate_page($base_url, $num_items, $per_page, $page);
if (!empty($generate_page)) {
Ejemplo n.º 15
0
    $parameters = $response->getParameters();
    $httpheaders = $response->getHttpHeaders();
    // Báo lỗi ở đây, không trả về trình duyệt, chưa thấy trường nào nào cần thiết phải trả về trình duyệt ở đây
    //if( ! isset( $httpheaders['Location'] ) and ! isset( $httpheaders['location'] ) )
    //{
    $contents = nv_info_theme(oauth2_getlang($parameters['error_description'], $parameters['error_description']), 'javascript:void(0);', $type = 'error');
    include NV_ROOTDIR . '/includes/header.php';
    echo nv_site_theme($contents, false);
    include NV_ROOTDIR . '/includes/footer.php';
    //}
    $response->send();
    die;
}
// Thành viên đăng nhập
if (!defined('NV_IS_USER')) {
    header('Location:' . NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=users&" . NV_OP_VARIABLE . "=login/simple&nv_redirect=" . nv_redirect_encrypt($client_info['selfurl']) . '&nv_header=' . md5($client_info['session_id'] . $global_config['sitekey']));
    die;
}
// Chỗ này cần xác định SCOPES nữa, sẽ phát triển ở phiên bản kế tiếp
// Lấy client data
$client_id = $request->query('client_id', $request->request('client_id'));
$client_data = $storage->getClientDetails($client_id);
// Truy vấn vào CSDL xem đã có authorization code còn hạn không, nếu có trả về nếu không có phải hỏi thành viên có đồng ý không
$sql = 'SELECT * FROM ' . $dbtable_config['code_table'] . ' WHERE client_id = :client_id AND user_id = :user_id';
$sth = $db->prepare($sql);
$sth->bindParam(':client_id', $client_id, PDO::PARAM_STR);
$sth->bindParam(':user_id', $user_info['userid'], PDO::PARAM_STR);
$sth->execute();
$authorization = $sth->fetch();
if (!empty($authorization)) {
    $authorization['expires'] = strtotime($authorization['expires']);
Ejemplo n.º 16
0
                        $xtpl->parse('main.install.installed');
                    } else {
                        // Da thanh toan
                        if ($array['compatible']['status'] === 'paid') {
                            if ($installed == 2) {
                                $xtpl->parse('main.install.not_install.paid.unsure');
                            } else {
                                $xtpl->parse('main.install.not_install.paid.startdownload');
                            }
                            $xtpl->parse('main.install.not_install.paid');
                        } elseif ($array['compatible']['status'] == 'await') {
                            // Dang thanh toan. Khong cho phep download
                            $xtpl->parse('main.install.not_install.await');
                        } elseif ($array['compatible']['status'] == 'notlogin') {
                            // Dang nhap de kiem tra
                            $xtpl->assign('LOGIN_LINK', 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_redirect_encrypt($client_info['selfurl']));
                            $xtpl->parse('main.install.not_install.notlogin');
                        } else {
                            // Chua thanh toan, xuat link thanh toan
                            $xtpl->parse('main.install.not_install.unpaid');
                        }
                        $xtpl->parse('main.install.not_install');
                    }
                }
            }
        }
        $xtpl->parse('main.install');
    }
}
$xtpl->parse('main');
$contents = $xtpl->text('main');