RSS Feed Icon for boards

Started by SMFHacks.com Team, July 17, 2006, 01:41:27 PM

Previous topic - Next topic

TrueSatan

Difficulty depends on level of experience and ability...you can answer this for yourself better than I can

mariolone

Hello,

I have installed this mod but I noted a problem.

I use SMF 1.1.4. and Mozilla Firefox as browser. First I made the login process and then tried to subscribe to a board feed in my forum. All ok (Mozilla asked me to add this feed to bookmarks) and after I made logout.

After few minutes, I came back to my forum and, after the login, Mozilla asked me if I would like to subscribe to a feed of my forum (that I have not selected before!) and, if I accepted, the page remained blank.
I noted that this happens only at the first login AFTER the one in which I subscribed to a feed in my forum. In fact, after the first login, all became ok and the forum works as usual.

Is it an error of the Mod? How to solve it? I am very interested in this feed and it should be usuful for me, but with this error is useless.

Thanks

Roberto

blackstar

Warning: set_time_limit(): Cannot set time limit in safe mode in /var/www/vhosts/web.com/httpdocs/oyunlar.php on line 73

?

vbgamer45

Quote from: blackstar on January 10, 2008, 06:02:17 PM
Warning: set_time_limit(): Cannot set time limit in safe mode in /var/www/vhosts/web.com/httpdocs/oyunlar.php on line 73

?

That's not coming fromt his mod.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

blackstar

<?php 
 
/* PHP RSS Reader v1.1 
 
By Richard James Kendall  
 
Bugs to [email protected]  
 
Free to use, please acknowledge me  
 
 
 
Place the URL of an RSS feed in the $file variable. 
 
 
 
The $rss_channel array will be filled with data from the feed, 
 
every RSS feed is different by by and large it should contain: 
 
 
 
Array { 
 
[TITLE] = feed title 
 
[DESCRIPTION] = feed description 
 
[LINK] = link to their website 
 
 
 
[IMAGE] = Array { 
 
[URL] = url of image 
 
[DESCRIPTION] = alt text of image 
 

 
 
 
[ITEMS] = Array { 
 
[0] = Array { 
 
[TITLE] = item title 
 
[DESCRIPTION] = item description 
 
[LINK = a link to the story 
 

 

 

 

 

 

 
 
 
By default it retrives the Reuters Oddly Enough RSS feed. The data is put into the array 
 
structure so you can format the information as you see fit. 
 
*/ 
 
set_time_limit(30); 
 
$file "http://www.sitem.com/form/index.php?action=.xml;type=rss;limit=30"
 
$rss_channel = array(); 
$currently_writing ""
 
$main ""
 
$item_counter 0
 
function 
startElement($parser$name$attrs) { 
 
global 
$rss_channel$currently_writing$main
 
switch(
$name) { 
 
case 
"RSS"
 
case 
"RDF:RDF"
 
case 
"ITEMS"
 
$currently_writing ""
 
break; 
 
case 
"CHANNEL"
 
$main "CHANNEL"
 
break; 
 
case 
"IMAGE"
 
$main "IMAGE"
 
$rss_channel["IMAGE"] = array(); 
 
break; 
 
case 
"ITEM"
 
$main "ITEMS"
 
break; 
 
default: 
 
$currently_writing $name
 
break; 
 

 

 
function 
endElement($parser$name) { 
 
global 
$rss_channel$currently_writing$item_counter
 
$currently_writing ""
 
if (
$name == "ITEM") { 
 
$item_counter++; 
 

 

 
function 
characterData($parser$data) { 
 
global 
$rss_channel$currently_writing$main$item_counter
 
if (
$currently_writing != "") { 
 
switch(
$main) { 
 
case 
"CHANNEL"
 
if (isset(
$rss_channel[$currently_writing])) { 
 
$rss_channel[$currently_writing] .= $data
 
} else { 
 
$rss_channel[$currently_writing] = $data
 

 
break; 
 
case 
"IMAGE"
 
if (isset(
$rss_channel[$main][$currently_writing])) { 
 
$rss_channel[$main][$currently_writing] .= $data
 
} else { 
 
$rss_channel[$main][$currently_writing] = $data
 

 
break; 
 
case 
"ITEMS"
 
if (isset(
$rss_channel[$main][$item_counter][$currently_writing])) { 
 
$rss_channel[$main][$item_counter][$currently_writing] .= $data
 
} else { 
 
//print ("rss_channel[$main][$item_counter][$currently_writing] = $data<br>"); 
 
$rss_channel[$main][$item_counter][$currently_writing] = $data
 

 
break; 
 

 

 

 
$xml_parser xml_parser_create(); 
 
xml_set_element_handler($xml_parser"startElement""endElement"); 
 
xml_set_character_data_handler($xml_parser"characterData"); 
 
if (!(
$fp fopen($file"r"))) { 
 
die(
"could not open XML input"); 
 

 
while (
$data fread($fp4096)) { 
 
if (!
xml_parse($xml_parser$datafeof($fp))) { 
 
die(
sprintf("XML error: %s at line %d"
 
xml_error_string(xml_get_error_code($xml_parser)),   
 
xml_get_current_line_number($xml_parser))); 
 

 

 
xml_parser_free($xml_parser); 
 
// output as HTML 
 
print ("<html><head><title>PHP RSS Reader</title></head><body>"); 
 
if (isset(
$rss_channel["IMAGE"])) { 
 
print (
"<a href=\"" $rss_channel["LINK"] . "\" target=\"_blank\"><img border=\"0\" src=\"" $rss_channel["IMAGE"]["URL"] . "\" align=\"middle\" alt=\"" $rss_channel["IMAGE"]["TITLE"] . "\"></a>  <font size=\"5\">" $rss_channel["TITLE"] . "</font><br><br>"); 
 
} else { 
 
print (
"<font size=\"5\">" $rss_channel["TITLE"] . "</font><br><br>"); 
 

 
print (
"<i>" $rss_channel["DESCRIPTION"] . "</i><br><br>"); 
 
if (isset(
$rss_channel["ITEMS"])) { 
 
if (
count($rss_channel["ITEMS"]) > 0) { 
 
for(
$i 0;$i count($rss_channel["ITEMS"]);$i++) { 
 
print (
"\n<table width=\"100%\" border=\"1\"><tr><td width=\"100%\"><a href=\"" $rss_channel["ITEMS"][$i]["LINK"] . "\" target=\"_blank\"><h2>" $rss_channel["ITEMS"][$i]["TITLE"] . "</h2></a></b>"); 
 
print (
"<i>" html_entity_decode($rss_channel["ITEMS"][$i]["DESCRIPTION"]) . "</i>"); 
 
print (
"</td></tr></table><br>"); 
 

 
} else { 
 
print (
"<b>There are no articles in this feed.</b>"); 
 

 

 
print (
"</body></html>"); 
 
?>



problem

Warning: set_time_limit(): Cannot set time limit in safe mode in /var/www/vhosts/sitem.com/httpdocs/oyunlar.php on line 73


RSS Feed mod

help pls..

TrueSatan

The code you have quoted has absolutely nothing to do with this mod!

mwmconsulting

Hey vbgamer45,

Love this mod.  Thanks heaps!

I thought you might make one edition.  There needs to be an icon for the overall Recent Posts of the forum.  I added one myself manually as follows:

On line 265 of the /Themes/default/BoardIndex.template.php file:

Change this:

<td class="titlebg" colspan="2">', $txt[214], '</td>

To this:

<td class="titlebg" colspan="2">', $txt[214], '&nbsp;<a href="http://<SITEURL>/index.php?type=rss;action=.xml" target="_blank"><img src="' . $settings['images_url'] . '/rss.png" alt="rss" /></a></td>


Where <SITEURL> is the URL of your particular SMF website (i.e. www.myforum.com).

Just my thoughts...

Cheers!

- MWM
========================
MWM Consulting, Inc.
InSiteful Business Solutions
http://www.mwmconsulting.biz
========================

mariolone

Hello,

I installed your great Mod and it works great.

I copied and pasted an RSS link to one website of mines to see how the Mod works.

I would like to control which part of the content visible on the website where I attached the RSS code. At this moment, 6-7 rows of the RSS link are visible on the website with my RSS feed: how to control them (for example to display on one website only the board title)?

Which file or code have I to modify? How?

Thank you

Ramón Cutanda

Simple, but effective. Thanks! :D

ACE844

Hello, I have a board with SMF114, TP.09X and using the 'classic' theme installed. I added the following mod : http://custom.simplemachines.org/mods/index.php?mod=376

to the board, and the install went without any displayed errors. I t seems though  that the 'child boards' aren't being updated  on the individual boards RSS feed but posts in them do appear in the 'MAIN-Forum' RSS-XML feed.

Could someone please help me to get this functionality enabled for the'child boards' so that it both updates, and allows an individual to subscribe to that 'child board' much like the mod allows for the main ones?

I'm not sure if it will help but here is the XML code from the mod


<?xml version="1.0"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
<id>vbgamer45:FeedIcon</id>
<version>1.1</version>


<file name="$themedir/BoardIndex.template.php">
    <operation>
        <search position="before"><![CDATA[', $board['name'], '[/url]]]></search>
        <add><![CDATA[&nbsp;<a href="' . $scripturl . '?action=.xml;board=' . $board['id'] . ';type=rss"><img src="' . $settings['images_url'] . '/rss.png" alt="rss" />[/url]]]></add>

    </operation>
</file>
<file name="$themedir/MessageIndex.template.php">
    <operation>
        <search position="before"><![CDATA[', $board['name'], '[/url]]]></search>
        <add><![CDATA[&nbsp;<a href="' . $scripturl . '?action=.xml;board=' . $board['id'] . ';type=rss"><img src="' . $settings['images_url'] . '/rss.png" alt="rss" />[/url]]]></add>

    </operation>
</file>

</modification>


Thanks in advance for your help,
ACE844

No.Body

THis one this great. Sad though that it shows only when im using the default theme.

Anyone knows how to put it in theme " Black22 " ?

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

ACE844

#132
I actually did install it manually, but it doesn't seem to show the feed for the child board on it's associated 'parent board feed'. It does however show up on the 'global-Forum feed'. I tried to add the code to the 'child board' in the same manner and it caused all sorts of errors. That is why I'm asking as this is outside of my expertise.

No.Body


ACE844

VBGamer,

Do you have any suggestions on how to solve this issue?
Thanks,
ACE844

vbgamer45

I would need to see the templates file for the custom them you are editing to look at the child boards code
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

ACE844

alright, just let me know which ones you need, just the board and message indicies, or are there others?.

Kender

i installed this mod, works great from the go...

the only change i made was in the 2 edited files i moved the rss feed to the front of the forum name, instead of following the forum name.. to me more pleasing to look at that way
http://chucknorris2012.com  Avoid a roundhouse kick to the head!  Sign the petition

vbgamer45

Quote from: ACE844 on February 19, 2008, 09:25:41 AM
alright, just let me know which ones you need, just the board and message indicies, or are there others?.
I belive just boardindex.template.php and messageindex.template.php
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

ACE844

"VBgamer,"

Here they are as requested the message index template .php and board index template.php
Thanks for your help and assistance with this,
ACE844

Advertisement: