/** * Возвращает ранее кэшированную строку. * @param string $Group Имя группы/папки в которой хранятся файлы кэша * @param string $Key Имя кэша. * @return mixed */ public function Get($Group, $Key) { if (!$this->Enabled) { return false; } if ($this->HasCache($Group, $Key)) { $files = $this->GetFiles($Group, $Key); return Unserialize(file_get_contents($files[0])); } else { return false; } }
RemoveConfig('news', 'thumb_max_width'); RemoveConfig('news', 'thumb_max_height'); // Обновление таблицы forms (добавление текстовой ссылки) System::database()->InsertColl('forms', Unserialize('a:5:{s:4:"name";s:4:"link";s:4:"type";s:7:"varchar";s:6:"length";i:255;s:7:"notnull";b:1;s:5:"index";b:1;}'), 2); $rows = System::database()->Select('forms'); foreach ($rows as $r) { $link = SafeEnv(UfuLink($r['hname']), 255, str); $id = SafeEnv($r['id'], 11, int); System::database()->Update('forms', "`link`='{$link}'", "`id`='{$id}'"); } // Обновление таблицы rewrite_rules System::database()->Truncate('rewrite_rules'); System::database()->InsertColl('rewrite_rules', Unserialize('a:4:{s:4:"name";s:4:"name";s:4:"type";s:7:"varchar";s:6:"length";i:255;s:7:"notnull";b:1;}'), 0); System::database()->InsertColl('rewrite_rules', Unserialize('a:4:{s:4:"name";s:6:"module";s:4:"type";s:7:"varchar";s:6:"length";i:255;s:7:"notnull";b:1;}'), 1); System::database()->InsertColl('rewrite_rules', Unserialize('a:4:{s:4:"name";s:11:"description";s:4:"type";s:7:"varchar";s:6:"length";i:255;s:7:"notnull";b:1;}'), 2); System::database()->InsertColl('rewrite_rules', Unserialize('a:4:{s:4:"name";s:5:"order";s:4:"type";s:3:"int";s:6:"length";i:11;s:7:"notnull";b:1;}'), 6); // Системные правила UfuAddRuleByTemplate('system', 'mod', 'Ссылка на модуль', 'name={str}', '{name}/', 1000); // Правила для страниц UfuAddRuleByTemplate('pages', 'page', 'Ссылка на страницу', 'name=pages&file={ustr}', '{file}.html'); // Правила для модуля веб форм UfuAddRuleByTemplate('forms', 'form', 'Страница с формой', 'name=forms&formlink={ustr}', 'forms/{formlink}.html'); Ufu('index.php?name=forms&form={num}', 'forms/{form}/'); Ufu('index.php?name=news&op=topics', 'news/{op}/', 15000); // Обновление шаблона $template = System::config('general/site_template'); if ($template != 'default' && $template != 'IgrimTheme') { $file_name = System::config('tpl_dir') . $template . '/module/user_list.html'; $temp_content = file_get_contents($file_name); $temp_content = str_replace('{title.last}', '{title.last_visit}', $temp_content); file_put_contents($file_name, $temp_content);
$text = escape_string($arr['text']); $data = $client_id ? "datetime=NOW(), from_user_id='{$_SESSION['admin_id']}', to_user_id='{$user_id}', \n\t\t\tto_card_id='{$client_id}', to_vip='{$client_vip}',\n\t\t\ttheme='{$theme}', text='{$text}', parent_id='{$parent_id}'" : "datetime=NOW(), from_user_id='{$_SESSION['admin_id']}', to_user_id='{$user_id}', \n\t\t\tto_agency_id='{$agency_id}', \n\t\t\ttheme='{$theme}', text='{$text}', parent_id='{$parent_id}'"; if ($parent_id) { $data .= ", block_id='{$block_id}'"; mysql_query("INSERT INTO " . TABLE_MESSAGE . " SET {$data}") or Error(1, __FILE__, __LINE__); } else { mysql_query("INSERT INTO " . TABLE_MESSAGE . " SET {$data}") or Error(1, __FILE__, __LINE__); $message_id = mysql_insert_id(); mysql_query("UPDATE " . TABLE_MESSAGE . " SET block_id='{$message_id}' WHERE message_id='{$message_id}'") or Error(1, __FILE__, __LINE__); } $_SESSION['message_data'] = ''; Header("Location: " . ADMIN_URL . "?p={$part}&user_id={$user_id}&client_id={$client_id}&client_vip={$client_vip}&agency_id={$agency_id}"); exit; } $replace = array(); $data_arr = @Unserialize($_SESSION['message_data']); foreach ($message_fields as $v) { $replace[$v] = htmlspecialchars(@$data_arr[$v], ENT_COMPAT, 'cp1251'); } $replace['text'] = nl2br($replace['text']); $replace['user_id'] = $user_id; if ($user_id) { $where .= " AND (m.from_user_id={$user_id} OR m.to_user_id={$user_id})"; } if ($client_id) { $where .= " AND ((m.from_card_id={$client_id} AND m.from_vip='{$client_vip}') OR (m.to_card_id={$client_id} AND m.to_vip='{$client_vip}'))"; } if ($agency_id) { $where .= " AND (m.from_agency_id={$agency_id} OR m.to_agency_id={$agency_id})"; } $replace['user_name'] = '';
$y = (int) @$a[2] + 2000; if (!checkdate($m, $d, $y)) { $replace['date_to'] = date("d.m.y", mktime(0, 0, 0, date("m"), date("d") + 7, date("Y"))); } $a = @split('\\.', $replace['date']); $d = (int) @$a[0]; $m = (int) @$a[1]; $y = (int) @$a[2] + 2000; if (!checkdate($m, $d, $y)) { $replace['date'] = date("d") . "." . date("m") . "." . date("y"); } $siteorder_id = (int) @$siteorder_id; if ($siteorder_id) { $sql1 = mysql_query("SELECT users, curuser, user_id, users_refuse, status, data FROM " . TABLE_SITEORDER . " \n\t\t\t\tWHERE siteorder_id={$siteorder_id}") or Error(1, __FILE__, __LINE__); $soarr = @mysql_fetch_array($sql1); $data = @Unserialize($soarr['data']); if (is_array($data)) { foreach ($data as $k => $v) { if (!@$_SESSION['form_data'] || count($arr_form_data) <= 2) { if (preg_match("/дату заезда/i", $v['name']) || preg_match("/Дата въезда/i", $v['name']) || preg_match("/Дата заезда/i", $v['name']) || $v['name'] == 'с') { $replace['date_from'] = $v['value']; $replace['date_to'] = $data[$k + 1]['value']; } if (preg_match("/фамилия/i", $v['name'])) { $replace['fio'] = $v['value']; } if (preg_match("/имя/i", $v['name'])) { $replace['fio'] .= " " . $v['value']; } if (preg_match("/отчество/i", $v['name'])) { $replace['fio'] .= " " . $v['value'];
$value = $v['type'] == 4 ? $value : $arr[$id]; $arr_sql[] = array('name' => $v['name'], 'value' => $value); } $mess = get_template('templ/mail_quest_results.htm', array('list' => $arr_html, 'oid' => $oid, 'object_name' => $object_name, 'client_fio' => $client_fio)); foreach ($mail_arr as $mail) { send_mail($mail, 'опрос на ' . DOMAIN, $mess); } $_SESSION['order_data'] = ''; mysql_query("UPDATE " . TABLE_ORDER . " SET questionnaire=1 WHERE order_id='{$oid}'") or Error(1, __FILE__, __LINE__); $data = count($arr_sql) ? serialize($arr_sql) : ''; mysql_query("INSERT INTO " . TABLE_QUESTDATA . " SET order_id='{$oid}', quest_id={$qid}, object_id={$object_id}, data='" . escape_string($data) . "', \n\t\tdate=CURDATE(), email='{$client_email}', user_id='{$manager_id}', manager='{$manager}', object='{$object}'") or Error(1, __FILE__, __LINE__); Header("Location: " . $direct_url . "&sendorder=1"); exit; } $replace = array(); $data_arr = @Unserialize($_SESSION['order_data']); $replace["err"] = 0; $fields = array(); foreach ($order_fields as $v) { $id = $v['field_id']; $v['value'] = @$data_arr[$id]; $v['err'] = @$data_arr["err_{$id}"]; $v['name'] = htmlspecialchars($v['name'], ENT_COMPAT, 'cp1251'); if ($v["err"]) { $replace["err"] = 1; } if ($v['type'] == 0 || $v['type'] == 1) { $v['value'] = htmlspecialchars($v["value"], ENT_COMPAT, 'cp1251'); } elseif ($v['type'] == 2 || $v['type'] == 5 || $v['type'] == 6) { $options_arr = split("((\r)?\n(\r)?)+", $v['data']); $options = '';
<?php $order_id = (int) @$order_id; $agency_id = (int) @$agency_id; $type = escape_string(from_form(@$type)); $siteorder_id = (int) @$siteorder_id; if ($siteorder_id) { $sql = mysql_query("SELECT so.*, s.name as site FROM " . TABLE_SITEORDER . " so\n\tLEFT JOIN " . TABLE_SITE . " s ON (s.site_id=so.site_id)\n\tWHERE siteorder_id='{$siteorder_id}'") or Error(1, __FILE__, __LINE__); if ($order = @mysql_fetch_array($sql)) { list($order['date'], $order['time']) = explode(" ", $order['datetime']); $order['time'] = substr($order['time'], 0, 5); $d = split("-", $order['date']); $order['date'] = @$d[2] . "." . @$d[1] . "." . @($d[0] - 2000); $_SESSION['order_data'] = array(); $data = @Unserialize($order['data']); if (is_array($data)) { foreach ($data as $k => $v) { $v['name'] = nl2br(htmlspecialchars($v['name'], ENT_COMPAT, 'cp1251')); $v['value'] = nl2br(htmlspecialchars($v['value'], ENT_COMPAT, 'cp1251')); $data[$k] = $v; } $order['data'] = $data; } else { $order['data'] = array(); } $order['orders_link'] = ADMIN_URL . "?p={$part}&page={$current_page}"; $order['current_page'] = $current_page; echo get_template('templ/siteorderprint.htm', $order); } return; }
if (!defined('VALID_RUN')) { header("HTTP/1.1 404 Not Found"); exit; } if (!System::user()->CheckAccess2('articles', 'articles')) { System::admin()->AccessDenied(); } System::admin()->AddSubTitle('Архив статей'); $colsdb = System::database()->GetTableColumns('articles'); $cols = array(); foreach ($colsdb as $c) { $cols[] = $c['name']; } if (!in_array('form', $cols)) { System::database()->InsertColl('articles', Unserialize('a:4:{s:4:"name";s:4:"form";s:4:"type";s:3:"int";s:6:"length";i:11;s:7:"notnull";b:1;}'), 22); System::database()->InsertColl('articles', Unserialize('a:4:{s:4:"name";s:10:"product_id";s:4:"type";s:7:"varchar";s:6:"length";i:255;s:7:"notnull";b:1;}'), 23); } global $editarticles; $editarticles = System::user()->CheckAccess2('articles', 'edit_articles'); $editcats = System::user()->CheckAccess2('articles', 'edit_cats'); $editconf = System::user()->CheckAccess2('articles', 'config'); if (isset($_GET['a'])) { $action = $_GET['a']; } else { $action = 'main'; } TAddToolLink('Статьи', 'main', 'articles'); if ($editarticles) { TAddToolLink('Добавить статью', 'editor', 'articles&a=editor'); } if ($editcats) {
protected function &GetTableData($name) { $this->StartQ('Database->GetTableData()'); $name = $this->DbAccess . $this->Prefix() . $name . $this->TableFileExt; if (file_exists($name) && is_file($name)) { if (isset($this->Cache['data'][$name])) { $data =& $this->Cache['data'][$name]; } else { $data = Unserialize($this->get_data($name)); foreach ($data as &$row) { $row = str_replace(array('
', '
'), array("\r", "\n"), $row); } if ($this->UseCache) { $this->Cache['data'][$name] =& $data; } } } else { $this->Error('Таблица с таким именем не существует.'); return false; } $this->Good(); return $data; }