Ejemplo n.º 1
0
 if (!isset($_POST['currency'])) {
     $errors[] = 'currency';
 }
 if (count($errors) > 0) {
     if ($is_ajax) {
         echo json_encode($errors);
         die;
     } else {
         include "form.php";
         exit;
     }
 }
 $db = new sql_db(DB_HOST, DB_USER, DB_PASS, DB_NAME);
 $created = time();
 $db->query("INSERT INTO members_changes SET\n\t\t\t\t            m_created = " . $created . ",\n\t\t\t\t            m_type = 'add',\n\t\t\t\t            m_state = 'awaiting',\n\t\t\t\t            m_nick = '" . $db->check($_POST["nick"]) . "',\n\t\t\t\t            m_name = '" . $db->check($_POST["name"] . " " . $_POST["surname"]) . "',\n\t\t\t\t            m_mail = '" . $db->check($_POST["email"]) . "',\n\t\t\t\t            m_address = '" . $db->check($_POST["address"] . ", " . $_POST["zip"] . " " . $_POST["city"] . ", " . $_POST["country"]) . "',\n\t\t\t\t            m_year = '" . $db->check($_POST["birth"]) . "',\n\t\t\t\t            m_jabber = '',\n\t\t\t\t            m_how = '" . $db->check($_POST["how"]) . "',\n\t\t\t\t            m_note = '" . $db->check($_POST["note"]) . "',\n\t\t\t\t            m_distribution = '" . $db->check($_POST["distribution"]) . "',\n\t\t\t\t            m_location = '" . $db->check($_POST["location"]) . "',\n\t\t\t\t            m_currency = '" . $db->check($_POST["currency"]) . "',\n\t\t\t\t            m_reason = '',\n\t\t\t\t            m_addr = '" . $db->check($_SERVER["REMOTE_ADDR"]) . "',\n\t\t\t\t            m_addr_reverse = '" . $db->check(gethostbyaddr($_SERVER["REMOTE_ADDR"])) . "',\n\t\t\t\t            m_last_mail_id = 1\n\t\t\t\t            ");
 $request_id = $db->insert_id();
 // Mail admins
 $admins = explode(",", cfg_get("mailer_requests_sendto"));
 $subject = cfg_get("mailer_requests_admin_sub");
 $text = cfg_get("mailer_requests_admin_text");
 $subject = str_replace("%request_id%", $request_id, $subject);
 $subject = str_replace("%type%", "add", $subject);
 $subject = str_replace("%state%", "awaiting", $subject);
 $subject = str_replace("%member_id%", "-", $subject);
 $subject = str_replace("%member%", "-", $subject);
 $subject = str_replace("%name%", $_POST["name"] . " " . $_POST["surname"], $subject);
 $text = str_replace("%created%", strftime("%Y-%m-%d %H:%M", $created), $text);
 $text = str_replace("%changed_at%", "-", $text);
 $text = str_replace("%request_id%", $request_id, $text);
 $text = str_replace("%type%", "add", $text);
 $text = str_replace("%state%", "awaiting", $text);
Ejemplo n.º 2
0
     file_put_contents(NV_ROOTDIR . '/robots.txt', $contents, LOCK_EX);
 }
 define('NV_IS_MODADMIN', true);
 $module_name = 'upload';
 $lang_global['mod_upload'] = 'upload';
 $global_config['upload_logo'] = '';
 define('NV_UPLOAD_GLOBALTABLE', $db_config['prefix'] . '_upload');
 define('SYSTEM_UPLOADS_DIR', NV_UPLOADS_DIR);
 require_once NV_ROOTDIR . '/' . NV_ADMINDIR . '/upload/functions.php';
 $real_dirlist = array();
 foreach ($allow_upload_dir as $dir) {
     $real_dirlist = nv_listUploadDir($dir, $real_dirlist);
 }
 foreach ($real_dirlist as $dirname) {
     try {
         $array_dirname[$dirname] = $db->insert_id("INSERT INTO " . NV_UPLOAD_GLOBALTABLE . "_dir (dirname, time, thumb_type, thumb_width, thumb_height, thumb_quality) VALUES ('" . $dirname . "', '0', '0', '0', '0', '0')", "did");
     } catch (PDOException $e) {
         trigger_error($e->getMessage());
     }
 }
 // Data Counter
 $db->query("INSERT INTO " . $db_config['prefix'] . "_counter VALUES ('c_time', 'start', 0, 0, 0)");
 $db->query("INSERT INTO " . $db_config['prefix'] . "_counter VALUES ('c_time', 'last', 0, 0, 0)");
 $db->query("INSERT INTO " . $db_config['prefix'] . "_counter VALUES ('total', 'hits', 0, 0, 0)");
 $year = date('Y');
 for ($i = 0; $i < 9; $i++) {
     $db->query("INSERT INTO " . $db_config['prefix'] . "_counter VALUES ('year', '" . $year . "', 0, 0, 0)");
     ++$year;
 }
 $ar_tmp = explode(',', 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec');
 foreach ($ar_tmp as $month) {