Ok, oto plik :
<?
/*--------------------------------------------+
| PHP-Fusion 6 - Content Management System |
|---------------------------------------------|
| author: Nick Jones (Digitanium) © 2002-2005 |
| web: http://www.php-fusion.co.uk |
| email: |
|---------------------------------------------|
| Released under the terms and conditions of |
| the GNU General Public License (Version 2) |
+--------------------------------------------*/
@include_once "../../config.php";
include_once "../../maincore.php";
include_once BASEDIR."subheader.php";
include_once BASEDIR."side_left.php";
if (file_exists(INFUSIONS."encyclopedia/locale/".$settings['locale'].".php")) {
include INFUSIONS."encyclopedia/locale/".$settings['locale'].".php";
} else {
include INFUSIONS."encyclopedia/locale/English.php";
}
if (isset($ency_id)) {
$result = dbquery("UPDATE ".$db_prefix."ency SET ency_count=ency_count+1 WHERE ency_id='$ency_id'");
$result = dbquery("SELECT ency_url FROM ".$db_prefix."ency WHERE ency_id='$ency_id'");
$data = dbarray($result);
header ("Location:".$data['ency_url']);
}
if (!isset($cat_id)) {
opentable($locale['LAN_400']);
$result = dbquery("SELECT * FROM ".$db_prefix."ency_cat ORDER BY ency_cat_name");
$rows = dbrows($result);
if ($rows != 0) {
$columns = 1; $counter = 0;
echo "<table width='100%' cellspacing='0' cellpadding='0' class='tbl'>\n<tr>\n";
while($data = dbarray($result)) {
if ($counter != 0) if ($counter % $columns == 0) echo "</tr>\n<tr>\n";
$num = dbcount("(ency_cat)", "ency", "ency_cat='".$data['ency_cat_id']."'");
echo "<td align='left' valign='top'><a href='$PHP_SELF?cat_id=".$data['ency_cat_id']."'>".$data['ency_cat_name']."</a> <span class='small2'>(Haseł: $num)</span>";
if ($data['ency_cat_description'] != "") echo "<br>\n<span class='small'>".$data['ency_cat_description']."</span>";
echo "</td>\n";
$counter++;
}
echo "</tr>\n</table>\n";
} else {
echo "<center><br>\n".$locale['LAN_430']."<br><br>\n</center>\n";
}
closetable();
} else {
if (!isNum($cat_id)) { header("Location:".$PHP_SELF); exit; }
if ($data = dbarray(dbquery("SELECT * FROM ".$db_prefix."ency_cat WHERE ency_cat_id='$cat_id'"))) {
opentable($locale['LAN_400'].": ".$data['ency_cat_name']);
$rows = dbcount("(*)", "ency", "ency_cat='$cat_id'");
if (!$rowstart) $rowstart = 0;
if ($rows != 0) {
$result = dbquery("SELECT * FROM ".$db_prefix."ency WHERE ency_cat='$cat_id' ORDER BY ency_name LIMIT $rowstart,8");
$numrows = dbrows($result); $i = 1;
while ($data = dbarray($result)) {
if ($data['ency_datestamp']+604800 > time()+($settings['timeoffset']*3600)) {
$new = " <span class='small'>".$locale['LAN_410']."</span>";
} else {
$new = "";
}
echo "<b>".$data['ency_name']."</b>$new\n";
if (iSUPERADMIN) {
echo " <span class='small'>(<a href='".INFUSIONS."encyclopedia/ency_admin.php?step=edit&ency_cat_id=".$data['ency_cat_id']."&ency_id=".$data['ency_id']."'>".$locale['LAN_2010']."</a>)</span>";
}
if ($data['ency_description'] != "")
$ency_ency = $data['ency_description'];
$ency_ency = nl2br($ency_ency);
echo "<br>".$ency_ency."<br><br>\n";
echo "<span class='small'><font class='alt'>".$locale['LAN_2003']." </font><a href='mailto:".$data['ency_mail']."'>";
if ($data['ency_nick'] != "") echo $data['ency_nick']."</a> ";
echo "<font class='alt'>".$locale['LAN_411']."</font> ".showdate("%d.%m.%y", $data['ency_datestamp'])."\n";
echo ($i != $numrows ? "<hr>\n" : "\n"); $i++;
}
closetable();
echo " <a href=\"javascript:history.go(-1)\"><b>".$locale['LAN_2009']."</b></a><br><div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,8,$rows,3,"$PHP_SELF?cat_id=$cat_id&")."\n</div>\n";
} else {
echo "<center><br>".$locale['LAN_2004']." <a href='ency_add.php'>".$locale['LAN_2005']."</a><br><br></center>\n";
closetable();
}
} else {
header("Location:".$PHP_SELF); exit;
}
}
include_once "../../side_right.php";
include_once "../../footer.php";
?>
Przyznaje z ręką na sercu, że nic nie grzebałem. |