1. فایل engine/modules/topnews.php را باز کنید و کد زیر را پیدا کنید:
$db->query( "SELECT id, title, date, alt_name, category, flag FROM " . PREFIX . "_post WHERE approve='1' AND date >= '$this_month' - INTERVAL 1 MONTH AND date < '$this_month' ORDER BY rating DESC, comm_num DESC, news_read DESC, date DESC LIMIT 0,10" );
2. کد بالا زیر را به جای کد بالا قرار بدین:
$db->query( "SELECT id, title, date, alt_name, category, short_story, flag FROM " . PREFIX . "_post WHERE approve='1' AND date >= '$this_month' - INTERVAL 1 MONTH AND date < '$this_month' ORDER BY rating DESC, comm_num DESC, news_read DESC, date DESC LIMIT 0,10" );
3. توی همین فایل کد زیر را پیدا کنید:
$topnews .= "» " . $link . "<br />";
4. به جای کد بالا کد زیر را قرار بدین:
preg_match('|<img(.*) src="([^"]*)"[^>]*>|is', $row['short_story'], $pts);
$thumba_parts = pathinfo($pts[2]);
$titla = stripslashes($row['title']);
if($pts[2]){
$pictitle = stripslashes( $row['title'] );
$pic = $thumba_parts['dirname'].'/'.$thumba_parts['basename'];
$wide = str_replace('thumbs/', "", $pic);
if(file_exists($wide)) $preview = "<a href=\"$wide\" onclick=\"return hs.expand(this)\"><img src=\"$pic\" width=\"100px\"; alt=\"$pictitle\" title=\"$pictitle\"></a>";
else $preview = "<img src=\"$pic\" width=\"100px\"; alt=\"$pictitle\" title=\"$pictitle\">";
}
else $preview = "<img style=\"border: medium none;\" src=\"{THEME}/images/nothumb.gif\" width=\"100px\" height=\"100px\">";
$row['short_story'] = preg_replace("/\[attachment=[[:digit:]]*\]/si","",stripslashes($row['short_story']));
$row['short_story'] = preg_replace("/<!--*-->/si","",$row['short_story']);
$row['short_story'] = strip_tags($row['short_story']);
if( strlen( $row['short_story'] ) > 106 ) $row['short_story'] = substr( $row['short_story'], 0,106 ) . " ... <br/><br/><a href=\"$full_link\" title=\"$titla\">متن کامل »</a>";
$topnews .= '<table width="100%" border="0" style="border-bottom: 1px dotted #E1E1E1;">
<tr>
<td width="64" height=64" align="center" valign="top">'.$preview.'</td>
<td width="91%" valign="top" style="padding-left: 7px; padding-bottom: 7px;"><strong><a href="'.$full_link.'" title="'.stripslashes( $row['title']).'">'.stripslashes( $row['title']).'</a></strong><br>
'.stripslashes($row['short_story']).'</td>
</tr>
</table><br>';
}
$thumba_parts = pathinfo($pts[2]);
$titla = stripslashes($row['title']);
if($pts[2]){
$pictitle = stripslashes( $row['title'] );
$pic = $thumba_parts['dirname'].'/'.$thumba_parts['basename'];
$wide = str_replace('thumbs/', "", $pic);
if(file_exists($wide)) $preview = "<a href=\"$wide\" onclick=\"return hs.expand(this)\"><img src=\"$pic\" width=\"100px\"; alt=\"$pictitle\" title=\"$pictitle\"></a>";
else $preview = "<img src=\"$pic\" width=\"100px\"; alt=\"$pictitle\" title=\"$pictitle\">";
}
else $preview = "<img style=\"border: medium none;\" src=\"{THEME}/images/nothumb.gif\" width=\"100px\" height=\"100px\">";
$row['short_story'] = preg_replace("/\[attachment=[[:digit:]]*\]/si","",stripslashes($row['short_story']));
$row['short_story'] = preg_replace("/<!--*-->/si","",$row['short_story']);
$row['short_story'] = strip_tags($row['short_story']);
if( strlen( $row['short_story'] ) > 106 ) $row['short_story'] = substr( $row['short_story'], 0,106 ) . " ... <br/><br/><a href=\"$full_link\" title=\"$titla\">متن کامل »</a>";
$topnews .= '<table width="100%" border="0" style="border-bottom: 1px dotted #E1E1E1;">
<tr>
<td width="64" height=64" align="center" valign="top">'.$preview.'</td>
<td width="91%" valign="top" style="padding-left: 7px; padding-bottom: 7px;"><strong><a href="'.$full_link.'" title="'.stripslashes( $row['title']).'">'.stripslashes( $row['title']).'</a></strong><br>
'.stripslashes($row['short_story']).'</td>
</tr>
</table><br>';
}
5. کد زیر رو توی همین فایل پیدا کنید:
?>
6. قبل از این کد یه } هست اونو حذف کنید !
7. با استفاده از تگ {topnews} می توانید ماژولو به نمایش در بیارین
پایان