コード例 #1
0
function save_notice($noticeid, $title, $html, $displayorder, $active, $persistent, $dismissible, $criteria_array, $username, $templateversion)
{
    $noticeid = save_notice_info($noticeid, $title, $displayorder, $active, $persistent, $dismissible, $criteria_array);
    save_notice_phrase($noticeid, $html, $username, $templateversion);
    // update the datastore notice cache
    build_notice_datastore();
    // rebuild languages
    require_once DIR . '/includes/adminfunctions_language.php';
    build_language();
}
コード例 #2
0
ファイル: notice.php プロジェクト: 0hyeah/yurivn
                    $sort = 'ASC';
                    break;
                default:
                    $comp = false;
                    $sort = false;
            }
            if ($comp and $sort and $notice_swap = $db->query_first("SELECT noticeid, displayorder FROM " . TABLE_PREFIX . "notice WHERE displayorder {$comp} {$notice_orig['displayorder']} ORDER BY displayorder {$sort}, title ASC LIMIT 1")) {
                $db->query_write("\n\t\t\t\t\tUPDATE " . TABLE_PREFIX . "notice\n\t\t\t\t\tSET displayorder = CASE noticeid\n\t\t\t\t\t\tWHEN {$notice_orig['noticeid']} THEN {$notice_swap['displayorder']}\n\t\t\t\t\t\tWHEN {$notice_swap['noticeid']} THEN {$notice_orig['displayorder']}\n\t\t\t\t\t\tELSE displayorder END\n\t\t\t\t\tWHERE noticeid IN({$notice_orig['noticeid']}, {$notice_swap['noticeid']})\n\t\t\t\t");
                // tell the datastore to update
                $changes = true;
            }
        }
    }
    //update the datastore notice cache
    if ($changes) {
        build_notice_datastore();
    }
    $_REQUEST['do'] = 'modify';
}
// #############################################################################
// list existing notices
if ($_REQUEST['do'] == 'modify') {
    print_form_header('notice', 'quickupdate');
    print_column_style_code(array('width:100%', 'white-space:nowrap'));
    print_table_header($vbphrase['notices_manager']);
    $notice_result = $db->query("SELECT * FROM " . TABLE_PREFIX . "notice ORDER BY displayorder, title");
    $notice_count = $db->num_rows($notice_result);
    if ($notice_count) {
        print_description_row('<label><input type="checkbox" id="allbox" checked="checked" />' . $vbphrase['toggle_active_status_for_all'] . '</label><input type="image" src="../' . $vbulletin->options['cleargifurl'] . '" name="normalsubmit" />', false, 2, 'thead" style="font-weight:normal; padding:0px 4px 0px 4px');
        while ($notice = $db->fetch_array($notice_result)) {
            print_label_row('<a href="notice.php?' . $vbulletin->session->vars['sessionurl'] . 'do=edit&amp;noticeid=' . $notice['noticeid'] . '" title="' . $vbphrase['edit_notice'] . '">' . $notice['title'] . '</a>', '<div style="white-space:nowrap">' . '<label class="smallfont"><input type="checkbox" name="active[' . $notice['noticeid'] . ']" value="1"' . ($notice['active'] ? ' checked="checked"' : '') . ' />' . $vbphrase['active'] . '</label> ' . '<label class="smallfont"><input type="checkbox" name="persistent[' . $notice['noticeid'] . ']" value="1"' . ($notice['persistent'] ? ' checked="checked"' : '') . ' />' . $vbphrase['persistent'] . '</label> ' . '<label class="smallfont"><input type="checkbox" name="dismissible[' . $notice['noticeid'] . ']" value="1"' . ($notice['dismissible'] ? ' checked="checked"' : '') . ' />' . $vbphrase['dismissible'] . '</label> &nbsp; ' . '<input type="image" src="../cpstyles/' . $vbulletin->options['cpstylefolder'] . '/move_down.gif" name="displayorderswap[' . $notice['noticeid'] . ',higher]" />' . '<input type="text" name="displayorder[' . $notice['noticeid'] . ']" value="' . $notice['displayorder'] . '" class="bginput" size="4" title="' . $vbphrase['display_order'] . '" style="text-align:' . vB_Template_Runtime::fetchStyleVar('right') . '" />' . '<input type="image" src="../cpstyles/' . $vbulletin->options['cpstylefolder'] . '/move_up.gif" name="displayorderswap[' . $notice['noticeid'] . ',lower]" />' . construct_link_code($vbphrase['edit'], 'notice.php?' . $vbulletin->session->vars['sessionurl'] . 'do=edit&amp;noticeid=' . $notice['noticeid']) . construct_link_code($vbphrase['delete'], 'notice.php?' . $vbulletin->session->vars['sessionurl'] . 'do=delete&amp;noticeid=' . $notice['noticeid']) . '</div>');