-
Notifications
You must be signed in to change notification settings - Fork 1
/
TemplatePage.php
executable file
·52 lines (45 loc) · 1.32 KB
/
TemplatePage.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
<?php
/*
Copyright © 2009,2015,2022 Siggi Bjarnason.
Licensed under GNU GPL v3 and later. Check out LICENSE.TXT for details
or see <https://www.gnu.org/licenses/gpl-3.0-standalone.html>
Dynamic Text page
*/
require("header.php");
$strQuery = "SELECT * FROM tblContent WHERE iMenuID = '$iMenuID' and dtTimeStamp = (select max(dtTimeStamp) from tblContent where iMenuID = '$iMenuID');";
$QueryData = QuerySQL($strQuery);
if($QueryData[0] > 0)
{
foreach($QueryData[1] as $Row)
{
$PageHeader = $Row["vcPageHeader"];
$PageText = $Row["tPageText"];
$bCRLF = $Row["bLineBreak"];
}
}
else
{
$strMsg = Array2String($QueryData[1]);
trigger_error("Query of $strQuery did not return data. Rowcount: $QueryData[0] Msg:$strMsg");
$PageHeader = "Error occured";
$PageText = "Failed to fetch the pagetext from the database";
$bCRLF = "";
}
printPg("$PageHeader","h1");
if(substr($PageText,0,1)=="<")
{
print "$PageText\n";
}
else
{
if($bCRLF == 1)
{
$PageText = str_replace("\n","<br>\n",$PageText);
}
$PageText = str_replace("\r\n","\n",$PageText);
$PageText = str_replace("\r","\n",$PageText);
$PageText = str_replace("\n\n","\n</p>\n<p class=MainText>\n",$PageText);
printPg("$PageText");
}
require("footer.php");
?>