Пример #1
0
<?php

defined('IN_DESTOON') or exit('Access Denied');
require MD_ROOT . '/know.class.php';
$do = new know($moduleid);
$menus = array(array('添加' . $MOD['name'], '?moduleid=' . $moduleid . '&action=add'), array($MOD['name'] . '列表', '?moduleid=' . $moduleid), array('审核' . $MOD['name'], '?moduleid=' . $moduleid . '&action=check'), array('未通过' . $MOD['name'], '?moduleid=' . $moduleid . '&action=reject'), array('回收站', '?moduleid=' . $moduleid . '&action=recycle'), array('移动分类', '?moduleid=' . $moduleid . '&action=move'));
if (in_array($action, array('add', 'edit'))) {
    $FD = cache_read('fields-' . substr($table, strlen($DT_PRE)) . '.php');
    if ($FD) {
        require DT_ROOT . '/include/fields.func.php';
    }
    isset($post_fields) or $post_fields = array();
    $CP = $MOD['cat_property'];
    if ($CP) {
        require DT_ROOT . '/include/property.func.php';
    }
    isset($post_ppt) or $post_ppt = array();
}
if ($_catids || $_areaids) {
    require DT_ROOT . '/admin/admin_check.inc.php';
}
if (in_array($action, array('', 'check', 'reject', 'recycle'))) {
    $sfields = array('模糊', '标题', '补充', '评价', '会员名', '专家', '提问对象', 'IP');
    $dfields = array('keyword', 'title', 'addition', 'comment', 'username', 'expert', 'ask', 'ip');
    $sorder = array('结果排序方式', '添加时间降序', '添加时间升序', '更新时间降序', '更新时间升序', '浏览次数降序', '浏览次数升序', '答案数量降序', '答案数量升序', '悬赏' . $DT['credit_name'] . '降序', '悬赏' . $DT['credit_name'] . '升序', '信息ID降序', '信息ID升序');
    $dorder = array($MOD['order'], 'addtime DESC', 'addtime ASC', 'updatetime DESC', 'updatetime ASC', 'hits DESC', 'hits ASC', 'answer DESC', 'answer ASC', 'credit DESC', 'credit ASC', 'itemid DESC', 'itemid ASC');
    isset($fields) && isset($dfields[$fields]) or $fields = 0;
    isset($order) && isset($dorder[$order]) or $order = 0;
    $level = isset($level) ? intval($level) : 0;
    $process = isset($process) ? intval($process) : 99;
    isset($datetype) && in_array($datetype, array('edittime', 'addtime', 'updatetime')) or $datetype = 'addtime';
Пример #2
0
     $all ? msg($MOD['name'] . '生成成功', $this_forward) : dmsg($MOD['name'] . '生成成功', $this_forward);
 }
 $catid = isset($catid) ? intval($catid) : '';
 $sql = $catid ? " AND catid={$catid}" : '';
 if (!isset($fid)) {
     $r = $db->get_one("SELECT min(itemid) AS fid FROM {$table} WHERE status>2 {$sql}");
     $fid = $r['fid'] ? $r['fid'] : 0;
 }
 isset($sid) or $sid = $fid;
 if (!isset($tid)) {
     $r = $db->get_one("SELECT max(itemid) AS tid FROM {$table} WHERE status>2 {$sql}");
     $tid = $r['tid'] ? $r['tid'] : 0;
 }
 if ($update) {
     require MD_ROOT . '/know.class.php';
     $do = new know($moduleid);
 }
 isset($num) or $num = 100;
 if ($fid <= $tid) {
     $result = $db->query("SELECT itemid FROM {$table} WHERE status>2 AND itemid>={$fid} {$sql} ORDER BY itemid LIMIT 0,{$num} ");
     if ($db->affected_rows($result)) {
         while ($r = $db->fetch_array($result)) {
             $itemid = $r['itemid'];
             $update ? $do->update($itemid) : tohtml('show', $module);
         }
         $itemid += 1;
     } else {
         $itemid = $fid + $num;
     }
 } else {
     if ($update) {
Пример #3
0
        }
        if ($MOD['answer_message'] && $item['username']) {
            send_message($item['username'], lang($L['answer_msg_title'], array(dsubstr($item['title'], 20, '...'))), lang($L['answer_msg_content'], array($item['title'], stripslashes($content), $linkurl)));
        }
        dalert($status == 3 ? $L['answer_success'] : $L['answer_check'], '', 'parent.window.location="' . $linkurl . '";');
    } else {
        $head_title = $L['answer_title'];
        include template('my_' . $module, 'member');
    }
    exit;
}
$MG['know_limit'] > -1 or dalert(lang('message->without_permission_and_upgrade'), 'goback');
include load($module . '.lang');
include load('my.lang');
require MD_ROOT . '/know.class.php';
$do = new know($moduleid);
if (in_array($action, array('add', 'edit'))) {
    $FD = cache_read('fields-' . substr($table, strlen($DT_PRE)) . '.php');
    if ($FD) {
        require DT_ROOT . '/include/fields.func.php';
    }
    isset($post_fields) or $post_fields = array();
    $CP = $MOD['cat_property'];
    if ($CP) {
        require DT_ROOT . '/include/property.func.php';
    }
    isset($post_ppt) or $post_ppt = array();
}
$sql = $_userid ? "username='******'" : "ip='{$DT_IP}'";
$limit_used = $limit_free = $need_password = $need_captcha = $need_question = $fee_add = 0;
if (in_array($action, array('', 'add'))) {