-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathviewhelp.php
More file actions
83 lines (74 loc) · 2.96 KB
/
viewhelp.php
File metadata and controls
83 lines (74 loc) · 2.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
/***************************************************************************
* copyright : (C) 2008 - 2013 WeBid
* site : http://www.webidsupport.com/
***************************************************************************/
/***************************************************************************
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. Although none of the code may be
* sold. If you have been sold this script, get a refund.
***************************************************************************/
include 'common.php';
$cat = (isset($_GET['cat'])) ? intval($_GET['cat']) : intval($_POST['cat']);
if ($cat > 0)
{
// Retrieve category's name
$query = "SELECT category FROM " . $DBPrefix . "faqscategories WHERE id = " . $cat;
$res = mysql_query($query);
$system->check_mysql($res, $query, __LINE__, __FILE__);
$FAQ_ctitle = stripslashes(mysql_result($res, 0));
$template->assign_vars(array(
'DOCDIR' => $DOCDIR, // Set document direction (set in includes/messages.XX.inc.php) ltr/rtl
'PAGE_TITLE' => $system->SETTINGS['sitename'] . ' ' . $MSG['5236'] . ' - ' . $FAQ_ctitle,
'CHARSET' => $CHARSET,
'LOGO' => ($system->SETTINGS['logo']) ? '<a href="' . $system->SETTINGS['siteurl'] . 'index.php?"><img src="' . $system->SETTINGS['siteurl'] . 'themes/' . $system->SETTINGS['theme'] . '/' . $system->SETTINGS['logo'] . '" border="0" alt="' . $system->SETTINGS['sitename'] . '"></a>' : " ",
'SITEURL' => $system->SETTINGS['siteurl'],
'FNAME' => $FAQ_ctitle
));
// Retrieve FAQs categories from the database
$query = "SELECT * FROM " . $DBPrefix . "faqscategories ORDER BY category ASC";
$res = mysql_query($query);
$system->check_mysql($res, $query, __LINE__, __FILE__);
while ($cats = mysql_fetch_array($res))
{
$template->assign_block_vars('cats', array(
'CAT' => stripslashes($cats['category']),
'ID' => $cats['id']
));
}
// Retrieve FAQs from the database
$query = "SELECT f.question As q, f.answer As a, t.* FROM " . $DBPrefix . "faqs f
LEFT JOIN " . $DBPrefix . "faqs_translated t ON (t.id = f.id)
WHERE f.category = " . $cat . " AND t.lang = '" . $language . "'";
$res = mysql_query($query);
$system->check_mysql($res, $query, __LINE__, __FILE__);
while ($row = mysql_fetch_assoc($res))
{
if (!empty($row['question']) && !empty($row['answer']))
{
$question = stripslashes($row['question']);
$answer = stripslashes($row['answer']);
}
else
{
$question = stripslashes($row['q']);
$answer = stripslashes($row['a']);
}
$template->assign_block_vars('faqs', array(
'Q' => $question,
'A' => $answer,
'ID' => $row['id']
));
}
$template->set_filenames(array(
'body' => 'viewhelp.tpl'
));
$template->display('body');
}
else
{
header('location: help.php');
}
?>