Hi Also ich bekomme das script nicht gebacken,vielleicht könnt ihr weiterhelfen und den schnipsel korigieren ist nur diese eine Seite zu machen,habe mich mal versucht aber die Datenbank abfrage und so naja .
Code: <?php include_once('../../mainfile.php');
global $db, $xoopsConfig;
if ( $xoopsConfig['startpage'] == "rgn-news" ) { $xoopsOption['show_rblock'] =1; include(XOOPS_ROOT_PATH."/header.php"); if ($News=="Y") { make_cblock(); echo "<br />"; } } else { $xoopsOption['show_rblock'] =0; include(XOOPS_ROOT_PATH."/header.php"); } #################################################################### # options # ####################################################################
### options link # ac = windows (news,box,title,scroll,ticker) # ac2 = number news # ac3 = topic
### General
$easy_name_rep = "rgn-news"; $tb_stories = $prefix."_stories"; $tb_topics = $prefix."_topics";
### box $easy_color_top_box = "CACACA"; $easy_color_body_box = "FFFFFF"; $easy_color_border_box = "000000"; $easy_color_topic_box = "FF0000"; $easy_color_title_box = "000000"; $easy_color_date_box = "FF0000"; $easy_color_sitename_box = "000000"; $easy_widht_box = 500; $easy_num_news_box = 5; # 5 news if ac2=0 $easy_topic_box = 0; # 0 all topics if ac3=0 $easy_gif_box ="rgn-news_75x20.gif"; # 75*20 (u can replace whith your logo)
### News $easy_color_top_news = "CACACA"; $easy_color_body_news = "FFFFFF"; $easy_color_border_news = "000000"; $easy_color_foot_news = "CACACA"; $easy_color_topic_news = "FF0000"; $easy_color_date_news = "FF0000"; $easy_color_sitename_news = "000000"; $easy_widht_news = 150; $easy_num_news_news = 5; # 5 news if ac2=0 $easy_topic_news = 0; # 0 all topics if ac3=0 $easy_gif_news ="rgn-news_mini.gif"; # 150*20 (u can replace whith your logo)
### Title $easy_color_top_title = "CACACA"; $easy_color_body_title = "FFFFFF"; $easy_color_border_title = "000000"; $easy_color_foot_title = "CACACA"; $easy_color_topic_title = "FF0000"; $easy_color_date_title = "FF0000"; $easy_color_sitename_title = "000000"; $easy_widht_title = 150; $easy_num_news_title = 5; # 5 news if ac2=0 $easy_topic_title = 0; # 0 all topics if ac3=0 $easy_gif_title = "rgn-news_mini.gif"; # 150*20 (u can replace whith your logo)
### Scroller $easy_color_top_scroll = "CACACA"; $easy_color_body_scroll = "FFFFFF"; $easy_color_border_scroll = "000000"; $easy_color_foot_scroll = "000000"; $easy_color_topic_scroll = "FF0000"; $easy_color_date_scroll = "FF0000"; $easy_color_sitename_scroll = "000000"; $easy_widht_scroll = 150; $easy_height_scroll = 150; $easy_num_news_scroll = 5; # 5 news if ac2=0 $easy_topic_scroll = 0; # 0 all topics if ac3=0 $easy_gif_scroll = "rgn-news_big.gif"; # 150*150 (u can replace whith your logo)
### Ticker $easy_color_body_ticker = "50000000"; $easy_widht_ticker = 300; $easy_num_news_ticker = 5; # 5 news if ac2=0 $easy_topic_ticker = 0; # 0 all topics if ac3=0 $easy_gif_ticker = "rgn-news_52x20.gif"; # 52*20 (u can replace whith your logo)
####################################################################
$supcri="";// si topic $easymod = "op=modload&name=$easy_name_rep&file=index";
function easy_jscript($jslo) { echo sprintf ("%s%s%s", "document.write('",$jslo,"');")."n"; }
function easy_clean($hometext,$lg) { $hometext = ereg_replace("<[^>]*>", "", $hometext); $hometext = ereg_replace(13, " ", $hometext); $hometext = ereg_replace(10, " ", $hometext); $hometext = substr($hometext,0,$lg); $hometext = chop(ereg_replace("'", "'",$hometext)); $hometext.=" ..."; return($hometext); }
function easy_modhtml() { global $easy_name_rep,$easymod,$db,$tb_topics; ## Insert in easy_html.php your html code to present headlines partnership ## $linknewsbox = XOOPS_ROOT_PATH."/modules.php?".$easymod."&ac=news&ac2=&ac3="; $linkboxbox = XOOPS_ROOT_PATH."/modules.php?".$easymod."&ac=box&ac2=&ac3="; $linktitlebox = XOOPS_ROOT_PATH."/modules.php?".$easymod."&ac=title&ac2=&ac3="; $linkscroller = XOOPS_ROOT_PATH."/modules.php?".$easymod."&ac=scroller&ac2=&ac3="; $linktickerbox = XOOPS_ROOT_PATH."/modules.php?".$easymod."&ac=ticker&ac2=&ac3="; $easyurl = XOOPS_ROOT_PATH."/modules.php?".$easymod."&ac=";
$easytopic=""; $result= mysql_db_query($db,"select topic_id,topic_title from $tb_topics"); while(list($topic_id,$topic_title)= mysql_fetch_row($result)) { $easytopic.="<OPTION VALUE="$topic_id"> $topic_titlen"; } include("modules/$easy_name_rep/easy_html.php"); }
function easy_make_date($time) { ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $time, $day); $date = $day[3].'/'.$day[2].'/'.$day[1]; return($date); }
switch($ac) {
case news : if ($ac3!=0) { $supcri="and $tb_stories.topic=".$ac3; }else{ if ($easy_topic_box == 0) { $supcri=""; }else{ $supcri="and $tb_stories.topic=".$easy_topic_news; } } if ($ac2==0){$ac2=$easy_num_news_news;} $easy_widht_news-=4; easy_jscript("<TABLE WIDTH=".$easy_widht_news." BORDER=1 CELLSPACING=0 cellpadding=2 bordercolor=".$easy_color_border_news.">"); easy_jscript("<TR><TD BGCOLOR=".$easy_color_top_news." bordercolor=".$easy_color_top_news."><FONT FACE=Verdana SIZE=2 COLOR=".$easy_color_sitename_news."><B>$sitename</B></FONT></TD></TR>"); easy_jscript("<TR><TD bgcolor=".$easy_color_body_news." bordercolor=".$easy_color_body_news.">"); $result = mysql_db_query($db,"SELECT $tb_stories.sid, $tb_stories.title, $tb_stories.time, $tb_stories.hometext, $tb_topics.topicname FROM $tb_stories,$tb_topics where $tb_topics.topicid=$tb_stories.topic $supcri ORDER BY $tb_stories.sid DESC limit $ac2"); while(list($sid,$title,$time,$hometext,$topicname) = mysql_fetch_row($result)) { $title= chop(ereg_replace("'", "'",$title)); $text=easy_clean($hometext,100); $topicname= ucfirst(chop(ereg_replace("'", "'",$topicname))); $date_news=easy_make_date($time); easy_jscript("<font FACE=Verdana size="1" color="".$easy_color_topic_news.""><b>".$topicname."</b> :</font>"); easy_jscript("<font FACE=Verdana size="1" color="".$easy_color_date_news."">".$date_news."</font>"); easy_jscript("<br><a href="".XOOPS_URL."/article.php?sid=".$sid."" target="_blank"><font size=1 face=Verdana ><b>".$text."</b></font></a><br><br>"); } easy_jscript("</td></tr><tr><td BGCOLOR=".$easy_color_foot_news." bordercolor=".$easy_color_foot_news.">"); easy_jscript("<center><b><a href=".XOOPS_URL."/modules.php?".$easymod."&ac=add" target=_blank><img src="./modules/'".$easy_name_rep."/".$easy_gif_news."" border==0></a></center>"); easy_jscript("</FONT></td></tr></table>"); break;
case box : if ($ac3!=0) { $supcri="and $tb_stories.topic=".$ac3; }else{ if ($easy_topic_box == 0) { $supcri=""; }else{ $supcri="and $tb_stories.topic=".$easy_topic_box; } } if ($ac2==0){$ac2=$easy_num_news_box;} easy_jscript("<TABLE WIDTH=".$easy_widht_box." BORDER=0 CELLSPACING=0 cellpadding=0 ><TR>"); easy_jscript("<td><a href=".XOOPS_URL."/modules.php?".$easymod."&ac=add" target=_blank><img src="./modules/".$easy_name_rep."/".$easy_gif_box."" border=0></a></td>"); easy_jscript("<TD width=100% BGCOLOR=".$easy_color_top_box."><FONT FACE=Verdana SIZE=2 COLOR=".$easy_color_sitename_box."><B>".$sitename."</B></FONT></TD></TR>"); easy_jscript("<TR><TD colspan=2>"); easy_jscript("<table WIDTH=100% BORDER=1 CELLSPACING=1 cellpadding=3 bgcolor=".$easy_color_body_box." bordercolor=".$easy_color_border_box.">"); easy_jscript("<TR><TD bgcolor=".$easy_color_body_box." bordercolor=".$easy_color_body_box.">"); $result = mysql_db_query($db,"SELECT $tb_stories.sid, $tb_stories.title, $tb_stories.time, $tb_stories.hometext, $tb_topics.topicname FROM $tb_stories,$tb_topics where $tb_topics.topicid=$tb_stories.topic $supcri ORDER BY $tb_stories.sid DESC limit $ac2"); while(list($sid,$title,$time,$hometext,$topicname) = mysql_fetch_row($result)) { $title= ucfirst(chop(ereg_replace("'", "'",$title))); $text=easy_clean($hometext,300); $topicname= ucfirst(chop(ereg_replace("'", "'",$topicname))); $date_news=easy_make_date($time); easy_jscript("<font FACE=Verdana size="2" color="".$easy_color_topic_box.""><b>".$topicname."</b> :</font>"); easy_jscript("<font FACE=Verdana size="1" color="".$easy_color_date_box."">".$date_news."</font>"); easy_jscript("<br><font FACE=Verdana size="2" color="".$easy_color_title_box.""><b>".$title."</b></font><br>"); easy_jscript("<a href="".XOOPS_URL."/article.php?sid=".$sid."" target="_blank"><font size=1 face=Verdana ><b>".$text."</b></font></a></font><br><br>"); } easy_jscript("</td></tr></table>"); easy_jscript("</td></tr></table>"); break; case title : if ($ac3!=0) { $supcri="and $tb_stories.topic=".$ac3; }else{ if ($easy_topic_title == 0) { $supcri=""; }else{ $supcri="and $tb_stories.topic=".$easy_topic_title; } } if ($ac2==0){$ac2=$easy_num_news_title;} $easy_widht_title-=4; easy_jscript("<TABLE WIDTH=".$easy_widht_title." BORDER=1 CELLSPACING=0 cellpadding=2 bordercolor=".$easy_color_border_title.">"); easy_jscript("<TR><TD BGCOLOR=".$easy_color_top_title." bordercolor=".$easy_color_top_title."><FONT FACE=Verdana SIZE=2 COLOR=".$easy_color_sitename_title."><B>$sitename</B></FONT></TD></TR>"); easy_jscript("<TR><TD bgcolor=".$easy_color_body_title." bordercolor=".$easy_color_body_title.">"); $result = mysql_db_query($db,"SELECT $tb_stories.sid, $tb_stories.title, $tb_stories.time, $tb_stories.hometext, $tb_topics.topicname FROM $tb_stories,$tb_topics where $tb_topics.topicid=$tb_stories.topic $supcri ORDER BY $tb_stories.sid DESC limit $ac2"); while(list($sid,$title,$time,$hometext,$topicname) = mysql_fetch_row($result)) { $title= chop(ereg_replace("'", "'",$title)); $topicname= ucfirst(chop(ereg_replace("'", "'",$topicname))); $date_news=easy_make_date($time); easy_jscript("<font FACE=Verdana size="1" color="".$easy_color_topic_title.""><b>".$topicname."</b> :</font>"); easy_jscript("<font FACE=Verdana size="1" color="".$easy_color_date_title."">".$date_news."</font>"); easy_jscript("<br><a href="".XOOPS_URL."/article.php?sid=".$sid."" target="_blank"><font size=1 face=Verdana ><b>".$title."</b></font></a><br><br>"); } easy_jscript("</td></tr><tr><td BGCOLOR=".$easy_color_foot_title." bordercolor=".$easy_color_foot_title.">"); easy_jscript("<center><b><a href=".XOOPS_URL."/modules.php?".$easymod."&ac=add" target=_blank><img src="./modules/".$easy_name_rep."/".$easy_gif_title."" border==0></a></center>"); easy_jscript("</FONT></td></tr></table>"); break; case scroller: if ($ac3!=0) { $supcri="and $tb_stories.topic=".$ac3; }else{ if ($easy_topic_scroll == 0) { $supcri=""; }else{ $supcri="and $tb_stories.topic=".$easy_topic_scroll; } } if ($ac2==0){$ac2=$easy_num_news_scroll;} if ($ac2<2){$ac2=2;} easy_jscript("<TABLE WIDTH=".$easy_widht_scroll." BORDER=1 CELLSPACING=0 cellpadding=2 bordercolor=".$easy_color_border_scroll.">"); easy_jscript("<TR><TD BGCOLOR=".$easy_color_top_scroll." bordercolor=".$easy_color_top_scroll."><FONT FACE=Verdana SIZE=2 COLOR=".$easy_color_sitename_scroll."><B>$sitename</B></FONT></TD></TR>"); easy_jscript("<TR><TD bgcolor=".$easy_color_body_scroll." bordercolor=".$easy_color_body_scroll.">"); echo "var scrollerwidth=$easy_widht_scrolln"; echo "var scrollerheight=$easy_height_scrolln"; echo "var scrollerbgcolor='$easy_color_body_scroll'n"; echo "var messages=new Array();n"; $z=0; $result = mysql_db_query($db,"SELECT $tb_stories.sid, $tb_stories.title, $tb_stories.time, $tb_stories.hometext, $tb_topics.topicname FROM $tb_stories,$tb_topics where $tb_topics.topicid=$tb_stories.topic $supcri ORDER BY $tb_stories.sid DESC limit $ac2"); while(list($sid,$title,$time,$hometext,$topicname) = mysql_fetch_row($result)) { $title= chop(ereg_replace("'", "'",$title)); $text=easy_clean($hometext,200); $topicname= ucfirst(chop(ereg_replace("'", "'",$topicname))); $date_news=easy_make_date($time); echo "messages[".$z."]='<font FACE=Verdana size="1" color="".$easy_color_topic_scroll.""><b>".$topicname."</b> :</font><font FACE=Verdana size="1" color="".$easy_color_date_scroll."">".$date_news."</font><br><a href="".XOOPS_URL."/article.php?sid=".$sid."" target="_blank"><font face=vedana size=1><b>$text</b></font></a>';n"; $z++; } echo "messages[".$z."]='<center><a href=".XOOPS_URL."/modules.php?".$easymod."&ac=add" target=_blank><img src="./modules/".$easy_name_rep."/".$easy_gif_scroll."" border=0></a></center>';n"; include("modules/".$easy_name_rep."/easynews2k.js"); easy_jscript("</td></tr></table>"); break;
case ticker: if ($ac3!=0) { $supcri="and $tb_stories.topic=".$ac3; }else{ if ($easy_topic_ticker == 0) { $supcri=""; }else{ $supcri="and $tb_stories.topic=".$easy_topic_ticker; } } if ($ac2==0){$ac2=$easy_num_news_ticker;} easy_jscript("<TABLE WIDTH=".$easy_widht_ticker." BORDER=0 CELLSPACING=0 cellpadding=0 >"); easy_jscript("<TR><TD><a href=".XOOPS_URL."/modules.php?".$easymod."&ac=add" target=_blank><img src="./modules/".$easy_name_rep."/".$easy_gif_ticker."" border==0></a></TD>"); easy_jscript("<TD WIDTH=100%>"); $linkclass=XOOPS_URL."/modules/".$easy_name_rep."/"; $widhtclass=$easy_widht_ticker-52; easy_jscript("<applet codebase=".$linkclass." code=easynews.class width=".$widhtclass." height=20>"); easy_jscript("<param name=bgcolor value="".$easy_color_body_ticker."">"); $z=0; $result = mysql_db_query($db,"SELECT $tb_stories.sid, $tb_stories.title, $tb_stories.time, $tb_stories.hometext, $tb_topics.topicname FROM $tb_stories,$tb_topics where $tb_topics.topicid=$tb_stories.topic $supcri ORDER BY $tb_stories.sid DESC limit $ac2"); while(list($sid,$title,$time,$hometext,$topicname) = mysql_fetch_row($result)) { $title= chop(ereg_replace("'", "'",$title)); $topicname= ucfirst(chop(ereg_replace("'", "'",$topicname))); $date_news=easy_make_date($time); $linkfinal=$date_news." ".$topicname." : ".$title." § ".XOOPS_URL."/article.php?sid=".$sid." § _load"; easy_jscript("<param name=N".$z." value="".$linkfinal."">"); $z++; } easy_jscript("</applet>"); easy_jscript("</td></tr></table>"); break; case add: default: include("header.php"); OpenTable(); easy_modhtml(); CloseTable();
include(XOOPS_ROOT_PATH."/footer.php"); break; break; } ?>  |