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


PHP nv_url_rewrite函数代码示例

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


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

示例1: sendcontact

/**
 * sendcontact()
 *
 * @param mixed $url
 * @return
 */
function sendcontact($url)
{
    global $module_file, $module_info, $lang_module;
    $xtpl = new XTemplate('sendcontact.tpl', NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $module_file);
    $lang_module['urlrefresh'] = nv_url_rewrite($url, true);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->parse('main');
    return $xtpl->text('main');
}
开发者ID:anhtunguyen,项目名称:vietnamguide,代码行数:15,代码来源:theme.php

示例2: nv_show_playlist_cat_list

/**
 * nv_show_playlist_cat_list()
 *
 * @return
 */
function nv_show_playlist_cat_list()
{
    global $db, $lang_module, $lang_global, $module_name, $module_data, $op, $module_file, $module_config, $global_config, $module_info, $user_info;
    $sql = 'SELECT * FROM ' . NV_PREFIXLANG . '_' . $module_data . '_playlist_cat WHERE userid=' . $user_info['userid'] . ' ORDER BY weight ASC';
    $_array_block_cat = $db->query($sql)->fetchAll();
    $num = sizeof($_array_block_cat);
    if ($num > 0) {
        $array_status = array($lang_global['no'], $lang_global['yes']);
        $array_share_mode = array($lang_module['playlist_private_off'], $lang_module['playlist_private_on']);
        $xtpl = new XTemplate('playlist_cat.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $module_file);
        $xtpl->assign('LANG', $lang_module);
        $xtpl->assign('GLANG', $lang_global);
        foreach ($_array_block_cat as $row) {
            $numnews = $db->query('SELECT COUNT(*) FROM ' . NV_PREFIXLANG . '_' . $module_data . '_playlist where playlist_id=' . $row['playlist_id'])->fetchColumn();
            $xtpl->assign('ROW', array('playlist_id' => $row['playlist_id'], 'title' => $row['title'], 'numnews' => $numnews, 'weight' => $row['weight'], 'link' => nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $module_info['alias']['user-playlist'] . '/' . $row['alias'] . '-' . $row['playlist_id'], true), 'linksite' => nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $module_info['alias']['playlists'] . '/' . $row['alias'], true), 'url_edit' => nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&playlist_id=' . $row['playlist_id'] . '&mode=edit#edit', true), 'url_delete' => nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&playlist_id=' . $row['playlist_id'] . '&mode=delete', true)));
            for ($i = 1; $i <= $num; ++$i) {
                $xtpl->assign('WEIGHT', array('key' => $i, 'title' => $i, 'selected' => $i == $row['weight'] ? ' selected="selected"' : ''));
                $xtpl->parse('playlistcat_lists.loop.weight');
            }
            foreach ($array_share_mode as $key => $val) {
                $xtpl->assign('PRIVATE_MODE', array('key' => $key, 'title' => $val, 'selected' => $key == $row['private_mode'] ? ' selected="selected"' : ''));
                $xtpl->parse('playlistcat_lists.loop.private_mode');
            }
            foreach ($array_status as $key => $val) {
                $xtpl->assign('STATUS', array('key' => $key, 'title' => $val, 'selected' => $key == $row['status'] ? ' selected="selected"' : ''));
                $xtpl->parse('playlistcat_lists.loop.status');
            }
            for ($i = 1; $i <= 30; ++$i) {
                $xtpl->assign('NUMBER', array('key' => $i, 'title' => $i, 'selected' => $i == $row['numbers'] ? ' selected="selected"' : ''));
                $xtpl->parse('playlistcat_lists.loop.number');
            }
            if ($row['status'] == 2) {
                $xtpl->parse('playlistcat_lists.loop.pl_moderate');
            } elseif ($row['status'] == 0) {
                $xtpl->parse('playlistcat_lists.loop.pl_disallow');
            }
            if ($module_config[$module_name]['playlist_allow_detele'] > 0) {
                $xtpl->parse('playlistcat_lists.loop.delete');
            }
            if ($module_config[$module_name]['allow_user_plist'] == 1) {
                $xtpl->parse('playlistcat_lists.loop.edit_link');
                $xtpl->parse('playlistcat_lists.loop.edit_btn');
            } else {
                $xtpl->parse('playlistcat_lists.loop.title_only');
            }
            $xtpl->parse('playlistcat_lists.loop');
        }
        $xtpl->parse('playlistcat_lists');
        $contents = $xtpl->text('playlistcat_lists');
    } else {
        $contents = '&nbsp;';
    }
    return $contents;
}
开发者ID:webvangvn,项目名称:nv4_module_videos,代码行数:59,代码来源:site.functions.php

示例3: nv_comment_new

 function nv_comment_new($block_config)
 {
     global $db, $site_mods, $db_slave, $module_info, $global_config;
     $module = $block_config['module'];
     $mod_data = $site_mods[$module]['module_data'];
     $sql = "SELECT * FROM " . NV_PREFIXLANG . "_comment WHERE module = " . $db->quote($module) . " AND status=1 ORDER BY post_time DESC LIMIT " . $block_config['numrow'];
     $result = $db_slave->query($sql);
     $array_comment = array();
     $array_news_id = array();
     while ($comment = $result->fetch()) {
         $array_comment[] = $comment;
         $array_news_id[] = $comment['id'];
     }
     if (!empty($array_news_id)) {
         $result = $db_slave->query('SELECT t1.id, t1.alias AS alias_id, t2.alias AS alias_cat FROM ' . NV_PREFIXLANG . '_' . $mod_data . '_rows t1 INNER JOIN ' . NV_PREFIXLANG . '_' . $mod_data . '_cat t2 ON t1.catid = t2.catid WHERE t1.id IN (' . implode(',', array_unique($array_news_id)) . ') AND status = 1');
         $array_news_id = array();
         while ($row = $result->fetch()) {
             $array_news_id[$row['id']] = $row;
         }
         $mod_file = $site_mods[$module]['module_file'];
         if (file_exists(NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $mod_file . '/block_new_comment.tpl')) {
             $block_theme = $module_info['template'];
         } else {
             $block_theme = 'default';
         }
         $xtpl = new XTemplate('block_new_comment.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/modules/' . $mod_file);
         $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
         $xtpl->assign('TEMPLATE', $block_theme);
         foreach ($array_comment as $comment) {
             if (isset($array_news_id[$comment['id']])) {
                 $comment['url_comment'] = nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module . '&' . NV_OP_VARIABLE . '=' . $array_news_id[$comment['id']]['alias_cat'] . '/' . $array_news_id[$comment['id']]['alias_id'] . '-' . $comment['id'] . $global_config['rewrite_exturl'], true);
                 $comment['content'] = nv_clean60($comment['content'], $block_config['titlelength']);
                 $comment['post_time'] = nv_date('d/m/Y H:i', $comment['post_time']);
                 $xtpl->assign('COMMENT', $comment);
                 $xtpl->parse('main.loop');
             }
         }
         $xtpl->parse('main');
         return $xtpl->text('main');
     }
 }
开发者ID:NukeVietCMS,项目名称:CodeWeb,代码行数:41,代码来源:global.block_new_comment.php

示例4: openidLogin_Res1

/**
 * openidLogin_Res1()
 * Function thuc hien khi OpenID duoc nhan dien
 *
 * @param mixed $attribs
 * @return
 */
function openidLogin_Res1($attribs)
{
    global $page_title, $key_words, $mod_title, $db, $crypt, $nv_Request, $lang_module, $lang_global, $module_name, $module_info, $global_config, $gfx_chk, $nv_redirect, $op, $db_config;
    $email = (isset($attribs['contact/email']) and nv_check_valid_email($attribs['contact/email']) == '') ? $attribs['contact/email'] : '';
    if (empty($email)) {
        $nv_Request->unset_request('openid_attribs', 'session');
        openidLogin_Res0($lang_module['logged_in_failed']);
        die;
    }
    $opid = $crypt->hash($attribs['id']);
    $current_mode = isset($attribs['current_mode']) ? $attribs['current_mode'] : 1;
    $stmt = $db->prepare('SELECT a.userid AS uid, a.email AS uemail, b.active AS uactive FROM ' . NV_USERS_GLOBALTABLE . '_openid a, ' . NV_USERS_GLOBALTABLE . ' b
		WHERE a.opid= :opid
		AND a.email= :email
		AND a.userid=b.userid');
    $stmt->bindParam(':opid', $opid, PDO::PARAM_STR);
    $stmt->bindParam(':email', $email, PDO::PARAM_STR);
    $stmt->execute();
    list($user_id, $op_email, $user_active) = $stmt->fetch(3);
    if ($user_id) {
        $nv_Request->unset_request('openid_attribs', 'session');
        if ($op_email != $email) {
            openidLogin_Res0($lang_module['not_logged_in']);
            die;
        }
        if (!$user_active) {
            openidLogin_Res0($lang_module['login_no_active']);
            die;
        }
        if (defined('NV_IS_USER_FORUM') and file_exists(NV_ROOTDIR . '/' . DIR_FORUM . '/nukeviet/set_user_login.php')) {
            require_once NV_ROOTDIR . '/' . DIR_FORUM . '/nukeviet/set_user_login.php';
            if (defined('NV_IS_USER_LOGIN_FORUM_OK')) {
                $nv_redirect = !empty($nv_redirect) ? nv_base64_decode($nv_redirect) : NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name;
            } else {
                $nv_redirect = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name;
            }
        } else {
            $query = 'SELECT * FROM ' . NV_USERS_GLOBALTABLE . ' WHERE userid=' . $user_id;
            $row = $db->query($query)->fetch();
            if (!empty($row)) {
                validUserLog($row, 1, $opid, $current_mode);
                $nv_redirect = !empty($nv_redirect) ? nv_base64_decode($nv_redirect) : NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name;
            } else {
                $nv_redirect = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name;
            }
        }
        Header('Location: ' . nv_url_rewrite($nv_redirect, true));
        die;
    }
    $stmt = $db->prepare('SELECT * FROM ' . NV_USERS_GLOBALTABLE . ' WHERE email= :email');
    $stmt->bindParam(':email', $email, PDO::PARAM_STR);
    $stmt->execute();
    $nv_row = $stmt->fetch();
    if (!empty($nv_row)) {
        $login_allowed = false;
        if (empty($nv_row['password'])) {
            $nv_Request->unset_request('openid_attribs', 'session');
            $login_allowed = true;
        }
        if ($nv_Request->isset_request('openid_account_confirm', 'post')) {
            $password = $nv_Request->get_string('password', 'post', '');
            $nv_seccode = $nv_Request->get_title('nv_seccode', 'post', '');
            $nv_seccode = !$gfx_chk ? 1 : (nv_capcha_txt($nv_seccode) ? 1 : 0);
            $nv_Request->unset_request('openid_attribs', 'session');
            if (defined('NV_IS_USER_FORUM') and file_exists(NV_ROOTDIR . '/' . DIR_FORUM . '/nukeviet/login.php')) {
                $nv_username = $nv_row['username'];
                $nv_password = $password;
                require_once NV_ROOTDIR . '/' . DIR_FORUM . '/nukeviet/login.php';
                if (empty($error)) {
                    $login_allowed = true;
                } else {
                    openidLogin_Res0($lang_module['openid_confirm_failed']);
                    die;
                }
            } else {
                if ($crypt->validate_password($password, $nv_row['password']) and $nv_seccode) {
                    $login_allowed = true;
                } else {
                    openidLogin_Res0($lang_module['openid_confirm_failed']);
                    die;
                }
            }
        }
        if ($login_allowed) {
            $stmt = $db->prepare('INSERT INTO ' . NV_USERS_GLOBALTABLE . '_openid VALUES (' . intval($nv_row['userid']) . ', :server, :opid, :email )');
            $stmt->bindParam(':server', $attribs['server'], PDO::PARAM_STR);
            $stmt->bindParam(':opid', $opid, PDO::PARAM_STR);
            $stmt->bindParam(':email', $email, PDO::PARAM_STR);
            $stmt->execute();
            if (intval($nv_row['active']) != 1) {
                openidLogin_Res0($lang_module['login_no_active']);
            } else {
                validUserLog($nv_row, 1, $opid, $current_mode);
//.........这里部分代码省略.........
开发者ID:lzhao18,项目名称:nukeviet,代码行数:101,代码来源:login.php

示例5: die

 * @Createdate 17/6/2010, 11:25
 */
if (!defined('NV_IS_MOD_STATISTICS')) {
    die('Stop!!!');
}
$host = $nv_Request->get_string('host', 'get', '');
if (!isset($host) or !preg_match('/^[0-9a-z]([-.]?[0-9a-z])*.[a-z]{2,4}$/', $host)) {
    Header('Location: ' . nv_url_rewrite(NV_BASE_MOD_URL, true));
    die;
}
$sth = $db->prepare('SELECT * FROM ' . NV_REFSTAT_TABLE . ' WHERE host= :host');
$sth->bindParam(':host', $host, PDO::PARAM_STR);
$sth->execute();
$row = $sth->fetch();
if (empty($row)) {
    Header('Location: ' . nv_url_rewrite(NV_BASE_MOD_URL, true));
    die;
}
$contents = '';
$mod_title = $page_title = sprintf($lang_module['refererbysite'], $host);
$key_words = $module_info['keywords'];
$cts = array();
$cts['caption'] = $page_title;
$cts['rows'] = array();
$cts['rows']['Jan'] = array('fullname' => $lang_global['january'], 'count' => $row['month01']);
$cts['rows']['Feb'] = array('fullname' => $lang_global['february'], 'count' => $row['month02']);
$cts['rows']['Mar'] = array('fullname' => $lang_global['march'], 'count' => $row['month03']);
$cts['rows']['Apr'] = array('fullname' => $lang_global['april'], 'count' => $row['month04']);
$cts['rows']['May'] = array('fullname' => $lang_global['may'], 'count' => $row['month05']);
$cts['rows']['Jun'] = array('fullname' => $lang_global['june'], 'count' => $row['month06']);
$cts['rows']['Jul'] = array('fullname' => $lang_global['july'], 'count' => $row['month07']);
开发者ID:lzhao18,项目名称:nukeviet,代码行数:31,代码来源:referer.php

示例6: unset

            $end_publtime = $item['publtime'];
            $item['link'] = $global_array_cat[$item['catid']]['link'] . '/' . $item['alias'] . '-' . $item['id'] . $global_config['rewrite_exturl'];
            $item_array[] = $item;
        }
        $result->closeCursor();
        unset($query, $row);
        $item_array_other = array();
        if ($st_links > 0) {
            $db->sqlreset()->select('id, catid, addtime, edittime, publtime, title, alias, hitstotal')->from(NV_PREFIXLANG . '_' . $module_data . '_rows')->where('status=1 AND id IN (SELECT id FROM ' . NV_PREFIXLANG . '_' . $module_data . '_tags_id WHERE tid=' . $tid . ') and publtime < ' . $end_publtime)->order('publtime DESC')->limit($st_links);
            $result = $db->query($db->sql());
            while ($item = $result->fetch()) {
                $item['link'] = $global_array_cat[$item['catid']]['link'] . '/' . $item['alias'] . '-' . $item['id'] . $global_config['rewrite_exturl'];
                $item_array_other[] = $item;
            }
            unset($query, $row);
        }
        $generate_page = nv_alias_page($page_title, $base_url, $num_items, $per_page, $page);
        if (!empty($image_tag)) {
            $image_tag = NV_BASE_SITEURL . NV_FILES_DIR . '/' . $module_upload . '/' . $image_tag;
        }
        $contents = topic_theme($item_array, $item_array_other, $generate_page, $page_title, $description, $image_tag);
        if ($page > 1) {
            $page_title .= ' ' . NV_TITLEBAR_DEFIS . ' ' . $lang_global['page'] . ' ' . $page;
        }
        include NV_ROOTDIR . '/includes/header.php';
        echo nv_site_theme($contents);
        include NV_ROOTDIR . '/includes/footer.php';
    }
}
$redirect = '<meta http-equiv="Refresh" content="3;URL=' . nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name, true) . '" />';
nv_info_die($lang_global['error_404_title'], $lang_global['error_404_title'], $lang_global['error_404_content'] . $redirect);
开发者ID:anhtunguyen,项目名称:vietnamguide,代码行数:31,代码来源:tag.php

示例7: ceil

 }
 $content = $result->fetch();
 $body_contents = $db_slave->query('SELECT bodyhtml as bodytext, sourcetext, imgposition, copyright, allowed_print FROM ' . NV_PREFIXLANG . '_' . $module_data . '_bodyhtml_' . ceil($content['id'] / 2000) . ' where id=' . $content['id'])->fetch();
 $content = array_merge($content, $body_contents);
 unset($sql, $result, $body_contents);
 if ($content['allowed_print'] == 1 and (defined('NV_IS_MODADMIN') or $content['status'] == 1 and $content['publtime'] < NV_CURRENTTIME and ($content['exptime'] == 0 or $content['exptime'] > NV_CURRENTTIME))) {
     $base_url_rewrite = nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=print/' . $global_array_cat[$catid]['alias'] . '/' . $content['alias'] . '-' . $id . $global_config['rewrite_exturl'], true);
     if ($_SERVER['REQUEST_URI'] != $base_url_rewrite and NV_MAIN_DOMAIN . $_SERVER['REQUEST_URI'] != $base_url_rewrite) {
         Header('Location: ' . $base_url_rewrite);
         die;
     }
     $sql = 'SELECT title FROM ' . NV_PREFIXLANG . '_' . $module_data . '_sources WHERE sourceid = ' . $content['sourceid'];
     $result = $db_slave->query($sql);
     $sourcetext = $result->fetchColumn();
     unset($sql, $result);
     $base_url_rewrite = nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=' . $global_array_cat[$catid]['alias'] . '/' . $content['alias'] . '-' . $id . $global_config['rewrite_exturl'], true);
     $canonicalUrl = NV_MAIN_DOMAIN . $base_url_rewrite;
     $meta_tags = nv_html_meta_tags();
     $result = array('url' => $global_config['site_url'], 'meta_tags' => $meta_tags, 'sitename' => $global_config['site_name'], 'title' => $content['title'], 'alias' => $content['alias'], 'image' => '', 'position' => $content['imgposition'], 'time' => nv_date('l - d/m/Y H:i', $content['publtime']), 'status' => $content['status'], 'hometext' => $content['hometext'], 'bodytext' => $content['bodytext'], 'copyright' => $content['copyright'], 'copyvalue' => $module_config[$module_name]['copyright'], 'link' => "<a href=\"" . NV_MY_DOMAIN . $base_url_rewrite . "\" title=\"" . $content['title'] . "\">" . NV_MY_DOMAIN . $base_url_rewrite . "</a>\n", 'contact' => $global_config['site_email'], 'author' => $content['author'], 'source' => $sourcetext);
     if (!empty($content['homeimgfile']) and $content['imgposition'] > 0) {
         $src = $alt = $note = '';
         $width = $height = 0;
         if ($content['homeimgthumb'] == 1 and $content['imgposition'] == 1) {
             $src = NV_BASE_SITEURL . NV_FILES_DIR . '/' . $module_upload . '/' . $content['homeimgfile'];
             $width = $module_config[$module_name]['homewidth'];
         } elseif ($content['homeimgthumb'] == 3) {
             $src = $content['homeimgfile'];
             $width = $content['imgposition'] == 1 ? $module_config[$module_name]['homewidth'] : $module_config[$module_name]['imagefull'];
         } elseif (file_exists(NV_UPLOADS_REAL_DIR . '/' . $module_upload . '/' . $content['homeimgfile'])) {
             $src = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/' . $content['homeimgfile'];
             $width = $content['imgposition'] == 1 ? $module_config[$module_name]['homewidth'] : $module_config[$module_name]['imagefull'];
开发者ID:NukeVietCMS,项目名称:CodeWeb,代码行数:31,代码来源:print.php

示例8: die

<?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 2-9-2010 14:43
 */
if (!defined('NV_IS_FILE_ADMIN')) {
    die('Stop!!!');
}
$id = $nv_Request->get_int('id', 'get,post', 0);
$row = $db->query('SELECT * FROM ' . NV_PREFIXLANG . '_' . $module_data . ' where id=' . $id)->fetch();
if (!empty($row['id'])) {
    $_url_rewrite = nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=' . $list_cats[$row['catid']]['alias'] . '/' . $row['alias'] . $global_config['rewrite_exturl'], true);
    Header('Location: ' . $_url_rewrite);
    die;
}
nv_info_die($lang_global['error_404_title'], $lang_global['error_404_title'], $lang_global['admin_no_allow_func']);
开发者ID:NukeVlad,项目名称:module-download,代码行数:20,代码来源:view.php

示例9: nv_rss_generate

/**
 * nv_rss_generate()
 * 
 * @param mixed $channel
 * @param mixed $imamge
 * @param mixed $items
 * @return void
 */
function nv_rss_generate($channel, $items)
{
    global $db, $global_config;
    if (file_exists(NV_ROOTDIR . "/themes/" . $global_config['site_theme'] . "/layout/rss.tpl")) {
        $path = NV_ROOTDIR . "/themes/" . $global_config['site_theme'] . "/layout/";
    } else {
        $path = NV_ROOTDIR . "/themes/default/layout/";
    }
    $xtpl = new XTemplate("rss.tpl", $path);
    $channel['title'] = nv_unhtmlspecialchars($channel['title']);
    $channel['description'] = nv_unhtmlspecialchars($channel['description']);
    $channel['lang'] = $global_config['site_lang'];
    $channel['copyright'] = htmlspecialchars($global_config['site_name']);
    $channel['docs'] = NV_MY_DOMAIN . NV_BASE_SITEURL . '?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=rss';
    $channel['generator'] = htmlspecialchars('Nukeviet Version ' . $global_config['version']);
    $xtpl->assign('CHANNEL', $channel);
    if (file_exists(NV_ROOTDIR . '/images/' . $global_config['site_logo'])) {
        $image = NV_ROOTDIR . '/images/' . $global_config['site_logo'];
        $image = nv_ImageInfo($image, 144, true, NV_UPLOADS_REAL_DIR);
        if (!empty($image)) {
            $image['title'] = $channel['title'];
            $image['link'] = $channel['link'];
            $image['src'] = NV_MY_DOMAIN . $image['src'];
            $xtpl->assign('IMAGE', $image);
            $xtpl->parse('main.image');
        }
    }
    if (!empty($items)) {
        foreach ($items as $item) {
            if (!empty($item['title'])) {
                $item['title'] = nv_unhtmlspecialchars($item['title']);
            }
            if (!empty($item['description'])) {
                $item['description'] = htmlspecialchars($item['description'], ENT_QUOTES);
            }
            $item['pubdate'] = gmdate("D, j M Y H:m:s", $item['pubdate']) . ' GMT';
            $xtpl->assign('ITEM', $item);
            $xtpl->parse('main.item');
        }
    }
    $xtpl->parse('main');
    $content = $xtpl->text('main');
    $content = $db->unfixdb($content);
    $content = nv_url_rewrite($content);
    header("Content-Type: text/xml");
    header("Content-Type: application/rss+xml");
    header("Content-Encoding: none");
    echo $content;
    die;
}
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:58,代码来源:theme_functions.php

示例10: sprintf

            $message = sprintf($lang_module['safe_send_content'], $name, $sitename, $row['safekey']);
            @nv_sendmail($global_config['site_email'], $row['email'], $lang_module['safe_send_subject'], $message);
            $ss_safesend = NV_CURRENTTIME + 600;
            $nv_Request->set_Session('safesend', $ss_safesend);
        }
        $ss_safesend = ceil(($ss_safesend - NV_CURRENTTIME) / 60);
        die(json_encode(array('status' => 'ok', 'input' => '', 'mess' => sprintf($lang_module['safe_send_ok'], $ss_safesend))));
    }
    $safe_key = nv_substr($nv_Request->get_title('safe_key', 'post', '', 1), 0, 32);
    if (empty($row['safekey']) or $safe_key != $row['safekey']) {
        die(json_encode(array('status' => 'error', 'input' => 'safe_key', 'mess' => $lang_module['verifykey_error'])));
    }
    $stmt = $db->prepare('UPDATE ' . NV_USERS_GLOBALTABLE . ' SET safemode=1, safekey= :safekey WHERE userid=' . $user_info['userid']);
    $stmt->bindParam(':safekey', $row['safekey'], PDO::PARAM_STR);
    $stmt->execute();
    die(json_encode(array('status' => 'ok', 'input' => nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=editinfo', true), 'mess' => $lang_module['safe_activate_ok'])));
}
$page_title = $mod_title = $lang_module['editinfo_pagetitle'];
$key_words = $module_info['keywords'];
if (!defined('NV_EDITOR')) {
    define('NV_EDITOR', 'ckeditor');
}
require_once NV_ROOTDIR . '/' . NV_EDITORSDIR . '/' . NV_EDITOR . '/nv.php';
$sql = 'SELECT * FROM ' . NV_USERS_GLOBALTABLE . '_info WHERE userid=' . $user_info['userid'];
$result = $db->query($sql);
$custom_fields = $result->fetch();
$array_data['username'] = $row['username'];
$array_data['email'] = $row['email'];
$array_data['first_name'] = $row['first_name'];
$array_data['last_name'] = $row['last_name'];
$array_data['gender'] = $row['gender'];
开发者ID:nukeplus,项目名称:nuke,代码行数:31,代码来源:editinfo.php

示例11: COUNT

                    $query = "SELECT COUNT(*) AS `count` FROM `" . NV_USERS_GLOBALTABLE . "_reg` WHERE `email`=" . $db->dbescape($email);
                    if ($global_config['allowuserreg'] == 2) {
                        $query .= " AND `regdate`>" . (NV_CURRENTTIME - 86400);
                    }
                    $result = $db->sql_query($query);
                    list($count) = $db->sql_fetchrow($result);
                    if ($count) {
                        $nv_Request->set_Session('openid_error', 6);
                        header("Location: " . nv_url_rewrite(NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=openid", true));
                        die;
                    }
                }
                $sql = "INSERT INTO `" . NV_USERS_GLOBALTABLE . "_openid` VALUES (" . $user_info['userid'] . ", " . $db->dbescape($openid) . ", " . $db->dbescape($opid) . ", " . $db->dbescape($email) . ")";
                $db->sql_query($sql);
                nv_insert_logs(NV_LANG_DATA, $module_name, $lang_module['openid_add'], $user_info['username'] . " | " . $client_info['ip'] . " | " . $opid, 0);
                header("Location: " . nv_url_rewrite(NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=openid", true));
                die;
            }
        } else {
            $openid_class->identity = $openid_servers[$server]['identity'];
            $openid_class->required = array_values($openid_servers[$server]['required']);
            header('Location: ' . $openid_class->authUrl());
            die;
        }
    }
}
$data = array();
$data['openid_list'] = array();
$sql = "SELECT * FROM `" . NV_USERS_GLOBALTABLE . "_openid` WHERE `userid`=" . $user_info['userid'];
$query = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($query)) {
开发者ID:atarubi,项目名称:nuke-viet,代码行数:31,代码来源:openid.php

示例12: die

 * @author VINADES.,JSC (contact@vinades.vn)
 * @Copyright (C) 2012 VINADES.,JSC. all rights reserved
 * @createdate 3-6-2010 0:14
 */
if (!defined('NV_IS_MOD_WEBLINKS')) {
    die('Stop!!!');
}
$submit = $nv_Request->get_string('submit', 'post');
$report_id = $nv_Request->get_int('report_id', 'post');
$id = $id == 0 ? $report_id : $id;
$sql = "SELECT `title`, `alias` FROM `" . NV_PREFIXLANG . "_" . $module_data . "_rows` WHERE `id`='" . $id . "'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
unset($sql, $result);
$row['error'] = "";
$row['action'] = nv_url_rewrite(NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $module_name . "&amp;" . NV_OP_VARIABLE . "=reportlink-" . $row['alias'] . "-" . $id, true);
$row['id'] = $id;
if ($id) {
    $check = false;
    if ($submit and $report_id) {
        $sql = "SELECT `type` FROM `" . NV_PREFIXLANG . "_" . $module_data . "_report` WHERE `id`='" . $report_id . "'";
        $result = $db->sql_query($sql);
        $rows = $db->sql_fetchrow($result);
        $report = $nv_Request->get_int('report', 'post');
        $report_note = filter_text_input('report_note', 'post', '', 1, 255);
        $row['report_note'] = $report_note;
        if ($report == 0 and empty($report_note)) {
            $row['error'] = $lang_module['error'];
        } elseif (!empty($report_note) and !isset($report_note[9])) {
            $row['error'] = $lang_module['error_word_min'];
        } elseif ($rows['type'] == $report) {
开发者ID:hongoctrien,项目名称:module-weblink,代码行数:31,代码来源:reportlink.php

示例13: implode

            if (!empty($array_link_content)) {
                $xtpl->assign('ADMINLINK', implode('&nbsp;-&nbsp;', $array_link_content));
                $xtpl->parse('main.viewcatloop.news.adminlink');
            }
            if ($array_row_i['imghome'] != '') {
                $xtpl->assign('HOMEIMG1', $array_row_i['imghome']);
                $xtpl->assign('HOMEIMGALT1', !empty($array_row_i['homeimgalt']) ? $array_row_i['homeimgalt'] : $array_row_i['title']);
                $xtpl->parse('main.viewcatloop.news.image');
            }
            $xtpl->parse('main.viewcatloop.news');
            ++$a;
        }
        $xtpl->parse('main.viewcatloop');
        $generate_page = nv_alias_page($page_title, $base_url, $num_items, $per_page, $page);
        if (!empty($generate_page)) {
            $xtpl->assign('GENERATE_PAGE', $generate_page);
            $xtpl->parse('main.generate_page');
        }
        $xtpl->parse('main');
        $contents .= $xtpl->text('main');
        if ($page > 1) {
            $page_title .= ' ' . NV_TITLEBAR_DEFIS . ' ' . $lang_global['page'] . ' ' . $page;
        }
    }
} elseif ($array_post_user['addcontent']) {
    Header('Location: ' . nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&contentid=0&checkss=' . md5('0' . $client_info['session_id'] . $global_config['sitekey']), true));
    die;
}
include NV_ROOTDIR . '/includes/header.php';
echo nv_site_theme($contents);
include NV_ROOTDIR . '/includes/footer.php';
开发者ID:NukeVietCMS,项目名称:CodeWeb,代码行数:31,代码来源:content.php

示例14: nv_insert_logs

            if ($db->exec('INSERT INTO ' . NV_USERS_GLOBALTABLE . '_info (' . implode(', ', array_keys($query_field)) . ') VALUES (' . implode(', ', array_values($query_field)) . ')')) {
                $db->query('UPDATE ' . NV_GROUPS_GLOBALTABLE . ' SET numbers = numbers+1 WHERE group_id=4');
                $db->query('DELETE FROM ' . NV_USERS_GLOBALTABLE . '_reg WHERE userid=' . $row['userid']);
                $check_update_user = true;
                nv_insert_logs(NV_LANG_DATA, $module_name, $lang_module['account_active_log'], $row['username'] . ' | ' . $client_info['ip'], 0);
            } else {
                $db->query('DELETE FROM ' . NV_USERS_GLOBALTABLE . ' WHERE userid=' . $row['userid']);
            }
        }
    }
}
if ($check_update_user) {
    if ($is_change_email) {
        $info = $lang_module['account_change_mail_ok'] . "<br /><br />\n";
    } else {
        $info = $lang_module['account_active_ok'] . "<br /><br />\n";
    }
} else {
    if ($is_change_email) {
        $info = $lang_module['account_active_error'] . "<br /><br />\n";
    } else {
        $info = $lang_module['account_change_mail_error'] . "<br /><br />\n";
    }
}
$info .= "<img border=\"0\" src=\"" . NV_BASE_SITEURL . "images/load_bar.gif\"><br /><br />\n";
$info .= "[<a href=\"" . NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $module_name . "\">" . $lang_module['redirect_to_login'] . "</a>]";
$contents = user_info_exit($info);
$contents .= "<meta http-equiv=\"refresh\" content=\"5;url=" . nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name, true) . "\" />";
include NV_ROOTDIR . '/includes/header.php';
echo nv_site_theme($contents);
include NV_ROOTDIR . '/includes/footer.php';
开发者ID:lzhao18,项目名称:nukeviet,代码行数:31,代码来源:active.php

示例15: while

        if ($st_links > 0) {
            $db_slave->sqlreset()->select('id, catid, addtime, edittime, publtime, title, alias, hitstotal')->from(NV_PREFIXLANG . '_' . $module_data . '_rows')->where('status=1 AND topicid = ' . $topicid . ' AND publtime < ' . $end_publtime)->order('publtime DESC')->limit($st_links);
            $result = $db_slave->query($db_slave->sql());
            while ($item = $result->fetch()) {
                $item['link'] = $global_array_cat[$item['catid']]['link'] . '/' . $item['alias'] . '-' . $item['id'] . $global_config['rewrite_exturl'];
                $topic_other_array[] = $item;
            }
            unset($result, $row);
        }
        $generate_page = nv_alias_page($page_title, $base_url, $num_items, $per_page, $page);
        if (!empty($topic_image)) {
            $topic_image = NV_BASE_SITEURL . NV_FILES_DIR . '/' . $module_upload . '/topics/' . $topic_image;
        }
        $contents = topic_theme($topic_array, $topic_other_array, $generate_page, $page_title, $description, $topic_image);
    } else {
        Header('Location: ' . nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=' . $module_info['alias']['topic'], true));
        exit;
    }
} else {
    $page_title = $module_info['custom_title'];
    $key_words = $module_info['keywords'];
    $result = $db_slave->query('SELECT topicid as id, title, alias, image, description as hometext, keywords, add_time as publtime FROM ' . NV_PREFIXLANG . '_' . $module_data . '_topics ORDER BY weight ASC');
    while ($item = $result->fetch()) {
        if (!empty($item['image']) and file_exists(NV_ROOTDIR . '/' . NV_FILES_DIR . '/' . $module_upload . '/topics/' . $item['image'])) {
            //image thumb
            $item['src'] = NV_BASE_SITEURL . NV_FILES_DIR . '/' . $module_upload . '/topics/' . $item['image'];
        } elseif (!empty($item['image'])) {
            //image file
            $item['src'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/topics/' . $item['image'];
        } elseif (!empty($show_no_image)) {
            //no image
开发者ID:nukeplus,项目名称:nuke,代码行数:31,代码来源:topic.php


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