Ok zrobilem to na poczatku nie dzialalo ale po malym zabiegu dziala. Wiec dla kogos komu sie przyda:
Dobry kod do tego to:
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fu...
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location:../../index.php"); exit; }
openside($locale['023']);
$result = dbquery(
"SELECT ta.*,tac.* FROM ".$db_prefix."articles ta
INNER JOIN ".$db_prefix."article_cats tac ON ta.article_cat=tac.article_cat_id
WHERE ".groupaccess('article_cat_access')." ORDER BY article_datestamp DESC LIMIT 0,5"
);
if (dbrows($result) != 0) {
while($data = dbarray($result)) {
$itemsubject = trimlink($data['article_subject'], 23);
$czas = $data['article_datestamp'];
if($czas+259200 <= time()) {
$class = "side";
} elseif($czas+259200 > time()) {
$class = "artykul";
}
echo "<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."readarticle.php?article_id=".$data['article_id']."' title='".$data['article_subject']."' class='".$class."'>$itemsubject</a><br>\n";
}
} else {
echo "<center>".$locale['004']."</center>\n";
}
closeside();
?>
w cssie thema dopisac:
a.artykul {color:#twojkolor; text-decoration:none;}
Niebede zakladal nowego tematu wiec:
Chcialbym prosic o pomoc w takiej samej sprawie z tym ze do panelu z ostatnimi topicami forum
panel nazywa sie forum_ticker_panel i wyglada tak:
potrzebna mi pomoc w nastepujacej rzeczy:
-Gdy topic zostanie utworzony kolorowy ma byc 2 dni
-jezeli napisany jest nowy post koloruje sie na 24 godziny
Dolaczam kod:
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------+
+----------------------------------------------------+
| Forum Ticker by Divine JazOOn
| based on:
| News Ticker Script by Matonor
| Infusion Code by MrX2003
| v 1.02 fix by Matonor
+---------------------------------------------------*/
@opentable("Ostatnie tematy na forum");
//settings
//0 = no, 1= yes
//show author?
$ticker_author = "0";
//show date?
$ticker_date = "0";
//show commentcount?
$ticker_comments = "1";
//show readcounts?
$ticker_reads = "0";
//the higher the value the slower, default is 100
$ticker_speed = "100";
//ticker width? (use either % or px values)
$ticker_width = "100%";
$tickerquery = $result = dbquery(
"SELECT tf.*, tt.*, tu.user_id,user_name FROM ".$db_prefix."forums tf
INNER JOIN ".$db_prefix."threads tt USING(forum_id)
INNER JOIN ".$db_prefix."users tu ON tt.thread_lastuser=tu.user_id
WHERE ".groupaccess('forum_access')." ORDER BY thread_lastpost DESC LIMIT 0,".$settings['numofthreads']
);
$ticker_content = "<marquee Behavior='scroll' Direction='left' ScrollDelay='".$ticker_speed."' width='".$ticker_width."' onmouseover='this.stop()' onmouseout='this.start()'>";
while($data = dbarray($tickerquery)) {
$data2 = dbarray(dbquery("SELECT post_id FROM ".$db_prefix."posts WHERE thread_id='".$data['thread_id']."' ORDER BY post_id DESC LIMIT 1"));
$ticker_content .= "<span style='font-weight:bold;'><a href='".FORUM."viewthread.php?".$rstart."forum_id=".$data['forum_id']."&thread_id=".$data['thread_id']."#post_".$data2['post_id']."' title='".$data['thread_subject']."'>".trimlink($data['thread_subject'], 30)."</a></span> ";
if($ticker_author+$ticker_date+$ticker_comments+$ticker_reads != "0" ) {
$ticker_content .= "[";
$reply_count = dbcount("(thread_id)", "posts", "thread_id='".$data['thread_id']."'");
$data2 = dbarray(dbquery("SELECT post_id FROM ".$db_prefix."posts WHERE thread_id='".$data['thread_id']."' ORDER BY post_id DESC LIMIT 1"));
$rstart = ($reply_count > 20 ? "rowstart=".((ceil($reply_count / 20)-1)*20)."&" : "");
if($ticker_comments == "1") {
$ticker_content .= ($reply_count - 1). " " .$locale['033'];
if($ticker_reads != "0"){
$ticker_content .= " | ";
}
}
if($ticker_reads == "1") {
$ticker_content .= $data['thread_views'] .$locale['044'];
$ticker_content .= " | ";
}
if($ticker_author == "1") {
$ticker_content .= $locale['034']. " dodał <b><a href='".BASEDIR."profile.php?lookup=".$data['thread_lastuser']."'>".$data['user_name']."</a></b>";
if($ticker_date+$ticker_comments+$ticker_reads != "0"){
$ticker_content .= " | ";
}
}
if($ticker_date == "1") {
$ticker_content .= showdate("shortdate", $data['thread_lastpost']);
if($ticker_comments+$ticker_reads != "0"){
}
}
$ticker_content .= "]";
}
$ticker_content .= " | ";
}
$ticker_content .= "</marquee>";
echo $ticker_content;
@closetable();
?>
Edytowane przez black_raven dnia 02.03.2008 17:30:07
|