home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2005 April
/
PCWorld_2005-04_cd.bin
/
akce
/
web
/
unitednuke
/
unitednuke.exe
/
html
/
backend.php
< prev
next >
Wrap
PHP Script
|
2004-01-31
|
8KB
|
165 lines
<?php
/************************************************************************/
/* */
/* */
/* Copyright (c) 2002 by Michal Soukup */
/* http://www.boule.cz */
/* */
/* upraveno/pridano generovani obrazku a konverzni funkce pro cestinu */
/* Vydano pod GNU/GPL verze 2 */
/* */
/*For UNITED-NUKE rewritten by Jiri Stavinoha - http://united-nuke.openland.cz */
/************************************************************************/
/************************************************************************/
/* PHP-NUKE: Advanced Content Management System */
/* ============================================ */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program 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 2 of the License. */
/************************************************************************/
include("mainfile.php");
global $prefix, $db, $nukeurl;
if (isset($help))
{
include ("includes/backend_help.php");
exit();
}
header("Content-Type: text/xml");
$cat = intval($cat);
$enc = strtolower($enc);
if ($cat != "") {
$sql = "SELECT catid from ".$prefix."_stories_cat where title LIKE '%$cat%' limit 1";
$result = $db->sql_query($sql);
$catid = $db->sql_fetchrow($result);
if ($catid == "") {
$sql = "SELECT sid, title FROM ".$prefix."_stories ORDER BY sid DESC limit 10";
$result = $db->sql_query($sql);
} else {
$catid = intval($catid);
$sql = "SELECT sid, title FROM ".$prefix."_stories WHERE catid='$catid' ORDER BY sid DESC limit 10";
$result = $db->sql_query($sql);
}
} else {
$sql = "SELECT sid, title FROM ".$prefix."_stories ORDER BY sid DESC limit 10";
$result = $db->sql_query($sql);
}
if ($enc == "iso")
{
$charset = "iso-8859-2";
}
elseif($enc == "win")
{
$charset = "windows-1250";
}
elseif($enc == "asci")
{
$charset = "ISO-8859-1";
}
else
{
$charset = _CHARSET;
}
if($enc == "") {
$charset = _CHARSET;
$backend_language = str_replace ("_","-",$backend_language); //v rss nesmi byt podtrzitko ale pomlcka
$echo_content = "<?xml version=\"1.0\" encoding=\"$charset\"?>\n";
$echo_content .= "<!DOCTYPE rss PUBLIC \"-//Netscape Communications//DTD RSS 0.91//EN\"\n\n";
$echo_content .= " \"http://my.netscape.com/publish/formats/rss-0.91.dtd\">\n\n";
$echo_content .= "<rss version=\"0.91\">\n\n";
$echo_content .= "<channel>\n";
$echo_content.= "<title>".htmlspecialchars($sitename)."</title>\n";
$echo_content.= "<link>$nukeurl</link>\n";
$echo_content.= "<description>".htmlspecialchars($backend_title)."</description>\n";
$echo_content.= "<language>$backend_language</language>\n\n";
$echo_content.= "<item>\n";
$echo_content.= "<title>"._BE_BADSET."</title>\n";
$echo_content.= "<link>$nukeurl/backend.php?help=1</link>\n";
$echo_content.= "</item>\n\n";
$echo_content.= "<item>\n";
$echo_content.= "<title>"._BE_INFO."</title>\n";
$echo_content.= "<link>http://united-nuke.openland.cz</link>\n";
$echo_content.= "</item>\n\n";
$echo_content.= "</channel>\n";
$echo_content .= "</rss>\n";
echo "$echo_content";
} else {
$backend_language = str_replace ("_","-",$backend_language); //v rss nesmi byt podtrzitko ale pomlcka
$echo_content = "<?xml version=\"1.0\" encoding=\"$charset\"?>\n\n";
$echo_content .= "<!DOCTYPE rss PUBLIC \"-//Netscape Communications//DTD RSS 0.91//EN\"\n";
$echo_content .= " \"http://my.netscape.com/publish/formats/rss-0.91.dtd\">\n\n";
$echo_content .= "<rss version=\"0.91\">\n\n";
$echo_content .= "<channel>\n";
$echo_content .= "<title>".htmlspecialchars($sitename)."</title>\n";
$echo_content .= "<link>$nukeurl</link>\n";
$echo_content .= "<description>".htmlspecialchars($backend_title)."</description>\n";
$echo_content .= "<language>$backend_language</language>\n\n";
if (isset($img) AND $img == 1)
{
$echo_content .= "<image>\n";
$echo_content .= "<title>".htmlspecialchars($sitename)."</title>\n";
$echo_content .= "<url>$nukeurl/themes/$Default_Theme/images/rsslogo.gif</url>\n";
$echo_content .= "<link>$nukeurl</link>\n";
$echo_content .= "<description>".htmlspecialchars($backend_title)."</description>\n";
/*$echo_content .= "<width>98</width>\n"; // pro libovolne logo zakomentovano
$echo_content .= "<height>27</height>\n";*/
$echo_content .= "</image>\n\n";
}
while ($row = $db->sql_fetchrow($result)) {
$rsid = intval($row['sid']);
$rtitle = $row['title'];
$echo_content .= "<item>\n";
$echo_content .= "<title>".htmlspecialchars($rtitle)."</title>\n";
$echo_content .= "<link>$nukeurl/modules.php?name=News&file=article&sid=$rsid</link>\n";
$echo_content .= "</item>\n\n";
}
$echo_content .= "</channel>\n\n";
$echo_content .= "</rss>\n";
$a = _CHARSET; //nastaveno v root/language/lang-czech.php windows-1250/iso-8859-2
if (($a=="iso-8859-2") AND ($charset=="iso-8859-2"))
{
echo "$echo_content";
}
elseif (($a == "windows-1250") AND ($charset == "windows-1250"))
{
echo "$echo_content";
}
elseif (($a == "iso-8859-2") AND ($charset == "windows-1250"))
{
// konvertuju z ISO do WIN
$echo_content = StrTr($echo_content,"⌐╣«╛Ñ╡½╗ª¼╢╝í▒","____╝╛______Ñ╣"); //iso to win conversion
echo "$echo_content";
}
elseif (($a == "windows-1250") AND ($charset == "iso-8859-2"))
{
// konvertuju z WIN do ISO
$echo_content = StrTr($echo_content,"____╝╛______Ñ╣","⌐╣«╛Ñ╡½╗ª¼╢╝í▒"); //WIN to ISO
echo "$echo_content";
}
elseif (($a == "windows-1250") AND ($charset == "ISO-8859-1"))
{
// konvertuju z WIN do ASCI
$echo_content = StrTr($echo_content, "ßΣΦ∩Θ∞δφ╛≥⌠≤÷α°__·∙ⁿ²_┴─╚╧╔╠╦═╝╥╙╓╘╪└__┌┘▄▌_","aacdeeeilnooorrstuuuyzAACDEEELINOOORRSTUUUYZ"); //WIN to ASCI
echo "$echo_content";
}
elseif (($a=="iso-8859-2") AND ($charset=="ISO-8859-1"))
{
// konvertuju z ISO latin 2 do ASCI
$echo_content = StrTr($echo_content, "ßΣΦ∩Θ∞δφ╡≥≤÷⌠α°╣╗·∙ⁿ²╛┴─╚╧╔╠╦═Ñ╥╙╓╘╪└⌐½┌┘▄▌«","aacdeeeilnooorrstuuuyzAACDEEELINOOORRSTUUUYZ"); //iso to ASCI
echo "$echo_content";
}
else
{
echo "$echo_content";
}
}
?>