<?php $sql_result = $db->query( "SELECT id, title, date, alt_name, category, short_story, flag FROM " . PREFIX . "_post WHERE approve='1' ORDER BY rating DESC LIMIT 0,10" );while ( $row = $db->get_row()){$row['date'] = strtotime( $row['date'] );$row['category'] = intval( $row['category'] );if( $config['allow_alt_url'] == "yes"){if( $row['flag'] and $config['seo_type']){if( $row['category'] and $config['seo_type'] == 2 ){$full_link = $config['http_home_url'] . get_url( $row['category'] ) . "/" . $row['id'] . "-" . $row['alt_name'] . ".html";}else{$full_link = $config['http_home_url'] . $row['id'] . "-" . $row['alt_name'] . ".html";}}else{$full_link = $config['http_home_url'] . date( 'Y/m/d/', $row['date'] ) . $row['alt_name'] . ".html";}}else{$full_link = $config['http_home_url'] . "index.php?newsid=" . $row['id'];}$title = substr( $row['title'], 0, 30 ) . "...";$short_story = substr( strip_tags($row['short_story']), 0, 30 )."...";
$shortnews = $row['short_story'];
preg_match_all( '#<img[^>]*\\ssrc=(\'|")(.*?)\\1.*?>#i',$shortnews,$total);
echo('<dl><dt><a href="'.$full_link.'"><span>');
foreach( $total[2] as $image ) {
echo('<img src="'.$image.'"');
list($width, $height)=getimagesize($image);
$size=25;
if($width>$height) {
echo(' height="'.$size.'" />');
}
if($height>$width) {
echo(' width="'.$size.'" />');
}
if($height==$width) {
echo(' height="'.$size.'" width="'.$size.'" />');
}
}echo('</span></a></dt><dd><a href="'.$full_link.'" class="toplink">'.$title.'</a><p><a href="'.$full_link.'">'.$short_story.'</a></p></dd></dl>')
;}
// 3.0
?>