|
おまたせ~♪
|
|
▲ |
|
|
|
|
|
<?php
include('rss_fetch.inc');
$rss = fetch_rss('http://長いので省略/topsongs/limit=10/rss.xml');
if ($rss){
$items = array_slice($rss->items, 0, 10);
echo "document.write(¥"<SCR¥" + ¥"IPT Language = 'JavaScript'>¥");¥n";
echo "<!--¥n";
echo "document.write(¥"img = new Array();¥");¥n";
$i = 0;
foreach ($items as $item ) {
$i = $i+1;
$url = $item['link'];
$songname = $item['itms']['song'];
$artist = $item['itms']['artist'];
$tdata = ''.$item['content']['encoded'].'';
$line = explode('>', $tdata);
$imgurl = explode('"',$line[7]);
if ($i < 11){
echo "document.write(¥"img[$i] = '<img src=$imgurl[3]>';¥");¥n";
} else{
break;
}
}}
echo "document.write(¥"function popUp(i) {¥");¥n";
echo "document.write(¥"ID.innerHTML = img[i];¥");¥n";
// ヘルプの位置を調整 適当に変えてみましたが・・・^^;
echo "document.write(¥"ID.style.left = event.x + 50;¥");¥n";
echo "document.write(¥"ID.style.top = event.y + 150;¥");¥n";
echo "document.write(¥"ID.style.visibility = 'visible';¥");¥n";
echo "document.write(¥"}¥");¥n";
echo "document.write(¥"function hidePop() {¥");¥n";
echo "document.write(¥"ID.style.visibility = 'hidden';¥");¥n";
echo "document.write(¥"}¥");¥n";
echo "//-->¥n";
echo "document.write(¥"<¥/scr¥" + ¥"ipt>¥");¥n";
if ($rss){
$items = array_slice($rss->items, 0, 10);
$title = $rss->channel['title'];
$title = mb_convert_encoding($title, "utf-8", "auto");
echo "<!--¥n";
echo "document.write(¥"<SPAN id=¥'ID¥' STYLE=¥'visibility: hidden; position: absolute;¥'></SPAN>¥");¥n";//ここは改行してはいけません
echo "document.write(¥"<B>$title</B>¥");¥n";
echo "document.write(¥"<ol>¥");¥n";
$rndkey = rand(1,10);
$getkey= 0;
foreach ($items as $item ) {
$getkey = $getkey+1;
$url = $item['link'];
$songname = $item['itms']['song'];
$artist = $item['itms']['artist'];
$tdata = ''.$item['content']['encoded'].'';
$line = explode('>', $tdata);
$imgurl = explode('"',$line[7]);
echo "document.write(¥"<li><a href=$url onMouseOver=popUp($getkey) onMouseOut=hidePop()>$songname</a><br>$artist<br></li>¥");¥n";//ここも改行はNG
if ($getkey == $rndkey){
echo "document.write(¥"<a href=$url><img src=$imgurl[3]></a>¥");¥n";
} else{
}
}}
echo "document.write(¥"</ol>¥");¥n";
echo "//-->";
?>
基本としては index16で行けました。
動作確認は”NotFound”見てください。。w
ポップアップ表示位置の微調整はお任せします。。^^;
|
|
|
|
|
|
by team714_neo
| 2004-08-18 17:32
| その他
|
|
|
|
|