RSS Feed für PHPkit

U

Urs Bernhard

Guest
Hallo liebe Kollegen

Vor einigen Tagen wurde ich angefragt, im PHPKIT meine News, Artikel - oder auch die neuesten Forumbeiträge für das RSS oder auch RDF Format anzubieten. Natürlich entspricht das nicht so ganz meinen Vorstellungen, sich nur blicken zu lassen, wenn sich etwas tut. Man dürfte selbst auch aktiv neues Material beitragen.

Doch der Wunsch wurde geäussert und meine Englisch-Kenntnisse sind mehr als nur miserabel, um die bisher gefundenen Informationen umsetzen zu können.

In meiner Signatur findet sich ein Link, den ich leider nicht direkt darstellen konnte, der die 5 letzten News in einer png-Datei auflistet. Dazu musste ich ein paar php-Dateien uploaden - und schon funktionierte es.

Es wäre also möglich, ohne die SQL-Datenbank mittels Passwort anzuzapfen, solche RSS-Feeds anzubieten.

Kann mir jemand deutsche Hilfe anbieten, oder so eine php-gerechte Lösung für PHPKIT als backend.rdf per Mail zusenden?

Mir sind die vielen Stunden Suche nach Lösungen nicht mehr möglich und wäre für eine Abkürzung sehr dankbar.

smile.gif
 
Vielen Dank, Alain

Aber genau dieser Vorschlag haut nicht hin.

QUOTE Es wäre also möglich, ohne die SQL-Datenbank mittels Passwort anzuzapfen, solche RSS-Feeds anzubieten.

Das Konzept deines Links von phpkit.de probierte ich schon aus.

Diese Dateien erreichten nicht die gewünschte Lösung.

Die Leute dort haben kein Interesse, denn ich hatte dort schon nachgefragt - aber nie Antwort erhalten bisher.

Es sollte ja eine dynamische Lösung geben - eine statische Lösung sah ich aus dem ursprünglichen Thread, wo Dr. Web erwähnt wurde.

Meine PHP-Kenntnisse sind sehr gering, womit ich noch keine eigene Dateien erstellt hatte. Ich hatte daher die Hoffnung, vielleicht eine rasche Lösung hier zu finden, die auch für den Helfenden nicht viel Aufwand bedeuten würde.

smile.gif
 
QUOTE Es wäre also möglich, ohne die SQL-Datenbank mittels Passwort anzuzapfen, solche RSS-Feeds anzubieten.

Das versteh ich nicht ganz. Eine dynamische Datei würde hier die neuen Themen aus der Datenbank auslesen und dann in rss Format umwandeln. Wie meinst Du ohne SQL-Datenbank?
Falls die RSS Feed den selben Inhalt haben wie das Bild, dann poste hier mal den Code des Scriptes, welches das Bild generiert.
 
Meine Betonung meint ohne Passwort auf die Inhalte zugreifen können.

Hier also nun die Datei, womit die PNG-Datei gefüttert wird:
CODE <?php

include("admin/config/config.php");

$DB->sqlerrorreport(1);

parsertime("start");

$getcontentinfo=$DB->query("SELECT ".$db_tab['content'].".content_id, ".$db_tab['content'].".content_title FROM ".$db_tab['content']." LEFT JOIN ".$db_tab['contentcat']." ON ".$db_tab['contentcat'].".contentcat_id=".$db_tab['content'].".content_cat WHERE ".$db_tab['content'].".content_option=2 AND ".$db_tab['content'].".content_status=1 AND (".$db_tab['content'].".content_expire>'".time()."' OR ".$db_tab['content'].".content_expire='0') AND ".$db_tab['content'].".content_time<'".time()."' AND ".sqlrights($db_tab['contentcat'].'.contentcat_rights')." ORDER by ".$db_tab['content'].".content_time DESC LIMIT 5");

$i = 0;
while($result = $DB->fetch_array($getcontentinfo)){
$contentcat_id[$i]=$result['contentcat'];
$content_id[$i]=$result['content_id'];
$content_title[$i]=$result['content_title'];
$i++;
}

?>


natürlich fehlt bei dieser Variante der News-Inhalt.

Diese Datei hier hatte ich noch vergessen:

CODE <?php


include("news.php");

echo"
$contentcat_id[0]
$content_id[0]
$content_title[0]
$contentcat_id[1]
$content_id[1]
$content_title[1]
$contentcat_id[2]
$content_id[2]
$content_title[2]
$contentcat_id[3]
$content_id[3]
$content_title[3]
$contentcat_id[4]
$content_id[4]
$content_title[4]
$contentcat_id[5]
$content_id[5]
$content_title[5]";
?>
 
Bild aktualisieren? Das wird bei jedem Anklicken neu abgerufen. Oder was meinst du?

Als Ergänzung möchte ich noch die content/news.php zur Ansicht stellen:
CODE <?php
if ($_REQUEST['entries']=="") {$entries=0;}
else {$entries=$_REQUEST['entries'];}

if ($_REQUEST['contentid']!='') {$contentid=$_REQUEST['contentid'];}
if ($_REQUEST['catid']!='') {$catid=$_REQUEST['catid'];}

unset($sqlcommand);
$sqlcommand=" WHERE ".$db_tab['content'].".content_option='2' AND ".$db_tab['content'].".content_status='1' AND ".$db_tab['content'].".content_time<'".$time_now."' AND (".$db_tab['content'].".content_expire>'".$time_now."' OR ".$db_tab['content'].".content_expire='0')";
if ($contentid!="" && $contentid!="new") {$sqlcommand.=" AND ".$db_tab['content'].".content_id='".$contentid."'";}
if ($catid!="") {$sqlcommand.=" AND ".$db_tab['content'].".content_cat='".$catid."'";}
$sqlcommand=" FROM ".$db_tab['content']." LEFT JOIN ".$db_tab['contentcat']." ON ".$db_tab['contentcat'].".contentcat_id=".$db_tab['content'].".content_cat ".$sqlcommand." AND (".sqlrights($db_tab['contentcat'].".contentcat_rights").")";

$sqlcommand2="SELECT ".$db_tab['content'].".* ".$sqlcommand;
$sqlcommand.=" ORDER by ".$db_tab['content'].".content_time DESC LIMIT ".$entries.",";

if ($contentid!="") {$sqlcommand.=1;}
else {$sqlcommand.=$config[content_epp2];}

$sqlcommand="SELECT ".$db_tab['content'].".* ".$sqlcommand;

$getcontentinfo=$DB->query($sqlcommand);
unset($sqlcommand);
while ($contentinfo=$DB->fetch_array($getcontentinfo)) {
$contentinfo_cache[]=$contentinfo;
if ($contentinfo[content_autorid]!=0) {
if ($sqlcommand=="") {$sqlcommand="SELECT user_nick, user_id FROM ".$db_tab['user']." WHERE user_id='".$contentinfo['content_autorid']."'";}
else {$sqlcommand.=" OR user_id='".$contentinfo['content_autorid']."'";}
}
}

if ($sqlcommand!="") {
$getuserinfo=$DB->query($sqlcommand);
while($userinfo=$DB->fetch_array($getuserinfo)) {$userinfo_cache[$userinfo[user_id]]=$userinfo;}}

if (is_array($contentinfo_cache)) {
$contentcat=contentcats(); $contentcat_cache=$contentcat['0'];
foreach($contentinfo_cache as $contentinfo) {
$contentcatinfo=$contentcat_cache[$contentinfo[content_cat]];

if ($contentinfo['content_autorid']==0) {$autor_info=$newsinfo['content_autor'];}
else {
$userinfo=$userinfo_cache[$contentinfo[content_autorid]];

if ($userinfo[0]!="") {eval ("\$autor_info= \"".getTemplate("member_showprofil_textlink")."\";");}
else {$autor_info=$contentinfo['content_autor'];}
}

$news_time=formattime($contentinfo['content_time']);
$catimage_dimension=@getimagesize("images/catimages/".$contentcatinfo['contentcat_symbol']);
eval ("\$news_image= \"".getTemplate("content/cat_image_right")."\";");

if ($contentid=="") {$news_text=explode("<break>",$contentinfo['content_text']); $news_text=$news_text['0'];}
else {$news_text=str_replace("<break>","",$contentinfo[content_text]);}

$news_text=$PARSE->parse($news_text,$contentinfo['content_html'],$contentinfo['content_ubb'],$contentinfo['content_smilies'],1);

if ($contentid=="" && eregi("<break>",$contentinfo['content_text'])) {eval ("\$news_text.= \"".getTemplate("content/news_morelink")."\";");}
$news_text=str_replace("<break>","",$news_text);

if ($contentinfo['content_comment_status']==1) {
$commentcount=$DB->fetch_array($DB->query("SELECT COUNT(*) FROM ".$db_tab['comment']." WHERE comment_subid='".$contentinfo['content_id']."' AND comment_cat='cont'"));

if ($commentcount[0]>1) {$news_comments=$commentcount[0].' '.$lang['comments'];}
elseif ($commentcount[0]==1) {$news_comments=" 1 ".$lang['comment'];}
else {$news_comments=$lang['no_comments'];}
}
if ($contentinfo['content_altdat']!='') {
$source=explode("\n",$contentinfo['content_altdat']);
foreach($source as $s) {
if ($news_source!="") {$news_source.=", ";}
$news_source.=$PARSE->parse($s,0,1,0,0);
}
if ($news_source!='') {eval ("\$news_source= \"".getTemplate("content/news_source")."\";");}
}

$cont_title=stripslashes($contentinfo['content_title']);

$suggest_url=urlencode("path=content/news.php&contentid=".$contentinfo['content_id']);

eval ("\$site_body.= \"".getTemplate("content/news")."\";");
unset($news_source); unset($news_comments); unset($news_text); unset($news_text_cut);
}
}

if ($contentid=="") {
$counter=$DB->num_rows($DB->query($sqlcommand2));
if ($counter>$config['content_epp2']) {
$page_link=sidelinkfull($counter,$config['content_epp2'],$entries,"include.php?path=content/news.php&catid=".$catid,"sitebodysmall");}
}



Diese Datei ist wohl dafür zuständig, dass die Neuigkeiten unter POK-Portal angezeigt werden.
 
Zurück
Oben