if ($_catids || $_areaids) { require DT_ROOT . '/admin/admin_check.inc.php'; } $do = new ad(); $do->pid = $pid; $do->aid = $aid; $currency = $MOD['ad_currency']; $unit = $currency == 'money' ? $DT['money_unit'] : $DT['credit_unit']; $this_forward = '?moduleid=' . $moduleid . '&file=' . $file . '&action=list&pid=' . $pid . '&page=' . $page; $this_place_forward = '?moduleid=' . $moduleid . '&file=' . $file . '&page=' . $page; switch ($action) { case 'add': $pid or msg('未指定广告位'); if ($submit) { if ($do->is_ad($ad)) { $do->add($ad); $aid = $do->aid; if ($ad['typeid'] == 6) { $MOD['linkurl'] = $MODULE[$ad['key_moduleid']]['linkurl']; } tohtml('ad', $module); dmsg('添加成功', $forward ? $forward : $this_forward); } else { msg($do->errmsg); } } else { $p = $do->get_one_place(); $fromtime = timetodate($DT_TIME, 3); include tpl('ad_add', $module); } break;