View Single Post

  #11 (permalink)  
Old 12-03-2008, 04:05 PM
satimis satimis is offline
Coder
 
Join Date: Jun 2007
Posts: 36
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
satimis will become famous soon enough
Default

Quote:
Originally Posted by ghost View Post
for the scroller you will need to remove the right side feeds remove these two lines from the php code
Code:
foreach ($rss_right as $url) ShowOneRSS($url);
echo '</td></tr></table>';
Place the js code in the <head> HERE </head>of your doc
Remove the above 2 lines of code its near the bottom of the PHP script.
in the <body> Put
Code:
<div id="marqueecontainer" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">
<div id="vmarquee" style="position: absolute; width: 98%;">
place the complete php script here
</div>
</div>
Just ran it on my own localhost and it works fine
Sorry, still fail

$ cat /var/www/index.php
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"https://www.satimis.com/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<center>
<script language="JavaScript1.2">
//Specify the marquee's width (in pixels)
var marqueewidth="600px"
//Specify the marquee's height
var marqueeheight="50px"
//Specify the marquee's marquee speed (larger is faster 1-10)
var marqueespeed=2
//configure background color:
var marqueebgcolor="#DEFDD9"
//Pause marquee onMousever (0=no. 1=yes)?
var pauseit=1


//Specify the marquee's content (don't delete <nobr> tag)
//Keep all content on ONE line, and backslash any single quotations (ie: that\'s great):

var marqueecontent='<nobr><h><tags style="word-spacing:25px;"><strong>Tokyo NewYork Paris HongKong London Sydney Soeul Frankfurt SanFrancisco Singapore Taiwan Shanghai KualaLupur Mexico Jakata</strong></tags></h></nobr>'


////NO NEED TO EDIT BELOW THIS LINE////////////
marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1) //slow speed down by 1 for NS
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById
if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+marqueecontent+'</span>')
var actualwidth=''
var cross_marquee, ns_marquee

function populate(){
if (iedom){
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
cross_marquee.innerHTML=marqueecontent
cross_marquee.style.border='.0625ex solid red';
cross_marquee.style.top=parseInt(marqueeheight)/2-cross_marquee.offsetHeight/2+'px';
cross_marquee.style.border='none';
actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
}
else if (document.layers){
ns_marquee=document.ns_marquee.document.ns_marquee2
ns_marquee.left=parseInt(marqueewidth)+8
ns_marquee.document.write(marqueecontent)
ns_marquee.document.close()
actualwidth=ns_marquee.document.width
}
lefttime=setInterval("scrollmarquee()",20)
}
window.onload=populate

function scrollmarquee(){
if (iedom){
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+"px"
else
cross_marquee.style.left=parseInt(marqueewidth)+8+"px"

}
else if (document.layers){
if (ns_marquee.left>(actualwidth*(-1)+8))
ns_marquee.left-=copyspeed
else
ns_marquee.left=parseInt(marqueewidth)+8
}
}

if (iedom||document.layers){
with (document){
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
if (iedom){
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';border:blue dotted 2px;overflow:hidden">')
//write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
write('<div id="iemarquee" style="position:absolute;left:0px;top:0px"></div>')
write('</div></div>')
}
else if (document.layers){
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
write('<layer name="ns_marquee2" lefft=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
write('</ilayer>')
}
document.write('</td></table>')
}
}
</script>
</center>
<br>
<br>

    <title>Common Tests</center></title>

<style>
h { font-size: 25px; font-family: sans-serif; font-style: italic; color: rgb(0, 100, 0); }
</style>


</head>

<br>
<body background="greece_w.jpg">
<H1><FONT SIZE="+4"><FONT COLOR="red"><center><I>Common Test</I></center></FONT></FONT></H1>


<br>
<br>
<p>
<center><img src="WELCOME2.gif" height="44" width=150"></center>
</p>

<br>
<br>
<div id="marqueecontainer" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">
<div id="vmarquee" style="position: absolute; width: 98%;">
<?php
function ShowOneRSS($url) {
global $rss;
if ($rs = $rss->get($url)) {
echo '<h2><a href="'.$rs['link'].'">'.$rs['title']."</a></h2>\n";
echo $rs['description']."<br>\n";
echo "<ul>\n";
foreach ($rs['items'] as $item) {
echo '<li><a href="'.$item['link'].'" title="'.$item['description'].'">'.$item['title'].'</a></li>';
}
if ($rs['items_count'] <= 0) { echo "<li>Sorry, no items found in the RSS file :-(</li>"; }
echo "</ul>\n";
}
}
// ===
// include lastRSS
include "lastRSS.php";
// List of RSS URLs
$rss_left = array(
'http://www.rte.ie/rss/gaa.xml',
);
$rss_right = array(
'http://www.independent.ie/sport/hurling/rss'
);
// Create lastRSS object
$rss = new lastRSS;
// Set cache dir, cache interval and character encoding
$rss->cache_dir = 'cache';
$rss->cache_time = 14000; // (4hrs)
$rss->cp = '';
$rss->items_limit = 5;
// Show all rss files
echo '<table class="rss_section" cellpadding="5" border="0"><tr><td width="50%" valign="top">';
foreach ($rss_left as $url) ShowOneRSS($url);
echo '</td><td width="50%" valign="top">';
?>
</div>
</div>
........
........
No marquee container. All texts below are pushed to the right leaving half page empty.


How to get my own marquee displayed under the topic "Commone Test"? Now it is on top of the title. Thanks


B.R.
satimis
Reply With Quote