longctht / nuke-viet

Automatically exported from code.google.com/p/nuke-viet
0 stars 0 forks source link

em bị lỗi lấy tin theo chủ đề , chỉ lấy được id 1 va 2 còn các id khaccs khong duoc , có ai giúp em với #23

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 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 . "&amp;" . NV_NAME_VARIABLE . "=news&amp;" . 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

Attachments:

GoogleCodeExporter commented 8 years ago
Đâ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