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


PHP nv_site_theme函数代码示例

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


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

示例1: opidr

/**
 * opidr()
 *
 * @param mixed $openid_info
 * @return void
 */
function opidr($openid_info)
{
    global $lang_module, $nv_Request, $nv_redirect;
    $nv_Request->unset_request('openid_attribs', 'session');
    $openid_info['redirect'] = nv_redirect_decrypt($nv_redirect);
    $contents = openid_callback($openid_info);
    include NV_ROOTDIR . '/includes/header.php';
    echo nv_site_theme($contents, false);
    include NV_ROOTDIR . '/includes/footer.php';
    exit;
}
开发者ID:nukeplus,项目名称:nuke,代码行数:17,代码来源:login.php

示例2: redict_link

/**
 * redict_link()
 *
 * @param mixed $lang_view
 * @param mixed $lang_back
 * @param mixed $nv_redirect
 * @return
 */
function redict_link($lang_view, $lang_back, $nv_redirect)
{
    $contents = "<div class=\"frame\">";
    $contents .= $lang_view . "<br /><br />\n";
    $contents .= "<img border=\"0\" src=\"" . NV_BASE_SITEURL . NV_ASSETS_DIR . "/images/load_bar.gif\"><br /><br />\n";
    $contents .= "<a href=\"" . $nv_redirect . "\">" . $lang_back . "</a>";
    $contents .= "</div>";
    $contents .= "<meta http-equiv=\"refresh\" content=\"2;url=" . $nv_redirect . "\" />";
    include NV_ROOTDIR . '/includes/header.php';
    echo nv_site_theme($contents);
    include NV_ROOTDIR . '/includes/footer.php';
    exit;
}
开发者ID:nukeplus,项目名称:shops,代码行数:21,代码来源:theme.php

示例3: elseif

                $item['imghome'] = NV_BASE_SITEURL . NV_FILES_DIR . '/' . $module_upload . '/' . $item['homeimgfile'];
            } elseif ($item['homeimgthumb'] == 2) {
                //image file
                $item['imghome'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/' . $item['homeimgfile'];
            } elseif ($item['homeimgthumb'] == 3) {
                //image url
                $item['imghome'] = $item['homeimgfile'];
            } elseif (!empty($show_no_image)) {
                //no image
                $item['imghome'] = NV_BASE_SITEURL . $show_no_image;
            } else {
                $item['imghome'] = '';
            }
            $item['newday'] = $global_array_cat[$item['catid']]['newday'];
            $item['link'] = $global_array_cat[$item['catid']]['link'] . '/' . $item['alias'] . '-' . $item['id'] . $global_config['rewrite_exturl'];
            $array_catpage[] = $item;
        }
        $viewcat = 'viewcat_list_new';
        $generate_page = nv_alias_page($page_title, $base_url, $num_items, $per_page, $page);
        $contents = call_user_func($viewcat, $array_catpage, 0, ($page - 1) * $per_page, $generate_page);
    }
    if (!defined('NV_IS_MODADMIN') and $contents != '' and $cache_file != '') {
        $nv_Cache->setItem($module_name, $cache_file, $contents);
    }
}
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';
开发者ID:nukeplus,项目名称:nuke,代码行数:31,代码来源:main.php

示例4: openidLogin_Res1


//.........这里部分代码省略.........
                } 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);
                Header('Location: ' . nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name, true));
            }
            die;
        }
        $page_title = $lang_module['openid_login'];
        $key_words = $module_info['keywords'];
        $mod_title = $lang_module['openid_login'];
        $lang_module['login_info'] = sprintf($lang_module['openid_confirm_info'], $email);
        $contents = openid_account_confirm($gfx_chk, $attribs);
        include NV_ROOTDIR . '/includes/header.php';
        echo nv_site_theme($contents);
        include NV_ROOTDIR . '/includes/footer.php';
        exit;
    }
    if ($global_config['allowuserreg'] == 2 or $global_config['allowuserreg'] == 3) {
        $query = 'SELECT * FROM ' . NV_USERS_GLOBALTABLE . '_reg WHERE email= :email';
        if ($global_config['allowuserreg'] == 2) {
            $query .= ' AND regdate>' . (NV_CURRENTTIME - 86400);
        }
        $stmt = $db->prepare($query);
        $stmt->bindParam(':email', $email, PDO::PARAM_STR);
        $stmt->execute();
        $row = $stmt->fetch();
        if (!empty($row)) {
            if ($global_config['allowuserreg'] == 2) {
                if ($nv_Request->isset_request('openid_active_confirm', 'post')) {
                    $nv_Request->unset_request('openid_attribs', 'session');
                    $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);
                    if ($crypt->validate_password($password, $row['password']) and $nv_seccode) {
                        $reg_attribs = set_reg_attribs($attribs);
                        $sql = "INSERT INTO " . NV_USERS_GLOBALTABLE . " (\n\t\t\t\t\t\t\tusername, md5username, password, email, first_name, last_name, gender, photo, birthday, regdate,\n\t\t\t\t\t\t\tquestion, answer, passlostkey, view_mail, remember, in_groups,\n\t\t\t\t\t\t\tactive, checknum, last_login, last_ip, last_agent, last_openid, idsite) VALUES (\n\t\t\t\t\t\t\t:username,\n\t\t\t\t\t\t\t:md5username,\n\t\t\t\t\t\t\t:password,\n\t\t\t\t\t\t\t:email,\n\t\t\t\t\t\t\t:first_name,\n\t\t\t\t\t\t\t:last_name,\n\t\t\t\t\t\t\t:gender,\n\t\t\t\t\t\t\t'', 0,\n\t\t\t\t\t\t\t:regdate,\n\t\t\t\t\t\t\t:question,\n\t\t\t\t\t\t\t:answer,\n\t\t\t\t\t\t\t'', 1, 1, '', 1, '', 0, '', '', '', " . $global_config['idsite'] . ")";
                        $data_insert = array();
                        $data_insert['username'] = $row['username'];
                        $data_insert['md5username'] = nv_md5safe($row['username']);
                        $data_insert['password'] = $row['password'];
                        $data_insert['email'] = $row['email'];
                        $data_insert['first_name'] = $row['first_name'];
                        $data_insert['last_name'] = $row['last_name'];
                        $data_insert['gender'] = $reg_attribs['gender'];
                        $data_insert['regdate'] = $row['regdate'];
                        $data_insert['question'] = $row['question'];
开发者ID:lzhao18,项目名称:nukeviet,代码行数:67,代码来源:login.php

示例5: nv_chmod_dir

            nv_chmod_dir($conn_id, NV_UPLOADS_DIR, true);
            ftp_chmod($conn_id, 0644, NV_CONFIG_FILENAME);
            ftp_close($conn_id);
        } else {
            @rename(NV_ROOTDIR . '/' . NV_TEMP_DIR . '/' . NV_CONFIG_FILENAME, NV_ROOTDIR . '/' . NV_CONFIG_FILENAME);
        }
    }
    if (file_exists(NV_ROOTDIR . '/' . NV_CONFIG_FILENAME)) {
        $finish = 1;
    } else {
        $finish = 2;
    }
    $title = $lang_module['done'];
    $contents = nv_step_7($finish);
}
echo nv_site_theme($step, $title, $contents);
function nv_save_file_config()
{
    global $nv_Request, $file_config_temp, $db_config, $global_config, $step;
    if (is_writable(NV_ROOTDIR . '/' . $file_config_temp) or is_writable(NV_ROOTDIR . '/' . NV_TEMP_DIR)) {
        $global_config['cookie_prefix'] = (empty($global_config['cookie_prefix']) or $global_config['cookie_prefix'] == 'nv4') ? 'nv4c_' . nv_genpass(5) : $global_config['cookie_prefix'];
        $global_config['session_prefix'] = (empty($global_config['session_prefix']) or $global_config['session_prefix'] == 'nv4') ? 'nv4s_' . nv_genpass(6) : $global_config['session_prefix'];
        $global_config['site_email'] = !isset($global_config['site_email']) ? '' : $global_config['site_email'];
        $db_config['dbhost'] = !isset($db_config['dbhost']) ? 'localhost' : $db_config['dbhost'];
        $db_config['dbport'] = !isset($db_config['dbport']) ? '' : $db_config['dbport'];
        $db_config['dbname'] = !isset($db_config['dbname']) ? '' : $db_config['dbname'];
        $db_config['dbuname'] = !isset($db_config['dbuname']) ? '' : $db_config['dbuname'];
        $db_config['dbsystem'] = isset($db_config['dbsystem']) ? $db_config['dbsystem'] : $db_config['dbuname'];
        $db_config['dbpass'] = !isset($db_config['dbpass']) ? '' : $db_config['dbpass'];
        $db_config['prefix'] = !isset($db_config['prefix']) ? 'nv4' : $db_config['prefix'];
        $db_config['charset'] = strstr($db_config['collation'], '_', true);
开发者ID:NukeVietCMS,项目名称:CodeWeb,代码行数:31,代码来源:index.php

示例6: preg_replace

        // Storage in temp dir
        $upload_info = $upload->save_file($_FILES['image_file'], NV_ROOTDIR . '/' . NV_TEMP_DIR, false);
        // Delete upload tmp
        @unlink($_FILES['image_file']['tmp_name']);
        if (empty($upload_info['error'])) {
            $basename = $upload_info['basename'];
            $basename = preg_replace('/(.*)(\\.[a-zA-Z]+)$/', '\\1_' . nv_genpass(8) . "_" . $user_info['userid'] . '\\2', $basename);
            $image = new image($upload_info['name'], NV_MAX_WIDTH, NV_MAX_HEIGHT);
            // Resize image, crop image
            $image->resizeXY($array['w'], $array['h']);
            $image->cropFromLeft($array['x1'], $array['y1'], $array['avatar_width'], $array['avatar_height']);
            $image->resizeXY($global_config['avatar_width'], $global_config['avatar_height']);
            // Save new image
            $image->save(NV_ROOTDIR . '/' . NV_TEMP_DIR, $basename);
            $image->close();
            if (file_exists($image->create_Image_info['src'])) {
                $array['success'] = true;
                $array['filename'] = str_replace(NV_ROOTDIR . '/' . NV_TEMP_DIR . '/', '', $image->create_Image_info['src']);
            } else {
                $array['error'] = $lang_module['avata_error_save'];
            }
            @nv_deletefile($upload_info['name']);
        } else {
            $array['error'] = $upload_info['error'];
        }
    }
}
$contents = nv_avatar($array);
include NV_ROOTDIR . '/includes/header.php';
echo nv_site_theme($contents, false);
include NV_ROOTDIR . '/includes/footer.php';
开发者ID:anhtunguyen,项目名称:vietnamguide,代码行数:31,代码来源:avatar.php

示例7: opidr

function opidr($openid_info)
{
    global $lang_module;
    if ($openid_info == 1) {
        $openid_info = array('status' => 'error', 'mess' => $lang_module['canceled_authentication']);
    } elseif ($openid_info == 2) {
        $openid_info = array('status' => 'error', 'mess' => $lang_module['not_logged_in']);
    } elseif ($openid_info == 3) {
        $openid_info = array('status' => 'error', 'mess' => $lang_module['logged_in_failed']);
    } elseif ($openid_info == 4) {
        $openid_info = array('status' => 'error', 'mess' => $lang_module['openid_is_exists']);
    } elseif ($openid_info == 5 or $openid_info == 6) {
        $openid_info = array('status' => 'error', 'mess' => $lang_module['email_is_exists']);
    } else {
        $openid_info = array('status' => 'success', 'mess' => $lang_module['openid_added']);
    }
    $contents = openid_callback($openid_info);
    include NV_ROOTDIR . '/includes/header.php';
    echo nv_site_theme($contents, false);
    include NV_ROOTDIR . '/includes/footer.php';
    exit;
}
开发者ID:nukeplus,项目名称:nuke,代码行数:22,代码来源:editinfo.php

示例8: nv_theme_nvform_alert

/**
 * nv_theme_nvform_alert()
 *
 * @param mixed $message
 * @param mixed $type
 * @return
 */
function nv_theme_nvform_alert($message_title, $message_content, $type = 'info', $link_back = '', $time_back = 0)
{
    global $module_file, $module_info, $page_title;
    $xtpl = new XTemplate('info.tpl', NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $module_file);
    if ($type == 'success') {
        $class = 'class="alert alert-success"';
    } elseif ($type == 'warning') {
        $class = 'class="alert alert-warning"';
    } elseif ($type == 'danger') {
        $class = 'class="alert alert-danger"';
    } else {
        $class = 'class="alert alert-info"';
    }
    if (!empty($message_title)) {
        $page_title = $message_title;
        $xtpl->assign('TITLE', $message_title);
        $xtpl->parse('main.title');
    } else {
        $page_title = $module_info['custom_title'];
    }
    $xtpl->assign('CONTENT', $message_content);
    $xtpl->assign('CLASS', $class);
    $xtpl->parse('main');
    $contents = $xtpl->text('main');
    include NV_ROOTDIR . "/includes/header.php";
    echo nv_site_theme($contents);
    include NV_ROOTDIR . "/includes/footer.php";
    exit;
}
开发者ID:hoangvtien,项目名称:module-nvform,代码行数:36,代码来源:theme.php

示例9: nv_url_rewrite

                    $global_config['mudim_active'] = $array_op[2];
                    $base_url_rewrite .= '/' . $array_op[2];
                }
            }
        }
        $base_url_rewrite = nv_url_rewrite($base_url_rewrite, true);
        if ($_SERVER['REQUEST_URI'] == $base_url_rewrite) {
            $canonicalUrl = NV_MAIN_DOMAIN . $base_url_rewrite;
        } elseif (NV_MAIN_DOMAIN . $_SERVER['REQUEST_URI'] != $base_url_rewrite) {
            Header('Location: ' . $base_url_rewrite);
            die;
        } else {
            $canonicalUrl = $base_url_rewrite;
        }
    }
}
$bodytext = '';
if (isset($array_department[$fpart]) and !empty($array_department[$fpart]['note'])) {
    $bodytext = $array_department[$fpart]['note'];
} elseif (isset($module_config[$module_name]['bodytext'])) {
    $bodytext = $module_config[$module_name]['bodytext'];
}
if (!empty($bodytext)) {
    $lang_module['note'] = $bodytext;
}
$array_content = array('error' => $error, 'fpart' => $fpart, 'fname' => $fname, 'femail' => $femail, 'fcon' => $fcon, 'ftitle' => $ftitle, 'fphone' => $fphone);
$checkss = md5($client_info['session_id'] . $global_config['sitekey']);
$contents = contact_main_theme($array_content, $array_department, $base_url, $checkss);
include NV_ROOTDIR . '/includes/header.php';
echo nv_site_theme($contents, $full);
include NV_ROOTDIR . '/includes/footer.php';
开发者ID:lzhao18,项目名称:nukeviet,代码行数:31,代码来源:main.php

示例10: nv_html_meta_tags

            $meta_tags = nv_html_meta_tags();
            $content['bodytext'] = $db_slave->query('SELECT bodyhtml FROM ' . NV_PREFIXLANG . '_' . $module_data . '_bodyhtml_' . ceil($content['id'] / 2000) . ' where id=' . $content['id'])->fetchColumn();
            $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);
            $page_title = $result['title'];
            if (!empty($content['homeimgfile']) and $content['imgposition'] > 0) {
                $src = $alt = $note = '';
                $width = $height = 0;
                if ($content['homeimgthumb'] == 1 and $content['imgposition'] == 1 and file_exists(NV_ROOTDIR . '/' . NV_FILES_DIR . '/' . $module_upload . '/' . $content['homeimgfile'])) {
                    $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'];
                }
                $alt = empty($content['homeimgalt']) ? $content['title'] : $content['homeimgalt'];
                $result['image'] = array('src' => $src, 'width' => $width, 'alt' => $alt, 'note' => $content['homeimgalt'], 'position' => $content['imgposition']);
            }
            $contents = call_user_func('news_print', $result);
            header("Content-Type: text/x-delimtext; name=\"" . $result['alias'] . ".html\"");
            header("Content-disposition: attachment; filename=" . $result['alias'] . ".html");
            include NV_ROOTDIR . '/includes/header.php';
            echo preg_replace_callback("/(src|href)\\=\"([^\"]+)\"/", "nv_src_href_callback", nv_url_rewrite(nv_site_theme($contents, false)));
            include NV_ROOTDIR . '/includes/footer.php';
        }
    }
}
header('Location: ' . $global_config['site_url']);
exit;
开发者ID:nukeplus,项目名称:nuke,代码行数:31,代码来源:savefile.php

示例11: array_map

        }
        $ratingdetail = array_map("intval", explode("|", $news_contents['ratingdetail']));
        $ratingdetail[0] = isset($ratingdetail[0]) ? intval($ratingdetail[0]) : 0;
        $ratingdetail[1] = isset($ratingdetail[1]) ? intval($ratingdetail[1]) : 0;
        $news_contents['stringrating'] = sprintf($lang_module['stringrating'], $ratingdetail[0], $ratingdetail[1]);
        $ratingdetail[1] = $ratingdetail[1] > 0 ? $ratingdetail[1] : 1;
        $news_contents['numberrating'] = round($ratingdetail[0] / $ratingdetail[1]) - 1;
        $news_contents['langstar'] = array("note" => $lang_module['star_note'], "verypoor" => $lang_module['star_verypoor'], "poor" => $lang_module['star_poor'], "ok" => $lang_module['star_ok'], "good" => $lang_module['star_good}'], "verygood" => $lang_module['star_verygood']);
    }
    $page_title = $news_contents['title'];
    $key_words = $news_contents['keywords'];
    $description = $news_contents['hometext'];
    if (empty($news_contents['author'])) {
        $sql = $db->sql_query(" SELECT `username`, `full_name` FROM `" . NV_USERS_GLOBALTABLE . "` WHERE `userid` = '" . $news_contents['admin_id'] . "' LIMIT 0,1 ");
        $chk_u = $db->sql_numrows($sql);
        if ($chk_u) {
            list($row) = $db->sql_fetchrowset($sql);
        }
        $news_contents['author_name'] = empty($row['full_name']) ? $row['username'] : $row['full_name'];
    } else {
        $news_contents['author_name'] = $news_contents['author'];
    }
    $contents = detail_theme($news_contents, $related_new_array, $related_array, $topic_array, $commentenable);
} else {
    $contents = no_permission($func_who_view);
}
include NV_ROOTDIR . "/includes/header.php";
$results = nv_site_theme($contents);
// new dBug($results);
echo $results;
include NV_ROOTDIR . "/includes/footer.php";
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:31,代码来源:detail.php

示例12: user_info_exit_redirect

/**
 * user_info_exit_redirect()
 *
 * @param mixed $info
 * @param mixed $nv_redirect
 * @return void
 */
function user_info_exit_redirect($info, $nv_redirect)
{
    global $module_info, $module_file, $lang_module;
    $xtpl = new XTemplate('info_exit_redirect.tpl', NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $module_file);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
    $xtpl->assign('INFO', $info);
    $xtpl->assign('NV_REDIRECT', $nv_redirect);
    $xtpl->parse('main');
    $contents = $xtpl->text('main');
    include NV_ROOTDIR . '/includes/header.php';
    echo nv_site_theme($contents);
    include NV_ROOTDIR . '/includes/footer.php';
}
开发者ID:hongoctrien,项目名称:nukeviet,代码行数:21,代码来源:theme.php

示例13: nv_theme_alert

/**
 * nv_theme_alert()
 *
 * @param mixed $message_title
 * @param mixed $message_content
 * @param mixed $type
 * @param mixed $url_back
 * @param mixed $time_back
 * @return
 */
function nv_theme_alert($message_title, $message_content, $type = 'info', $url_back = '', $time_back = 5, $lang_back = true)
{
    global $module_file, $module_info, $lang_module, $page_title;
    $xtpl = new XTemplate('alert.tpl', NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $module_file);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('CONTENT', $message_content);
    if ($type == 'success') {
        $xtpl->parse('main.success');
    } elseif ($type == 'warning') {
        $xtpl->parse('main.warning');
    } elseif ($type == 'danger') {
        $xtpl->parse('main.danger');
    } else {
        $xtpl->parse('main.info');
    }
    if (!empty($message_title)) {
        $page_title = $message_title;
        $xtpl->assign('TITLE', $message_title);
        $xtpl->parse('main.title');
    } else {
        $page_title = $module_info['custom_title'];
    }
    if (!empty($url_back)) {
        $xtpl->assign('TIME', $time_back);
        $xtpl->assign('URL', $url_back);
        $xtpl->parse('main.url_back');
        if ($lang_back) {
            $xtpl->parse('main.url_back_button');
        }
    }
    $xtpl->parse('main');
    $contents = $xtpl->text('main');
    include NV_ROOTDIR . "/includes/header.php";
    echo nv_site_theme($contents);
    include NV_ROOTDIR . "/includes/footer.php";
    exit;
}
开发者ID:ThinhNguyenVB,项目名称:module-download,代码行数:47,代码来源:theme.php

示例14: 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;
    $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']);
    $query = "SELECT a.userid AS uid, a.email AS uemail, b.active AS uactive FROM `" . NV_USERS_GLOBALTABLE . "_openid` a, `" . NV_USERS_GLOBALTABLE . "` b \r\n    WHERE a.opid=" . $db->dbescape($opid) . " \r\n    AND a.email=" . $db->dbescape($email) . " \r\n    AND a.userid=b.userid";
    $result = $db->sql_query($query);
    $numrows = $db->sql_numrows($result);
    if ($numrows) {
        list($user_id, $op_email, $user_active) = $db->sql_fetchrow($result);
        $db->sql_freeresult($result);
        $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;
        }
        $query = "SELECT * FROM `" . NV_USERS_GLOBALTABLE . "` WHERE `userid`=" . $db->dbescape($user_id);
        $result = $db->sql_query($query);
        $row = $db->sql_fetchrow($result);
        validUserLog($row, 1, $opid);
        $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;
        Header("Location: " . $nv_redirect);
        die;
    }
    $query = "SELECT * FROM `" . NV_USERS_GLOBALTABLE . "` WHERE `email`=" . $db->dbescape($email);
    $result = $db->sql_query($query);
    $numrows = $db->sql_numrows($result);
    if ($numrows) {
        $nv_row = $db->sql_fetchrow($result);
        $db->sql_freeresult($result);
        $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')) {
            $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 {
                $password = $nv_Request->get_string('password', 'post', '');
                $nv_seccode = filter_text_input('nv_seccode', 'post', '');
                $nv_seccode = !$gfx_chk ? 1 : (nv_capcha_txt($nv_seccode) ? 1 : 0);
                if ($crypt->validate($password, $nv_row['password']) and $nv_seccode) {
                    $login_allowed = true;
                } else {
                    openidLogin_Res0($lang_module['openid_confirm_failed']);
                    die;
                }
            }
        }
        if ($login_allowed) {
            $sql = "INSERT INTO `" . NV_USERS_GLOBALTABLE . "_openid` VALUES (" . intval($nv_row['userid']) . ", " . $db->dbescape($attribs['id']) . ", " . $db->dbescape($opid) . ", " . $db->dbescape($email) . ")";
            $db->sql_query($sql);
            if (intval($nv_row['active']) != 1) {
                openidLogin_Res0($lang_module['login_no_active']);
            } else {
                validUserLog($nv_row, 1, $opid);
                Header("Location: " . NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name);
            }
            die;
        }
        $page_title = $lang_module['openid_login'];
        $key_words = $module_info['keywords'];
        $mod_title = $lang_module['openid_login'];
        $lang_module['login_info'] = sprintf($lang_module['openid_confirm_info'], $email);
        $contents = openid_account_confirm($gfx_chk, $attribs);
        include NV_ROOTDIR . "/includes/header.php";
        echo nv_site_theme($contents);
        include NV_ROOTDIR . "/includes/footer.php";
        exit;
    }
    if ($global_config['allowuserreg'] == 2 or $global_config['allowuserreg'] == 3) {
        $query = "SELECT * FROM `" . NV_USERS_GLOBALTABLE . "_reg` WHERE `email`=" . $db->dbescape($email);
        if ($global_config['allowuserreg'] == 2) {
            $query .= " AND `regdate`>" . (NV_CURRENTTIME - 86400);
//.........这里部分代码省略.........
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:101,代码来源:login.php


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