<?php
// =====================================================
//
// s-p-e - Content management system.
// Copyright (C) 2004, 2005, 2006, 2010, 2011 Vladimir B. Tsarkov
//
// This file is part of s-p-e.
//
// s-p-e 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 3 of the License, or
// (at your option) any later version.
//
// s-p-e is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with s-p-e. If not, see <http://www.gnu.org/licenses/>.
//
// ------
//
// You can contact me via e-mail: lipetsk-gnu-lug at bk period ru
//
// print.php
//
// Abstract: Print version.
//
// Revision History:
//
// 1 2004-03-27 - 2005-07-02 vbt
// 2 2005-07-19 vbt
// 3 2005-08-03 vbt
// 4 2006-02-24 vbt
// 5 2010-06-23 vbt
// 6 2011-01-22 vbt
// 7 2011-05-14 vbt
//
// =====================================================
header("Content-Type: text/html; charset=UTF-8");
if(isset($_GET['id']) && isset($_GET['rid']))
{
$id = $_GET['id'];
$rid = $_GET['rid'];
if(ctype_digit($id) && ctype_digit($rid))
{
include("data/configure/specfg.php");
include("include/functions.php");
if(isset($_GET["lng"]))
{
$lng = $_GET["lng"];
language(langch($lng));
}
else
{
$cfg["language"] = $cfg["deflang"];
$shortlng = substr($cfg["deflang"], 0, 2);
language($cfg["deflangvisitor"]);
}
connect($cfg["host"], $cfg["user"], $cfg["password"], $cfg["database"], $connector);
$result = mysql_query("select partname, pnid
from ".($cfg["prefix"])."partition
where num='$id'", $connector)
or die("error #102");
while($row = mysql_fetch_array($result, MYSQL_NUM))
{
$pointer = $row[1];
$sname = $row[0];
}
mysql_free_result($result);
$result = mysql_query("select theme, intro, text, date, timer
from ".($cfg["prefix"].$pointer)."
where num='$rid'", $connector)
or die("error #102");
while($row = mysql_fetch_array($result, MYSQL_NUM))
{
echo "<HTML>
<HEAD>
<TITLE>".$row[0]." - $sname - ".($cfg["xtitle"])."</TITLE>
<LINK rel='stylesheet' href='skin/".($cfg["skin"])."/style.css' type='text/css'>
</HEAD>
<BODY>
<FIELDSET>
<LEGEND><font class='s-normal' id='w-bold'>".$row[0]."</font></LEGEND>
<p>
<font class='s-normal' id='w-normal'>
".(_("Published"))." : ".$row[3]."; ".$row[4]."
</font>
</p>
<p><font class='s-normal' id='w-normal'>".$row[1]."</font></p>
<p><font class='s-normal' id='w-normal'>".$row[2]."</font></p>
</FIELDSET>";
}
mysql_free_result($result);
mysql_close($connector);
echo "<p>
<font class='s-normal' id='w-normal'>";
if(isset($lng)){
echo "".(_("Back to the"))." <a href='index.php?lng=$lng'>".(_("Index page"))."</a>";
}
else
{
echo "".(_("Back to the"))." <a href='index.php'>".(_("Index page"))."</a>";
}
echo "</font>
</p>
<p align='center'>
<img src='skin/".($cfg["skin"])."/img/copy.jpg' alt='Powered by s-p-e: Sound PHP Engine' border='0' height='40'>
</p>
<p align='center'>
<font class='s-normal' id='w-normal'>
s-p-e is Free Software released under the GNU General Public License.
</font>
</p>
</BODY>
</HTML>";
}
}
?>