Exemplo n.º 1
0
<?php

defined('IN_DESTOON') or exit('Access Denied');
$TYPE = get_type('announce', 1);
require MD_ROOT . '/announce.class.php';
$do = new announce();
$menus = array(array('添加公告', '?moduleid=' . $moduleid . '&file=' . $file . '&action=add'), array('公告列表', '?moduleid=' . $moduleid . '&file=' . $file), array('更新地址', '?moduleid=' . $moduleid . '&file=' . $file . '&action=update'), array('生成网页', '?moduleid=' . $moduleid . '&file=' . $file . '&action=html'), array('公告分类', 'javascript:Dwidget(\'?file=type&item=' . $file . '\', \'公告分类\');'), array('模块设置', '?moduleid=' . $moduleid . '&file=setting#' . $file));
if ($_catids || $_areaids) {
    require DT_ROOT . '/admin/admin_check.inc.php';
}
switch ($action) {
    case 'add':
        if ($submit) {
            if ($do->pass($post)) {
                $do->add($post);
                dmsg('添加成功', '?moduleid=' . $moduleid . '&file=' . $file . '&action=' . $action . '&typeid=' . $post['typeid']);
            } else {
                msg($do->errmsg);
            }
        } else {
            foreach ($do->fields as $v) {
                isset(${$v}) or ${$v} = '';
            }
            $addtime = timetodate($DT_TIME);
            $menuid = 0;
            include tpl('announce_edit', $module);
        }
        break;
    case 'edit':
        $itemid or msg();
        $do->itemid = $itemid;
Exemplo n.º 2
0
<?php

defined('IN_DESTOON') or exit('Access Denied');
require DT_ROOT . '/module/' . $module . '/common.inc.php';
$MOD['announce_enable'] or dheader(DT_PATH);
$TYPE = get_type('announce', 1);
require MD_ROOT . '/announce.class.php';
$do = new announce();
$typeid = isset($typeid) ? intval($typeid) : 0;
if ($itemid) {
    $do->itemid = $itemid;
    $item = $do->get_one();
    $item or dheader(DT_PATH);
    extract($item);
    $adddate = timetodate($addtime, 3);
    $fromdate = $fromtime ? timetodate($fromtime, 3) : $L['timeless'];
    $todate = $totime ? timetodate($totime, 3) : $L['timeless'];
    $db->query("UPDATE {$DT_PRE}announce SET hits=hits+1 WHERE itemid={$itemid}");
    $head_title = $head_keywords = $head_description = $title . $DT['seo_delimiter'] . $L['announce_title'];
    $template = $item['template'] ? $item['template'] : 'announce';
    include template($template, $module);
} else {
    $head_title = $head_keywords = $head_description = $L['announce_title'];
    $condition = '1';
    if ($typeid) {
        $condition .= " AND typeid={$typeid}";
    }
    if ($keyword) {
        $condition .= " AND title LIKE '%{$keyword}%'";
    }
    if ($cityid) {