-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfaq.php
More file actions
96 lines (83 loc) · 2.68 KB
/
Copy pathfaq.php
File metadata and controls
96 lines (83 loc) · 2.68 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
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
/***
* INTEGRATED FLEET MANAGEMENT SYSTEM
* OBSIDIAN FLEET
* http://www.obsidianfleet.net/ifs/
*
* Developer: Frank Anon
* fanon@obsidianfleet.net
*
* Version: 1.11
* Release Date: June 3, 2004
*
* Copyright (C) 2003-2004 Frank Anon for Obsidian Fleet RPG
* Distributed under the terms of the GNU General Public License
* See doc/LICENSE for details
*
* This file based on code from Mambo Site Server 4.0.12
* Copyright (C) 2000 - 2002 Miro International Pty Ltd
*
* Date: 12/9/03
* Comments: The function listing retrieves all faq categories and titles from the database.
***/
require ("classes/html/faq.php");
$faq = new faq();
switch($task)
{
case "show":
show($faq, $database, $artid, $mpre);
break;
default:
listfaq($faq, $database, $topid, $mpre);
break;
}
function listfaq($faq, $database, $topid, $mpre)
{
$qry = "SELECT categoryid, categoryname
FROM {$mpre}categories
WHERE section='Faq' AND published=1
ORDER BY categoryname";
$result = $database->openConnectionWithReturn($qry);
$j = 0;
while ( list($catid, $catname) = mysql_fetch_array($result))
{
$topicid[$j] = $catid;
$topictext[$j] = $catname;
$qry2 = "SELECT artid, title, counter
FROM {$mpre}faqcont
WHERE faqid='$catid' AND published=1 AND archived=0
ORDER BY ordering";
$result2 = $database->openConnectionWithReturn($qry2);
$num[$j] = mysql_num_rows($result2);
if ($topid <> "")
{
$i=0;
if (mysql_num_rows($result2)<> 0)
while ( list($artid, $arttitle, $artcounter) = mysql_fetch_array($result2))
{
$sid[$catname][$i] = $artid;
$title[$catname][$i] = $arttitle;
$counter[$catname][$i] = $artcounter;
$i++;
}
}
$j++;
}
$faq->faqlist($topictext, $topicid, $title, $sid, $topid, $counter);
}
function show($faq, $database, $id, $mpre)
{
$qry = "SELECT title, content FROM {$mpre}faqcont WHERE artid='$id' AND published=1";
$result = $database->openConnectionWithReturn($qry);
list($title, $content) = mysql_fetch_array($result);
$qry = "UPDATE {$mpre}faqcont SET counter=counter+1 WHERE artid=$id";
$database->openConnectionNoReturn($qry);
$pat= "SRC=images";
$replace= "SRC=../images";
$pat2= "SRC=\"images";
$replace2= "SRC=\"../images";
$content=eregi_replace($pat, $replace, $content);
$content=eregi_replace($pat2, $replace2, $content);
$faq->showfaq($title, $id, $content);
}
?>