Log in

View Full Version : Content Slider & retrieve data from mysql



ajloun
02-13-2010, 05:37 AM
Hello and Warm Regards ..

A FreshMan here . Hola

I use this Script
http://dynamicdrive.com/dynamicindex...tentslider.htm

to Make Content Slider , with My smarty Template .. this Script works for Manual Insert the Content .. but I need to use it to retrieve data from mysql ... I have tried to do it my self but it only brings the Data from the Mysql to the Content Box .. it dose not loop to make Next Page for Each result ..i do not want all results in one Page .. No sense to use the Slider HUH..

this wht i have in my Smarty Template..


<html>
<head>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<link rel="stylesheet" type="text/css" href="<{$url}>/images/contentslider.css" />
<script type="text/javascript" src="<{$url}>/images/contentslider.js">
/***********************************************
* Featured Content Slider- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/
</script>
</head>
<body>
<div id="slider1" class="sliderwrapper">
<div class="contentdiv">

<{foreach name="list" from=$news item="lastnews"}>
<img src="<{$url}>/images/shots/<{$shot}>">
<p class="even"><{$description}></p>
<{/foreach}>
</div>

</div>
<div id="paginate-slider1" class="pagination">
</div>
<script type="text/javascript">
featuredcontentslider.init({
id: "slider1", //id of main slider DIV
contentsource: ["inline", ""], //Valid values: ["inline", ""] or ["ajax", "path_to_file"]
toc: "#increment", //Valid values: "#increment", "markup", ["label1", "label2", etc]
nextprev: ["Previous", "Next"], //labels for "prev" and "next" links. Set to "" to hide.
revealtype: "click", //Behavior of pagination links to reveal the slides: "click" or "mouseover"
enablefade: [true, 0.2], //[true/false, fadedegree]
autorotate: [true, 3000], //[true/false, pausetime]
onChange: function(previndex, curindex){ //event handler fired whenever script changes slide
//previndex holds index of last slide viewed b4 current (1=1st slide, 2nd=2nd etc)
//curindex holds index of currently shown slide (1=1st slide, 2nd=2nd etc)
}
})

</script>
</body>
</html>

ajloun
02-16-2010, 12:04 AM
Bomb!