-
Notifications
You must be signed in to change notification settings - Fork 2
/
error.php
92 lines (86 loc) · 3.77 KB
/
error.php
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
<?php
/*
##########################################################################
# #
# Version 4 / / / #
# -----------__---/__---__------__----__---/---/- #
# | /| / /___) / ) (_ ` / ) /___) / / #
# _|/_|/__(___ _(___/_(__)___/___/_(___ _/___/___ #
# Free Content / Management System #
# / #
# #
# #
# Copyright 2005-2015 by webspell.org #
# #
# visit webSPELL.org, webspell.info to get webSPELL for free #
# - Script runs under the GNU GENERAL PUBLIC LICENSE #
# - It's NOT allowed to remove this copyright-tag #
# -- http://www.fsf.org/licensing/licenses/gpl.html #
# #
# Code based on WebSPELL Clanpackage (Michael Gruber - webspell.at), #
# Far Development by Development Team - webspell.org #
# #
# visit webspell.org #
# #
##########################################################################
*/
if (isset($_GET['type'])) {
$type = $_GET['type'];
} else {
$type = null;
}
$_language->readModule('error');
if ($type == 404) {
$error_header = $_language->module['error_404'];
$error_message = $_language->module['message_404'];
}
if (isset($error_header)) {
echo '<h2>' . $error_header . '</h2>';
echo $error_message;
} else {
echo '<h2>Error</h2>';
}
if (!isset($_GET['url'])) {
$_GET['url'] = '';
}
$urlparts = preg_split('/[\s.,-\/]+/si', $_GET['url']);
$results = array();
foreach ($urlparts as $tag) {
$sql = safe_query("SELECT * FROM " . PREFIX . "tags WHERE tag='" . $tag . "'");
if ($sql->num_rows) {
while ($ds = mysqli_fetch_assoc($sql)) {
$data_check = null;
if ($ds['rel'] == "news") {
$data_check = \webspell\Tags::getNews($ds['ID']);
} elseif ($ds['rel'] == "articles") {
$data_check = \webspell\Tags::getArticle($ds['ID']);
} elseif ($ds['rel'] == "static") {
$data_check = \webspell\Tags::getStaticPage($ds['ID']);
} elseif ($ds['rel'] == "faq") {
$data_check = \webspell\Tags::getFaq($ds['ID']);
}
if (is_array($data_check)) {
$results[] = $data_check;
}
}
}
}
if (count($results)) {
echo "<h1>" . $_language->module['alternative_results'] . "</h1>";
usort($results, array('Tags', 'sortByDate'));
echo "<p class='text-center'><strong>" . count($data) . "</strong> " . $_language->module['results_found'] . "</p>";
foreach ($results as $entry) {
$date = getformatdate($entry['date']);
$type = $entry['type'];
$auszug = $entry['content'];
$link = $entry['link'];
$title = $entry['title'];
$data_array = array();
$data_array['$date'] = $date;
$data_array['$link'] = $link;
$data_array['$title'] = $title;
$data_array['$auszug'] = $auszug;
$search_tags = $GLOBALS["_template"]->replaceTemplate("search_tags", $data_array);
echo $search_tags;
}
}