This repository has been archived by the owner on Jan 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
print.php
executable file
·131 lines (112 loc) · 4.32 KB
/
print.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php
ini_set("include_path","./:/homepages/25/d358692369/htdocs/tsv-sulzfeld/modules/content/classes:/homepages/25/d358692369/htdocs/tsv-sulzfeld/modules/image/classes:/homepages/25/d358692369/htdocs/tsv-sulzfeld/modules/common/classes:/homepages/25/d358692369/htdocs/tsv-sulzfeld/modules/auth/classes:/homepages/25/d358692369/htdocs/tsv-sulzfeld/modules/leaguemanager/classes:/homepages/25/d358692369/htdocs/tsv-sulzfeld/modules/date/classes:/homepages/25/d358692369/htdocs/tsv-sulzfeld/modules/news/classes");
include("classError.php");
include("classDBmysql.php");
include("classXMLShow.php");
include("classXMLPrint.php");
include("classMenu.php");
// initialize objects
$error = new Error();
$db = new DBmysql($error);
$menu = new Menu($error, $db);
$menuStarted = false;
// check $type and $ID
if(isset($type) && ($type == "page"))
$table = "contentPage";
else if(isset($type) && ($type == "cat"))
$table = "contentCat";
else
{
$table = "contentPage";
$type = "page";
}
if(!isset($ID))
$ID = 1;
// start html output
$xml = new XMLPrint($error, $db);
pageStartPrint();
pageContentStartPrint();
// get content and contentType for the current page/category
// $query = sprintf(" select p.content, t.name as contentType from %s p, contentType t where p.ID=%s and p.contentTypeID=t.ID", $table, $ID);
$query = sprintf(" select p.content,
date_format(p.lastmodifyDate, '%%d.%%m.%%Y') as lastupdate,
t.name as contentType,
t.file
from %s p,
contentType t
where p.ID=%s
and p.contentTypeID=t.ID",
$table,
$ID );
$db->executeQuery($query);
$db->nextRow();
$content = $db->getValue("content");
$file = $db->getValue("file");
$contentType = $db->getValue("contentType");
$lastupdate = $db->getValue("lastupdate");
while($contentType == "emptyCat")
{
$table = "contentPage";
$query = sprintf(" select p.content,
date_format(p.lastmodifyDate, '%%d.%%m.%%Y') as lastupdate,
t.name as contentType,
t.file
from %s p,
contentType t
where p.catID=%s
and p.contentTypeID=t.ID
order by ord
limit 0,1 ",
$table,
$ID );
$db->executeQuery($query);
if($db->getNumRows() == 1)
{
$db->nextRow();
$content = $db->getValue("content");
$file = $db->getValue("file");
$contentType = $db->getValue("contentType");
$lastupdate = $db->getValue("lastupdate");
}
else
{
// nächste Sub-Kategorie finden
}
}
if($contentType == "normal")
$data = $content;
else
include($file);
$xml = new XMLPrint($error, $db);
$xml->parse($data);
pageContentStopPrint();
pageStopPrint();
function pageStartPrint()
{
?>
<html>
<head>
<title></title>
<link rel="STYLESHEET" type="text/css" href="/css/print.css"></link>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#0000FF" alink="#0000FF">
<?php
}
function pageStopPrint()
{
?>
</body>
</html>
<?php
}
function pageContentStartPrint()
{
?>
<?php
}
function pageContentStopPrint()
{
?>
<?php
}
?>