Beispiel #1
0
                $result = $select->commit();
                $element = $db->fetch_assoc($result);
                $lines = array();
                foreach ($element as $db_key => $db_val) {
                    $lines[] = $db_key . '=>' . $db_val;
                }
                $insertquery = new DBInsert('interface_history', array('action' => 'edit', 'area' => 'pages', 'field' => intval($key), 'user' => $futurebb_user['id'], 'time' => time(), 'old_value' => base64_encode(implode("\n", $lines))), 'Failed to insert history entry');
                $insertquery->commit();
                foreach ($val as $field => $field_value) {
                    //update the field
                    $updatequery = new DBUpdate('pages', array($field => $field_value), 'id=' . intval($key), 'Failed to update page entry');
                    $updatequery->commit();
                }
            }
        }
        CacheEngine::CachePages();
        redirect($base_config['baseurl'] . '/admin/interface/pages');
    } else {
        echo '<p>Your password was incorrect. Hit the back button to try again.</p>';
        return;
    }
} else {
    if (isset($_POST['form_sent_a'])) {
        //submitted, but not confirmed
        $changes_list = array();
        $changes_submit = array();
        while ($page = $db->fetch_assoc($result)) {
            if (isset($_POST['url'][$page['id']])) {
                //it's changed somehow, reflect the changes
                $changed = false;
                $cur_change = '<tr><td';
Beispiel #2
0
 static function remove_page($url)
 {
     global $db;
     $db->query('DELETE FROM `#^pages` WHERE url=\'' . $db->escape($url) . '\'') or enhanced_error('Failed to remove page from database', true);
     CacheEngine::CachePages();
 }