Go Back   Pligg CMS Forum > Pligg Development > Modification Tutorials

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-15-2008, 03:50 AM
New Pligger
 
Join Date: May 2008
Posts: 25
Thanks: 0
Thanked 2 Times in 1 Post
Newsticker or Pligg feed ticker

Somebody already did this... only it was not good enough for me.
With my version you can use for example 20 feeds.
Download rsstickerajax

Dynamic Drive DHTML Scripts- Advanced RSS Ticker (Ajax invocation)

upload rssticker.js in your Pligg root, the rest you upload to "lastrss" chmod the cache directory to 777.
----------------------------------------------------------------------------------------
Pligg.tpl
Add script below between the <head>here!</head>

<script src="rssticker.js" type="text/javascript"></script>
----------------------------------------------------------------------------------------
index_center.tpl

Okay this was a problem, only one feed. So i made a random number and give the feeds in bridge.php the name 0,1,2 and 3. So you get a rotation from different feeds. You can also use the feeds from your own pligg or news, whatever makes you happy. When you add more feeds to bridge.php you need to change the number here --->>> rand(0,3); change the 3. To make it look good in your pligg add some code in your main.css for example put the code below in a nice div ccs styled box.
Don't forget to add a bottom margin for your box. Because it looks stupid in your design if you don't.
margin-bottom: 10px; <---this, so it integrate neatly in your design.

Put the code below in the top from index_center.tpl.

{php}
$random_number = rand(0,3);
{/php}
<script type="text/javascript">
//rssticker_ajax(RSS_id, cachetime, divId, divClass, delay, optionalswitch)
//1) RSS_id: "Array key of RSS feed in PHP script"
//2) cachetime: Time to cache the feed in seconds (0 for no cache)
//3) divId: "ID of DIV to display ticker in. DIV id dynamically created"
//4) divClass: "Class name of this ticker, for styling purposes"
//5) delay: delay between message change, in miliseconds
//6) optionalswitch: "string" to control which parts of an item to display: "date" or "date+description"

new rssticker_ajax("{php}echo "$random_number";{/php}", 1000, "cnnbox", "cnnclass", 3500, "date")

</script>
-----------------------------------------------------------------------------------------

Bridge.php
edit this file...give the urls not a name but a number..example :

// List of RSS URLs
$rsslist=array(
"0" => "http://forums.pligg.com/external.php",
"1" => "http://rss.cnn.com/rss/cnn_topstories.rss",
"2" => "http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml",
"3" => "http://rss.news.yahoo.com/rss/topstories"
);
-----------------------------------------------------------------------------------------
main.css
Put this in your main.css. You can edit this how you like.

}

.cnnclass{
filterrogidXImageTransform.Microsoft.alpha(opa city=80); /*Specify fade effect in IE. Remove if desired.*/
-moz-opacity: 0.8; /*Specify fade effect in Firefox. Remove if desired.*/
}

.cnnclass a{
text-decoration: none;
}

.rsstitle{
font-size:136%;
color:#774525;
}

.rssdate{
color: gray;
font-size: 85%;
}
-------------------------------------------------------------------------------------------
Maybe somebody can add this into a nice easy pligg mod, just like featured story. im to lazy for that
Hope you can use it, bye bye peoples...
Reply With Quote
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
Pligg integration with SMF Forum autoinc Modification Tutorials 64 05-19-2008 02:22 AM
RSS Import Feed - Feed Frequency Not working ant560 Installation and Upgrade Help 4 03-15-2008 04:31 AM
How to add del.icio.us tags to your Pligg in a native manner abenamer Bug Report 10 06-01-2007 10:21 PM


Search Engine Friendly URLs by vBSEO 3.2.0