Page 1 of 5

[ABD]RSS News Ticker 0.1.1

Posted: Fri Nov 09, 2007 12:23 am
by t27duck
I made a custom RSS ticker for my college's gaming club's forum. I compiled it into a proper MOD in case anyone else might have a use for it. If all goes well, I'll just send it to phpBB for validation. Let me know if my installation instructions are not working.

MOD Title: RSS News Ticker
MOD Description: Adds a scrolling news ticker on the forum index displaying the latest headlines from a given RSS feed.
MOD Version: 0.1.1
phpBB Version: 3.0 RC7 or later (as the base code does not rely on phpBB's functions)

Supported styles: prosilver and subsilver2 (Styles based off of prosilver and subsilver2 *should* work but don't quote me on that)

Languages: English
(Note: This Mod only has 3 language strings. Because of this, I just set the strings as variables in newscenter/rss.php for quick access and easy translation without having to deal with extra files)

MOD Download: Here
Please read through the Author's note and DIY Instruction sections (at the bottom of the install.xml page) before posting problems.

USERS UPDATING FROM 0.1.0: Just override the files. No editing is needed...but you'll have to reset your settings in newscenter/rss.php

MOD Screen Shot:
Image


MOD NOTES:
  • This Mod uses a modified version of lastRSS.php with some of its features disabled for faster loading and less memory use. You can download the full version at http://lastrss.oslab.net/ and use it in place of the provided file. This Mod also uses the Pausing up-down scroller by Dynamic Drive. Both files are freeware under GNU.
  • To modify this MOD's settings, open newsceneter/rss.php in a text editor to change the values
  • The default feed for this MOD is Slashdot's feed
  • If you are using the RSS caching feature on lastRSS (turned on by default on this MOD), chmod the newscenter/tmp folder to 777.

MOD History:
0.1.0
- First release

0.1.1
- Added switch to choose if clicking on links opens in a new window
- Set default re-encoding of RSS data to UTF-8

Re: [BETA]RSS News Center 0.1.0

Posted: Fri Nov 09, 2007 1:26 am
by .:: Chico ::.
wow,
really great for sites that wanna integrate some information like last news from tv, from fotolog sites, frmo PHPBB.com too, really great!

contragulations!

Re: [BETA]RSS News Center 0.1.0

Posted: Fri Nov 09, 2007 8:45 am
by saaiberke
Great mod :) Can I adapt the font dimensions?

And I get these notices in my errorlog:

Code: Select all

[09-Nov-2007  10:09:08] [phpBB Debug] [client XXX.X.XXX.XXX] [File index.php] PHP Notice: in file /beforum/newscenter/rss.php on line 57 : Use of undefined constant items - assumed 'items'
Grtz,

Nic

Re: [BETA]RSS News Center 0.1.0

Posted: Fri Nov 09, 2007 2:02 pm
by t27duck
saaiberke:
Opps, :oops: forgot some quotes.

In rss.php...
FIND (or just go to line 57)

Code: Select all

foreach ($rs[items] as $value)
REPLACE WITH

Code: Select all

foreach ($rs['items'] as $value)
Also, the CSS that you add to the .css files in the [style]/theme/ file controls how the news box looks. Just edit or at to those values and it'll update the look on your site.

Re: [BETA]RSS News Center 0.1.0

Posted: Fri Nov 09, 2007 3:53 pm
by saaiberke
Thanks for the info. I can indeed change the css but I can't manage to get the titles bigger. How can I do that?

And would it be possible to change the links so that they open in a new tab so you don't go away from the board's index page?

Grtz,

Nic

Re: [BETA]RSS News Center 0.1.0

Posted: Fri Nov 09, 2007 7:11 pm
by t27duck
I can add a switch that'll open up links in a new window in a future version.


As far as the CSS goes...

Code: Select all

#pscroller1{
width: 100%; /* 200px; */
height: 30px;
padding: 0px;
margin: 0px;
}
Under the 'margin: 0px;' you can add the line, 'font-size: XXpx;' where XX is the font size for the titles in pixels.

Re: [BETA]RSS News Center 0.1.0

Posted: Fri Nov 09, 2007 7:12 pm
by sotis
I have a problem with the charset

The news are in windows-1251 charset and they appear on the forum like "?????????????"

Re: [BETA]RSS News Center 0.1.0

Posted: Fri Nov 09, 2007 7:50 pm
by saaiberke
Thank you very much for the info, it worked :)

Grtz,

Nic

Re: [BETA]RSS News Center 0.1.0

Posted: Fri Nov 09, 2007 10:07 pm
by t27duck
sotis wrote:I have a problem with the charset

The news are in windows-1251 charset and they appear on the forum like "?????????????"
You can try this and see if it works.

Open rss.php

FIND

Code: Select all

$rss->items_limit = 0;
AFTER ADD

Code: Select all

$rss->cp = 'UTF-8';
I think that'll convert the char set for the RSS file into UTF-8 which should display correctly on your forum.

Re: [BETA]RSS News Center 0.1.0

Posted: Fri Nov 09, 2007 10:47 pm
by sotis
WOW

It works :D

Thanks a lot

How the news can be open in new window

Re: [BETA]RSS News Center 0.1.0

Posted: Sat Nov 10, 2007 3:38 am
by t27duck
sotis wrote:How the news can be open in new window
Will add that in a future release.

If you want to force it to open in a new window yourself, in rss.php...

FIND

Code: Select all

$rss_js_data .= "pausecontent[c++]='<a href=\"".$value['link']."\">".str_replace("'","\'",$value['title'])."</a>';\n";
REPLACE WITH

Code: Select all

$rss_js_data .= "pausecontent[c++]='<a href=\"#\" onClick=\"window.open(\\'".$value['link']."\\'); return false;\">".str_replace("'","\'",$value['title'])."</a>';\n";

Re: [BETA]RSS News Center 0.1.0

Posted: Sat Nov 10, 2007 12:35 pm
by yaw_pakhtoon
thanks alot.. good mod.

Re: [BETA]RSS News Center 0.1.0

Posted: Sat Nov 10, 2007 9:02 pm
by johnfosteruk
This is a fantastic mod - thanks.

Have you looked at extending the features so that it'll grab the content of each item in a feed and post it in a given forum as a new topic?

Re: [BETA]RSS News Center 0.1.0

Posted: Tue Nov 13, 2007 2:49 am
by comuter
Installed it myself good mod

is there any options to display more than one article? I want to have 2 articles names

like this

News Article One
News Article Two

Re: [BETA]RSS News Center 0.1.1

Posted: Tue Nov 13, 2007 3:35 am
by t27duck
Ok, 0.1.1 is up. I added a switch in rss.php that'll let you choose if clicking on links opens in a new window (default is set to false) and the RSS data will auto re-encode to UTF-8 if the feed is not UTF-8.

Let me know if I botched up this package as I sort of threw my changed files into a zip and threw it up on my server.

People updating from 0.1.0, just override the files on the sever and you're good to go.


johnfosteruk:
Possibly. It may not be "throw news entries in a thread or threads" but does having a page that'll list all entries in the feed work? I'm trying to keep this MOD as simple and as "idiot-proof" as possible.


comuter:
Don't take this the wrong way, but I have absolutely no idea what you are talking about. :D