window.onload = function() {
dp.SyntaxHighlighter.ClipboardSwf = ‘http://tmh.main.jp/lib/js/dp.SyntaxHighlighter/Scripts/clipboard.swf’;
dp.SyntaxHighlighter.HighlightAll(‘code’);
};
jquery_news_tickerを使ってみたもの。
<?php // Make sure SimplePie is included. You may need to change this to match the location of autoloader.php // For 1.0-1.2: #require_once('../simplepie.inc'); // For 1.3+: // http://tmh.main.jp/etc/ph/news/simplepie-simplepie-1.3.1-0-gce53709.zip // http://tmh.main.jp/etc/ph/news/news5.php require_once('simplepie/autoloader.php'); // We'll process this feed with all of the default options. $feed = new SimplePie(); // Set which feed to process. //$feed->set_feed_url('http://mix.chimpfeedr.com/9db14-mimi'); // フィードしたいRSSのURL $feed->set_feed_url(array( "http://rss.dailynews.yahoo.co.jp/fc/rss.xml", "http://www.glitty.jp/atom.xml", "http://feed.rssad.jp/rss/gigazine/rss_1.0", "http://piano.phpapps.jp/feed" )); //キャッシュ $feed->set_cache_location("tmp/");//保存するディレクトリ $feed->set_cache_duration(600); //単位は秒で指定 // Run SimplePie. $feed->init(); // This makes sure that the content is sent to the browser as text/html and the UTF-8 character set (since we didn't change it). $feed->handle_content_type(); // Let's begin our XHTML webpage code. The DOCTYPE is supposed to be the very first thing, so we'll keep it on the same line as the closing-PHP tag. ?> <html> <head> <title>Sample SimplePie Page</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link href="jquery_news_ticker/styles/style2.css?v=2011-04-25" rel="stylesheet" type="text/css" /> <link href="jquery_news_ticker/styles/ticker-style.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script> <script src="jquery_news_ticker/includes/jquery.ticker.js" type="text/javascript"></script> <script src="jquery_news_ticker/includes/site.js" type="text/javascript"></script> <style> .ticker { background-color: #F8F0DB; display: block; height: 23px; overflow: hidden; position: relative; width: 450px; } body { font:16px/1.4em meiryo,Verdana, sans-serif; color:#333; } a:hover { color:#326EA1; text-decoration:underline; padding:0 1px; } .ticker-title{ display:none !important; } .ticker{ background-color: white; padding:0px; } .ticker-content { left:0px !important; } .ticker-wrapper.has-js { background-color: white; border-radius: 15px; display: block; font-size: 0.75em; height: 32px; margin: 3px 0; padding: 0; width: 530px; } .ticker-content { background-color: white; color: #1F527B; } .ticker-swipe { background-color: white; } body { _font-family: arial; _font-size: 1em; margin: 0 auto; padding: 0 0px 0px; width: 500px; } .ticker-swipe span { margin-left: 1px; background-color: white; } </style> </head> <body> <script type="text/javascript"> $(function () { $('#js-news').ticker({ titleText: 'News' }); }); </script> <ul id="js-news" class="js-hidden"> <?php /* Here, we'll loop through all of the items in the feed, and $item represents the current item in the loop. */ foreach ($feed->get_items(0,30) as $item): //foreach ($feed->get_items() as $item)://無制限取得 ?> <!--- ◇◇ティッカー◇◇ -----------------------------------------------------------------------------------> <li class="news-item"><a target=_blank href="<?php echo $item->get_permalink(); ?>"><?php echo $item->get_title(); ?></a></li> <!--- ◇◇ティッカー◇◇ -----------------------------------------------------------------------------------> <?php endforeach; ?> </ul> </body> </html>