help.php
上传用户:gzy2002
上传日期:2010-02-11
资源大小:1785k
文件大小:5k
- <?php
- // +-------------------------------------------------------------+
- // | DeskPRO v [2.0.1 Production]
- // | Copyright (C) 2001 - 2004 Headstart Solutions Limited
- // | Supplied by WTN-WDYL
- // | Nullified by WTN-WDYL
- // | Distribution via WebForum, ForumRU and associated file dumps
- // +-------------------------------------------------------------+
- // | DESKPRO IS NOT FREE SOFTWARE
- // +-------------------------------------------------------------+
- // | License ID : Full Enterprise License =) ...
- // | License Owner : WTN-WDYL Team
- // +-------------------------------------------------------------+
- // | $RCSfile: help.php,v $
- // | $Date: 2004/02/12 21:16:57 $
- // | $Revision: 1.20 $
- // +-------------------------------------------------------------+
- // | File Details:
- // | - Template-based user help display.
- // +-------------------------------------------------------------+
- error_reporting(E_ALL & ~E_NOTICE);
- require_once('./global.php');
- //Nullify WTN-WDYL Team
- $template_cache = templatecache('HELP_footer,HELP_content');
- eval(makeeval('help_footer', 'HELP_footer'));
- // Which validation help do we show?
- if ($settings['validate_email'] AND $settings['manual_validation']) {
- $validation = 'register-both-val';
- } elseif ($settings['validate_email'] AND !$settings['manual_validation']) {
- $validation = 'register-user-val';
- } elseif (!$settings['validate_email'] AND $settings['manual_validation']) {
- $validation = 'register-manual-val';
- } else {
- $validation = 'register-no-val';
- }
- if ($settings['require_registration'] AND !$user['id'] AND ($settings['manual_validation'] OR $settings['validate_email'])) {
- $newticket = 'new-ticket-not-regged-val';
- } elseif ($settings['require_registration'] AND !$user['id']) {
- $newticket = 'new-ticket-not-regged-no-val';
- } elseif ($settings['require_registration'] AND $user['id'] OR (!$settings['require_registration'] AND !$user['id'])) {
- $newticket = 'new-ticket-regged';
- } else {
- $newticket = 'new-ticket-not-val';
- }
- $items = array(
- 'login',
- 'ticket-list',
- 'general-settings',
- 'update-password',
- 'update-email',
- 'subscriptions',
- 'viewing',
- 'advanced-search',
- 'about_dp',
- 'about_ceonex',
- $validation,
- $newticket
- );
- if ($settings[default_language] < $session[language]) {
- $order = "DESC";
- } else {
- $order = "ASC";
- }
- $categories = $db->query_return_array_id(
- "SELECT user_help_cats.id, name, entry FROM user_help_cats, user_help_cats_entries
- WHERE user_help_cats.id = user_help_cats_entries.categoryid
- AND (languageid = '$session[language]'
- OR languageid = '$settings[default_language]'
- )
- ORDER BY displayorder");
- if (is_array($categories)) {
- foreach ($categories AS $data) {
- if (!isset($catnames[$data['name']])) {
- $catnames[$data['name']] = $data['id'];
- }
- }
- }
- $tab = parse_url($_SERVER["HTTP_REFERER"]);
- $path = $tab['path'];
- $query = $tab['query'];
- $vars= explode("&",$query);
- if (is_array($var)) {
- foreach ($vars AS $var) {
- $tmp = explode('=', $var);
- if ($tmp[0] == 'do') {
- $do = $tmp[1];
- }
- }
- }
- if (stristr($path, 'faq.php')) {
- $section = 'FAQ';
- switch ($do) {
- case 'subscriptions':
- $article = 'subscriptions';
- break;
- case 'viewing':
- default:
- $article = 'viewing';
- break;
- case 'advanced-search':
- $article = 'advanced-search';
- break;
- }
- } elseif (stristr($path, 'profile.php')) {
- $section = 'Profile';
- switch ($_REQUEST['do']) {
- case 'view_profile':
- $article = 'general-settings';
- break;
- case 'view_emails':
- $article = 'update-email';
- break;
- case 'view_password':
- $article = 'update-password';
- break;
- }
- } elseif (stristr($path, 'ticketlist.php')) {
- $section = 'Tickets';
- $article = 'ticket-list';
- } elseif (stristr($path, 'newticket.php')) {
- $section = 'Tickets';
- $article = $newticket;
- } elseif (stristr($path, 'register.php')) {
- $section = 'Profile';
- $article = $validation;
- } elseif (stristr($path, 'login.php')) {
- $section = 'Profile';
- $article = 'login';
- }
- if (!$article) {
- $article = 'ticket-list';
- $section = 'Tickets';
- }
- if ($_REQUEST['section']) {
- $section = $_REQUEST['section'];
- if (!$_REQUEST['article']) {
- $article = NULL;
- }
- } else {
- $section = $catnames[$section];
- }
- if (!$section) {
- $section = 'Tickets';
- $section = $catnames[$section];
- }
- $articles = $db->query_return_array_id(
- "SELECT user_help.id, user_help.category, title, name, helpentry FROM user_help, user_help_entries
- WHERE user_help.id = user_help_entries.helpid
- AND (language = '$session[language]' OR language = '$settings[default_language]')
- AND name in " . array2sql($items) .
- "AND user_help.category = '" . mysql_escape_string($section) . "'
- ORDER BY language $order, displayorder
- ");
- if (is_array($articles)) {
- foreach ($articles AS $data) {
- if (!isset($artnames[$data['name']])) {
- $artnames[$data['name']] = $data['id'];
- }
- }
- }
- if ($_REQUEST['article']) {
- $article = $_REQUEST['article'];
- } else {
- $article = $artnames[$article];
- }
- $categories[$section]['selected'] = 1;
- $articles[$article]['selected'] = 1;
- eval(makeeval('echo', 'HELP_content'));