Beispiel #1
0
<?php

defined('DT_ADMIN') or exit('Access Denied');
$TYPE = get_type('poll', 1);
require MD_ROOT . '/poll.class.php';
$do = new poll();
$menus = array(array('添加票选', '?moduleid=' . $moduleid . '&file=' . $file . '&action=add'), array('票选列表', '?moduleid=' . $moduleid . '&file=' . $file), array('更新地址', '?moduleid=' . $moduleid . '&file=' . $file . '&action=html'), array('票选分类', 'javascript:Dwidget(\'?file=type&item=' . $file . '\', \'票选分类\');'), array('模块首页', $EXT[$file . '_url'], ' target="_blank"'), 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('添加成功', $forward);
            } else {
                msg($do->errmsg);
            }
        } else {
            foreach ($do->fields as $v) {
                isset(${$v}) or ${$v} = '';
            }
            $poll_max = 0;
            $poll_page = 30;
            $poll_cols = 3;
            $poll_order = 0;
            $thumb_width = 120;
            $thumb_height = 90;
            $addtime = timetodate($DT_TIME);
            $typeid = 0;