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


PHP nv_base64_encode函数代码示例

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


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

示例1: validUserLog

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);
}
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:12,代码来源:functions.php

示例2: validUserLog

/**
 * 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 = " . NV_CURRENTTIME . ",\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);
}
开发者ID:nukeplus,项目名称:nuke,代码行数:24,代码来源:functions.php

示例3: nv_html_site_js

/**
 * 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=" . (int) defined("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;
}
开发者ID:anhtunguyen,项目名称:vietnamguide,代码行数:50,代码来源:user_functions.php

示例4: VALUES

 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'];
开发者ID:NukeVietCMS,项目名称:CodeWeb,代码行数:31,代码来源:register.php

示例5: array_map

        $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;
            }
        }
    }
}
开发者ID:hoangvtien,项目名称:module-shops,代码行数:31,代码来源:onepaydomestic.checkorders.php

示例6: Header

    $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');
开发者ID:anhtunguyen,项目名称:vietnamguide,代码行数:31,代码来源:groups.php

示例7: nv_theme_comment_module

/**
 * @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');
//.........这里部分代码省略.........
开发者ID:anhtunguyen,项目名称:vietnamguide,代码行数:101,代码来源:comment.php

示例8: nv_del_moduleCache

            //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;
            }
        }
    }
}
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:31,代码来源:index.php

示例9: nv_site_theme


//.........这里部分代码省略.........
            $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;
}
开发者ID:anhtunguyen,项目名称:vietnamguide,代码行数:101,代码来源:theme.php

示例10: detail_theme


//.........这里部分代码省略.........
        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');
}
开发者ID:atarubi,项目名称:nuke-viet,代码行数:101,代码来源:theme.php

示例11: nv_base64_encode

            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';
}
开发者ID:anhtunguyen,项目名称:vietnamguide,代码行数:31,代码来源:content.php

示例12: nv_base64_encode

                     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)) {
开发者ID:anhtunguyen,项目名称:vietnamguide,代码行数:31,代码来源:ftp.php

示例13: array

$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"' : '');
开发者ID:nukeviet,项目名称:nukeviet,代码行数:31,代码来源:add.php

示例14: is_serialized_string

$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'];
开发者ID:anhtunguyen,项目名称:vietnamguide,代码行数:31,代码来源:main.php

示例15: nv_redirect_encrypt

/**
 * 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));
}
开发者ID:nukeviet,项目名称:nukeviet,代码行数:12,代码来源:functions.php


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