Here is the php file:
PHP Code:
<?php $type=$_REQUEST["Type"]; $term=$_REQUEST["Term"]; $count=$_REQUEST["Count"]; $menu=$_REQUEST["Menu"]; $ch = curl_init(); $timeout = 0; // set to zero for no timeout curl_setopt ($ch, CURLOPT_URL, "http://api.bing.net/json.aspx?AppId=F8DA6024CF&Market=en-US&Query=".$term."&Sources=".$type."&".$type.".Count=".$count."&JsonType=raw"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $search = curl_exec($ch); curl_close($ch); $Response = json_decode($search,true); if ($term == "")$term = "Top News Stories"; $term = str_replace("site:","",$term); $term = explode(".", $term); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="X-UA-Compatible" content="IE=8" /> <link href = "style.css" rel = "stylesheet" type = "text/css"> <script type = 'text/javascript' src = '../scriptaculous/lib/prototype.js'></script> <script type = 'text/javascript' src = '../scriptaculous/src/scriptaculous.js'></script> </head> <body> <div id = "container"> <div id = "text1"> <?php foreach($Response['SearchResponse'][$type]['Results'] as $item) { echo(" <div onmouseover = \"clearInterval(Scroll)\" onmouseout = \"clearInterval(Scroll); Scroll = setInterval ('scroll()', 50)\"> <div class = 'Source' style='color:green'><b>$term[0]</b></div> <div class = 'Title'><b><a href='$item[Url]' target='_blank' style='color:yellow'></b>$item[Title]</b></a></div> <div class = 'Description' style='color:#cccccc'>$item[Snippet]</div> <br> </div> "); } ?> </div> <div id = "text2"> <?php foreach($Response['SearchResponse'][$type]['Results'] as $item) { echo(" <div onmouseover = \"clearInterval(Scroll)\" onmouseout = \"clearInterval(Scroll); Scroll = setInterval ('scroll()', 50)\"> <div class = 'Source' style='color:green'><b>$term[0]</b></div> <div class='Title'><b><a href = '$item[Url]' target='_blank' style='color:yellow'></b>$item[Title]</b></a></div> <div class='Description' style='color:#cccccc'>$item[Snippet]</div> <br> </div> "); } ?> </div> </div> <?php if(file_exists("$menu")) { echo(" <div id = 'menu'>".file_get_contents($menu)."</div> "); } ?> <script type = "text/javascript"> $("container").style.height = document.viewport.getHeight() - 30 + 'px'; $("container").style.width = document.viewport.getWidth() + 'px'; $('text1').style.top = 0 + 'px'; $('text2').style.top = $('text1').getHeight() + 'px'; var Scroll = setInterval ("scroll()", 50); function scroll() { if (parseInt($('text1').style.top) <= 0) { $('text2').style.top = parseInt($('text1').style.top) + $('text1').getHeight() + 'px'; } if (parseInt($('text2').style.top) <= 0) { $('text1').style.top = parseInt($('text2').style.top) + $('text2').getHeight() + 'px'; } $('text1').style.top = parseInt($('text1').style.top) - 1 +'px'; $('text2').style.top = parseInt($('text2').style.top) - 1 +'px'; } </script>
And here is the style sheet:
Code:
*
{
padding:0;
margin:0;
}
body
{
background-color: transparent;
color: #ffffff;
overflow: hidden;
}
#container
{
overflow: hidden;
}
#menu .ul .li
{
display: inline-block;
height: 30px;
text-align: center;
background-color: transparent;
}
#text1
{
position: absolute;
text-align: left;
background-color: transparent;
}
#text2
{
position: absolute;
text-align: left;
background-color: transparent;
}
Http://ticktach.com/
Click on the loudspeaker (News)
This url will load page in a browser window instead of an iframe, same problem...
http://ticktach.biz/news/index.php?T...&Menu=menu.txt
I am at a loss and just spinning my wheels at this point, Help greatly appreciated.
__________________
Sleeping Troll, EMUSE, Mind Expansion...Truly serendipity!
Last edited by Sleeping Troll; 08-31-2010 at 01:22 AM..
|