Closed GoogleCodeExporter closed 8 years ago
<?php /** * @Author Xman (admin@user.vn) * @Website http://user.vn * @Description Get rows from catid */ $catid = 4; # cat id $num = 5; # amount rows to get $striptext = 100; #cutout long text $imgwidth = 52; #image width $imgheight = 60; #image height global $global_config, $db, $lang_global, $site_mods, $module_file; $sql = "SELECT id, title, alias, hometext, homeimgalt, homeimgthumb FROM `" . NV_PREFIXLANG . "_news_" . $catid . "` WHERE homeimgfile!='' AND `status`= 1 AND `publtime` < " . NV_CURRENTTIME . " AND (`exptime`=0 OR `exptime`>" . NV_CURRENTTIME . ") ORDER BY `publtime` DESC LIMIT 0, " . $num . ""; $result = $db->sql_query ( $sql ); $content = '<ul class="listnews">'; while ( list ( $id, $title, $alias, $hometext, $homeimgalt, $homeimgthumb ) = $db->sql_fetchrow ( $result ) ) { list ( $catalias ) = $db->sql_fetchrow ( $db->sql_query ( "SELECT alias FROM `" . NV_PREFIXLANG . "_news_cat` WHERE catid=" . $catid . "" ) ); $link = NV_BASE_SITEURL . "?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=news&" . NV_OP_VARIABLE . "=" . $catalias . "/" . $alias . "-" . $id; $homeimgthumb = explode ( '|', $homeimgthumb ); $imglink = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/news/' . $homeimgthumb [0]; $hometext = strip_tags ( $hometext ); $hometext = nv_clean60 ( $hometext, $striptext ); $content .= ' <li class="clearfix" style="margin:5px"> <a title="' . $title . '" href="' . $link . '"> <img src="' . $imglink . '" alt="' . $homeimgalt . '" width="' . $imgwidth . '" height="' . $imgheight . '" style="margin-right: 5px; float: left;"></a> <a title="' . $title . '"href="'. $link . '"><strong>' . $title . '</strong></a><br />'.$hometext.'</a> </li> '; } $content .= '</ul>'; ?>
Original issue reported on code.google.com by bachphuo...@gmail.com on 5 Sep 2010 at 6:01
bachphuo...@gmail.com
Attachments:
Đây là block không thuộc hệ thống, bạn vui lòng thảo luận phần này tại diễn đàn hoặc liên hệ trực tiếp với người phát triển block đó
Original comment by vutha...@gmail.com on 23 Sep 2010 at 2:15
vutha...@gmail.com
Original issue reported on code.google.com by
bachphuo...@gmail.com
on 5 Sep 2010 at 6:01Attachments: