![]() |
|
|||
|
arkadaşlar böyle bir java script kodu var ve bunu şu şekilde kullanmak istiyorum. haber siteme eklenen son 10 haberi buradaki newslist olan bölümlere veriyi ve linki cekmek istiyorum.
Kod:
<!-- Begin
// news ticker function
var newslist=new Array();
var cnt=0; // current news item
var curr = "";
var i=-1; // current letter being typed
newslist[0]=new Array("Check out the share check javascript","t_sharecheck.html")
newslist[1]=new Array("Use this javascript to create your own fruit machine","t_fruity.html")
newslist[2]=new Array("Create a To Do list with this script","t_todolist.html")
newslist[3]=new Array("Use this script to register users on your site","t_register.html")
newslist[4]=new Array("This script tells your users the last time they visited your site","t_greetings.html")
function newsticker()
{
// next character of current item
if (i < newslist[cnt][0].length - 1)
{
i++;
temp1 = newslist[cnt][0];
temp1 = temp1.split('');
curr = curr+temp1[i];
temp2 = newslist[cnt][1];
mtxt.innerHTML = "<small><a href='"+temp2+"'><font color='#ff0000'>"+curr+"_</small></font></a>";
setTimeout('newsticker()',10)
return;
}
// new item
i = -1; curr = "";
if (cnt<newslist.length-1)
cnt++;
else
cnt=0;
setTimeout('newsticker()',3000)
}
// End -->
Kod:
<?php
$sorgux = mysql_query("SELECT * FROM haberler ORDER BY haberno DESC LIMIT 10");
$saybak = mysql_num_rows($sorgux);
while ($liste = mysql_fetch_array($sorgux)) {
$haberno = $liste["haberno"];
$hbaslik = $liste["hbaslik"];
$hresim = $liste["hresim"];
$htarih = $liste["htarih"];
$hzaman = $liste["hzaman"];
$hmetin = $liste["hmetin"];
$resim = $liste["resim"];
;
echo '<span class="migg">'.$hzaman.' - </span></font><a href="'.SITE_ADRESI.'/?sayfa=haberoku&haberno='.$haberno.'" target="_blank" class="linkx">'.$hbaslik.'</a><br />';
$satir++;
}
mysql_free_result($sorgux);
unset($sorgux,$hresim,$resim,$saybak);
?>
__________________
Amasya "sabır, emek, bekleyiş" |
|
||||
|
dizinine attım içinde açıklaması mevcut.
http://www.corum.gen.tr/scrollers.php
__________________
mail selim61[at]gmail.com |
![]() |
| Seçenekler | |
| Stil | |
|
|
Benzer Konular
|
||||
| Konu | Konuyu Başlatan | Forum | Cevaplar | Son Mesaj |
| acil yardım! | NeFuSa | PHP | 2 | 2007-04-12 11:38 |
| Acil Yardım | [KaDeSign] | Webmaster Genel Konular | 0 | 2005-03-27 08:00 |
| Acil Yardım : Paypal Acil | malatyasporlu | Paypal E-Gold | 15 | 2004-12-23 14:24 |
| Acil Acil Acil Yardım ! | malatyasporlu | Webmaster Genel Konular | 19 | 2004-11-19 20:20 |
| acil yardım | riseofthemachines | Webmaster Genel Konular | 0 | 2003-02-16 00:12 |