示例#1
0
        }
        if ($action == "convert") {
            if (!empty($_GET['companynewsid'])) {
                $item_info['title'] = $pdb->GetOne("SELECT title FROM {$tb_prefix}companynewses WHERE id=" . intval($_GET['companynewsid']));
            }
        }
        if (!empty($item_info)) {
            setvar("item", $item_info);
        }
        $tpl_file = "news.edit";
        template($tpl_file);
        exit;
    }
}
if (isset($_POST['update']) && !empty($_POST['if_focus'])) {
    $pdb->Execute("update " . $news->getTable() . " set if_focus=0");
    $pdb->Execute("update " . $news->getTable() . " set if_focus=1 where id=" . intval($_POST['if_focus']));
}
if (isset($_POST['del']) && is_array($_POST['id'])) {
    foreach ($_POST['id'] as $key => $val) {
        $attach_filename = $pdb->GetOne("select picture from {$tb_prefix}newses where id=" . $val);
        $attachment->deleteBySource($attach_filename);
    }
    $deleted = $news->del($_POST['id']);
    if (!$deleted) {
        flash();
    }
}
if (isset($_POST['commend']) && is_array($_POST['id'])) {
    $news->saveField("if_commend", 1, $_POST['id']);
    flash("success");
示例#2
0
文件: news.php 项目: reboxhost/phpb2b
            if (!empty($_GET['companynewsid'])) {
                $item_info['title'] = $pdb->GetOne("SELECT title FROM {$tb_prefix}companynewses WHERE id=" . intval($_GET['companynewsid']));
            }
        }
        if (!empty($item_info)) {
            $seo = $meta->getSEOById($id, 'news');
            $item_info = am($item_info, $seo);
            setvar("item", $item_info);
        }
        $tpl_file = "news.edit";
        template($tpl_file);
        exit;
    }
}
if (isset($_POST['update']) && !empty($_POST['if_focus'])) {
    $pdb->Execute("UPDATE " . $news->getTable() . " SET if_focus=0");
    $pdb->Execute("UPDATE " . $news->getTable() . " SET if_focus=1 WHERE id=" . intval($_POST['if_focus']));
}
if (isset($_POST['focus']) && !empty($_POST['id'])) {
    $ids = implode(",", $_POST['id']);
    if ($ids) {
        $pdb->Execute("UPDATE " . $news->getTable() . " SET if_focus=if_focus+1 WHERE id IN (" . $ids . ")");
    }
}
if (isset($_POST['cancel_focus']) && !empty($_POST['id'])) {
    $ids = implode(",", $_POST['id']);
    $pdb->Execute("UPDATE " . $news->getTable() . " SET if_focus=0 WHERE id IN (" . $ids . ")");
}
if (isset($_POST['del']) && is_array($_POST['id'])) {
    foreach ($_POST['id'] as $key => $val) {
        $attach_filename = $pdb->GetOne("SELECT picture FROM {$tb_prefix}newses WHERE id=" . $val);