Dansongo, prosil mnie o cos takiego, wiec na szybko przerobilem i wstawiam.
Atriclesticker:
@opentable('Ostatnie artykuły');
//settings
//0 = no, 1= yes
//show author?
$ticker_author = "1";
//show date?
$ticker_date = "1";
//show commentcount?
$ticker_comments = "1";
//show readcounts?
$ticker_reads = "1";
//the higher the value the slower, default is 100
$ticker_speed = "100";
//ticker width? (use either % or px values)
$ticker_width = "100%";
$tickerquery = dbquery(
"SELECT ta.*,tac.*, tu.user_id,user_name, COUNT(comment_item_id) AS article_comments FROM ".$db_prefix."articles ta
LEFT JOIN ".$db_prefix."article_cats tac ON ta.article_cat=tac.article_cat_id
LEFT JOIN ".$db_prefix."users tu ON ta.article_name=tu.user_id
LEFT JOIN ".$db_prefix."comments ON comment_item_id=article_id AND comment_type='A' GROUP BY article_id ORDER BY article_datestamp DESC LIMIT 0,10"
);
$res = 0;
$ticker_content = "<marquee Behavior='scroll' Direction='left' ScrollDelay='".$ticker_speed."' width='".$ticker_width."' onmouseover='this.stop()' onmouseout='this.start()'>";
while($data = dbarray($tickerquery)) {
$itemsubject = trimlink($data['article_subject'], 23);
$ticker_content .= "<span style='font-weight:bold;'><a href='".BASEDIR."readarticle.php?article_id=".$data['article_id']."' title='".$data['article_subject']."' class='side'>$itemsubject</a></span> ";
if($ticker_author+$ticker_date+$ticker_comments+$ticker_reads != "0" ) {
$ticker_content .= "[";
if($ticker_author == "1") {
$ticker_content .= $locale['040'].$data[user_name];
if($ticker_date+$ticker_comments+$ticker_reads != "0"){
$ticker_content .= " | ";
}
}
if($ticker_date == "1") {
$ticker_content .= showdate("shortdate", $data['article_datestamp']);
if($ticker_comments+$ticker_reads != "0"){
$ticker_content .= " | ";
}
}
if($ticker_comments == "1") {
$ticker_content .= $data['article_comments'] .$locale['043'];
if($ticker_reads != "0"){
$ticker_content .= " | ";
}
}
if($ticker_reads == "1") {
$ticker_content .= $data['article_reads'] .$locale['044'];
}
$ticker_content .= "]";
}
$ticker_content .= " | ";
}
$ticker_content .= "</marquee>";
echo $ticker_content;
@closetable();
W zasadzie polowe kodu mozna wywalic, ale jak ktos chce miec tez ilosc komentow i czytan, to wystarczy, ze zmieni 0 na 1 B)
Do obejrzenia na: http://pieka.ovh.org
Edytowane przez Pieka dnia 12.12.2006 12:23:06
Jestem jaki jestem
|