Pulling specific topics with RSS

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Pulling specific topics with RSS
LordThaddius
CZ Newbie
LordThaddius has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: May 25, 2004
0.00 posts per day
Posts: 4
Points: 218
   
Alright, I've been straining my brain the last few days, trying to get this to work ...

I'm doing several music related sites. I want to link several news topics from one main site, to the smaller sites. Cuts down on updating each site. IE about 20+ sites.

Anyway, I know I can link news with the RSS ... however, what I need to do is pull specific topics, rather than all news from the site. For instance, I have a topic off the main site for band reviews that I want to filter through all the other sites. Likewise, I'll be filtering mainstream news from the main site to the smaller sites. And then I'll stream local news from the smaller sites to the main site. However, I need to be able to have everything topic specific.

Can anyone help me with this?



Back to top Reply with quote
#2   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
How are you trying to get the specific topics? Are they in separate categories?




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#3   re: Pulling specific topics with RSS
LordThaddius
CZ Newbie
LordThaddius has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: May 25, 2004
0.00 posts per day
Posts: 4
Points: 218
   
Well, I'm just trying to pull individual news topics. For instance: Local News is a topic that I would want to pull with RSS. I'm sure there is a way. But I can't figure it out, and I don't want to KISS anything up ... does this help at all?



Back to top Reply with quote
#4   re: Pulling specific topics with RSS
LordThaddius
CZ Newbie
LordThaddius has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: May 25, 2004
0.00 posts per day
Posts: 4
Points: 218
   
Okay, I read through my post and realized I'm being perhaps a little too vague in my question ... sorry about that.

So here I go ...

When to you go to /modules.php?name=Topics in a PHPNuke site, you can have different topics, with individual number in the database. I want to pull only certain topics from the database and use RSS to display them on other sites.

For instance: On my current site, I have topics like 'Band News', 'Label News', 'Interviews', 'WTC-News' and 'SafehavenNews'. I want to pull only certain topics, and not have the others stream. IE: Pull Label News and Interviews, but leave the other topics out of the RSS streaming.

I'm sure it can be done. Theoretically. I have a friend who also wants to do this, but can't figure out how to do it as well. I'm getting a little ansy because my project is on hold until I can do this. Any suggestions?



Back to top Reply with quote
#5   re: Pulling specific topics with RSS
lumax
CZ Super Newbie
lumax has been a member for over 20 year's 20 Year Member
usa.gif alaska.gif
Gender: Male
Status: Offline
Joined: Nov 14, 2003
0.01 posts per day
Posts: 60
Points: 3,953
   
Does this help?



karakas writes: "Hello Nukers, I have glued the famous rdf.php for phpBB and backendforums.php of nukecops together to create an RSS newsfeed of any combination of PHP-Nuke Forums on a site. Upload the rdf-nuke.php file to your PHP-Nuke root directory and enjoy the all-round syndication of any and all forums on your site in any combination and variation: from one single forum to three in a bundle - you define how long should be the description of the latest posts syndicated, the number of news items, and can even specify that the forum name or post date be included in the title of each news item! Read on for a detailed description... You can pass various parameters on the URL to control some aspects of the resulting headlines: fid: the forum ID. Use fid[] if you want to pass more than one fid parameters on the URL! count: number of headlines (forum postings). Default: 10 type: news or latest. When you use news, the first posting will control the sorting of the headlines. When you use latest, it is the latest posting in a thread that determines the date (and thus the position) of the thread in the feed. Default: latest. chars: sets the number of characters to be used in the description part of the news items. When 0, no description is output. Default: 200. titlepattern: with this parameter, you can format the title of each news item (i.e. each headline). The following placeholders are offered: __TITLE__ for the title of an item __FORUM__ for the forum name __DATE__ for the date in the format d.m.Y H:i Examples: [ Register or login to view links on this board. ] The newest 5 PHP-Nuke Forum contributions in the news sorting order. [ Register or login to view links on this board. ] The latest 10 contributions from the PHP-Nuke (fid=1) and SAP (fid=2) Forums without description. [ Register or login to view links on this board. ] The latest 15 contributions from the PHP-Nuke Forum (fid=1) with 500 chars long descriptions and the forum title added to the items titles. You can see how the feeds look like in the Karakas Online Section of my News-o-matic. If you want to offer RSS feeds of your PHP-Nuke Forums too, just download rdf-nuke.tar and untar it (with tar or winzip) in the base directory of your PHP-Nuke, then call it as in the above examples. Enjoy! Chris"



Here's the download: [ Register or login to view links on this board.]



Back to top Reply with quote
#6   re: Pulling specific topics with RSS
LordThaddius
CZ Newbie
LordThaddius has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: May 25, 2004
0.00 posts per day
Posts: 4
Points: 218
   
A little ... gives me at least something to work with, but not exactly what I had in mind. The news I want to stream isn't part of the forum ...



Back to top Reply with quote
#7   re: Pulling specific topics with RSS
lumax
CZ Super Newbie
lumax has been a member for over 20 year's 20 Year Member
usa.gif alaska.gif
Gender: Male
Status: Offline
Joined: Nov 14, 2003
0.01 posts per day
Posts: 60
Points: 3,953
   
I think I found your solution - its called the syndication module and allows you to do exactly what youre talking about - check out my site addy and if its what you want I'll send you a link to the download ( [ Register or login to view links on this board.] ).



Back to top Reply with quote
#8   Syndication module
lumax
CZ Super Newbie
lumax has been a member for over 20 year's 20 Year Member
usa.gif alaska.gif
Gender: Male
Status: Offline
Joined: Nov 14, 2003
0.01 posts per day
Posts: 60
Points: 3,953
   
Wonderiing if anyone else has tried the syndication module. It works good to set up script for non-nuke pages to pull news from your site but I'm having trouble getting the images to pass to the subscribers page.

This is the code from the index.php file:
<?

/**********************************************************************/
/* Syndication for phpNuke v6.0                                       */
/* Modified from/based on EasyNews for phpNuke 4.1                    */
/* by Pascal (extanfr@ifrance.com)                                    */
/* Modified by [ Register or login to view links on this board. ]                                     */
/* http://dev.queeries.net                                            */       
/**********************************************************************/

if (!eregi("modules.php", $PHP_SELF)) {
    die ("You can't access this file directly...");
}

$index = 1;   
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);


/* OPTIONS  */
$easy_name_rep            = "Syndication";        /* module folder name */
$tb_stories               = $prefix."_stories";
$tb_topics                 = $prefix."_topics";


/* News Box */
$easy_color_top_box          = "9999ff";
$easy_color_body_box      = "FFFFFF";
$easy_color_border_box      = "000000";
$easy_color_topic_box      = "FF0000";
$easy_color_title_box      = "000000";
$easy_color_date_box      = "FF0000";
$easy_color_sitename_box   = "000000";
$easy_widht_box             = 500;            
$easy_num_news_box           = 5;            /* 5 news if ac2=0 */
$easy_topic_box             = 0;            /* 0 all topics if ac3=0  */
$easy_gif_box              = "sb.gif";        /* 75x20 */


/* News */
$easy_color_top_news      = "9999ff";
$easy_color_body_news      = "FFFFFF";
$easy_color_border_news      = "000000";
$easy_color_foot_news      = "000000";
$easy_color_topic_news      = "FF0000";
$easy_color_date_news      = "FF0000";
$easy_color_sitename_news   = "000000";
$easy_widht_news          = 144;            
$easy_num_news_news          = 5;            /* 5 news if ac2=0 */
$easy_topic_news          = 0;            /* 0 all topics if ac3=0 */
$easy_gif_news             = "sn.gif";       /* 150x20 */


/* Title */
$easy_color_top_title      = "9999ff";
$easy_color_body_title      = "FFFFFF";
$easy_color_border_title   = "000000";
$easy_color_foot_title      = "000000";
$easy_color_topic_title      = "FF0000";
$easy_color_date_title      = "FF0000";
$easy_color_sitename_title   = "000000";
$easy_widht_title          = 150;            
$easy_num_news_title      = 5;            /* 5 news if ac2=0 */
$easy_topic_title          = 0;            /* 0 all topics if ac3=0 */
$easy_gif_title             = "sn.gif";        /* 150x20 */

/* Scroller */
$easy_color_top_scroll      = "9999ff";
$easy_color_body_scroll      = "FFFFFF";
$easy_color_border_scroll   = "000000";
$easy_color_foot_scroll      = "000000";
$easy_color_topic_scroll   = "FF0000";
$easy_color_date_scroll      = "FF0000";
$easy_color_sitename_scroll   = "000000";
$easy_widht_scroll         = 150;
$easy_height_scroll       = 150;            
$easy_num_news_scroll      = 5;            /* 5 news if ac2=0 */
$easy_topic_scroll        = 0;            /* 0 all topics if ac3=0 */
$easy_gif_scroll          = "ss.gif";         /* 150x150 */



/********************************************************************/


$supcri="";// si topic
$easymod = "op=modload&name=$easy_name_rep&file=index";



function easy_jscript($jslo)
{
   echo sprintf ("%s%s%s", "document.write('",$jslo,"');")."\n";
}

function easy_clean($hometext,$lg)
{
   $hometext = ereg_replace("<[^>]*>", "", $hometext);
   $hometext = ereg_replace(13, " ", $hometext);
   $hometext = ereg_replace(10, " ", $hometext);
   $hometext = substr($hometext,0,$lg);
   $hometext = chop(ereg_replace("'", "\'",$hometext));
   $hometext.=" ...";
   
   return($hometext);
}

function easy_modhtml()
{
global $easy_name_rep, $nukeurl, $easymod, $dbname, $tb_topics, $sitename, $slogan;
   
/* Insert in easy_html.php your html code to present headlines */
   
   $linknewsbox=$nukeurl."/modules.php?".$easymod."&ac=news&ac2=&ac3=";
   $linkboxbox=$nukeurl."/modules.php?".$easymod."&ac=box&ac2=&ac3=";
   $linktitlebox=$nukeurl."/modules.php?".$easymod."&ac=title&ac2=&ac3=";
   $linkscroller=$nukeurl."/modules.php?".$easymod."&ac=scroller&ac2=&ac3=";
   
   $easyurl =$nukeurl."/modules.php?".$easymod."&ac=";

   $easytopic="";
   $result= mysql_db_query($dbname,"select topicid,topictext from $tb_topics");   
   while(list($topicid,$topictext)=mysql_fetch_row($result))
   {
   $easytopic.="<OPTION VALUE=\"$topicid\"> $topictext\n";
   }
   
   include("modules/$easy_name_rep/html.php");
   
}

function easy_make_date($time)
{
   ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $time, $day);
   $date = $day[3].'/'.$day[2].'/'.$day[1];
   return($date);
}

switch($ac) {

   case news :
   
   if ($ac3!=0)
   {
   $supcri="and $tb_stories.topic=".$ac3;
   }else{
      if ($easy_topic_box == 0)
      {
      $supcri="";
      }else{
      $supcri="and $tb_stories.topic=".$easy_topic_news;
      }
   }
   
   if ($ac2==0){$ac2=$easy_num_news_news;}
   
   
   $easy_widht_news-=4;
   easy_jscript("<TABLE WIDTH=".$easy_widht_news." BORDER=1 CELLSPACING=0 cellpadding=2 bordercolor=".$easy_color_border_news.">");
   easy_jscript("<TR><TD BGCOLOR=".$easy_color_top_news." bordercolor=".$easy_color_top_news."><FONT FACE=Verdana SIZE=2 COLOR=".$easy_color_sitename_news."><CENTER><B>$sitename</B><CENTER></FONT></TD></TR>");
   easy_jscript("<TR><TD bgcolor=".$easy_color_body_news." bordercolor=".$easy_color_body_news.">");
      
   $result = mysql_db_query($dbname,"SELECT $tb_stories.sid, $tb_stories.title, $tb_stories.time, $tb_stories.hometext, $tb_topics.topictext FROM $tb_stories,$tb_topics where $tb_topics.topicid=$tb_stories.topic $supcri ORDER BY $tb_stories.sid DESC limit $ac2");
   while(list($sid,$title,$time,$hometext,$topictext) = mysql_fetch_row($result))
   {       
   
   $title= chop(ereg_replace("'", "\'",$title));
   $text=easy_clean($hometext,100);
   $topictext= ucfirst(chop(ereg_replace("'", "\'",$topictext)));
   $date_news=easy_make_date($time);
   
   easy_jscript("<font FACE=Verdana size=\"1\" color=\"".$easy_color_topic_news."\"><b>".$topictext."</b> :</font>");
   easy_jscript("<font FACE=Verdana size=\"1\" color=\"".$easy_color_date_news."\">".$date_news."</font>");
   easy_jscript("<br><a href=\"".$nukeurl."/modules.php?name=News&file=article&sid=".$sid."\" target=\"_blank\"><font size=1 face=Verdana ><b>".$text."</b></font></a><br><br>");
   }
   easy_jscript("</td></tr><tr><td BGCOLOR=".$easy_color_foot_news." bordercolor=".$easy_color_foot_news.">");
   easy_jscript("<center><b><a href=".$nukeurl."/modules.php?".$easymod."&ac=add target=_blank><img src=\"$nukeurl/modules/".$easy_name_rep."/images/".$easy_gif_news."\" border==0></a></center>");   
   easy_jscript("</FONT></td></tr></table>");
   
   break;


   case box :
   
   if ($ac3!=0)
   {
   $supcri="and $tb_stories.topic=".$ac3;
   }else{
      if ($easy_topic_box == 0)
      {
      $supcri="";
      }else{
      $supcri="and $tb_stories.topic=".$easy_topic_box;
      }
   }
   
   if ($ac2==0){$ac2=$easy_num_news_box;}
   
   easy_jscript("<TABLE WIDTH=".$easy_widht_box." BORDER=0 CELLSPACING=0 cellpadding=0 ><TR>");
   easy_jscript("<td><a href=".$nukeurl."/modules.php?".$easymod."&ac=add target=_blank><img src=\"$nukeurl/modules/".$easy_name_rep."/images/".$easy_gif_box."\" border=0></a></td>");
   easy_jscript("<TD width=100% BGCOLOR=".$easy_color_top_box."><FONT FACE=Verdana SIZE=2 COLOR=".$easy_color_sitename_box."><CENTER><B>".$sitename.":&nbsp;".$slogan."</B></CENTER></FONT></TD></TR>");
   easy_jscript("<TR><TD colspan=2>");
   easy_jscript("<table WIDTH=100% BORDER=1 CELLSPACING=1 cellpadding=3 bgcolor=".$easy_color_body_box." bordercolor=".$easy_color_border_box.">");
   easy_jscript("<TR><TD bgcolor=".$easy_color_body_box." bordercolor=".$easy_color_body_box.">");
      
   $result = mysql_db_query($dbname,"SELECT $tb_stories.sid, $tb_stories.title, $tb_stories.time, $tb_stories.hometext, $tb_topics.topictext FROM $tb_stories,$tb_topics where $tb_topics.topicid=$tb_stories.topic $supcri ORDER BY $tb_stories.sid DESC limit $ac2");
   while(list($sid,$title,$time,$hometext,$topictext) = mysql_fetch_row($result))
   {       
   
   $title= ucfirst(chop(ereg_replace("'", "\'",$title)));
   $text=easy_clean($hometext,300);
   $topictext= ucfirst(chop(ereg_replace("'", "\'",$topictext)));
   $date_news=easy_make_date($time);
   
   easy_jscript("<font FACE=Verdana size=\"2\" color=\"".$easy_color_topic_box."\"><b>".$topictext."</b> :</font>");
   easy_jscript("<font FACE=Verdana size=\"1\" color=\"".$easy_color_date_box."\">".$date_news."</font>");
   easy_jscript("<br><font FACE=Verdana size=\"2\" color=\"".$easy_color_title_box."\"><b>".$title."</b></font><br>");
   easy_jscript("<a href=\"".$nukeurl."/modules.php?name=News&file=article&sid=".$sid."\" target=\"_blank\"><font size=1 face=Verdana ><b>".$text."</b></font></a></font><br><br>");
   }
   easy_jscript("</td></tr></table>");
   easy_jscript("</td></tr></table>");
   break;
   
   case title :
   
   if ($ac3!=0)
   {
   $supcri="and $tb_stories.topic=".$ac3;
   }else{
      if ($easy_topic_title == 0)
      {
      $supcri="";
      }else{
      $supcri="and $tb_stories.topic=".$easy_topic_title;
      }
   }
   
   if ($ac2==0){$ac2=$easy_num_news_title;}
   
   
   $easy_widht_title-=4;
   easy_jscript("<TABLE WIDTH=".$easy_widht_title." BORDER=1 CELLSPACING=0 cellpadding=2 bordercolor=".$easy_color_border_title.">");
   easy_jscript("<TR><TD BGCOLOR=".$easy_color_top_title." bordercolor=".$easy_color_top_title."><FONT FACE=Verdana SIZE=2 COLOR=".$easy_color_sitename_title."><CENTER><B>$sitename</B></CENTER></FONT></TD></TR>");
   easy_jscript("<TR><TD bgcolor=".$easy_color_body_title." bordercolor=".$easy_color_body_title.">");
      
   $result = mysql_db_query($dbname,"SELECT $tb_stories.sid, $tb_stories.title, $tb_stories.time, $tb_stories.hometext, $tb_topics.topictext FROM $tb_stories,$tb_topics where $tb_topics.topicid=$tb_stories.topic $supcri ORDER BY $tb_stories.sid DESC limit $ac2");
   while(list($sid,$title,$time,$hometext,$topictext) = mysql_fetch_row($result))
   {       
   
   $title= chop(ereg_replace("'", "\'",$title));
   $topictext= ucfirst(chop(ereg_replace("'", "\'",$topictext)));
   $date_news=easy_make_date($time);
   
   easy_jscript("<font FACE=Verdana size=\"1\" color=\"".$easy_color_topic_title."\"><b>".$topictext."</b> :</font>");
   easy_jscript("<font FACE=Verdana size=\"1\" color=\"".$easy_color_date_title."\">".$date_news."</font>");
   easy_jscript("<br><a href=\"".$nukeurl."/modules.php?name=News&file=article&sid=".$sid."\" target=\"_blank\"><font size=1 face=Verdana ><b>".$title."</b></font></a><br><br>");
   }
   easy_jscript("</td></tr><tr><td BGCOLOR=".$easy_color_foot_title." bordercolor=".$easy_color_foot_title.">");
   easy_jscript("<center><b><a href=".$nukeurl."/modules.php?".$easymod."&ac=add target=_blank><img src=\"$nukeurl/modules/".$easy_name_rep."/images/".$easy_gif_title."\" border==0></a></center>");
   easy_jscript("</FONT></td></tr></table>");
   break;
   
   
   case scroller:
   
   if ($ac3!=0)
   {
   $supcri="and $tb_stories.topic=".$ac3;
   }else{
      if ($easy_topic_scroll == 0)
      {
      $supcri="";
      }else{
      $supcri="and $tb_stories.topic=".$easy_topic_scroll;
      }
   }
   
   if ($ac2==0){$ac2=$easy_num_news_scroll;}
   if ($ac2<2){$ac2=2;}
   
   easy_jscript("<TABLE WIDTH=".$easy_widht_scroll." BORDER=1 CELLSPACING=0 cellpadding=2 bordercolor=".$easy_color_border_scroll.">");
   easy_jscript("<TR><TD BGCOLOR=".$easy_color_top_scroll." bordercolor=".$easy_color_top_scroll."><FONT FACE=Verdana SIZE=2 COLOR=".$easy_color_sitename_scroll."><CENTER><B>$sitename</B><CENTER></FONT></TD></TR>");
   easy_jscript("<TR><TD bgcolor=".$easy_color_body_scroll." bordercolor=".$easy_color_body_scroll.">");
   
   echo "var scrollerwidth=$easy_widht_scroll\n";
   echo "var scrollerheight=$easy_height_scroll\n";
   echo "var scrollerbgcolor='$easy_color_body_scroll'\n";
   echo "var messages=new Array();\n";
   
   $z=0;   
   $result = mysql_db_query($dbname,"SELECT $tb_stories.sid, $tb_stories.title, $tb_stories.time, $tb_stories.hometext, $tb_topics.topictext FROM $tb_stories,$tb_topics where $tb_topics.topicid=$tb_stories.topic $supcri ORDER BY $tb_stories.sid DESC limit $ac2");
   while(list($sid,$title,$time,$hometext,$topictext) = mysql_fetch_row($result))
   {       
   
   $title= chop(ereg_replace("'", "\'",$title));
   $text=easy_clean($hometext,200);
   $topictext= ucfirst(chop(ereg_replace("'", "\'",$topictext)));
   $date_news=easy_make_date($time);
   
   echo "messages[".$z."]='<font FACE=Verdana size=\"1\" color=\"".$easy_color_topic_scroll."\"><b>".$topictext."</b> :</font><font FACE=Verdana size=\"1\" color=\"".$easy_color_date_scroll."\">".$date_news."</font><br><a href=\"".$nukeurl."/modules.php?name=News&file=article&sid=".$sid."\" target=\"_blank\"><font face=vedana size=1><b>$text</b></font></a>';\n";
   $z++;
   }
   echo "messages[".$z."]='<center><a href=".$nukeurl."/modules.php?".$easymod."&ac=add target=_blank><img src=\"$nukeurl/modules/".$easy_name_rep."/images/".$easy_gif_scroll."\" border=0></a></center>';\n";   
   include("modules/".$easy_name_rep."/syndication.js");
   easy_jscript("</td></tr></table>");
   
   break;
      
   
   case add:
   default:
   include("header.php");
   OpenTable();
   easy_modhtml();
   CloseTable();   
   include("footer.php");
   
   break;
        break;

}
?>

As it was made for nuke 6.0, perhaps it needs revision? So you can see it in operation, heres the page url to my syndication page:
[ Register or login to view links on this board.]

Any thoughts?



_________________
[ Register or login to view links on this board.]
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum