コード例 #1
0
        $usr['isadmin'] = $row['page_ownerid'] == $usr['id'] ? TRUE : $usr['isadmin'];
        sed_block($usr['isadmin']);
        $sql = sed_sql_query("UPDATE {$db_pages} SET page_state=1 WHERE page_id='{$id}'");
        sed_cache_clear('latestpages');
        header("Location: list.php?c=" . $row['page_cat']);
        exit;
    } else {
        sed_die();
    }
}
$sql = sed_sql_query("SELECT * FROM {$db_pages} WHERE page_id='{$id}' LIMIT 1");
sed_die(sed_sql_numrows($sql) == 0);
$pag = sed_sql_fetcharray($sql);
$pag['page_date'] = sed_selectbox_date($pag['page_date'] + $usr['timezone'] * 3600, 'long');
$pag['page_begin'] = sed_selectbox_date($pag['page_begin'] + $usr['timezone'] * 3600, 'long', '_beg');
$pag['page_expire'] = sed_selectbox_date($pag['page_expire'] + $usr['timezone'] * 3600, 'long', '_exp');
list($usr['auth_read'], $usr['auth_write'], $usr['isadmin']) = sed_auth('page', $pag['page_cat']);
$usr['isadmin'] = $pag['page_ownerid'] == $usr['id'] ? TRUE : $usr['isadmin'];
sed_block($usr['isadmin']);
$page_form_delete = "<input type=\"radio\" class=\"radio\" name=\"rpagedelete\" value=\"1\" />" . $L['Yes'] . " <input type=\"radio\" class=\"radio\" name=\"rpagedelete\" value=\"0\" checked=\"checked\" />" . $L['No'];
$page_form_categories = sed_selectbox_categories($pag['page_cat'], 'rpagecat');
$page_form_type = "<select name=\"rpagetype\" size=\"1\">";
$selected0 = $pag['page_type'] == 0 ? "selected=\"selected\"" : '';
$selected1 = $pag['page_type'] == 1 ? "selected=\"selected\"" : '';
$selected2 = $pag['page_type'] == 2 && $usr['maingrp'] == 5 ? "selected=\"selected\"" : '';
$page_form_type .= "<option value=\"0\" {$selected0}>" . $L['Default'] . "</option>";
$page_form_type .= "<option value=\"1\" {$selected1}>HTML</option>";
$page_form_type .= $usr['maingrp'] == 5 && $cfg['allowphp_pages'] ? "<option value=\"2\" {$selected2}>PHP</option>" : '';
$page_form_type .= "</select>";
if ($pag['page_file']) {
    $page_form_file = "<input type=\"radio\" class=\"radio\" name=\"rpagefile\" value=\"1\" checked=\"checked\" />" . $L['Yes'] . " <input type=\"radio\" class=\"radio\" name=\"rpagefile\" value=\"0\" />" . $L['No'];
<?php

/* ====================
[BEGIN_SED_EXTPLUGIN]
Code=hidefuturepages
Part=page
File=hidefuturepages.page.add.tags
Hooks=page.add.tags
Tags=
Order=1
[END_SED_EXTPLUGIN]
==================== */
defined('SED_CODE') or die('Wrong URL');
$yearstillpageexpire = (int) $cfg['plugin']['hidefuturepages']['yearstillpageexpire'];
$yearstillpageexpire = $yearstillpageexpire > 0 ? $yearstillpageexpire : 1;
if ($yearstillpageexpire > 1) {
    $newpage_form_expire = sed_selectbox_date($sys['now_offset'] + $usr['timezone'] * 3600 + 31536000 * $yearstillpageexpire, 'long', '_exp');
    $t->assign(array("PAGEADD_FORM_EXPIRE" => $newpage_form_expire));
}