bizarr-rss.php erfasst nicht alles

Du hast Probleme beim Einbau oder bei der Benutzung eines Mods? In diesem Forum bist du richtig.
Forumsregeln
phpBB 3.0 hat das Ende seiner Lebenszeit überschritten
phpBB 3.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 3.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf die neuste phpBB-Version, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Antworten
Benutzeravatar
fossi
Mitglied
Beiträge: 37
Registriert: 15.02.2008 10:12
Wohnort: 54550 Daun / Vulkaneifel
Kontaktdaten:

bizarr-rss.php erfasst nicht alles

Beitrag von fossi »

Habe bei mit die bizarr-rss.php als Newsfeed installiert.

Das Ding funktioniert, aber irgendwie nicht richtig.
Es werden immer nur neue Beiträge aus meinem 1. Unterforum (Small-Talk) erfasst, aber nicht aus den anderen Unterforen. :-?


Hier mal der Link zum Feed:

http://www.sellerforum.de/bizzar-rss.php?f=1


Eines habe ich raus bekommen:

Bei http://www.sellerforum.de/bizzar-rss.php?f=2
wird das zweite Unterforum angezeigt;
bei http://www.sellerforum.de/bizzar-rss.php?f=3
wird das dritte Unterforum angezeigt;
usw...

Ich möchte aber gerne ALLE Unterforen über einen Link erreichen.

Wie könnte ich das erreichen?



Quelltext der bizarr-rss.php:

Code: Alles auswählen

<?php

require "config.inc.php";

require $forum_config; $c=0;



if(isset($_REQUEST['f'])){ $f = $_REQUEST['f']; } else { die("Need to define a 'f' value!"); }

function dbconnect($dbase,$forum_config){

  require $forum_config;

  $link = mysql_connect($dbhost, $dbuser, $dbpasswd);

  if(!$link){ 

    echo "Could not connect to DB! : ".mysql_error()."<br>"; }

  else {

    $db_selected = mysql_select_db($dbase, $link);

    if (!$db_selected) { echo "Can't use db '".$dbase."':".mysql_error()."<br>"; }

  }

}



dbconnect($dbname,$forum_config);

$getPostsres = mysql_query("SELECT * FROM ".$table_prefix."posts WHERE forum_id='".$f."' ORDER BY post_id;");

$getPostsnum = mysql_num_rows($getPostsres);

$postArray = array();

while($postinforow=mysql_fetch_object($getPostsres)){

  if(array_key_exists($postinforow->topic_id,$postArray)!==true){

    $c++;

    $postArray[$postinforow->topic_id]['order']=$c;

    $postArray[$postinforow->topic_id]['post_id']=$postinforow->post_id;

    $postArray[$postinforow->topic_id]['topic_id']=$postinforow->topic_id;

    $postArray[$postinforow->topic_id]['icon_id']=$postinforow->icon_id;

    $postArray[$postinforow->topic_id]['post_subject']=$postinforow->post_subject;

    $postArray[$postinforow->topic_id]['post_time']=$postinforow->post_time;

    $postArray[$postinforow->topic_id]['poster_id']=$postinforow->poster_id;

    $postArray[$postinforow->topic_id]['poster_ip']=$postinforow->poster_ip;

    $postArray[$postinforow->topic_id]['post_text']=$postinforow->post_text;

    $postArray[$postinforow->topic_id]['replies']=0;

  } else {

    $postArray[$postinforow->topic_id]['replies']++;

  }

}

if($arraysort==1){ krsort($postArray); }

if($enableDebug==1){

// If enabled, will show instead of RSS feed!

  echo "<pre>";

  var_dump($postArray);

  echo "</pre>";

} else {

// Create RSS feed using postArray! 

header("Content-Type: application/xml; ");

echo "<?xml version='1.0'?>

<rss version='2.0'>

   <channel>

      <title>".$rssTitle."</title>

      <link>".$forumLink."</link>

      <language>de-de</language>

      <pubDate>".date("D, j M Y H:i:s",time())." GMT</pubDate>

      <lastBuildDate>".date("D, j M Y H:i:s",time())." GMT</lastBuildDate>

      <docs>http://blogs.law.harvard.edu/tech/rss</docs>

      <generator>bizzarForumRSS 1.0</generator>

      <managingEditor>".$rssManagingEditorEmail."</managingEditor>

      <webMaster>".$rssWebmasterEmail."</webMaster>";



  $posts = array_keys($postArray);

  if($getPostCount<count($posts)){

   for($b=0;$b<$getPostCount;$b++){

    echo "<item>";

    echo "  <title>".$postArray[$posts[$b]]['post_subject']."</title>";

    echo "  <link>".$forumViewTopic."?f=".$f."&t=".$posts[$b]."</link>";

    echo "  <description>".$postArray[$posts[$b]]['post_text']."</description>";

    echo "  <pubDate>".date("D, j M Y H:i:s",$postArray[$posts[$b]]['post_time'])." GMT</pubDate>";

    echo "  <guid>".$forumViewTopic."?f=".$f."&t=".$posts[$b]."</guid>";

    echo "</item>";

    }

  } else {

    for($b=0;$b<count($posts);$b++){

    echo "<item>";

    echo "  <title>".$postArray[$posts[$b]]['post_subject']."</title>";

    echo "  <link>".$forumViewTopic."?f=".$f."&t=".$posts[$b]."</link>";

    echo "  <description>".$postArray[$posts[$b]]['post_text']."</description>";

    echo "  <pubDate>".date("D, j M Y H:i:s",$postArray[$posts[$b]]['post_time'])." GMT</pubDate>";

    echo "  <guid>".$forumViewTopic."?f=".$f."&t=".$posts[$b]."</guid>";

    echo "</item>";

    }

}

echo "</channel></rss>";

}

?>


Quelltext der dazugehörigen config-Datei:

Code: Alles auswählen

<?php

// This config file is for the bizzarForumRSS script.



$forum_config = "config.php"; // Path to phpBB config file

$getPostCount = 100; // maximum number of posts to return. Set high to get unlimited

$arraysort=1; //0=older first, 1=newer first



$enableDebug=0; // 0=disable, 1=enable



$forumLink="http://www.sellerforum.de"; // URL to Forum main page

$forumViewTopic="http://www.sellerforum.de/viewtopic.php"; // URL to viewtopic.php



$rssTitle="sellerforum.de RSS Feed";// This is the title of the feed

$rssDescription="aktuelle Beiträge auf sellerforum.de"; // This is the description of the feed

$rssManagingEditorEmail="service@sellerforum.de"; // These are listed so you can change them

$rssWebmasterEmail="service@sellerforum.de";

?>
Antworten

Zurück zu „[3.0.x] Mod Support“