Beispiel #1
0
            }
            $input['fk_lk_id_reason'] = mysql_insert_id();
            $query = "INSERT INTO `{$dbtable_prefix}lang_strings` (`lang_value`,`fk_lk_id`,`skin`) VALUES ('" . $input['reason'] . "','" . $input['fk_lk_id_reason'] . "','{$default_skin_code}')";
            if (!($res = @mysql_query($query))) {
                trigger_error(mysql_error(), E_USER_ERROR);
            }
            $query = "INSERT INTO `{$dbtable_prefix}site_bans` SET ";
            foreach ($site_bans_default['defaults'] as $k => $v) {
                if (isset($input[$k])) {
                    $query .= "`{$k}`='" . $input[$k] . "',";
                }
            }
            $query = substr($query, 0, -1);
            if (!($res = @mysql_query($query))) {
                trigger_error(mysql_error(), E_USER_ERROR);
            }
            $topass['message']['type'] = MESSAGE_INFO;
            $topass['message']['text'] = 'Ban added.';
        }
        regenerate_langstrings_array();
        regenerate_ban_array();
    } else {
        $nextpage = 'site_bans_addedit.php';
        // 		you must re-read all textareas from $_POST like this:
        //		$input['x']=addslashes_mq($_POST['x']);
        $input = sanitize_and_format($input, TYPE_STRING, FORMAT_HTML2TEXT_FULL | FORMAT_STRIPSLASH);
        $topass['input'] = $input;
    }
}
$nextpage = _BASEURL_ . '/admin/' . $nextpage;
redirect2page($nextpage, $topass, '', true);
Beispiel #2
0
/******************************************************************************
Etano
===============================================================================
File:                       admin/processors/regenerate_skin.php
$Revision$
Software by:                DateMill (http://www.datemill.com)
Copyright by:               DateMill (http://www.datemill.com)
Support at:                 http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license.                         *
******************************************************************************/
require_once '../../includes/common.inc.php';
require_once '../../includes/admin_functions.inc.php';
allow_dept(DEPT_ADMIN);
set_time_limit(0);
$error = false;
$qs = '';
$qs_sep = '';
$topass = array();
$skin = sanitize_and_format_gpc($_GET, 's', TYPE_STRING, $__field2format[FIELD_TEXTFIELD], '');
$last_id = isset($_GET['last_id']) ? (int) $_GET['last_id'] : 0;
if (!$error) {
    if ($last_id == 0) {
        regenerate_langstrings_array($skin);
    }
    regenerate_skin_cache($skin, $last_id);
    $topass['message']['type'] = MESSAGE_INFO;
    $topass['message']['text'] = 'All files in the skin were regenerated.';
}
redirect2page('admin/site_skins.php', $topass, $qs);