示例#1
0
function module_article_list()
{
    global $smarty;
    $obj = new cat_art();
    $obj->set_where('cat_best = 1');
    $best_cat = $obj->get_list();
    $art_list = array();
    if (count($best_cat) > 0) {
        $smarty->assign('show_all_art', 0);
        $list_len = get_varia('index_art_list_len');
        for ($i = 0; $i < count($best_cat); $i++) {
            $cat_id = $best_cat[$i]['cat_id'];
            $best_cat[$i]['channel'] = get_data('channel', $best_cat[$i]['cat_channel_id'], 'cha_code');
            $family = implode(',', get_cat_family('cat_art', $cat_id));
            $obj = new article();
            $obj->set_field('art_id,art_title,art_add_time');
            $obj->set_where("art_cat_id in ({$family})");
            $obj->set_page_size($list_len ? $list_len : 5);
            $list = $obj->get_list();
            for ($j = 0; $j < count($list); $j++) {
                $list[$j]['short_title'] = cut_str($list[$j]['art_title'], 22);
            }
            $art_list[$cat_id] = $list;
            unset($obj);
        }
        $smarty->assign('best_art_cat', $best_cat);
        $smarty->assign('art_list', $art_list);
    } else {
        $smarty->assign('show_all_art', 1);
    }
}
示例#2
0
function module_new_article()
{
    global $smarty;
    $obj = new article();
    $obj->set_field('art_id,art_channel_id,art_title,art_add_time');
    $obj->set_page_size(10);
    $list = $obj->get_list();
    for ($i = 0; $i < count($list); $i++) {
        $list[$i]['channel'] = get_data('channel', $list[$i]['art_channel_id'], 'cha_code');
        $list[$i]['short_title'] = cut_str($list[$i]['art_title'], 16);
    }
    $smarty->assign('new_article', $list);
}
示例#3
0
            if (!$item || $item['username'] != $_username) {
                message();
            }
            $do->recycle($itemid);
        }
        dmsg($L['success_delete'], $forward);
        break;
    default:
        $status = isset($status) ? intval($status) : 3;
        in_array($status, array(1, 2, 3)) or $status = 3;
        $condition = "username='******'";
        $condition .= " AND status={$status}";
        if ($keyword) {
            $condition .= " AND keyword LIKE '%{$keyword}%'";
        }
        if ($catid) {
            $condition .= $CAT['child'] ? " AND catid IN (" . $CAT['arrchildid'] . ")" : " AND catid={$catid}";
        }
        $timetype = strpos($MOD['order'], 'edit') === false ? 'add' : '';
        $lists = $do->get_list($condition, $MOD['order']);
        break;
}
$head_title = lang($L['module_manage'], array($MOD['name']));
if ($_userid) {
    $nums = array();
    for ($i = 1; $i < 4; $i++) {
        $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE username='******' AND status={$i}");
        $nums[$i] = $r['num'];
    }
}
include template($MOD['template_my'] ? $MOD['template_my'] : 'my_' . $module, 'member');
示例#4
0
     $itemid or msg('请选择' . $MOD['name']);
     $do->restore($itemid);
     dmsg('还原成功', $forward);
     break;
 case 'clear':
     $do->clear();
     dmsg('清空成功', $forward);
     break;
 case 'level':
     $itemid or msg('请选择' . $MOD['name']);
     $level = intval($level);
     $do->level($itemid, $level);
     dmsg('级别设置成功', $forward);
     break;
 case 'recycle':
     $lists = $do->get_list('status=0' . $condition, $dorder[$order]);
     $menuid = 4;
     include tpl('index', $module);
     break;
 case 'reject':
     if ($itemid && !$psize) {
         $do->reject($itemid);
         dmsg('拒绝成功', $forward);
     } else {
         $lists = $do->get_list('status=1' . $condition, $dorder[$order]);
         $menuid = 3;
         include tpl('index', $module);
     }
     break;
 case 'check':
     if ($itemid && !$psize) {