function extract_label_koef($html) { $html = kill_tag_bound($html, 'div|tr'); $label = delete_all(copy_be($html, '<td', '</td>', 'label'), '<', '>'); $koef = delete_all(copy_be($html, '<td', '</td>', '\'odd\''), '<', '>'); return array($label, $koef); }
function extract_league($Html) { $Html = extract_tags($Html, '<input', '>', "\r\n", 'catm[]'); $Html = delete_all($Html, '<', 'name='); $Html = delete_all($Html, '"', '>'); $Html = replace_all($Html, '[]', '"', '[]='); return $Html; }
function kill_table_row($Html, $Tag) { $Tags = explode('|', $Tag); foreach ($Tags as $t) { $Html = delete_all($Html, '<tr', '</tr>', $t); } return $Html; }
function extract_bet($Html) { $Html = copy_be($Html, '<form ', '</form>', 'betform'); $Html = kill_tag($Html, 'script|div'); $Html = kill_space($Html); $Html = kill_tag_bound($Html, 'b|span|br|i|a|input|font|img'); $Html = delete_all($Html, '<tr', '</tr>', 'line3'); $Html = kill_property_value_exclude($Html, 'class', 'line_table'); $Html = kill_property($Html, 'width|height|valign|align|bgcolor|style|border|cellspacing|cellpadding'); // Убираем "левые" данные $Html = replace_all_contain($Html, '<tr', '</tr>', '', 'Хозяева|' . 'Гости|' . 'Индив.тотал:|' . '-я четверть|' . '-я партия|' . ' тайм|' . '-й сет'); return $Html; }
function extract_bet($Html) { $Html = extract_tags($Html, '<table cellSpacing=2 cellPadding=1', '</table>', "\r\n"); $Html = kill_space($Html); $Html = kill_tag_bound($Html, 'b|a|br|font|img'); $Html = str_ireplace(' nowrap', '', $Html); $Html = kill_property($Html, 'onmouseover|onclick|align|id|style|width|cellspacing'); // Убираем строки без ставок $Html = delete_all($Html, '<tr>', '</tr>', 'class="t_comment"'); $Html = delete_all($Html, '<tr>', '</tr>', 'class="t_comment1"'); $Html = str_ireplace(' class=date', ' @lass=date', $Html); $Html = kill_property($Html, 'class'); $Html = str_ireplace(' @lass=date', ' class=date', $Html); return $Html; }
function extract_league($Html) { $Html = copy_be($Html, '<form ', '</form>', '"frmTurnirs"'); $Html = extract_tags($Html, '<input', '>', "\r\n", 'id="sport_', 'name="turnir_'); $Html = delete_all($Html, '<input', '>', 'turnir_2_'); // Бейсбол $Html = delete_all($Html, '<input', '>', 'turnir_12_'); // Бокс $Html = delete_all($Html, '<input', '>', 'turnir_254_'); // Лотереи $Html = delete_all($Html, '<input', '>', 'turnir_255_'); // Другие виды спорта $Html = delete_all($Html, '<input', '>', 'turnir_6_'); // Хоккей $Html = extract_property_values($Html, 'name', ';'); return $Html; }
function extract_bet($Html) { // Разбираемся с концами строк $Html = str_ireplace("\n", '<br>', $Html); $Html = str_ireplace("\r", '<br>', $Html); $Html = copy_be($Html, '<form name=f1>', '</form>'); $Html = str_ireplace(' ', ' ', $Html); $Html = kill_tag_bound($Html, 'input|itemevent|a|b'); $Html = str_ireplace(' noshade', '', $Html); $Html = kill_property($Html, 'time|color'); $Html = replace_all($Html, '<sup>', '</sup>', ' '); $Html = kill_tag($Html, 'big'); $Html = str_ireplace('<endpreview/>', '', $Html); $Html = str_ireplace('<hr><br>', '<hr>', $Html); $Html = str_ireplace('<br>Оглавление<', '<', $Html); $Html = str_ireplace('<br>Оглавление<', '<', $Html); $Html = replace_all($Html, '<u>', '</form>', '</form>'); $Html = kill_tag_bound($Html, 'u|form'); $Html = delete_all($Html, '<span ', '</span>', 'maxcap'); return $Html; }
function extract_bet($Html) { $Html = copy_be($Html, '<form name=f1', '</form>', 'Дома'); $Html = kill_space($Html); $Html = kill_tag($Html, 'script'); $Html = kill_tag_bound($Html, 'b|a|tbody|small|colgroup'); // <!-- Выносим Экспресы и информацию о предыдущих встречах --> $Html = str_ireplace('<span class=tr>1</span>', '', $Html); $Html = delete_all($Html, '<tr>', '</tr>', '<span class=tr>'); $Html = delete_all($Html, '<span class=n>', '</span>'); // <!-- Убираем строки с кнопками --> $Html = delete_all($Html, '<table ', '</table>', '<input '); // <!-- Заменяем IMG с информацией на igif для последующего удаления --> $Html = replace_all($Html, '<img ', '>', "igif"); // <!-- Убираем левые коэффициенты в скобках --> $Html = replace_all($Html, '>(', ')', '>'); // <!-- Убираем оглавление --> $Html = delete_all($Html, "<div ", "</div", "Оглавление"); $Html = kill_property($Html, 'width|border'); $Html = replace_all_contain($Html, '<tr', '</tr>', '', '>Хозяева|' . '>Гости|' . '>Фолы|' . '>ж/к|' . '>угл.'); return $Html; }
function extract_main_bets(&$tournir_node, $html, $sport_sign, $tournir_id) { $subjects_file = "phrases/olymp/subjects.txt"; $subjects = file_get_hash($subjects_file); $event_id = extract_property_values(copy_be($html, '<ul', '>', 'rel'), 'rel', ''); $html = kill_tag_bound($html, 'u'); $cells = extract_all_tags($html, '<li', '</li>'); $i = 0; foreach ($cells as $cell) { $cells[$i++] = delete_all($cell, '<', '>', 'li'); } list($day_no, $month_no, $year_no, $hour, $minute) = decode_datetime(str_ireplace('<br>', ' ', $cells[0])); list($gamer1_name, $gamer2_name) = explode('<br/>', $cells[2]); $event_node = event_create($tournir_node, $event_id, mktime($hour, $minute, 0, $month_no, $day_no, $year_no), $gamer1_name, $gamer2_name); if ($cells[3] != '') { add_bet($event_node, 'Period=Match;Gamer=1;Modifier=Win;Koef=' . $cells[3]); } if ($cells[4] != '') { add_bet($event_node, 'Period=Match;Modifier=Draw;Koef=' . $cells[4]); } if ($cells[5] != '') { add_bet($event_node, 'Period=Match;Gamer=2;Modifier=Win;Koef=' . $cells[5]); } if ($cells[6] != '') { add_bet($event_node, 'Period=Match;Kind=DoubleChance;Modifier=NoLose;Gamer=1;Koef=' . $cells[6]); } if ($cells[7] != '') { add_bet($event_node, 'Period=Match;Kind=DoubleChance;Modifier=NoDraw;Koef=' . $cells[7]); } if ($cells[8] != '') { add_bet($event_node, 'Period=Match;Kind=DoubleChance;Modifier=NoLose;Gamer=2;Koef=' . $cells[8]); } if ($cells[9] != '') { preg_match('/\\(([\\+\\-]*?)(.+?)\\)<br\\/>(.+?)/iU', $cells[9], $matches); if ($matches[1] == '' and $matches[2] != '0') { $matches[1] = '+'; } add_bet($event_node, 'Period=Match;Kind=Fora;Value=' . $matches[1] . $matches[2] . ';Modifier=Win;Gamer=1;Koef=' . $matches[3]); } if ($cells[10] != '') { preg_match('/\\(([\\+\\-]*?)(.+?)\\)<br\\/>(.+?)/iU', $cells[10], $matches); if ($matches[1] == '' and $matches[2] != '0') { $matches[1] = '+'; } add_bet($event_node, 'Period=Match;Kind=Fora;Value=' . $matches[1] . $matches[2] . ';Modifier=Win;Gamer=2;Koef=' . $matches[3]); } if ($cells[12] != '') { $value = $cells[11]; if (!strpos($value, '.')) { $value = $value + 0.5; } add_bet($event_node, 'Period=Match;' . $subjects[$sport_sign] . ';Kind=Total;Value=' . $value . ';Modifier=Under;Koef=' . $cells[12]); } if ($cells[13] != '') { $value = $cells[11]; if (!strpos($value, '.')) { $value = $value - 0.5; } add_bet($event_node, 'Period=Match;' . $subjects[$sport_sign] . ';Kind=Total;Value=' . $value . ';Modifier=Over;Koef=' . $cells[13]); } }
function delete_all($path) { $dir = dir($path); while ($file = $dir->read()) { if ($file == '.' || $file == '..') { continue; } $file = $path . '/' . $file; if ($file != $path . '/.htaccess') { // Never remove a .htaccess if (is_dir($file)) { delete_all($file); rmdir($file); } else { unlink($file); } } } }
function extract_tag_from_tag($html, $outer_tag, $inner_tag, $kill_bounds = null) { $ul_tagno = copy_be($html, "<{$outer_tag}", '>'); $ul_tagno = extract_tagno($ul_tagno, $outer_tag); $html = extract_numbered_tag($html, $outer_tag, $ul_tagno); $result = array(); while ($li_tagno = copy_be($html, "<{$inner_tag}", '>')) { $li_tagno = extract_tagno($li_tagno, $inner_tag); $li_html = extract_numbered_tag($html, $inner_tag, $li_tagno); $html = str_replace($li_html, '', $html); if ($kill_bounds) { $li_html = delete_all($li_html, "<{$inner_tag}", '>', "TagNo=\"{$inner_tag}{$li_tagno}\""); $li_html = delete_all($li_html, "</{$inner_tag}", '>', "TagNo=\"{$inner_tag}{$li_tagno}\""); } $result[] = $li_html; } return $result; }
<?php /* delete-all.php * **********WARNING!!!**************** * Executing this script (or opening in browser) will DELETE and COMMIT * all data in the project Solr index. */ require "layout/head.php"; //require "layout/splash.php"; require "layout/nav-search.php"; require_once 'solr.php'; ?> <div class="container-fluid"> <pre> <?php delete_all(); ?> </pre> </div> <?php ?> <?php require "layout/footer.php"; require "layout/scripts.php";
$form['maintenance'] = '0'; } foreach ($form as $key => $input) { // Only update values that have changed if (array_key_exists('o_' . $key, $luna_config) && $luna_config['o_' . $key] != $input) { if ($input != '' || is_int($input)) { $value = '\'' . $db->escape($input) . '\''; } else { $value = 'NULL'; } $db->query('UPDATE ' . $db->prefix . 'config SET conf_value=' . $value . ' WHERE conf_name=\'o_' . $db->escape($key) . '\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error()); } } if ($action == 'clear_cache') { confirm_referrer('backstage/maintenance.php'); delete_all(FORUM_ROOT . 'cache'); redirect('backstage/maitenance.php?cache_cleared=true'); } // Regenerate the config cache if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) { require FORUM_ROOT . 'include/cache.php'; } generate_config_cache(); clear_feed_cache(); redirect('backstage/maintenance.php?saved=true'); } $page_title = array(luna_htmlspecialchars($luna_config['o_board_title']), __('Admin', 'luna'), __('Maintenance', 'luna')); define('FORUM_ACTIVE_PAGE', 'admin'); require 'header.php'; load_admin_nav('maintenance', 'maintenance'); if (isset($_GET['saved'])) {
<?php include "basket.php"; session_start(); $products = unserialize(file_get_contents("../products/prods.db")); foreach ($products as $key => $product) { if ($_POST[$product["name"]] == "delete") { delete_all($product["name"]); } } ?> <html> <body> <form method="POST"> <table style="margin-left: 50px; background-color: #A5EDE4; border-radius: 10px;"> <tr> <?php if (!$_SESSION["id_session"]) { $usr = "******"; } else { $usr = $_SESSION["id_session"]; } $basket = unserialize(file_get_contents("../basket/" . $usr)); $products = unserialize(file_get_contents("../products/prods.db")); foreach ($basket as $key => $elem) { if ($elem) { echo '<tr><td>' . $elem . '</td><td><input type="submit" name="' . $elem . '" value="delete"></td></tr>'; } } ?> </tr>
private function extract_main_bets(&$tournir_node, $html, $sport_sign, $tournir_id) { $event_id = extract_property_values(copy_be($html, '<ul', '>', 'rel'), 'rel', ''); $html = kill_tag_bound($html, 'u'); $cells = extract_all_tags($html, '<li', '</li>'); $i = 0; foreach ($cells as $cell) { $cells[$i++] = delete_all($cell, '<', '>', 'li'); } list($day_no, $month_no, $year_no, $hour, $minute) = $this->decode_datetime(str_ireplace('<br>', ' ', $cells[0])); list($gamer1_name, $gamer2_name) = explode('<br/>', $cells[2]); $event_node = $this->event_create($tournir_node, $event_id, mktime($hour, $minute, 0, $month_no, $day_no, $year_no), $gamer1_name, $gamer2_name); if ($cells[3] != '') { $this->addBet($event_node, $this->header[3] . ';Koef=' . $cells[3]); } if ($cells[4] != '') { $this->addBet($event_node, $this->header[4] . ';Koef=' . $cells[4]); } if ($cells[5] != '') { $this->addBet($event_node, $this->header[5] . ';Koef=' . $cells[5]); } if ($cells[6] != '') { $this->addBet($event_node, $this->header[6] . ';Koef=' . $cells[6]); } if ($cells[7] != '') { $this->addBet($event_node, $this->header[7] . ';Koef=' . $cells[7]); } if ($cells[8] != '') { $this->addBet($event_node, $this->header[8] . ';Koef=' . $cells[8]); } if ($cells[9] != '') { preg_match('/\\(([\\+\\-]*?)(.+?)\\)<br\\/>(.+?)/iU', $cells[9], $matches); if ($matches[1] == '' and $matches[2] != '0') { $matches[1] = '+'; } $this->addBet($event_node, $this->header[9] . ';Value=' . $matches[1] . $matches[2] . ';Koef=' . $matches[3]); } if ($cells[10] != '') { preg_match('/\\(([\\+\\-]*?)(.+?)\\)<br\\/>(.+?)/iU', $cells[10], $matches); if ($matches[1] == '' and $matches[2] != '0') { $matches[1] = '+'; } $this->addBet($event_node, $this->header[10] . ';Value=' . $matches[1] . $matches[2] . ';Koef=' . $matches[3]); } if ($cells[12] != '') { $value = $cells[11]; if (!strpos($value, '.')) { $value = $value - 0.5; } $this->addBet($event_node, $this->header[12] . ';Value=' . $value . ';Koef=' . $cells[12]); } if ($cells[13] != '') { $value = $cells[11]; if (!strpos($value, '.')) { $value = $value + 0.5; } $this->addBet($event_node, $this->header[13] . ';Value=' . $value . ';Koef=' . $cells[13]); } }
function Products_Spider_Catalog() { global $wpdb; require_once "products.php"; require_once "Products.html.php"; if (!function_exists('print_html_nav')) { require_once "nav_function/nav_html_func.php"; } if (isset($_GET['id'])) { $id = $_GET['id']; } else { $id = 0; } if (isset($_GET['task'])) { $task = $_GET['task']; } else { $task = ""; } switch ($task) { case 'edit_prad': editProduct($id); break; case 'add_prad': addProduct(); break; case 'apply': if ($id) { check_admin_referer('nonce_sp_cat', 'nonce_sp_cat'); update_prad_cat($id); } else { check_admin_referer('nonce_sp_cat', 'nonce_sp_cat'); save_prad_cat(); $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "spidercatalog_products"); } editProduct($id); break; case 'save': if ($id) { check_admin_referer('nonce_sp_cat', 'nonce_sp_cat'); update_prad_cat($id); } else { check_admin_referer('nonce_sp_cat', 'nonce_sp_cat'); save_prad_cat(); } showProducts(); break; case 'saveorder': break; case 'publish': check_admin_referer('nonce_sp_cat', 'nonce_sp_cat'); publish_all(TRUE); showProducts(); break; case 'unpublish': check_admin_referer('nonce_sp_cat', 'nonce_sp_cat'); publish_all(FALSE); showProducts(); break; case 'delete': check_admin_referer('nonce_sp_cat', 'nonce_sp_cat'); delete_all(); showProducts(); break; case 'unpublish_prad': $nonce_sp_cat = $_REQUEST['_wpnonce']; if (!wp_verify_nonce($nonce_sp_cat, 'nonce_sp_cat')) { die("Are you sure you want to do this?"); } change_prod($id); showProducts(); break; case 'unpublish_prad': $nonce_sp_cat = $_REQUEST['_wpnonce']; if (!wp_verify_nonce($nonce_sp_cat, 'nonce_sp_cat')) { die("Are you sure you want to do this?"); } change_prod($id); showProducts(); break; case 'remove_prod': $nonce_sp_cat = $_REQUEST['_wpnonce']; if (!wp_verify_nonce($nonce_sp_cat, 'nonce_sp_cat')) { die("Are you sure you want to do this?"); } removeProduct($id); showProducts(); break; case 'edit_reviews': spider_cat_prod_rev($id); break; case 'delete_reviews': check_admin_referer('nonce_sp_cat', 'nonce_sp_cat'); delete_rev($id); spider_cat_prod_rev($id); break; case 'delete_review': $nonce_sp_cat = $_REQUEST['_wpnonce']; if (!wp_verify_nonce($nonce_sp_cat, 'nonce_sp_cat')) { die("Are you sure you want to do this?"); } delete_single_review($id); spider_cat_prod_rev($id); break; case 'edit_rating': spider_cat_prod_rating($id); break; case 'delete_ratings': check_admin_referer('nonce_sp_cat', 'nonce_sp_cat'); delete_ratings($id); spider_cat_prod_rating($id); break; case 'delete_rating': $nonce_sp_cat = $_REQUEST['_wpnonce']; if (!wp_verify_nonce($nonce_sp_cat, 'nonce_sp_cat')) { die("Are you sure you want to do this?"); } delete_single_rating($id); spider_cat_prod_rating($id); break; case 's_p_apply_rating': check_admin_referer('nonce_sp_cat', 'nonce_sp_cat'); update_s_c_rating($id); spider_cat_prod_rating($id); break; case 's_p_save_rating': check_admin_referer('nonce_sp_cat', 'nonce_sp_cat'); update_s_c_rating($id); editProduct($id); break; default: showProducts(); break; } }
$users=new usersMenus(); if(!$users->AsWebStatisticsAdministrator){die();} if(isset($_GET["tabs"])){tabs();exit;} if(isset($_GET["popup"])){popup();exit;} if(isset($_POST["hostname"])){save_hostname();exit;} if(isset($_GET["status"])){status();exit;} if(isset($_GET["status-list"])){status_list();exit;} if(isset($_POST["delete-file"])){delete_file();exit;} if(isset($_POST["scan-now"])){scan_now();exit;} if(isset($_GET["test-nas-popup"])){test_nas_popup();exit;} if(isset($_GET["test-nas-js"])){test_nas_js();exit;} if(isset($_POST["import-now"])){import_now();exit;} if(isset($_GET["events"])){events();exit;} if(isset($_POST["delete-all"])){delete_all();exit;} js(); function test_nas_js(){ header("content-type: application/x-javascript"); $page=CurrentPageName(); $tpl=new templates(); $title=$tpl->_ENGINE_parse_body("{test_connection}"); echo "YahooWin3('650','$page?test-nas-popup=yes','$title');"; } function js(){ //echo "alert('".$tpl->javascript_parse_text("Beta mode")."')";return; $sock=new sockets(); $page=CurrentPageName();
/* Deletes the user with the userId that is passed Should be used by admin to controll users and by users themselves to eliminate their account. */ // header('Content-Type: application/json'); require '../class.categories.inc'; // GET The info from POST called by Ajax method $nameCat = $_POST['nameCat']; $category = new categories(); $category->nameCat = $nameCat; //Calls method to store users onto the database and Returns 1 if the the user was stored and 0 if the user could not be stored $catDelete = $category->deleteCat($category); $returnDelete = array('success' => false); //Assign values to array that will be returned with success true if the user was stored and false if not (user already exists) if ($catDelete != 0) { $returnDelete['success'] = true; delete_all('../../categories/' . $category->nameCat); } // Function used to delete folders with images inside of them function delete_all($item) { if (is_dir($item)) { array_map('delete_all', array_diff(glob("{$item}/{,.}*", GLOB_BRACE), array("{$item}/.", "{$item}/.."))); rmdir($item); } else { unlink($item); } } //Return for jason to work with echo json_encode($returnDelete);
$first_calc = $first_calc + 1; } if (!isset($result_calc)) { echo '種類名、カテゴリー名を削除しました。<br>'; } } //種類の集計結果を削除 if ($kind == true) { for ($i = $first_kind; $i <= $last_kind; $i++) { $result_kind = delete_all('kind', $first_kind); $first_kind = $first_kind + 1; } if (!isset($result_kind)) { echo '種類の集計結果を削除しました。<br>'; } } //カテゴリーの集計結果を削除 if ($category == true) { for ($i = $first_category; $i <= $last_category; $i++) { $result_category = delete_all('category', $first_category); $first_category = $first_category + 1; } if (!isset($result_category)) { echo 'カテゴリーの集計結果を削除しました。'; } } ?> </table> </body> </html>
$form['maintenance'] = '0'; } foreach ($form as $key => $input) { // Only update values that have changed if (array_key_exists('o_' . $key, $luna_config) && $luna_config['o_' . $key] != $input) { if ($input != '' || is_int($input)) { $value = '\'' . $db->escape($input) . '\''; } else { $value = 'NULL'; } $db->query('UPDATE ' . $db->prefix . 'config SET conf_value=' . $value . ' WHERE conf_name=\'o_' . $db->escape($key) . '\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error()); } } if ($action == 'clear_cache') { confirm_referrer('backstage/maintenance.php'); delete_all(LUNA_ROOT . 'cache'); redirect('backstage/maitenance.php?cache_cleared=true'); } // Regenerate the config cache if (!defined('LUNA_CACHE_FUNCTIONS_LOADED')) { require LUNA_ROOT . 'include/cache.php'; } generate_config_cache(); clear_feed_cache(); redirect('backstage/maintenance.php?saved=true'); } $page_title = array(luna_htmlspecialchars($luna_config['o_board_title']), __('Admin', 'luna'), __('Maintenance', 'luna')); define('LUNA_ACTIVE_PAGE', 'admin'); require 'header.php'; load_admin_nav('maintenance', 'maintenance'); if (isset($_GET['saved'])) {
private function extract_main_bets(&$tournir_node, $html, $sport_sign, $tournir_id) { $html = kill_property($html, 'TagNo'); $html = numbering_tag($html, 'tr'); $events = extract_all_numbered_tags($html, 'tr', 'event-header'); foreach ($events as $event) { // получаем $event_info = take_be($event, '<table', '</table>'); file_put_contents("Event.html", $event_info); preg_match_all('/<div class="(.*)?member-name(.*)?">(.*)?<\\/div>/imsU', $event_info, $matches); $gamer1_name = $matches[3][0]; $gamer2_name = $matches[3][1]; $datetime_str = delete_all(copy_be($event_info, '<td', '</td>', '"date"'), '<', '>'); list($day_no, $month_no, $year_no, $hour, $minute) = $this->decode_datetime($datetime_str); $extrabet = copy_be($event_info, '<a', '</a>', 'treeid'); $event_id = extract_property_values($extrabet, 'treeid', ''); $extrabet = delete_all($extrabet, '<', '>'); $event_node = $this->event_create($tournir_node, $event_id, mktime($hour, $minute, 0, $month_no, $day_no, $year_no), $gamer1_name, $gamer2_name); $cells = extract_all_tags(replace_all($event, '<td', '>', '<td>'), '<td>', '</td>'); $i = 0; foreach ($cells as $cell) { $cell = trim(copy_between($cell, '<td>', '</td>')); if ($cell) { $cell = kill_tag_bound($cell, 'a'); unset($bettype); $bettype_str = $this->header[$i]; foreach (explode(';', $bettype_str) as $bet_pair) { list($key, $value) = explode('=', $bet_pair); $bettype[$key] = $value; } if ($bettype['Kind'] == 'Total') { preg_match('/\\((.+?)\\)<br\\/>(.+?)/iU', $cell, $matches); if ($matches[2]) { $matches[2] = delete_all($matches[2], '<', '>'); $this->addBet($event_node, $bettype_str . ';Value=' . $matches[1] . ';Koef=' . $matches[2]); } } elseif ($bettype['Kind'] == 'Fora') { preg_match('/\\(([\\+\\-]*?)(.+?)\\)<br\\/>(.+?)/iU', $cell, $matches); if ($matches[3]) { $matches[3] = delete_all($matches[3], '<', '>'); $this->addBet($event_node, $bettype_str . ';Value=' . $matches[1] . $matches[2] . ';Koef=' . $matches[3]); } } else { $cell = delete_all($cell, '<', '>'); $this->addBet($event_node, $bettype_str . ';Koef=' . $cell); } } $i++; } //if ($extrabet > 0) $this->extract_extra_bets($event_node, $tournir_id, $event_id); } }
} if ($_SESSION['user_is_admin'] == '1' && isset($_GET['list_users'])) { echo list_users(); } elseif ($_SESSION['user_is_admin'] == '1' && isset($_GET['reset_user_password'])) { $user_id = mysql_real_escape_string($_POST['user_id']); echo reset_user_password($user_id); } elseif ($_SESSION['user_is_admin'] == '1' && isset($_GET['change_user_permissions'])) { $user_id = mysql_real_escape_string($_POST['user_id']); echo change_user_permissions($user_id); } elseif ($_SESSION['user_is_admin'] == '1' && isset($_GET['delete_user_data'])) { $user_id = mysql_real_escape_string($_POST['user_id']); $data = $_POST['delete_data']; echo delete_user_data($user_id, $data); } elseif ($_SESSION['user_is_admin'] == '1' && isset($_GET['delete_all'])) { $data = $_POST['delete_data']; echo delete_all($data); } elseif ($_SESSION['user_is_admin'] == '1' && isset($_GET['save_system_configuration'])) { $price = mysql_real_escape_string($_POST['price']); echo save_system_configuration($price); } elseif (isset($_GET['get_usage'])) { echo get_usage(); } elseif (isset($_GET['get_reservation_reminders'])) { echo get_reservation_reminders(); } elseif (isset($_GET['toggle_reservation_reminder'])) { echo toggle_reservation_reminder(); } elseif (isset($_GET['change_user_details'])) { $user_name = mysql_real_escape_string(trim($_POST['user_name'])); $user_email = mysql_real_escape_string($_POST['user_email']); $user_password = mysql_real_escape_string($_POST['user_password']); echo change_user_details($user_name, $user_email, $user_password); } else {
function extract_bet($Html) { $Html = delete_all($Html, "(at ", ")"); $Html = delete_all($Html, "(score: ", ")"); $Html = str_ireplace('<wbr/>', '', $Html); $Html = str_replace("-.--", " ", $Html); $Html = kill_tag($Html, "h1|script"); $Html = kill_space($Html); $Html = kill_comment($Html); $Html = numbering_tag($Html, 'div'); $Html = extract_numbered_tags($Html, 'div', "", "bet-list"); $Html = extract_numbered_tags($Html, 'div', "", "dsBodyContent"); $Html = kill_property($Html, 'TagNo'); $Html = kill_property($Html, "onmouseover|onmouseout|onclick|bgcolor|border|cellpadding|leaguename|id|width|cellspacing|regionname"); $Html = kill_property_value($Html, "colspan", "1"); $Html = kill_tag_bound($Html, "form|input|a|nobr|img|tbody|span"); $Html = delete_all($Html, ' class="unselected ', '"'); $Html = delete_all($Html, ' class=\'unselected ', '\''); $Html = replace_all_contain($Html, '<div', '</div>', '', 'isFavourite|' . 'isNoFavourite'); $Html = replace_all_contain($Html, '<tr', '</tr>', '', 'sizer|' . 'bottomline'); $Html = kill_property_value_exclude($Html, "class", "controlHeaderNoShadow|topbar|normal|def|alt|ControlContent"); $Html = str_ireplace('<td></td>', '<td/>', $Html); $Html = kill_unclassed_tag($Html, 'div'); $Html = kill_apostrof($Html, 'colspan'); // !-- Приводим Totalы к нормальному виду --> $Html = replace_all($Html, "<h5>Сумма набранных очков ", '</h5>', '<h5>Total</h5>'); $Html = replace_all($Html, "<h5>Тотал ", '</h5>', '<h5>Total</h5>'); $Html = replace_all($Html, "<h5>Сколько будет забито голов?", '</h5>', '<h5>Total</h5>'); $Html = replace_all($Html, "<h5>Сколько голов будет забито?", '</h5>', '<h5>Total</h5>'); $Html = replace_all($Html, "<h5>Сколько геймов будет сыграно в матче?", '</h5>', '<h5>Total</h5>'); $Html = replace_all($Html, "<h5>Кто выиграет больше геймов в матче? (гандикап игрока)", '</h5>', '<h5>Fora</h5>'); $Html = replace_all($Html, "<h5>Двойной шанс", '</h5>', '<h5>1X_12_X2</h5>'); $Html = str_ireplace('<tr class="alt"', "\r\n" . '<tr class="alt"', $Html); $Html = str_ireplace('<tr class="def"', "\r\n" . '<tr class="alt"', $Html); $Tags = explode("\r\n", $Html); foreach ($Tags as $tag) { if (copy_be($tag, '>', '<', ' - ', ' - ', ':')) { $Html = str_ireplace("\r\n" . $tag, str_ireplace('="alt"', '="evn"', $tag), $Html); } } $Tags = explode("\r\n", $Html); foreach ($Tags as $tag) { if (strpos($tag, '"alt"')) { $newtag = numbering_tag($tag, 'tr'); $trAlt = extract_numbered_tags($newtag, 'tr', '', 'alt'); $h5 = delete_all($trAlt, '<', '>'); if (strpos($h5, ' ')) { $newtag = str_replace($trAlt, '', $newtag); $Normals = explode("\r\n", extract_numbered_tags($newtag, 'tr', "\r\n", 'normal')); foreach ($Normals as $normal) { $newtag = str_replace($normal, '', $newtag); } $newtag = kill_property($newtag, 'TagNo'); $Html = str_replace($tag, $newtag, $Html); } } } $Html = str_ireplace("\r\n", '', $Html); $Html = str_ireplace('<tr class="evn"', "\r\n" . '<tr class="evn"', $Html); $Tags = explode("\r\n", $Html); foreach ($Tags as $tag) { if (strpos($tag, '"evn"')) { $newtag = numbering_tag($tag, 'tr'); $trEvn = extract_numbered_tags($newtag, 'tr', '', 'evn'); if (strpos($newtag, '="normal"') == 0) { $newtag = str_replace($trEvn, '', $newtag); } $newtag = kill_property($newtag, 'TagNo'); $Html = str_replace($tag, $newtag, $Html); } } $Html = str_ireplace("\r\n", '', $Html); return $Html; }
private function extract_main_bets_soccer(&$tournir_node, $html, $sport_sign, $tournir_id) { $html = str_ireplace('<tr', '<tr', $html); $html = str_ireplace('</tr', '</tr', $html); $html = copy_be($html, '<tr ', '</tr>', 'class=', 'tc'); $event_id = copy_between($html, 'shdop(\'', '\''); $html = kill_tag_bound($html, 'b|a'); $cells = extract_all_tags($html, '<td>', '</td>'); $i = 0; foreach ($cells as $cell) { $cells[$i++] = delete_all($cell, '<', '>'); } list($hour, $minute) = $this->decode_time($cells[0]); $gamer1_name = $cells[1]; $gamer2_name = $cells[4]; $event_node = $this->event_create($tournir_node, $event_id, mktime($hour, $minute, 0, $this->month_no, $this->day_no, $this->year_no), $gamer1_name, $gamer2_name); if ($cells[3] != '') { $this->addBet($event_node, $this->header[3] . ';Value=' . $cells[2] . ';Koef=' . $cells[3]); } if ($cells[6] != '') { $this->addBet($event_node, $this->header[6] . ';Value=' . $cells[5] . ';Koef=' . $cells[6]); } if ($cells[7] != '') { $this->addBet($event_node, $this->header[7] . ';Koef=' . $cells[7]); } if ($cells[8] != '') { $this->addBet($event_node, $this->header[8] . ';Koef=' . $cells[8]); } if ($cells[9] != '') { $this->addBet($event_node, $this->header[9] . ';Koef=' . $cells[9]); } if ($cells[10] != '') { $this->addBet($event_node, $this->header[10] . ';Koef=' . $cells[10]); } if ($cells[11] != '') { $this->addBet($event_node, $this->header[11] . ';Koef=' . $cells[11]); } if ($cells[12] != '') { $this->addBet($event_node, $this->header[12] . ';Koef=' . $cells[12]); } if ($cells[14] != '') { $this->addBet($event_node, $this->header[14] . ';Value=' . $cells[13] . ';Koef=' . $cells[14]); } if ($cells[15] != '') { $this->addBet($event_node, $this->header[15] . ';Value=' . $cells[13] . ';Koef=' . $cells[15]); } }
/** * delete a directory and all of its content * * @param string the directory to delete */ function delete_all($path) { global $context; $path_translated = str_replace('//', '/', $context['path_to_root'] . '/' . $path); if ($handle = Safe::opendir($path_translated)) { while (($node = Safe::readdir($handle)) !== FALSE) { if ($node[0] == '.') { continue; } // make a real name $target = str_replace('//', '/', $path . '/' . $node); $target_translated = str_replace('//', '/', $path_translated . '/' . $node); // delete a sub directory if (is_dir($target_translated)) { delete_all($path . '/' . $node); Safe::rmdir($target_translated); // delete the node } else { Safe::unlink($target_translated); } // statistics global $deleted_nodes; $deleted_nodes++; } Safe::closedir($handle); } }
/** * Delete all existing cache files * * @access public * @return bool */ function delete_all() { //---change---// //delete_files($this->db->cachedir, TRUE); if ($this->db->cache_method == "storage") { $storage = new SaeStorage(); $file_list = $storage->getList($this->db->cachedir); for ($i = 0; $i < count($file_list); $i++) { $storage->delete($this->db->cachedir, $file_list[$i]); } if (count($file_list) == 100) { delete_all(); } } else { $mmc = memcache_init(); if ($mmc) { $catalog_data = memcache_get($mmc, $this->db->cachedir); $catalog; if ($catalog_data == false) { return false; } else { $catalog = unserialize($catalog_data); } foreach ($catalog as $key => $value) { memcache_delete($mmc, $key); } $catalog = array(); memcache_set($mmc, $this->db->cachedir, serialize($catalog)); } } }