-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added feeds added feed-icons out-sourced login-data from config.inc.php to login.inc.php added $pref table-prefix-variable to login.inc.php added support for $global_config_arr[pref] as table-prefix => look into feeds/rss091.php etc. for usage git-svn-id: http://svn.xp-dev.com/svn/Sweil_fs2/src@52 b49b0359-402e-0410-ad19-9fd90e479030
- Loading branch information
Sweil
authored and
Sweil
committed
Aug 30, 2007
1 parent
14181b1
commit 0832843
Showing
14 changed files
with
761 additions
and
302 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
/////////////////////// | ||
//// DB Login Data //// | ||
/////////////////////// | ||
$host = "localhost"; //Hostname | ||
$user = "frogsystem"; //Database User | ||
$data = "frogsystem"; //Database Name | ||
$pass = "frogsystem"; //Password | ||
$pref = "fs_"; //Password | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<?php | ||
|
||
header("Content-type: application/atom+xml"); | ||
|
||
include("login.inc.php"); | ||
|
||
@$db = mysql_connect($host, $user, $pass); | ||
if ($db) | ||
{ | ||
include("functions.php"); | ||
mysql_select_db($data,$db); | ||
|
||
// Allgemeine Config + Infos | ||
$index = mysql_query("SELECT * FROM ".$pref."global_config", $db); | ||
$global_config_arr = mysql_fetch_assoc($index); | ||
if ($global_config_arr[virtualhost] == "") { | ||
$global_config_arr[virtualhost] = "http://notfound.com/"; | ||
} | ||
|
||
// News Config + Infos | ||
$index = mysql_query("SELECT * FROM ".$pref."news_config", $db); | ||
$news_config_arr = mysql_fetch_assoc($index); | ||
|
||
$index = mysql_query("SELECT news_date | ||
FROM ".$pref."news | ||
ORDER BY news_date DESC | ||
LIMIT 1"); | ||
|
||
$last_date[news_date] = mysql_result($index,0,"news_date"); | ||
$last_date[old_time_zone] = date("O",$last_date[news_date]); | ||
$last_date[time_zone] = substr($last_date[old_time_zone],0,strlen($last_date[old_time_zone]-2)) | ||
.":".substr($last_date[old_time_zone],-2,2); | ||
$last_date[news_updated] = date("Y-m-d\TH:i:s",$last_date[news_date]); | ||
$last_date[news_updated] .= $last_date[time_zone]; | ||
|
||
//Feed Header ausgeben | ||
echo'<?xml version="1.0" encoding="utf-8"?> | ||
<feed xmlns="http://www.w3.org/2005/Atom"> | ||
<id>'.$global_config_arr[virtualhost].'</id> | ||
<title>'.htmlspecialchars($global_config_arr[title]).'</title> | ||
<updated>'.$last_date[news_updated].'</updated> | ||
<link rel="self" href="atom10.php" /> | ||
'; | ||
|
||
$index = mysql_query("SELECT news_id, news_text, news_title, news_date, user_id | ||
FROM ".$pref."news | ||
ORDER BY news_date DESC | ||
LIMIT $news_config_arr[num_news]"); | ||
|
||
while ($news_arr = mysql_fetch_assoc($index)) | ||
{ | ||
$index2 = mysql_query("SELECT user_name FROM ".$pref."user WHERE user_id = $news_arr[user_id]"); | ||
$news_arr[user_name] = mysql_result($index2,0,"user_name"); | ||
|
||
$news_arr[old_time_zone] = date("O",$news_arr[news_date]); | ||
$news_arr[time_zone] = substr($news_arr[old_time_zone],0,2).":".substr($news_arr[old_time_zone],2,2); | ||
$news_arr[time_zone] = substr($news_arr[old_time_zone],0,strlen($news_arr[old_time_zone]-2)) | ||
.":".substr($news_arr[old_time_zone],-2,2); | ||
$news_arr[news_updated] = date("Y-m-d\TH:i:s",$news_arr[news_date]); | ||
$news_arr[news_updated] .= $news_arr[time_zone]; | ||
|
||
// Item ausgeben | ||
echo' | ||
<entry> | ||
<id>'.$global_config_arr[virtualhost].'?go=comments&id='.$news_arr[news_id].'</id> | ||
<title>'.utf8_encode(htmlspecialchars($news_arr[news_title])).'</title> | ||
<updated>'.$news_arr[news_updated].'</updated> | ||
<author> | ||
<name>'.$news_arr[user_name].'</name> | ||
</author> | ||
<content>'.utf8_encode(killfs($news_arr[news_text])).'</content> | ||
<link rel="alternate" href="'.$global_config_arr[virtualhost].'#'.$news_arr[news_id].'" /> | ||
</entry> | ||
'; | ||
} | ||
|
||
echo' | ||
</feed> | ||
'; | ||
} | ||
else | ||
{ | ||
//"Keine Verbindung"-Feed | ||
echo'<?xml version="1.0" encoding="utf-8"?> | ||
<feed xmlns="http://www.w3.org/2005/Atom"> | ||
<id>http://notfound.com/</id> | ||
<title>Fehler</title> | ||
<updated>'.date("r").'</updated> | ||
</feed> | ||
'; | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?php | ||
|
||
header("Content-type: application/rss+xml"); | ||
|
||
include("login.inc.php"); | ||
|
||
@$db = mysql_connect($host, $user, $pass); | ||
if ($db) | ||
{ | ||
include("functions.php"); | ||
mysql_select_db($data,$db); | ||
|
||
// Allgemeine Config + Infos | ||
$index = mysql_query("SELECT * FROM ".$pref."global_config", $db); | ||
$global_config_arr = mysql_fetch_assoc($index); | ||
if ($global_config_arr[virtualhost] == "") { | ||
$global_config_arr[virtualhost] = "http://notfound.com"; | ||
} | ||
|
||
// News Config + Infos | ||
$index = mysql_query("SELECT * FROM ".$pref."news_config", $db); | ||
$news_config_arr = mysql_fetch_assoc($index); | ||
|
||
//Feed Header ausgeben | ||
echo'<?xml version="1.0" encoding="utf-8"?> | ||
<!DOCTYPE rss SYSTEM "http://my.netscape.com/publish/formats/rss-0.91.dtd"> | ||
<rss version="0.91"> | ||
<channel> | ||
<language>de</language> | ||
<description>'.htmlspecialchars($global_config_arr[description]).'</description> | ||
<link>'.$global_config_arr[virtualhost].'</link> | ||
<title>'.htmlspecialchars($global_config_arr[title]).'</title> | ||
'; | ||
|
||
$index = mysql_query("SELECT news_id, news_text, news_title, news_date | ||
FROM ".$pref."news | ||
ORDER BY news_date DESC | ||
LIMIT $news_config_arr[num_news]"); | ||
while ($news_arr = mysql_fetch_assoc($index)) | ||
{ | ||
|
||
|
||
// Item ausgeben | ||
echo' | ||
<item> | ||
<title>'.utf8_encode(htmlspecialchars($news_arr[news_title])).'</title> | ||
<link>'.$global_config_arr[virtualhost].'#'.$news_arr[news_id].'</link> | ||
<pubDate>'.date("r",$news_arr[news_date]).'</pubDate> | ||
<description>'.truncate_string(utf8_encode(killfs($news_arr[news_text])),500," ...").'</description> | ||
</item> | ||
'; | ||
} | ||
|
||
echo' | ||
</channel> | ||
</rss> | ||
'; | ||
} | ||
else | ||
{ | ||
//"Keine Verbindung"-Feed | ||
echo'<?xml version="1.0" encoding="utf-8"?> | ||
<!DOCTYPE rss SYSTEM "http://my.netscape.com/publish/formats/rss-0.91.dtd"> | ||
<rss version="0.91"> | ||
<channel> | ||
<language>de</language> | ||
<description>Fehler: Keine Verbindung zur Datenbank</description> | ||
<link>http://notfound.com</link> | ||
<title>Fehler</title> | ||
</channel> | ||
</rss> | ||
'; | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<?php | ||
|
||
header("Content-type: application/rss+xml"); | ||
|
||
include("login.inc.php"); | ||
|
||
@$db = mysql_connect($host, $user, $pass); | ||
if ($db) | ||
{ | ||
include("functions.php"); | ||
mysql_select_db($data,$db); | ||
|
||
// Allgemeine Config + Infos | ||
$index = mysql_query("SELECT * FROM ".$pref."global_config", $db); | ||
$global_config_arr = mysql_fetch_assoc($index); | ||
if ($global_config_arr[virtualhost] == "") { | ||
$global_config_arr[virtualhost] = "http://notfound.com/"; | ||
} | ||
|
||
// News Config + Infos | ||
$index = mysql_query("SELECT * FROM ".$pref."news_config", $db); | ||
$news_config_arr = mysql_fetch_assoc($index); | ||
|
||
//Feed Header ausgeben | ||
echo'<?xml version="1.0" encoding="utf-8"?> | ||
<rdf:RDF | ||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||
xmlns="http://purl.org/rss/1.0/" | ||
> | ||
<channel rdf:about="'.$global_config_arr[virtualhost].'feeds/rss10.php"> | ||
<title>'.htmlspecialchars($global_config_arr[title]).'</title> | ||
<link>'.$global_config_arr[virtualhost].'</link> | ||
<description>'.htmlspecialchars($global_config_arr[description]).'</description> | ||
<items> | ||
<rdf:Seq> | ||
'; | ||
|
||
$index = mysql_query("SELECT news_id, news_text, news_title, news_date | ||
FROM ".$pref."news | ||
ORDER BY news_date DESC | ||
LIMIT $news_config_arr[num_news]"); | ||
|
||
while ($news_arr = mysql_fetch_assoc($index)) | ||
{ | ||
// <items> ausgeben | ||
echo' | ||
<rdf:li resource="'.$global_config_arr[virtualhost].'?go=comments&id='.$news_arr[news_id].'" /> | ||
'; | ||
} | ||
|
||
echo' | ||
</rdf:Seq> | ||
</items> | ||
</channel> | ||
'; | ||
|
||
|
||
|
||
|
||
while ($news_arr = mysql_fetch_assoc($index)) | ||
{ | ||
// Item ausgeben | ||
echo' | ||
<item rdf:about="'.$global_config_arr[virtualhost].'?go=comments&id='.$news_arr[news_id].'"> | ||
<title>'.utf8_encode(htmlspecialchars($news_arr[news_title])).'</title> | ||
<link>'.$global_config_arr[virtualhost].'#'.$news_arr[news_id].'</link> | ||
<description>'.truncate_string(utf8_encode(killfs($news_arr[news_text])),500," ...").'</description> | ||
</item> | ||
'; | ||
} | ||
|
||
echo' | ||
</rdf:RDF> | ||
'; | ||
} | ||
else | ||
{ | ||
//"Keine Verbindung"-Feed | ||
echo'<?xml version="1.0" encoding="utf-8"?> | ||
<rdf:RDF | ||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||
xmlns="http://purl.org/rss/1.0/" | ||
> | ||
<channel> | ||
<language>de</language> | ||
<description>Fehler: Keine Verbindung zur Datenbank</description> | ||
<link>http://notfound.com/</link> | ||
<title>Fehler</title> | ||
</channel> | ||
</rdf:RDF> | ||
'; | ||
} | ||
|
||
?> |
Oops, something went wrong.