[RC1] RSS bbCode

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
User avatar
Lucas1510
Registered User
Posts: 47
Joined: Thu Sep 04, 2003 12:07 am
Location: Herne - Germany
Contact:

Post by Lucas1510 »

That was the hint I needed :-) :-)

I replaced the URL in

Code: Select all

#
#-----[ AFTER, ADD ]---------------------------------
#
<!-- BEGIN rss --><script language="JavaScript" src="http://itde.vccs.edu/rss2js/feed2js.php?src={URL}&chan=y&num=1&desc=1&date=n&targ=y" type="text/javascript"></script><noscript>Enable javascript.</noscript><!-- END rss -->
with this one:

Code: Select all

<!-- BEGIN rss --><script language="JavaScript" src="http://jade.mcli.dist.maricopa.edu/feed/feed2js.php?src={URL}&chan=y&date=y&targ=y&html=a" type="text/javascript"></script><noscript>Enable javascript.</noscript><!-- END rss -->
And now it works without problems with german Chars as you can see here:D :D Great mod!

Thank you, Tom :) :)

BBnooby
Registered User
Posts: 20
Joined: Wed Mar 16, 2005 7:22 pm

Post by BBnooby »

OK, I installed this and foolowed the directions to a 't'. Problem is I see the rss button, when I press it and enter an url (blah.com/blah.xml) i get this as a view after submitting:

[rss]blah.com/blah.xml[/rss]

No feed, it is like the rss command is ignored by phpbb

any suggestions?

tomythius
Registered User
Posts: 74
Joined: Sat May 28, 2005 3:05 pm
Location: Queniborough - Leicester - UK
Contact:

Post by tomythius »

The code is quite strict about url formation.
The url must start with "http://www."
Hope this helps.
Tom says so, QED.

User avatar
smithy_dll
Former Team Member
Posts: 7630
Joined: Tue Jan 08, 2002 6:27 am
Location: Australia
Name: Lachlan Smith
Contact:

Post by smithy_dll »

Hello,

Could you please edit your topic title with a prefix as outlined in MOD Development forum rules section 3.a, 3.b. The prefix you are currently using is not allowed. If your MOD is still in development you can use the prefixes in section 3.a. If your MOD is stable could you please submit your MOD to the phpBB.com MODDB (MOD release database), for validation pending release.

Your co-operation is very much appreciated by the phpBB MOD Team.

Thank you,
The phpBB MOD Team

tomythius
Registered User
Posts: 74
Joined: Sat May 28, 2005 3:05 pm
Location: Queniborough - Leicester - UK
Contact:

Post by tomythius »

Sure, tis now renamed.
smithy_dll wrote: If your MOD is stable could you please submit your MOD to the phpBB.com MODDB (MOD release database), for validation pending release.

Thanks, but I already submitted it for validation.
Tom says so, QED.

BBnooby
Registered User
Posts: 20
Joined: Wed Mar 16, 2005 7:22 pm

Post by BBnooby »


tomythius
Registered User
Posts: 74
Joined: Sat May 28, 2005 3:05 pm
Location: Queniborough - Leicester - UK
Contact:

Post by tomythius »

OK, I see the problem there.
You need to add .asp to the list of acceptable file types like this:
Change

Code: Select all

// [rss]RSS_url_here[/rss] code..
	$text = preg_replace("#\[rss\]((http|ftp|https|ftps)://)
	([^ \?&=\#\"\n\r\t<]*?(\.(xml|php|rdf|aspx|rss|rss1|rss2))([^ \"\n\r\t<]*?))\[/rss\]#sie",
	"'[rss:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/rss:$uid]'", $text);
to

Code: Select all

// [rss]RSS_url_here[/rss] code..
	$text = preg_replace("#\[rss\]((http|ftp|https|ftps)://)
	([^ \?&=\#\"\n\r\t<]*?(\.(xml|php|rdf|aspx|rss|rss1|rss2|asp))([^ \"\n\r\t<]*?))\[/rss\]#sie",
	"'[rss:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/rss:$uid]'", $text);
Note the |asp added.
It'd be great if someone better at string matching code could show me how to use a wildcard there...
Tom says so, QED.

BBnooby
Registered User
Posts: 20
Joined: Wed Mar 16, 2005 7:22 pm

Post by BBnooby »

OK, i changed the code, same thing :( Sorry, I am not to bright at this.

tomythius
Registered User
Posts: 74
Joined: Sat May 28, 2005 3:05 pm
Location: Queniborough - Leicester - UK
Contact:

Post by tomythius »

Ah, I see what you mean.
I'll see what I can do.
~~~~~~~~~~~~~~
OK, so I tried with some feeds which I know work ok. They didn't display either.
It looks like a problem with the bbcode side of things: If the magpie or feed2js were borked the tags would've have been removed and we'd just see empty JS tags...
Could you post the relevant code here?
(bbcode.tpl, bbcode.php etc)
Tom says so, QED.

BBnooby
Registered User
Posts: 20
Joined: Wed Mar 16, 2005 7:22 pm

Post by BBnooby »


tomythius
Registered User
Posts: 74
Joined: Sat May 28, 2005 3:05 pm
Location: Queniborough - Leicester - UK
Contact:

Post by tomythius »

So, I've been pondering over your script (trying to decode the mess that the bbcode parser has made of it) and have noticed something...
It seems like parts of your code are from different versions of my mod, for example

Code: Select all

 // [rss]image_url_here[/rss] code..
// This one gets first-passed..
$patterns[] = "#\[rss:$uid\](.*?)\[/rss:$uid\]#si";
$replacements[] = $bbcode_tpl['rss']; 
was changed to

Code: Select all

 // [rss]RSS_url_here[/rss] code..
// This one gets first-passed..
$patterns[] = "#\[rss:$uid\](.*?)\[/rss:$uid\]#si";
$replacements[] = $bbcode_tpl['rss']; 
some time ago, that change in itself won't cause the problem you're seeing, but it may be a symptom of slap-dash upgrading. I've touched up the mod again (http://www.tom.whaletattoo.com/rss_v1.5.1.zip), I recommend you go through your source re-installing the mod line by line.
Good luck.
:)
Tom says so, QED.

BBnooby
Registered User
Posts: 20
Joined: Wed Mar 16, 2005 7:22 pm

Post by BBnooby »

in your mod instructions it says this:

copy feeds/feed2js.inc to includes/feeds/feed2js.inc


however, there is no feed2js.inc file in the feeds folder I extracted.

User avatar
Lucas1510
Registered User
Posts: 47
Joined: Thu Sep 04, 2003 12:07 am
Location: Herne - Germany
Contact:

Post by Lucas1510 »

Hey BBnooby & tomythius,

this is, how I installed the mod, and as I postet, it works for me now with phpBB 2.0.15.

This were the installation-instructions of mod-version 1.1.1 (so without included feeds-folder), I edited them to work with my board:

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/posting_body.tpl

#
#-----[ FIND ]---------------------------------
#
f_help = "{L_BBCODE_F_HELP}";

#
#-----[ AFTER, ADD ]---------------------------------
#
r_help = "{L_BBCODE_R_HELP}";

#
#-----[ FIND ]---------------------------------
#
			  <td><span class="genmed">
			  <input type="button" class="button" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onClick="bbstyle(14)" onMouseOver="helpline('p')" />

			  </span></td>
#
#-----[ AFTER, ADD ]---------------------------------
#
			  <td><span class="genmed">
			  <input type="button" class="button" accesskey="r" name="addbbcode16" value="RSS" style="width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('r')" />
			</span></td>

#
#-----[ FIND ]---------------------------------
#
	bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','
','
  • ','
','
  • ','
','[img]','[/img]', '','');

#
#-----[ IN-LINE FIND ]---------------------------------
#
,'[img]','[/img]'

#
#-----[ IN-LINE AFTER, ADD ]---------------------------------
#
,'[rss]','[/rss]'

#
#-----[ OPEN ]------------------------------------------
#
languages/lang_english/lang_main.php

#
#-----[ FIND ]---------------------------------
#
$lang['bbcode_f_help'] = 'Font size: [size=x-small]small text[/size]';

#
#-----[ AFTER, ADD ]---------------------------------
#
$lang['bbcode_r_help'] = 'RSS: enter the URL of an RSS feed for it\'s inclusion in your post.';

#
#-----[ OPEN ]------------------------------------------
#
includes/bbcode.php

#
#-----[ FIND ]---------------------------------
#
$bbcode_tpl['img'] = str_replace('{URL}', '\\1', $bbcode_tpl['img']);

#
#-----[ AFTER, ADD ]---------------------------------
#
$bbcode_tpl['rss'] = str_replace('{URL}', '\\1', $bbcode_tpl['rss']);

#
#-----[ FIND ]---------------------------------
#
# // [img]image_url_here[/img] code..
# // This one gets first-passed..
# $patterns[] = "#\[img:$uid\](.*?)\[/img:$uid\]#si";

$replacements[] = $bbcode_tpl['img'];

#
#-----[ AFTER, ADD ]---------------------------------
#
// [rss]image_url_here[/rss] code..
// This one gets first-passed..
$patterns[] = "#\[rss:$uid\](.*?)\[/rss:$uid\]#si";
$replacements[] = $bbcode_tpl['rss'];

#
#-----[ FIND ]---------------------------------
#
// [img]image_url_here[/img] code..
$text = preg_replace("#\[img\]((http|ftp|https|ftps)://)
([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie",
"'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'",
$text);

#
#-----[ AFTER, ADD ]---------------------------------
#
$text = preg_replace("#\[rss\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(xml|php|rdf|rss|rss1|rss2|asp)))\[/rss\]#sie", "'[rss:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/rss:$uid]'", $text);

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/bbcode.tpl

#
#-----[ FIND ]------------------------------------------
#
<!-- BEGIN email --><a href="mailto:{EMAIL}">{EMAIL}</A><!-- END email -->


#
#-----[ AFTER, ADD ]---------------------------------
#
<!-- BEGIN rss --><script language="JavaScript" src="http://jade.mcli.dist.maricopa.edu/feed ... g=y&html=a" type="text/javascript"></script><noscript>Enable javascript.</noscript><!-- END rss -->

#
#-----[ SAVE/CLOSE ALL FILES ]---------------------------------
#
# EoM[/code]

I hope, you can use this :)

- Lucas

tomythius
Registered User
Posts: 74
Joined: Sat May 28, 2005 3:05 pm
Location: Queniborough - Leicester - UK
Contact:

Post by tomythius »

BBnooby wrote: in your mod instructions it says this:

copy feeds/feed2js.inc to includes/feeds/feed2js.inc


however, there is no feed2js.inc file in the feeds folder I extracted.

Sorry, that's a typo, the file is called feed2php.inc.
Basically everything in the feeds directory in the package needs to be shoved in the feeds directory inside includes inside your site.
Thanks for pointing out the typo.
Lucas, thanks for providing this code, on form as always.
:)
Tom says so, QED.

BBnooby
Registered User
Posts: 20
Joined: Wed Mar 16, 2005 7:22 pm

Post by BBnooby »

OK, redid everything, and now this:

Code: Select all

Warning: preg_replace(): Compilation failed: nothing to repeat at offset 34 in /home/chatspor/public_html/phpBB/includes/bbcode.php on line 294

Warning: Cannot modify header information - headers already sent by (output started at /home/chatspor/public_html/phpBB/includes/bbcode.php:294) in /home/chatspor/public_html/phpBB/includes/page_header.php on line 506

Warning: Cannot modify header information - headers already sent by (output started at /home/chatspor/public_html/phpBB/includes/bbcode.php:294) in /home/chatspor/public_html/phpBB/includes/page_header.php on line 508

Warning: Cannot modify header information - headers already sent by (output started at /home/chatspor/public_html/phpBB/includes/bbcode.php:294) in /home/chatspor/public_html/phpBB/includes/page_header.php on line 509

Post Reply

Return to “[2.0.x] MODs in Development”