function AddComment($AccountDBHost, $DBUser, $DBPassword, $AccountDB, $ID, $REASON) { $connection = mysql_connect($AccountDBHost, $DBUser, $DBPassword) or die(mysql_error()); _SelectDB($AccountDB, $connection); $query = mysql_query("UPDATE `account_transfer` SET `Reason` = \"" . _X($REASON) . "\" WHERE `id` = " . (int) $ID . ";", $connection) or die(mysql_error()); mysql_close($connection); }
die("DELETE INSTALATION FOLDER"); } include_once '_template/_header.php'; if (_getUsername()) { Header('Location: _userside.php'); } if (!isset($_POST['username']) || !isset($_POST['password']) || !isset($_POST['CaptchaText']) || empty($_POST['username']) || empty($_POST['password']) || empty($_POST['CaptchaText'])) { $REASON = _RDiv($L[147]); } else { if ($_SESSION['capcha'] != strtolower($_POST['CaptchaText'])) { $REASON = _RDiv($L[145]); } else { $username = _Z($_POST['username']); $SHA1Password = SHA1Password($username, _Z($_POST['password'])); $connection = _MySQLConnect($AccountDBHost, $DBUser, $DBPassword, $AccountDB); $query = mysql_query("SELECT `id`,`username` FROM `account` WHERE `username` = '" . _X($username) . "' AND `sha_pass_hash` = '" . _X($SHA1Password) . "';", $connection) or die(mysql_error()); $result = mysql_fetch_array($query); if (empty($result['username'])) { $REASON = _RDiv($L[157]); mysql_close($connection) or die(mysql_error()); } else { $_SESSION['AccountID'] = $result['id']; $_SESSION['AccountUN'] = strtoupper($result['username']); $query = mysql_query("SELECT `id` FROM `account_details` WHERE `id` = " . (int) _getAccountID() . ";", $connection) or die(mysql_error()); $result = mysql_fetch_array($query); if (empty($row[0])) { mysql_query("INSERT IGNORE INTO `account_details`(`id`) VALUES (" . (int) _getAccountID() . ");", $connection) or die(mysql_error()); } mysql_close($connection) or die(mysql_error()); Header('Location: _userside.php'); }
} else { $_SESSION['STEP2'] = "NO"; $char_money = _MaxValue($json['uinf']['money'], $MaxMoney); $char_speccount = $json['uinf']['specs']; $char_gender = $json['uinf']['gender'] - 2 == 1 ? 1 : 0; $char_totalkills = $json['uinf']['kills']; $char_arenapoints = _MaxValue($json['uinf']['arenapoints'], $MaxAP); $char_honorpoints = _MaxValue($json['uinf']['honor'], $MaxHP); $INVrow = ""; $GEMrow = ""; $CURrow = ""; $row = ""; $QUERYFOREXECUTE = ""; $connection = mysql_connect(_HostDBSwitch($CHAR_REALM), $DBUser, $DBPassword); _SelectDB(_CharacterDBSwitch($CHAR_REALM), $connection); mysql_query("\n INSERT INTO `characters`(`guid`,`name`,`level`,`gender`,`totalHonorPoints`,`arenaPoints`,`totalKills`,`money`,`class`,`race`,`at_login`,`account`,`taximask`,`speccount`,`online`) VALUES (\n " . $GUID . ",\"" . _X($CHAR_NAME) . "\"," . (int) $CharLevel . "," . (int) $char_gender . "," . (int) $char_honorpoints . "," . (int) $char_arenapoints . ",\n " . (int) $char_totalkills . "," . (int) $char_money . "," . $ClassID . "," . $RaceID . ", 0x180, 1, \"0 0 0 0 0 0 0 0 0 0 0 0 0 0\"," . (int) $char_speccount . ", 0);", $connection); $QUERYFOREXECUTE = $QUERYFOREXECUTE . "\n INSERT INTO `character_transfer` VALUES (" . $GUID . "," . $CHAR_ACCOUNT_ID . "," . $GM_ACCOUNT_ID . "," . $ID . ");\n\n UPDATE `characters` SET\n `position_x` = 5741.36,\n `position_y` = 626.982,\n `position_z` = 648.354,\n `map` = 571,\n `health` = 100,\n `zone` = 4395,\n `cinematic` = 1\n WHERE `guid` = " . $GUID . ";"; if ($char_speccount == 2) { LearnSeparateSpell(63644, $GUID, $connection); LearnSeparateSpell(63645, $GUID, $connection); } if ($ClassID == 6) { $QUERYFOREXECUTE = $QUERYFOREXECUTE . "\n " . DeathKnightTransfer($GUID); } foreach ($json['glyphs'] as $key => $value) { $GlyphID1 = _GetGlyphID($value[0][0]); $GlyphID2 = _GetGlyphID($value[0][1]); $GlyphID3 = _GetGlyphID($value[0][2]); $GlyphID4 = _GetGlyphID($value[1][0]); $GlyphID5 = _GetGlyphID($value[1][1]); $GlyphID6 = _GetGlyphID($value[1][2]);
if (!_getUsername()) { Header('Location: index.php'); } if (!isset($_POST['cur_password']) || !isset($_POST['new_password']) || !isset($_POST['new_password2']) || empty($_POST['cur_password']) || empty($_POST['new_password']) || empty($_POST['new_password2'])) { $reason = _BDiv($L[214]); } else { if ($_POST['new_password'] !== $_POST['new_password2']) { $reason = _RDiv($L[211]); } else { $SHA1Password = SHA1Password(_getUsername(), _Z($_POST['cur_password'])); $SHA1PasswordNEW = SHA1Password(_getUsername(), _Z($_POST['new_password'])); $connection = _MySQLConnect($AccountDBHost, $DBUser, $DBPassword, $AccountDB); $query = mysql_query("SELECT `id` FROM `account` WHERE `username` = '" . _getUsername() . "' AND `sha_pass_hash` = '" . _X($SHA1Password) . "';", $connection) or die(mysql_error()); $result = mysql_fetch_array($query); if (!empty($result['id'])) { mysql_query("UPDATE `account` SET `sha_pass_hash` = '" . _X($SHA1PasswordNEW) . "',`sessionkey` = '',`v` = '',`s` = '' WHERE `username` = '" . _getUsername() . "';", $connection) or die(mysql_error()); _SpendMythCoins(0, 13, "", 0, "", 0, "", $connection); $reason = _BDiv($L[213]); mysql_close($connection) or die(mysql_error()); } else { $reason = _RDiv($L[212]); mysql_close($connection) or die(mysql_error()); } } } ?> <div class = 'text-center'> <h2><?php echo $L[93]; ?> </h2>
if (!$content['sign-in']['done?'] and !$content['sign-in']['necessary?']) { ?> <a id="e2-visual-login" href="<?php echo $content['hrefs']['sign-in']; ?> "><img src="<?php echo _IMGSRC('login.png'); ?> " class="icon" alt="¬ход под паролем" width="16" height="16" /></a> <?php } ?> <?php _T('copyrights'); ?> <div class="authors"> <?php _T('engine-info'); ?> , дизайн — <a href="http://nikitin.cc/e2_literra">Literra</a>. </div> </div> <div class="searchform"> <?php _T_FOR('form-search'); ?> </div> </footer> <?php _X('footer-post');
<div id="message" class="alert alert-error"><strong><?php echo esc_html(_X($message, 'calendar-feeds', AI1EC_PLUGIN_NAME)); ?> </strong></div>
/** * Sample data * * Adds sample SportsPress data * * @access public */ public static function insert_posts() { // Initialize inserted ids array $inserted_ids = array('sp_league' => array(), 'sp_season' => array(), 'sp_venue' => array(), 'sp_position' => array(), 'sp_role' => array(), 'sp_event' => array(), 'sp_calendar' => array(), 'sp_team' => array(), 'sp_table' => array(), 'sp_player' => array(), 'sp_list' => array(), 'sp_staff' => array()); // Terms to insert $taxonomies = array(); // Competitions $taxonomies['sp_league'] = array(_x('Primary League', 'example', 'sportspress'), _x('Secondary League', 'example', 'sportspress')); // Seasons $current_year = date('Y'); $current_year = intval($current_year); $taxonomies['sp_season'] = array($current_year - 1, $current_year, $current_year + 1); // Venues $taxonomies['sp_venue'] = array(array('name' => 'Bentleigh', 'meta' => array('sp_address' => '12A Bolinda Street, Bentleigh VIC 3204, Australia', 'sp_latitude' => -37.920537, 'sp_longitude' => 145.043199)), array('name' => 'Essendon', 'meta' => array('sp_address' => '74 Napier Street, Essendon VIC 3040, Australia', 'sp_latitude' => -37.75194, 'sp_longitude' => 144.919549)), array('name' => 'Kensington', 'meta' => array('sp_address' => '50 Altona Street, Kensington, Victoria, Australia', 'sp_latitude' => -37.797789, 'sp_longitude' => 144.924709))); // Jobs $taxonomies['sp_role'] = array(_X('Coach', 'example', 'sportspress')); /* * Insert terms */ foreach ($taxonomies as $taxonomy => $terms) { foreach ($terms as $term) { // Determine if term is array or name string if (is_array($term)) { $name = $term['name']; } else { $name = $term; } // Insert term $inserted = wp_insert_term($name, $taxonomy, array('description' => $name, 'slug' => sanitize_title($name))); // Add meta to term if is array if (!is_wp_error($inserted) && is_array($term) && array_key_exists('meta', $term)) { $t_id = sp_array_value($inserted, 'term_id', 1); $meta = sp_array_value($term, 'meta'); update_option("taxonomy_{$t_id}", $meta); // Add to inserted ids array $inserted_ids[$taxonomy][] = $t_id; } } } // Create sample content $sample_content = _x('This is an example %1$s. As a new SportsPress user, you should go to <a href=\\"%3$s\\">your dashboard</a> to delete this %1$s and create new %2$s for your content. Have fun!', 'example', 'sportspress'); // Define teams $teams = array(array('name' => 'Bluebirds', 'abbreviation' => 'BENT', 'url' => 'http://tboy.co/bluebirds'), array('name' => 'Eagles', 'abbreviation' => 'ESS', 'url' => 'http://tboy.co/eagles'), array('name' => 'Kangaroos', 'abbreviation' => 'KENS', 'url' => 'http://tboy.co/kangaroos')); // Define players $players = array('Mario Bellucci', 'Aiden Leggatt', 'Seth Clemens', 'Mitchell Childe', 'Daniel Benn', 'Archie Stead', 'Finn Rosetta', 'Koby Brough', 'Blake Bannan', 'Hugo Stones', 'Tristian Holme', 'Mason Ewing'); // Define staff $staff = array('Bobby Brown'); // Define event videos $event_videos = array('https://www.youtube.com/watch?v=xNkf2LYckI0', 'https://www.youtube.com/watch?v=sIrjQyuwteM', 'https://www.youtube.com/watch?v=xSGxuTGVQYE'); // Get countries $countries = new SP_Countries(); /* * Insert teams */ foreach ($teams as $index => $team) { $post['post_title'] = $team['name']; $post['post_type'] = 'sp_team'; $post['post_status'] = 'publish'; $post['post_content'] = sprintf($sample_content, __('Team', 'sportspress'), __('Teams', 'sportspress'), admin_url()); // Terms $post['tax_input'] = array(); $taxonomies = array('sp_league', 'sp_season'); foreach ($taxonomies as $taxonomy) { $post['tax_input'][$taxonomy] = get_terms($taxonomy, array('hide_empty' => 0, 'fields' => 'ids')); } $post['tax_input']['sp_venue'] = get_terms('sp_venue', array('hide_empty' => 0, 'fields' => 'ids', 'orderby' => 'id', 'order' => 'ASC', 'number' => 1, 'offset' => $index)); // Insert post $id = wp_insert_post($post); // Add to inserted ids array $inserted_ids['sp_team'][] = $id; // Flag as sample update_post_meta($id, '_sp_sample', 1); // Update meta update_post_meta($id, 'sp_abbreviation', $team['abbreviation']); update_post_meta($id, 'sp_url', $team['url']); } // Get columns $columns = array('team'); $args = array('post_type' => array('sp_performance', 'sp_statistic'), 'posts_per_page' => 2, 'orderby' => 'menu_order', 'order' => 'ASC'); $vars = get_posts($args); foreach ($vars as $var) { $columns[] = $var->post_name; } /* * Insert players */ foreach ($players as $index => $name) { $post['post_title'] = $name; $post['post_type'] = 'sp_player'; $post['post_status'] = 'publish'; $post['post_content'] = sprintf($sample_content, __('Player', 'sportspress'), __('Players', 'sportspress'), admin_url()); // Terms $post['tax_input'] = array(); $taxonomies = array('sp_league', 'sp_season'); foreach ($taxonomies as $taxonomy) { $post['tax_input'][$taxonomy] = get_terms($taxonomy, array('hide_empty' => 0, 'fields' => 'ids')); } $taxonomies = array('sp_position'); foreach ($taxonomies as $taxonomy) { $terms = get_terms($taxonomy, array('hide_empty' => 0, 'fields' => 'ids', 'orderby' => 'slug', 'number' => 1, 'offset' => $index % 4)); if ($terms && !is_wp_error($terms)) { $post['tax_input'][$taxonomy] = $terms; } } // Insert post $id = wp_insert_post($post); // Add to inserted ids array $inserted_ids['sp_player'][] = $id; // Flag as sample update_post_meta($id, '_sp_sample', 1); // Calculate meta $nationality = array_rand($countries->countries); $team_index = floor($index / 4); $past_team_index = ($team_index + 1) % 3; $current_team = sp_array_value($inserted_ids['sp_team'], $team_index, 0); $past_team = sp_array_value($inserted_ids['sp_team'], $past_team_index, 0); $primary_league = reset($post['tax_input']['sp_league']); $season_teams = $season_stats = array(); foreach ($post['tax_input']['sp_season'] as $season_index => $season_id) { $season_stats[$season_id] = array(); if ($season_index == 0) { $season_teams[$season_id] = $past_team; } else { $season_teams[$season_id] = $current_team; if ($season_index == 1) { foreach ($vars as $var) { $season_stats[$season_id][$var->post_name] = rand(1, 10); } } } } $player_stats = array($primary_league => $season_stats); $player_leagues = array($primary_league => $season_teams); // Update meta update_post_meta($id, 'sp_columns', $columns); update_post_meta($id, 'sp_number', $index + 1); update_post_meta($id, 'sp_nationality', $nationality); update_post_meta($id, 'sp_current_team', $current_team); update_post_meta($id, 'sp_past_team', $past_team); update_post_meta($id, 'sp_leagues', $player_leagues); update_post_meta($id, 'sp_statistics', $player_stats); sp_update_post_meta_recursive($id, 'sp_team', array($current_team, $past_team)); } // Get columns $columns = array(); $args = array('post_type' => 'sp_performance', 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC'); $performance_posts = get_posts($args); foreach ($performance_posts as $performance_post) { if (sizeof($columns) >= 5) { continue; } $columns[] = $performance_post->post_name; } $args = array('post_type' => 'sp_result', 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC'); $result_posts = get_posts($args); $args = array('post_type' => 'sp_outcome', 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC'); $outcome_posts = get_posts($args); /* * Insert staff */ foreach ($staff as $index => $name) { $post['post_title'] = $name; $post['post_type'] = 'sp_staff'; $post['post_status'] = 'publish'; $post['post_content'] = sprintf($sample_content, __('Staff', 'sportspress'), __('Staff', 'sportspress'), admin_url()); // Terms $post['tax_input'] = array(); $taxonomies = array('sp_league', 'sp_season'); foreach ($taxonomies as $taxonomy) { $post['tax_input'][$taxonomy] = get_terms($taxonomy, array('hide_empty' => 0, 'fields' => 'ids')); } $taxonomies = array('sp_role'); foreach ($taxonomies as $taxonomy) { $terms = get_terms($taxonomy, array('hide_empty' => 0, 'fields' => 'ids', 'orderby' => 'slug', 'number' => 1, 'offset' => $index % 4)); $post['tax_input'][$taxonomy] = $terms; } // Insert post $id = wp_insert_post($post); // Add to inserted ids array $inserted_ids['sp_staff'][] = $id; // Flag as sample update_post_meta($id, '_sp_sample', 1); // Calculate meta $team_index = floor($index / 4); $past_teams = $inserted_ids['sp_team']; $current_team = sp_array_value($past_teams, $team_index, 0); unset($past_teams[$team_index]); // Update meta update_post_meta($id, 'sp_columns', $columns); update_post_meta($id, 'sp_number', $index + 1); update_post_meta($id, 'sp_nationality', 'aus'); update_post_meta($id, 'sp_current_team', $current_team); sp_update_post_meta_recursive($id, 'sp_past_team', $past_teams); sp_update_post_meta_recursive($id, 'sp_team', $inserted_ids['sp_team']); } /* * Insert events */ for ($index = 0; $index < 6; $index++) { // Determine team index and post status $i = $index % 3; if ($index < 3) { $post_status = 'publish'; $post_year = $current_year - 1; $event_season = get_terms('sp_season', array('hide_empty' => 0, 'fields' => 'ids', 'orderby' => 'id', 'order' => 'ASC', 'number' => 1)); } else { $post_status = 'future'; $post_year = $current_year + 1; $event_season = get_terms('sp_season', array('hide_empty' => 0, 'fields' => 'ids', 'orderby' => 'id', 'order' => 'DESC', 'number' => 1)); } // The away team should be the next inserted team, or the first if this is the last event if ($i == 2) { $away_index = 0; } else { $away_index = $i + 1; } $post = array('post_title' => $teams[$i]['name'] . ' ' . get_option('sportspress_event_teams_delimiter', 'vs') . ' ' . $teams[$away_index]['name'], 'post_type' => 'sp_event', 'post_status' => $post_status, 'post_content' => sprintf($sample_content, __('Event', 'sportspress'), __('Events', 'sportspress'), admin_url()), 'post_date' => $post_year . '-' . sprintf('%02d', 3 + $i * 3) . '-' . sprintf('%02d', 5 + $i * 10) . ' ' . (18 + $i) . ':00:00', 'tax_input' => array('sp_league' => get_terms('sp_league', array('hide_empty' => 0, 'fields' => 'ids', 'orderby' => 'id', 'order' => 'ASC', 'number' => 1)), 'sp_season' => $event_season, 'sp_venue' => get_terms('sp_venue', array('hide_empty' => 0, 'fields' => 'ids', 'orderby' => 'id', 'order' => 'ASC', 'number' => 1, 'offset' => $i)))); // Insert post $id = wp_insert_post($post); // Add to inserted ids array $inserted_ids['sp_event'][] = $id; // Flag as sample update_post_meta($id, '_sp_sample', 1); // Calculate home and away team ids $home_team_index = $i % 3; $away_team_index = ($i + 1) % 3; $home_team_id = sp_array_value($inserted_ids['sp_team'], $home_team_index, 0); $away_team_id = sp_array_value($inserted_ids['sp_team'], $away_team_index, 0); $event_teams = array($home_team_id, $away_team_id); // Initialize meta $event_players = array(0); $performance = $results = array(); if ($home_team_id) { // Add home team player performance $performance[$home_team_id] = array(); for ($j = 0; $j < 4; $j++) { $player_id = sp_array_value($inserted_ids['sp_player'], $home_team_index * 4 + $j); $event_players[] = $player_id; $player_performance = array(); foreach ($performance_posts as $performance_post) { $player_performance[$performance_post->post_name] = rand(0, 1); } $performance[$home_team_id][$player_id] = $player_performance; } // Add home team results $results[$home_team_id] = array(); foreach ($result_posts as $result_post_index => $result_post) { $results[$home_team_id][$result_post->post_name] = 1 + $result_post_index; } $outcome = reset($outcome_posts); if (is_object($outcome)) { $results[$home_team_id]['outcome'] = array($outcome->post_name); } } // Separate teams with zero $event_players[] = 0; if ($away_team_id) { $performance[$away_team_id] = array(); for ($j = 0; $j < 4; $j++) { $player_id = sp_array_value($inserted_ids['sp_player'], $away_team_index * 4 + $j); $event_players[] = $player_id; $player_performance = array(); foreach ($performance_posts as $performance_post) { $player_performance[$performance_post->post_name] = rand(0, 1); } $performance[$away_team_id][$player_id] = $player_performance; } // Add away team results $results[$away_team_id] = array(); foreach ($result_posts as $result_post) { $results[$away_team_id][$result_post->post_name] = '0'; } $outcome = next($outcome_posts); if (is_object($outcome)) { $results[$away_team_id]['outcome'] = array($outcome->post_name); } } if ('publish' === $post_status) { // Swap results for last event only if ($i == 2) { $k = array_keys($results); $v = array_values($results); $rv = array_reverse($v); $results = array_combine($k, $rv); } // Update future post meta update_post_meta($id, 'sp_players', $performance); update_post_meta($id, 'sp_results', $results); } // Update general meta sp_update_post_meta_recursive($id, 'sp_team', $event_teams); sp_update_post_meta_recursive($id, 'sp_player', $event_players); update_post_meta($id, 'sp_columns', $columns); update_post_meta($id, 'sp_format', 'league'); update_post_meta($id, 'sp_video', $event_videos[$i]); } /* * Insert calendar */ $post = array('post_title' => _x('Fixtures & Results', 'example', 'sportspress'), 'post_type' => 'sp_calendar', 'post_status' => 'publish', 'post_content' => sprintf($sample_content, __('Calendar', 'sportspress'), __('Calendars', 'sportspress'), admin_url())); // Insert post $id = wp_insert_post($post); // Add to inserted ids array $inserted_ids['sp_calendar'][] = $id; // Flag as sample update_post_meta($id, '_sp_sample', 1); // Define columns $columns = array('event', 'time', 'article'); // Update meta update_post_meta($id, 'sp_format', 'list'); update_post_meta($id, 'sp_status', 'any'); update_post_meta($id, 'sp_date', 0); update_post_meta($id, 'sp_team', 0); update_post_meta($id, 'sp_order', 'ASC'); update_post_meta($id, 'sp_columns', $columns); /* * Insert league table */ $leagues = get_terms('sp_league', array('hide_empty' => 0, 'orderby' => 'id', 'order' => 'ASC', 'number' => 1)); $league = reset($leagues); $seasons = get_terms('sp_season', array('hide_empty' => 0, 'orderby' => 'id', 'order' => 'ASC', 'number' => 1)); $season = reset($seasons); $post = array('post_title' => $league->name . ' ' . $season->name, 'post_type' => 'sp_table', 'post_status' => 'publish', 'post_content' => sprintf($sample_content, __('League Table', 'sportspress'), __('League Tables', 'sportspress'), admin_url()), 'tax_input' => array('sp_league' => $league->term_id, 'sp_season' => $season->term_id)); // Insert post $id = wp_insert_post($post); // Add to inserted ids array $inserted_ids['sp_table'][] = $id; // Flag as sample update_post_meta($id, '_sp_sample', 1); // Get columns $columns = array(); $args = array('post_type' => 'sp_column', 'posts_per_page' => 8, 'orderby' => 'menu_order', 'order' => 'ASC'); $column_posts = get_posts($args); foreach ($column_posts as $column_post) { $columns[] = $column_post->post_name; } // Update meta sp_update_post_meta_recursive($id, 'sp_team', $inserted_ids['sp_team']); update_post_meta($id, 'sp_columns', $columns); update_post_meta($id, 'sp_highlight', reset($inserted_ids['sp_team'])); /* * Insert player list for each team */ foreach ($inserted_ids['sp_team'] as $index => $team_id) { $post = array('post_title' => get_the_title($team_id) . ' ' . _x('Roster', 'example', 'sportspress'), 'post_type' => 'sp_list', 'post_status' => 'publish', 'post_content' => sprintf($sample_content, __('Player List', 'sportspress'), __('Player Lists', 'sportspress'), admin_url())); // Insert post $id = wp_insert_post($post); // Add to inserted ids array $inserted_ids['sp_list'][] = $id; // Flag as sample update_post_meta($id, '_sp_sample', 1); // Get players from team $list_players = array_slice($inserted_ids['sp_player'], $index * 4, 4); // Get columns $columns = array(); $args = array('post_type' => array('sp_metric'), 'posts_per_page' => 2, 'orderby' => 'menu_order', 'order' => 'ASC'); $column_posts = get_posts($args); foreach ($column_posts as $column_post) { $columns[] = $column_post->post_name; } // Update meta update_post_meta($id, 'sp_format', 'list'); sp_update_post_meta_recursive($id, 'sp_player', $list_players); update_post_meta($id, 'sp_columns', $columns); update_post_meta($id, 'sp_grouping', 'position'); update_post_meta($id, 'sp_orderby', 'name'); update_post_meta($id, 'sp_order', 'ASC'); update_post_meta($id, 'sp_team', $team_id); } /* * Insert player list for player ranking */ $post = array('post_title' => _x('Player Ranking', 'example', 'sportspress'), 'post_type' => 'sp_list', 'post_status' => 'publish', 'post_content' => sprintf($sample_content, __('Player List', 'sportspress'), __('Player Lists', 'sportspress'), admin_url())); // Insert post $id = wp_insert_post($post); // Add to inserted ids array $inserted_ids['sp_list'][] = $id; // Flag as sample update_post_meta($id, '_sp_sample', 1); // Get columns $columns = array('team'); $performance_post = reset($performance_posts); if (is_object($performance_post)) { $columns[] = $performance_post->post_name; } // Update meta update_post_meta($id, 'sp_format', 'list'); sp_update_post_meta_recursive($id, 'sp_player', $inserted_ids['sp_player']); update_post_meta($id, 'sp_columns', $columns); update_post_meta($id, 'sp_grouping', '0'); update_post_meta($id, 'sp_order', 'DESC'); if (is_object($performance_post)) { update_post_meta($id, 'sp_orderby', $performance_post->post_name); } /* * Update player list and league table per team */ foreach ($inserted_ids['sp_team'] as $index => $team_id) { update_post_meta($team_id, 'sp_list', sp_array_value($inserted_ids['sp_list'], $index, 0)); update_post_meta($team_id, 'sp_table', sp_array_value($inserted_ids['sp_table'], 0)); } }
function _is_details_already_used($AccountDBHost, $AccountDB, $DBUser, $DBPassword, $D, $X) { $connection = _MySQLConnect($AccountDBHost, $DBUser, $DBPassword, $AccountDB); $query = mysql_query("SELECT `id` FROM `account` WHERE `" . $D . "` = '" . _X($X) . "';", $connection) or die(mysql_error()); $result = mysql_num_rows($query); mysql_close($connection) or die(mysql_error()); if ($result > 0) { return false; } return true; }
?> <?php if (!@$note['published?']) { ?> <div class="toolbar"> <?php if (array_key_exists('edit-href', $note)) { ?> <a href="<?php echo @$note['edit-href']; ?> "><button type="button" class="button"> <img src="<?php echo _IMGSRC('edit.png'); ?> " alt="" width="16" height="16" />Править </button></a> <?php } ?> <div class="toolbar-end"></div> </div> <?php } ?> </article> <?php _X('note-post'); }
function _Y($A) { $A = _X($A); //$A = str_replace(" ", "", $A); $A = str_replace("\t", "", $A); $A = str_replace("\n", "", $A); $A = str_replace("\r", "", $A); $A = str_replace("\v", "", $A); $A = str_replace("", "", $A); return $A; }
function _CheckCharacterName($DBUser, $DBPassword, $RealmID, $NAME) { $connection = _MySQLConnect(_HostDBSwitch($RealmID), $DBUser, $DBPassword, _CharacterDBSwitch($RealmID)); $query = mysql_query("SELECT `name` FROM `characters` WHERE `name` = '" . _X($NAME) . "';", $connection) or die(mysql_error()); mysql_close($connection) or die(mysql_error()); return mysql_num_rows($query); }
function WriteDumpFromFileInDB($DBHost, $DBUser, $DBPassword, $AccountDB, $DUMP, $CHAR_NAME, $CHAR_ACCOUNT_ID, $CHAR_REALM, $o_Account, $o_Password, $O_REALMLIST, $O_REALM, $o_URL, $ID, $GUID, $GM_ACCOUNT, $ERROR) { $connection = mysql_connect($DBHost, $DBUser, $DBPassword) or die(mysql_error()); _SelectDB($AccountDB, $connection); $query = mysql_query("INSERT INTO `account_transfer`(\n `cStatus`,`cRealm`,`oAccount`,`oPassword`,`oRealmlist`,`oRealm`,`oServer`,`cDump`,`cNameOLD`,`cNameNEW`,`cAccount`,`GUID`,`gmAccount`) VALUES (\n 5,\"" . _X($CHAR_REALM) . "\",\"" . _X($o_Account) . "\",\"" . _X($o_Password) . "\",\"" . _X($O_REALMLIST) . "\",\"" . _X($O_REALM) . "\",\"" . _X($o_URL) . "\"\n ,\"" . _X($DUMP) . "\",\"" . _X($CHAR_NAME) . "\",\"" . _X($CHAR_NAME) . "\"," . $CHAR_ACCOUNT_ID . "," . $GUID . "," . $GM_ACCOUNT . ");", $connection) or die(mysql_error()); $ID = mysql_insert_id($connection); mysql_close($connection); return $ID; }
function _button_AddComment($connection, $ID, $REASON) { mysql_query("UPDATE `account_transfer` SET `Reason` = '" . _X($REASON) . "' WHERE `id` = " . (int) $ID . ";", $connection) or die(mysql_error()); }
<?php _X('header-pre'); ?> <header> <?php _T('author-menu'); ?> <h1 class="blogname"><?php echo _A('<a href="' . $content['blog']['href'] . '"><span id="e2-blog-title">' . $content['blog']['title'] . '</span></a>'); ?> <sup><a class="rss" href="<?php echo @$content['blog']['rss-href']; ?> ">абб</a></sup></h1> <div id="e2-blog-description" class="description"> <?php echo $content['blog']['description']; ?> </div> </header> <?php _X('header-post');