View Single Post
  #1  
Old 01-11-2009, 05:01 PM
 
ladybird ladybird is offline
 

Advanced Member
  
Join Date: Sep 2008
Posts: 93
 

Unhappy Rotate news items in vertical right menu

Hi Everyone,

I am trying to figure out how to get the news items which appear in the vertical right menu of x-cart to rotate.

I have searched the form and found a couple possible starting points, and I have searched the web looking at banner rotators. Before I start messing with the templates which is my next course of action I thought I would ask

1) has anyone successfully done what I am trying to do
2) if you have would you be able to share the process steps for doing it.

My intention is to have a short paragraph rotate every 5 - 10 seconds or so which highlights a different news story.

I found this rotating array script:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Rotating Quotes</title>

<style type="text/css">
/*<![CDATA[*/

body {
background-color:#aaaaaa;
}
#quotes {
position:absolute;
left:50%;
top:50%;
margin:-50px 0 0 -81px;
padding:20px;
font-family:arial;
font-size:16px;
color:#000000;
width:162px;
height:100px;
border:solid 1px #000000;
background-color:#ffffff;
text-align:center;
}

/*//]]>*/
</style>

<script type="text/javascript">
//<![CDATA[
var quote=new Array();
quote[0]='This is quote number one'; /* add as many quotes as you like!*/
quote[1]='This is quote number two';
quote[2]='This is quote number three';
quote[3]='This is quote number four';
quote[4]='This is quote number five';
quote[5]='This is quote number six';
quote[6]='This is quote number seven';
quote[7]='This is quote number eight';
quote[8]='This is quote number nine';
quote[9]='This is quote number ten';


var speed=2000; /*this is the time in milliseconds adjust to suit*/
var q=0;

function showQuote() {

document.getElementById("quotes").innerHTML=quote[q];
q++;
if(q==quote.length) {
q=0;
}
}
setInterval('showQuote()',speed);

//]]>
</script>

</head>
<body>

<div id="quotes"></div>

</body>
</html>

but is there a way to have the section in green simply select and read the last say 5 news items from the archive?

L
__________________
x-cart gold 4.1.9
x-cart gold 4.1.5
www.makeuwell.com.au
www.amberbebe.com
Sydney Australia
Reply With Quote