function adr_battle_equip_screen($user_id)
{
    global $db, $lang, $adr_general, $template, $phpEx;
    $user_id = intval($user_id);
    $char = adr_get_user_infos($user_id);
    ### START restriction checks ###
    $item_sql = adr_make_restrict_sql($char);
    ### END restriction checks ###
    if ($char['character_hp'] < '1') {
        $message = $lang['Adr_battle_character_dead'];
        $message .= '<br /><br />' . sprintf($lang['Adr_battle_temple'], "<a href=\"" . 'adr_temple.' . $phpEx . "\">", "</a>");
        $message .= '<br /><br />' . sprintf($lang['Adr_character_return'], "<a href=\"" . 'adr_character.' . $phpEx . "\">", "</a>");
        message_die(GENERAL_MESSAGE, $message);
    }
    // No battle in progress , display the equipment page
    adr_template_file('adr_battle_equip_body.tpl');
    // First select the available items
    $sql = "SELECT * FROM " . ADR_SHOPS_ITEMS_TABLE . "\n\t\tWHERE item_in_shop = '0'\n\t\tAND item_duration > '0'\n\t\tAND item_in_warehouse = '0'\n\t\t{$item_sql}\n\t\tAND item_owner_id = '{$user_id}'";
    if (!($result = $db->sql_query($sql))) {
        message_die(GENERAL_ERROR, 'Could not query battle list', '', __LINE__, __FILE__, $sql);
    }
    $items = $db->sql_fetchrowset($result);
    // Prepare the items list
    $armor_list = '<select name="item_armor">';
    $armor_list .= '<option value = "0" >' . $lang['Adr_battle_no_armor'] . '</option>';
    $buckler_list = '<select name="item_buckler">';
    $buckler_list .= '<option value = "0" >' . $lang['Adr_battle_no_buckler'] . '</option>';
    $helm_list = '<select name="item_helm">';
    $helm_list .= '<option value = "0" >' . $lang['Adr_battle_no_helm'] . '</option>';
    $gloves_list = '<select name="item_gloves">';
    $gloves_list .= '<option value = "0" >' . $lang['Adr_battle_no_gloves'] . '</option>';
    $amulet_list = '<select name="item_amulet">';
    $amulet_list .= '<option value = "0" >' . $lang['Adr_battle_no_amulet'] . '</option>';
    $ring_list = '<select name="item_ring">';
    $ring_list .= '<option value = "0" >' . $lang['Adr_battle_no_ring'] . '</option>';
    $equip_armor = $char['equip_armor'];
    $equip_buckler = $char['equip_buckler'];
    $equip_helm = $char['equip_helm'];
    $equip_gloves = $char['equip_gloves'];
    $equip_amulet = $char['equip_amulet'];
    $equip_ring = $char['equip_ring'];
    for ($i = 0; $i < count($items); $i++) {
        $item_power = $items[$i]['item_power'] + $items[$i]['item_add_power'];
        if ($items[$i]['item_type_use'] == '7') {
            $armor_selected = $equip_armor == $items[$i]['item_id'] ? 'selected' : '';
            $armor_list .= '<option value = "' . $items[$i]['item_id'] . '" ' . $armor_selected . ' >' . adr_get_lang($items[$i]['item_name']) . ' ( ' . $lang['Adr_items_power'] . ' : ' . $item_power . ' - ' . $lang['Adr_items_duration'] . ' : ' . $items[$i]['item_duration'] . ' )' . '</option>';
        }
        if ($items[$i]['item_type_use'] == '8') {
            $buckler_selected = $equip_buckler == $items[$i]['item_id'] ? 'selected' : '';
            $buckler_list .= '<option value = "' . $items[$i]['item_id'] . '" ' . $buckler_selected . '>' . adr_get_lang($items[$i]['item_name']) . ' ( ' . $lang['Adr_items_power'] . ' : ' . $item_power . ' - ' . $lang['Adr_items_duration'] . ' : ' . $items[$i]['item_duration'] . ' )' . '</option>';
        }
        if ($items[$i]['item_type_use'] == '9') {
            $helm_selected = $equip_helm == $items[$i]['item_id'] ? 'selected' : '';
            $helm_list .= '<option value = "' . $items[$i]['item_id'] . '" ' . $helm_selected . '>' . adr_get_lang($items[$i]['item_name']) . ' ( ' . $lang['Adr_items_power'] . ' : ' . $item_power . ' - ' . $lang['Adr_items_duration'] . ' : ' . $items[$i]['item_duration'] . ' )' . '</option>';
        }
        if ($items[$i]['item_type_use'] == '10') {
            $gloves_selected = $equip_gloves == $items[$i]['item_id'] ? 'selected' : '';
            $gloves_list .= '<option value = "' . $items[$i]['item_id'] . '" ' . $gloves_selected . '>' . adr_get_lang($items[$i]['item_name']) . ' ( ' . $lang['Adr_items_power'] . ' : ' . $item_power . ' - ' . $lang['Adr_items_duration'] . ' : ' . $items[$i]['item_duration'] . ' )' . '</option>';
        }
        if ($items[$i]['item_type_use'] == '13') {
            $amulet_selected = $equip_amulet == $items[$i]['item_id'] ? 'selected' : '';
            $amulet_list .= '<option value = "' . $items[$i]['item_id'] . '" ' . $amulet_selected . '>' . adr_get_lang($items[$i]['item_name']) . ' ( ' . $lang['Adr_items_power'] . ' : ' . $item_power . ' - ' . $lang['Adr_items_duration'] . ' : ' . $items[$i]['item_duration'] . ' )' . '</option>';
        }
        if ($items[$i]['item_type_use'] == '14') {
            $ring_selected = $equip_ring == $items[$i]['item_id'] ? 'selected' : '';
            $ring_list .= '<option value = "' . $items[$i]['item_id'] . '" ' . $ring_selected . '>' . adr_get_lang($items[$i]['item_name']) . ' ( ' . $lang['Adr_items_power'] . ' : ' . $item_power . ' - ' . $lang['Adr_items_duration'] . ' : ' . $items[$i]['item_duration'] . ' )' . '</option>';
        }
    }
    $armor_list .= '</select>';
    $buckler_list .= '</select>';
    $helm_list .= '</select>';
    $gloves_list .= '</select>';
    $amulet_list .= '</select>';
    $ring_list .= '</select>';
    $template->assign_vars(array('SELECT_ARMOR' => $armor_list, 'SELECT_BUCKLER' => $buckler_list, 'SELECT_HELM' => $helm_list, 'SELECT_GLOVES' => $gloves_list, 'SELECT_AMULET' => $amulet_list, 'SELECT_RING' => $ring_list, 'L_EQUIPMENT' => $lang['Adr_battle_equipment'], 'L_SELECT_ARMOR' => $lang['Adr_battle_select_armor'], 'L_SELECT_BUCKLER' => $lang['Adr_battle_select_buckler'], 'L_SELECT_HELM' => $lang['Adr_battle_select_helm'], 'L_SELECT_GLOVES' => $lang['Adr_battle_select_gloves'], 'L_SELECT_AMULET' => $lang['Adr_battle_select_amulet'], 'L_SELECT_RING' => $lang['Adr_battle_select_ring'], 'L_FIGHT' => $lang['Adr_battle_fight']));
    return;
}
Example #2
0
// Start session management
$userdata = session_pagestart($user_ip, PAGE_ADR);
init_userprefs($userdata);
// End session management
//
include $phpbb_root_path . 'adr/includes/adr_global.' . $phpEx;
// Sorry, only logged users ...
if (!$userdata['session_logged_in']) {
    $redirect = "adr_character.{$phpEx}";
    $redirect .= isset($user_id) ? '&user_id=' . $user_id : '';
    header('Location: ' . append_sid("login.{$phpEx}?redirect={$redirect}", true));
}
// Get the general config
$adr_general = adr_get_general_config();
// Includes the tpl and the header
adr_template_file('adr_character_faq_body.tpl');
include $phpbb_root_path . 'includes/page_header.' . $phpEx;
$lang_file = 'lang_adr_faq';
$l_title = $lang['rpg_faq'];
include $phpbb_root_path . 'adr/language/lang_' . $board_config['default_lang'] . '/' . $lang_file . '.' . $phpEx;
//
// Pull the array data from the lang pack
//
$j = 0;
$counter = 0;
$counter_2 = 0;
$faq_block = array();
$faq_block_titles = array();
for ($i = 0; $i < count($faq); $i++) {
    if ($faq[$i][0] != '--') {
        $faq_block[$j][$counter]['id'] = $counter_2;
Example #3
0
 ***************************************************************************/
define('IN_PHPBB', 1);
define('IN_ADR_ADMIN', 1);
define('IN_ADR_ZONES_ADMIN', 1);
define('IN_ADR_CHARACTER', 1);
define('IN_ADR_CELL', 1);
if (!empty($setmodules)) {
    $filename = basename(__FILE__);
    $module['ADR-Zones']['Zone General'] = $filename;
    return;
}
$phpbb_root_path = "./../";
require $phpbb_root_path . 'extension.inc';
require './pagestart.' . $phpEx;
include_once $phpbb_root_path . 'adr/includes/adr_global.' . $phpEx;
adr_template_file('admin/config_adr_zone_general_body.tpl');
$submit = isset($HTTP_POST_VARS['submit']);
$sql = "SELECT zone_id from " . ADR_ZONES_TABLE . " WHERE zone_name = 'World Map'";
$result = $db->sql_query($sql);
$existing_zone_worldmap_zone = $db->sql_fetchrow($result);
if ($submit) {
    $dead_travel = intval($HTTP_POST_VARS['dead_travel']);
    $stat_bonus = intval($HTTP_POST_VARS['stat_bonus']);
    $att_bonus = $HTTP_POST_VARS['att_bonus'];
    $def_bonus = $HTTP_POST_VARS['def_bonus'];
    $zone_townmap_enable = intval($HTTP_POST_VARS['Adr_zone_townmap_enable']);
    $zone_townmap_name = $db->sql_escape($HTTP_POST_VARS['Adr_zone_townmap_name']);
    $zone_picture_link_enable = intval($HTTP_POST_VARS['Adr_zone_picture_link_enable']);
    $zone_worldmap_zone = intval($HTTP_POST_VARS['Adr_zone_worldmap_zone']);
    $zone_townmap_display_required = intval($HTTP_POST_VARS['Adr_zone_townmap_display_required']);
    $zone_npc_display_text = intval($HTTP_POST_VARS['npc_display_text']);
                message_die(GENERAL_ERROR, $lang['Adr_shop_items_failure_deleted']);
            }
            $items = $db->sql_fetchrowset($result);
            while (list(, $item) = @each($items)) {
                if (isset($_POST[$item['spell_id']])) {
                    $item_id = $item['spell_id'];
                    for ($j = 0; $j < $quantity; $j++) {
                        adr_spell_add_new($item_id, $to_user_id, 'admin_adr_give_users_spells');
                    }
                }
            }
            adr_previous(Adr_spells_give_spell_success, admin_adr_give_users_spells, '');
            break;
    }
} else {
    adr_template_file('admin/config_adr_give_user_spells_body.tpl');
    $template->assign_block_vars('view_store', array());
    if (isset($_GET['mode2']) || isset($_POST['mode2'])) {
        $mode2 = isset($_POST['mode2']) ? htmlspecialchars($_POST['mode2']) : htmlspecialchars($_GET['mode2']);
    } else {
        $mode2 = 'itemname';
    }
    if (isset($_POST['order'])) {
        $sort_order = $_POST['order'] == 'ASC' ? 'ASC' : 'DESC';
    } else {
        if (isset($_GET['order'])) {
            $sort_order = $_GET['order'] == 'ASC' ? 'ASC' : 'DESC';
        } else {
            $sort_order = 'ASC';
        }
    }
Example #5
0
// End session management
//
$user_id = $userdata['user_id'];
$points = $userdata['user_points'];
include $phpbb_root_path . 'adr/includes/adr_global.' . $phpEx;
// Sorry , only logged users ...
if (!$userdata['session_logged_in']) {
    $redirect = "adr_TownMap_forge.{$phpEx}";
    $redirect .= isset($user_id) ? '&user_id=' . $user_id : '';
    header('Location: ' . append_sid("login.{$phpEx}?redirect={$redirect}", true));
}
adr_enable_check();
adr_ban_check($user_id);
adr_character_created_check($user_id);
// Includes the tpl and the header and the choice for the season
adr_template_file('adr_TownMap_forge_body.tpl');
include $phpbb_root_path . 'includes/page_header.' . $phpEx;
include $phpbb_root_path . 'adr/includes/adr_header.' . $phpEx;
$saison = 'Carte' . $board_config['adr_seasons'];
// Get the general config
$adr_general = adr_get_general_config();
// Grab details for skill limit
$sql = "SELECT character_skill_limit FROM " . ADR_CHARACTERS_TABLE . "\r\n\t\tWHERE character_id = {$user_id} ";
if (!($result = $db->sql_query($sql))) {
    message_die(GENERAL_ERROR, 'Could not query skill limit value', '', __LINE__, __FILE__, $sql);
}
$limit_update = $db->sql_fetchrow($result);
if (!$adr_general['Adr_disable_rpg'] && $userdata['user_level'] != ADMIN) {
    adr_previous(Adr_disable_rpg, 'index', '');
}
// Deny access if user is imprisioned
$phpbb_root_path = "./../";
require $phpbb_root_path . 'extension.inc';
require 'pagestart.' . $phpEx;
include_once $phpbb_root_path . 'adr/includes/adr_global.' . $phpEx;
//
//check for userlevel
//
if (!$userdata['session_logged_in']) {
    header('Location: ' . append_sid("login.{$phpEx}?redirect=tableupdate.{$phpEx}", true));
}
if ($userdata['user_level'] != ADMIN) {
    message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
}
//end check
$adr_general = adr_get_general_config();
adr_template_file('admin/config_adr_zones_manage_maps_body.tpl');
$zone_townmap_name = $HTTP_POST_VARS['Adr_zone_townmap_name'];
$mode = stripslashes($HTTP_POST_VARS['mode']);
$action = stripslashes($HTTP_POST_VARS['action']);
$zone_name2 = $HTTP_POST_VARS['zone_name2'];
$zone_name1 = $HTTP_POST_VARS['zone_name1'];
$assignzone = $HTTP_POST_VARS['assignzone'];
$id = $HTTP_POST_VARS['id'];
$zone_name = $HTTP_POST_VARS['zone_name'];
$remove = $HTTP_POST_VARS['remove'];
$buildingcell = $HTTP_POST_VARS['buildingcell'];
$buildingcellitem = $HTTP_POST_VARS['buildingcellitem'];
$buildingname = $HTTP_POST_VARS['buildingname'];
$btype = $HTTP_POST_VARS['btype'];
$building_name = $HTTP_POST_VARS['building_name'];
$image_name = $HTTP_POST_VARS['image_name'];
Example #7
0
     }
     $row = $db->sql_fetchrow($result);
     // Get the "other" id
     $other_id = $row['battle_opponent_id'] != $user_id ? intval($row['battle_opponent_id']) : intval($row['battle_challenger_id']);
     // Get opponent's character name name
     $ssql = "SELECT character_name FROM " . ADR_CHARACTERS_TABLE . "\r\t\t\t\tWHERE character_id = '{$other_id}'";
     if (!($sresult = $db->sql_query($ssql))) {
         message_die(GENERAL_ERROR, 'Could not query character name', '', __LINE__, __FILE__, $ssql);
     }
     $opponent = $db->sql_fetchrow($sresult);
     $opponent_name = $opponent['character_name'];
     $sql = " SELECT prefs_pvp_notif_pm FROM " . ADR_CHARACTERS_TABLE . "\r\t\t\t\tWHERE character_id = {$other_id} ";
     $result = $db->sql_query($sql);
     if (!$result) {
         message_die(GENERAL_ERROR, "Couldn't query preferences", "", __LINE__, __FILE__, $sql);
     }
     $opponent = $db->sql_fetchrow($result);
     $subject = $lang['Adr_pvp_denied'];
     $message = sprintf($lang['Adr_pvp_denied_by'], $adr_user['character_name']);
     $sql = " DELETE FROM " . ADR_BATTLE_PVP_TABLE . "\r\t\t\t\tWHERE battle_result = 0\r\t\t\t\tAND battle_id = {$battle_id}\r\t\t\t\tAND ( battle_opponent_id = {$user_id}\tOR battle_challenger_id = {$user_id} ) ";
     if (!($result = $db->sql_query($sql))) {
         message_die(GENERAL_ERROR, 'Could not delete defy', '', __LINE__, __FILE__, $sql);
     }
     if ($opponent['prefs_pvp_notif_pm']) {
         adr_send_pm($other_id, $subject, $message);
     }
     adr_previous(Adr_pvp_deny_ok, adr_character_pvp, "mode=waiting");
     break;
 case 'see':
     $battle_id = intval($HTTP_GET_VARS['battle_id']);
     adr_template_file('adr_battle_pvp_body.tpl');
            $del_item = $db->sql_fetchrow($result);
            $split_loottables = explode(':', $del_item['item_loottables']);
            foreach ($split_loottables as $value) {
                if ($value != $loottable_id) {
                    $loottables_list .= $loottables_list == '' ? $value : ":" . $value;
                }
            }
            $sql = "UPDATE " . ADR_SHOPS_ITEMS_TABLE . "\r\n\t\t\t\tSET item_loottables = '" . $loottables_list . "'\r\n\t\t\t\tWHERE item_id = " . $item_id . " \r\n\t\t\t\tAND item_owner_id = 1\r\n\t\t\t\t";
            if (!($result = $db->sql_query($sql))) {
                message_die(GENERAL_ERROR, "Couldn't update item", "", __LINE__, __FILE__, $sql);
            }
            adr_previous(Adr_loottable_cats_successful_item_deleted, admin_adr_loottables_cats, 'mode=view_loottable&amp;loottable_id=' . $loottable_id . '');
            break;
    }
} else {
    adr_template_file('admin/config_adr_loottables_cats_list_body.tpl');
    $start = isset($HTTP_GET_VARS['start']) ? intval($HTTP_GET_VARS['start']) : 0;
    if (isset($HTTP_GET_VARS['mode2']) || isset($HTTP_POST_VARS['mode2'])) {
        $mode2 = isset($HTTP_POST_VARS['mode2']) ? htmlspecialchars($HTTP_POST_VARS['mode2']) : htmlspecialchars($HTTP_GET_VARS['mode2']);
    } else {
        $mode2 = 'loottablename';
    }
    if (isset($HTTP_POST_VARS['order'])) {
        $sort_order = $HTTP_POST_VARS['order'] == 'ASC' ? 'ASC' : 'DESC';
    } else {
        if (isset($HTTP_GET_VARS['order'])) {
            $sort_order = $HTTP_GET_VARS['order'] == 'ASC' ? 'ASC' : 'DESC';
        } else {
            $sort_order = 'ASC';
        }
    }
             $element_id = $fields_data['element_id'] + 1;
             if ($element_name == '') {
                 message_die(MESSAGE, $lang['Fields_empty']);
             }
             $sql = "INSERT INTO " . ADR_ELEMENTS_TABLE . " \n\t\t\t\t( element_id , element_name , element_desc ,  element_level , element_img , element_skill_mining_bonus , element_skill_stone_bonus , element_skill_forge_bonus , element_skill_enchantment_bonus , element_skill_trading_bonus , element_skill_thief_bonus , element_oppose_strong , element_oppose_strong_dmg , element_oppose_weak , element_oppose_weak_dmg , element_oppose_same_dmg, element_colour )\n\t\t\t\tVALUES ( {$element_id},'" . str_replace("\\'", "''", $element_name) . "', '" . str_replace("\\'", "''", $element_desc) . "' , {$level} , '" . str_replace("\\'", "''", $element_img) . "' , {$b_mining} , {$b_stone} , {$b_forge} ,{$b_enchant} , {$b_trading} ,{$b_thief} , {$element_oppose_str} , {$oppose_str_dmg} , {$element_oppose_weak} , {$oppose_weak_dmg} , {$oppose_same_dmg}, '{$element_colour}' )";
             $result = $db->sql_query($sql);
             if (!$result) {
                 message_die(GENERAL_ERROR, "Couldn't insert new element", "", __LINE__, __FILE__, $sql);
             }
             // Update cache
             adr_update_element_infos();
             adr_previous(Adr_element_successful_added, admin_adr_elements, '');
             break;
     }
 } else {
     adr_template_file('admin/config_adr_elements_list_body.tpl');
     $sql = "SELECT *\n\t\tFROM " . ADR_ELEMENTS_TABLE;
     $result = $db->sql_query($sql);
     if (!$result) {
         message_die(GENERAL_ERROR, 'Could not obtain elements information', "", __LINE__, __FILE__, $sql);
     }
     $elements = $db->sql_fetchrowset($result);
     for ($i = 0; $i < count($elements); $i++) {
         $row_class = !($i % 2) ? $theme['td_class1'] : $theme['td_class2'];
         $level[0] = $lang['Adr_races_level_all'];
         $level[1] = $lang['Adr_races_level_admin'];
         $level[2] = $lang['Adr_races_level_mod'];
         $element_level = $level[$elements[$i]['element_level']];
         $pic = $elements[$i]['element_img'];
         $template->assign_block_vars("elements", array("ROW_CLASS" => $row_class, "NAME" => adr_get_lang($elements[$i]['element_name']), "DESC" => adr_get_lang($elements[$i]['element_desc']), "IMG" => $pic, "LEVEL" => $element_level, "U_ELEMENTS_EDIT" => append_sid("admin_adr_elements.{$phpEx}?mode=edit&amp;id=" . $elements[$i]['element_id']), "U_ELEMENTS_DELETE" => append_sid("admin_adr_elements.{$phpEx}?mode=delete&amp;id=" . $elements[$i]['element_id'])));
     }
Example #10
0
//
$user_id = $userdata['user_id'];
include $phpbb_root_path . 'adr/includes/adr_global.' . $phpEx;
// Sorry , only logged users ...
if (!$userdata['session_logged_in']) {
    $redirect = "adr_battle.{$phpEx}";
    $redirect .= isset($user_id) ? '&user_id=' . $user_id : '';
    header('Location: ' . append_sid("login.{$phpEx}?redirect={$redirect}", true));
}
// Get the general config
$adr_general = adr_get_general_config();
// Load the headers
$gen_simple_header = TRUE;
include_once $phpbb_root_path . 'includes/page_header.' . $phpEx;
// Grab info
adr_template_file('adr_battle_chatbox_body.tpl');
// Select the battle text again
$sql = "SELECT battle_id, battle_text, battle_challenger_id, battle_opponent_id\n\tFROM  " . ADR_BATTLE_LIST_TABLE . "\n\tWHERE battle_challenger_id = '{$user_id}'\n\tAND battle_result = '0'\n\tAND battle_type = '1'";
if (!($result = $db->sql_query($sql))) {
    message_die(GENERAL_ERROR, 'Could not query battle list', '', __LINE__, __FILE__, $sql);
}
$battle = $db->sql_fetchrow($result);
/* Start: Format chat - Credit to aUsTiN*/
$format_chat = str_replace('%END%', '<tr><td class="row2"><span class="genmed"><i>', $battle['battle_text']);
$format_chat .= str_replace('%ST%', '</i></span></td></tr>', $format_chat);
$format_chat .= str_replace('%COLOR%orange', '', $format_chat);
$format_chat .= str_replace('%COLOR%blue', '', $format_chat);
$format_chat .= str_replace('%COLOR%purple', '', $format_chat);
$format_chat .= str_replace('%APOS%', '\'', $format_chat);
/* End: Format chat */
$log = $battle['battle_text'];
Example #11
0
//
// Start session management
$userdata = session_pagestart($user_ip, PAGE_ADR);
init_userprefs($userdata);
// End session management
//
$user_id = $userdata['user_id'];
include_once $phpbb_root_path . 'adr/includes/adr_global.' . $phpEx;
// Sorry , only logged users ...
if (!$userdata['session_logged_in']) {
    $redirect = "adr_character.{$phpEx}";
    $redirect .= isset($user_id) ? '&user_id=' . $user_id : '';
    header('Location: ' . append_sid("login.{$phpEx}?redirect={$redirect}", true));
}
// Includes the tpl and the header
adr_template_file('adr_zones_body.tpl');
include_once $phpbb_root_path . 'includes/page_header.' . $phpEx;
// Get the general config and character infos
$adr_general = adr_get_general_config();
adr_enable_check();
adr_ban_check($user_id);
adr_character_created_check($user_id);
$adr_user = adr_get_user_infos($user_id);
// don't let people tell you what to do!
$template->assign_var('OUT_OF_ZONES', false);
// Get Zone infos
$area_id = $adr_user['character_area'];
$zone = zone_get($area_id);
// V: let's make sure nothing bad happened for some reason
//  i.e. somebody deleted the zone.
//  of course, it's still gonna fail its race's start zone got ERASED
 *
 ***************************************************************************/
define('IN_PHPBB', 1);
define('IN_ADR_ADMIN', 1);
define('IN_ADR_CHARACTER', 1);
define('IN_ADR_SHOPS', 1);
if (!empty($setmodules)) {
    $filename = basename(__FILE__);
    $module['ADR Spells']['Spell Settings'] = $filename;
    return;
}
$phpbb_root_path = "./../";
require $phpbb_root_path . 'extension.inc';
require './pagestart.' . $phpEx;
include_once $phpbb_root_path . 'adr/includes/adr_global.' . $phpEx;
adr_template_file('admin/config_adr_spells_general_body.tpl');
$sql = "SELECT * FROM  " . ADR_GENERAL_TABLE;
if (!($result = $db->sql_query($sql))) {
    message_die(GENERAL_MESSAGE, $lang['Adr_character_lack']);
}
while ($row = $db->sql_fetchrow($result)) {
    $adr_general[$row['config_name']] = $row['config_value'];
}
$submit = isset($_POST['submit']);
if ($submit) {
    $pm = intval($_POST['pm']);
    // update pm
    $sql = "UPDATE " . ADR_GENERAL_TABLE . " \r\n\t\tSET config_value = '{$pm}' \r\n\t\tWHERE config_name = 'spell_enable_pm' ";
    if (!($result = $db->sql_query($sql))) {
        message_die(GENERAL_ERROR, "Could not update pm.", '', __LINE__, __FILE__, $sql);
    }
Example #13
0
         }
     }
     $item_id_list .= '0)';
     $sql = "SELECT i.* FROM " . ADR_SHOPS_ITEMS_TABLE . " i\n\t\t\t\tWHERE i.item_owner_id = {$user_id}\n\t\t\t\tAND i.item_in_shop = 0\n\t\t\t\tAND i.item_duration > 0 \n\t\t\t\tAND i.item_auth = 0 \n\t\t\t\tAND i.item_id IN {$item_id_list} \n\t\t\t\tORDER BY i.item_name ";
     if (!($result = $db->sql_query($sql))) {
         message_die(GENERAL_ERROR, 'Could not obtain items information', "", __LINE__, __FILE__, $sql);
     }
     $items = $db->sql_fetchrowset($result);
     $items_name = '';
     while (list(, $item) = @each($items)) {
         $item_id = $item['item_id'];
         $temp_price = adr_get_item_real_price($item_id, $user_id);
         $price = intval($price + adr_use_skill_trading($user_id, $temp_price, sell));
         $s_hidden_fields .= '<input type="hidden" name="' . $item_id . '" value="1" />';
     }
     adr_template_file('adr_confirm_body.tpl');
     $template->assign_block_vars('sell_item', array());
     $s_hidden_fields .= '<input type="hidden" name="cat" value="' . $cat . '" />';
     $s_hidden_fields .= '<input type="hidden" name="mode" value="sell_item" />';
     $template->assign_vars(array('MESSAGE_TITLE' => $lang['Adr_items_sell_confirm'], 'MESSAGE_TEXT' => sprintf($lang['Adr_items_sell_confirm_price'], intval($price), get_reward_name()), 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'S_SELL_CONFIRM_ACTION' => append_sid("adr_shops.{$phpEx}"), 'HIDDEN_FIELDS' => $s_hidden_fields));
     break;
 case 'create_shop':
     $sql = "SELECT shop_id FROM " . ADR_SHOPS_TABLE . "\n\t\t\t\tWHERE shop_owner_id = {$user_id} ";
     $result = $db->sql_query($sql);
     if (!$result) {
         message_die(GENERAL_ERROR, 'Could not obtain shops information', "", __LINE__, __FILE__, $sql);
     }
     $row = $db->sql_fetchrow($result);
     if (is_numeric($row['shop_id'])) {
         adr_previous(Adr_users_shops_already, adr_shops, '');
     } else {
Example #14
0
                 }
                 $approve_fee = $newfees[$xy];
                 $template->assign_block_vars('approvelist', array('L_APPROVE' => $lang['clans_clp_members_approve'], 'L_DISAPPROVE' => $lang['clans_clp_members_disapprove'], 'NAME' => $approve_name, 'ID' => $newapprove[$xy], 'L_FEE' => sprintf($lang['clans_clp_members_approve_paid'], $approve_fee, $points_name)));
             }
             $template->assign_vars(array('L_TRANSFER' => $lang['clans_clp_members_approve_transfer']));
         } else {
             if ($rowN['approving'] == 1) {
                 $template->assign_block_vars('no_approvelist', array('L_EMPTY' => $lang['clans_empty']));
             } else {
                 $template->assign_block_vars('no_approvelist', array('L_EMPTY' => $lang['clans_disabled']));
             }
         }
     }
     $template->assign_vars(array('FILE' => $file, 'L_HEADER' => $lang['clans_clp'], 'L_INTRO' => $lang['clans_clp_intro'], 'L_DETAILS' => $lang['clans_clp_details'], 'L_MEMBERS' => $lang['clans_clp_members'], 'L_NEWS' => $lang['clans_clp_news'], 'L_MANAGE' => $lang['clans_clp_members_manage'], 'L_MANAGE_APPROVE' => $lang['clans_approvelist'], 'LEADER_NAME' => $leader_name, 'LEADER_RANK' => $leader_rank, 'CLAN' => $_GET['clan']));
     //			$template->set_filenames(array('body' => 'adr_clans_clp_members_body.tpl'));
     adr_template_file('adr_clans_clp_members_body.tpl');
 }
 if ($_GET['a'] == "kick") {
     if ($_GET['member'] == "" || !is_numeric($_GET['member'])) {
         message_die(GENERAL_MESSAGE, $lang['clans_clp_members_none_selected'] . '<br /><br />' . sprintf($lang['clans_click_here'], '<a href="' . $file . '?action=clp&t=members&clan=' . $_GET['clan'] . '">', '</a>'));
     }
     $sql2 = "SELECT * FROM " . ADR_CLANS_TABLE . " WHERE id = '" . intval($_GET['clan']) . "' ";
     if (!($result2 = $db->sql_query($sql2))) {
         message_die(GENERAL_ERROR, 'Error retrieving data', '', __LINE__, __FILE__, $sql2);
     }
     while ($row2 = $db->sql_fetchrow($result2)) {
         if ($_GET['member'] == $row2['leader']) {
             message_die(GENERAL_MESSAGE, $lang['clans_clp_members_no_leader_kick'] . '<br /><br />' . sprintf($lang['clans_click_here'], '<a href="' . $file . '?action=clp&t=members&clan=' . $_GET['clan'] . '">', '</a>'));
         }
         if (substr_count($row2['members'], "ß" . $_GET['member'] . "Þ") < 1) {
             message_die(GENERAL_MESSAGE, $lang['clans_clp_members_non_exist'] . '<br /><br />' . sprintf($lang['clans_click_here'], '<a href="' . $file . '?action=clp&t=members&clan=' . $_GET['clan'] . '">', '</a>'));
Example #15
0
             $book_difficulty = intval($HTTP_POST_VARS['book_difficulty']);
             $book_false = intval($HTTP_POST_VARS['book_false']);
             $book_crafting = intval($HTTP_POST_VARS['book_crafting']);
             $book_id = $fields_data['book_id'] + 1;
             if ($book_name == '' || $book_details == '') {
                 message_die(MESSAGE, $lang['Fields_empty']);
             }
             $sql = "INSERT INTO " . ADR_LIBRARY_TABLE . " \r\n\t\t\t\t( book_id , book_name , book_details , book_zone , book_difficulty , book_false , book_crafting )\r\n\t\t\t\tVALUES ( {$book_id},'" . str_replace("\\'", "''", $book_name) . "', '" . str_replace("\\'", "''", $book_details) . "' , '" . str_replace("\\'", "''", $book_zone) . "' , {$book_difficulty} , '{$book_false}' , '{$book_crafting}' )";
             if (!($result = $db->sql_query($sql))) {
                 message_die(GENERAL_ERROR, "Couldn't insert new alignment", "", __LINE__, __FILE__, $sql);
             }
             adr_previous(Adr_library_successful_added, admin_adr_library, '');
             break;
     }
 } else {
     adr_template_file('admin/config_adr_library_list_body.tpl');
     $start = isset($HTTP_GET_VARS['start']) ? intval($HTTP_GET_VARS['start']) : 0;
     if (isset($HTTP_GET_VARS['mode2']) || isset($HTTP_POST_VARS['mode2'])) {
         $mode2 = isset($HTTP_POST_VARS['mode2']) ? htmlspecialchars($HTTP_POST_VARS['mode2']) : htmlspecialchars($HTTP_GET_VARS['mode2']);
     } else {
         $mode2 = 'book_id';
     }
     if (isset($HTTP_POST_VARS['order'])) {
         $sort_order = $HTTP_POST_VARS['order'] == 'ASC' ? 'ASC' : 'DESC';
     } else {
         if (isset($HTTP_GET_VARS['order'])) {
             $sort_order = $HTTP_GET_VARS['order'] == 'ASC' ? 'ASC' : 'DESC';
         } else {
             $sort_order = 'ASC';
         }
     }
Example #16
0
 *
 ***************************************************************************/
define('IN_PHPBB', 1);
define('IN_ADR_SEASONS', 1);
define('IN_ADR_ADMIN', 1);
define('IN_ADR_CHARACTER', 1);
if (!empty($setmodules)) {
    $filename = basename(__FILE__);
    $module['ADR-Zones']['Seasons'] = $filename;
    return;
}
$phpbb_root_path = "./../";
require $phpbb_root_path . 'extension.inc';
require './pagestart.' . $phpEx;
include_once $phpbb_root_path . 'adr/includes/adr_global.' . $phpEx;
adr_template_file('admin/config_adr_seasons_body.tpl');
//season list
$season[1] = $lang['Adr_Season_1'];
$season[2] = $lang['Adr_Season_2'];
$season[3] = $lang['Adr_Season_3'];
$season[4] = $lang['Adr_Season_4'];
$season_list = '<select name="season">';
for ($i = 1; $i < 5; $i++) {
    $selected = $i == $board_config['adr_seasons'] ? ' selected="selected"' : '';
    $season_list .= '<option value = "' . $i . '" ' . $selected . ' >' . $season[$i] . '</option>';
}
$season_list .= '</select>';
$submit = isset($HTTP_POST_VARS['submit']);
if ($submit) {
    $new_season = trim(str_replace('"', '&quot;', $HTTP_POST_VARS['season']));
    $season_time = intval($HTTP_POST_VARS['season_time']) * 86400;
Example #17
0
$userdata = session_pagestart($user_ip, PAGE_ADR);
init_userprefs($userdata);
// End session management
//
$user_id = $userdata['user_id'];
// Sorry , only logged users ...
if (!$userdata['session_logged_in']) {
    $redirect = "adr_TownMap_Clan.{$phpEx}";
    $redirect .= isset($user_id) ? '&user_id=' . $user_id : '';
    header('Location: ' . append_sid("login.{$phpEx}?redirect={$redirect}", true));
}
adr_enable_check();
adr_ban_check($user_id);
adr_character_created_check($user_id);
// Includes the tpl and the header and the choice of the season
adr_template_file('adr_TownMap_Clan_body.tpl');
include $phpbb_root_path . 'includes/page_header.' . $phpEx;
include $phpbb_root_path . 'adr/includes/adr_header.' . $phpEx;
$saison = 'Carte' . $board_config['adr_seasons'];
// Deny access if the user is into a battle
$sql = " SELECT * FROM  " . ADR_BATTLE_LIST_TABLE . " \r\n\tWHERE battle_challenger_id = {$user_id}\r\n\tAND battle_result = 0\r\n\tAND battle_type = 1 ";
if (!($result = $db->sql_query($sql))) {
    message_die(GENERAL_ERROR, 'Could not query battle list', '', __LINE__, __FILE__, $sql);
}
$bat = $db->sql_fetchrow($result);
if (is_numeric($bat['battle_id'])) {
    adr_previous(Adr_battle_progress, adr_battle, '');
}
// Get the general config
$adr_general = adr_get_general_config();
// Deny access if user is imprisioned
Example #18
0
                 sort($monster_loottables);
                 $loottables_list = '';
                 for ($a = 0; $a < $selected_loottables; $a++) {
                     $loottables_list .= $loottables_list == '' ? $monster_loottables[$a] : ":" . $monster_loottables[$a];
                 }
             }
             $monster_items = array();
             $monster_items = $HTTP_POST_VARS['items'];
             $selected_items = count($monster_items);
             if ($selected_items == 0) {
                 $items_list = '';
             } elseif (in_array('0', $monster_items)) {
                 $items_list = '0';
             } else {
                 sort($monster_items);
                 $items_list = '';
                 for ($a = 0; $a < $selected_items; $a++) {
                     $items_list .= $items_list == '' ? $monster_items[$a] : ":" . $monster_items[$a];
                 }
             }
             $sql = "INSERT INTO " . ADR_BATTLE_MONSTERS_TABLE . " \r\t\t\t\t( monster_id , monster_name , monster_img , monster_level , monster_base_hp , monster_base_def , monster_base_att , monster_base_element , monster_base_mp , monster_base_mp_power , monster_base_magic_attack , monster_base_magic_resistance , monster_base_sp , monster_base_custom_spell , monster_thief_skill, monster_season , monster_weather  , monster_message_enable , monster_message, monster_possible_drop, monster_guranteened_drop, monster_loottables, monster_specific_drop, monster_regeneration , monster_mp_regeneration , monster_base_mp_drain , monster_base_mp_transfer , monster_base_hp_drain , monster_base_hp_transfer, monster_time )\r\t\t\t\tVALUES ( {$monster_id} , '" . str_replace("\\'", "''", $monster_name) . "', '" . str_replace("\\'", "''", $monster_img) . "' , {$level} , {$hp} , {$def} , {$att} , {$element} , {$mp} , {$mp_power} , {$ma} , {$md} , {$sp} , '" . str_replace("\\'", "''", $custom_spell) . "' , {$thief_skill}, {$season} , {$weather} , {$message_enable} , '" . str_replace("\\'", "''", $message) . "' , {$possible_drop}, {$guranteened_drop}, '" . $loottables_list . "', '" . $items_list . "', {$regeneration} , {$mp_regeneration} , {$mp_drain} , {$mp_transfer} , {$hp_drain} , {$hp_transfer}, {$time})";
             $result = $db->sql_query($sql);
             if (!$result) {
                 message_die(GENERAL_ERROR, "Couldn't insert new monster", "", __LINE__, __FILE__, $sql);
             }
             adr_previous(Adr_monster_successful_added, admin_adr_monsters, '');
             break;
     }
 } else {
     adr_template_file('admin/config_adr_monsters_list_body.tpl');
     $start = isset($HTTP_GET_VARS['start']) ? intval($HTTP_GET_VARS['start']) : 0;
Example #19
0
 *
 *
 ***************************************************************************/
define('IN_PHPBB', 1);
define('IN_ADR_ADMIN', 1);
define('IN_ADR_VAULT', 1);
if (!empty($setmodules)) {
    $file = basename(__FILE__);
    $module['Adr_Users']['Adr_vault_users'] = $file;
    return;
}
$phpbb_root_path = "./../";
require $phpbb_root_path . 'extension.inc';
require './pagestart.' . $phpEx;
include $phpbb_root_path . 'adr/includes/adr_global.' . $phpEx;
adr_template_file('admin/config_adr_vault_users_body.tpl');
$submit = isset($HTTP_POST_VARS['submit']);
if ((isset($HTTP_POST_VARS['owner_name']) || isset($HTTP_GET_VARS['owner_name'])) && ($HTTP_POST_VARS['owner_name'] != '' || $HTTP_GET_VARS['owner_name'] != '')) {
    $username = isset($HTTP_POST_VARS['owner_name']) ? htmlspecialchars($HTTP_POST_VARS['owner_name']) : htmlspecialchars($HTTP_GET_VARS['owner_name']);
    $sql = " SELECT user_id FROM " . USERS_TABLE . " \r\n\t\tWHERE username = '******'", "''", $username) . "'";
    if (!($result = $db->sql_query($sql))) {
        message_die(GENERAL_ERROR, 'Could not obtain group list', '', __LINE__, __FILE__, $sql);
    }
    $row = $db->sql_fetchrow($result);
    $owner_id = intval($row['user_id']);
} else {
    if (isset($HTTP_POST_VARS[POST_OWNERS_URL]) || isset($HTTP_GET_VARS[POST_OWNERS_URL]) || !is_numeric($owner_id)) {
        $owner_id = isset($HTTP_POST_VARS[POST_OWNERS_URL]) ? intval($HTTP_POST_VARS[POST_OWNERS_URL]) : intval($HTTP_GET_VARS[POST_OWNERS_URL]);
    }
}
if (!$owner_id) {
Example #20
0
define('IN_ADR_CHARACTER', true);
$phpbb_root_path = './';
include_once $phpbb_root_path . 'extension.inc';
include_once $phpbb_root_path . 'common.' . $phpEx;
//
// Start session management
$userdata = session_pagestart($user_ip, PAGE_ADR);
init_userprefs($userdata);
// End session management
//
$user_id = $userdata['user_id'];
include_once $phpbb_root_path . 'adr/includes/adr_global.' . $phpEx;
// Sorry , only logged users ...
if (!$userdata['session_logged_in']) {
    $redirect = "adr_character.{$phpEx}";
    $redirect .= isset($user_id) ? '&user_id=' . $user_id : '';
    header('Location: ' . append_sid("login.{$phpEx}?redirect={$redirect}", true));
}
// Includes the tpl and the header
adr_template_file('adr_library_body.tpl');
include_once $phpbb_root_path . 'includes/page_header.' . $phpEx;
// Get the general config and character infos
$adr_general = adr_get_general_config();
adr_enable_check();
adr_ban_check($user_id);
adr_character_created_check($user_id);
$adr_user = adr_get_user_infos($user_id);
$template->assign_vars(array('L_ZONE_LIBRARY' => $lang['Adr_zone_library_title'], 'L_ZONE_CHARACTER_FAQ' => $lang['Adr_zone_character_faq'], 'L_ZONE_CHARACTER_LIST' => $lang['Adr_zone_character_list'], 'L_ZONE_CHARACTER_PREFS' => $lang['Adr_zone_character_prefs'], 'U_ZONE_CHARACTER_FAQ' => append_sid("adr_character_faq.{$phpEx}"), 'U_ZONE_CHARACTER_LIST' => append_sid("adr_character_list.{$phpEx}"), 'U_ZONE_CHARACTER_PREFS' => append_sid("adr_character_prefs.{$phpEx}"), 'S_ZONES_ACTION' => append_sid("adr_library.{$phpEx}")));
include $phpbb_root_path . 'adr/includes/adr_header.' . $phpEx;
$template->pparse('body');
include_once $phpbb_root_path . 'includes/page_tail.' . $phpEx;
Example #21
0
include_once $phpbb_root_path . 'adr/includes/adr_global.' . $phpEx;
//
// Start session management
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
// End session management
//
$user_id = $userdata['user_id'];
// Sorry , only logged users ...
if (!$userdata['session_logged_in']) {
    $redirect = "adr_research_learned.{$phpEx}";
    $redirect .= isset($user_id) ? '&user_id=' . $user_id : '';
    header('Location: ' . append_sid("login.{$phpEx}?redirect={$redirect}", true));
}
// Includes the tpl and the header
adr_template_file('adr_research_learned_body.tpl');
include $phpbb_root_path . 'includes/page_header.' . $phpEx;
// Get the general config
$adr_general = adr_get_general_config();
adr_enable_check();
adr_ban_check($user_id);
adr_character_created_check($user_id);
$sql = "SELECT * FROM " . ADR_LIBRARY_LEARN_TABLE . "\r\n\t\tWHERE user_id = '{$user_id}'\r\n\t\tORDER BY book_id DESC";
if (!($result = $db->sql_query($sql))) {
    message_die(GENERAL_ERROR, 'Could not obtain required learned information', "", __LINE__, __FILE__, $sql);
}
$research_log = $db->sql_fetchrowset($result);
for ($i = 0; $i < count($research_log); $i++) {
    $template->assign_block_vars('learned', array("BOOK_NAME" => $research_log[$i]['book_name'], "BOOK_INFO" => $research_log[$i]['book_details']));
}
include $phpbb_root_path . 'adr/includes/adr_header.' . $phpEx;
Example #22
0
         case "use_potion":
             $potion_id = !empty($HTTP_POST_VARS['potion_id']) ? intval($HTTP_POST_VARS['potion_id']) : intval($HTTP_GET_VARS['potion_id']);
             $used_potion = adr_consume($potion_id, $user_id);
             if ($used_potion[0] == 1) {
                 $direction = append_sid("adr_character_inventory.{$phpEx}");
                 $message .= $used_potion[1] . '<br /><br />' . sprintf($lang['Adr_return'], "<a href=\"" . $direction . "\">", "</a>");
                 message_die(GENERAL_MESSAGE, $message);
             } else {
                 if ($used_potion[0] == 0) {
                     adr_previous(Adr_potion_used, adr_character_inventory, '');
                 }
             }
             break;
         case "use_recipe":
             $recipe_id = !empty($HTTP_POST_VARS['recipe_id']) ? intval($HTTP_POST_VARS['recipe_id']) : intval($HTTP_GET_VARS['recipe_id']);
             $learn_recipe = adr_use_recipe($recipe_id, $user_id);
             if ($learn_recipe == 1) {
                 adr_previous(Adr_recipe_successful_added, adr_character_inventory, '');
             } else {
                 if ($learn_recipe == 2) {
                     adr_previous(Adr_recipe_was_delted, adr_character_inventory, '');
                 } else {
                     if ($learn_recipe == 0) {
                         adr_previous(Adr_recipe_already_known, adr_character_inventory, '');
                     }
                 }
             }
             break;
     }
 } else {
     adr_template_file('adr_inventory_body.tpl');
Example #23
0
// Start session management
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
// End session management
//
$user_id = $userdata['user_id'];
$points = $userdata['user_points'];
include $phpbb_root_path . 'adr/includes/adr_global.' . $phpEx;
// Sorry , only logged users ...
if (!$userdata['session_logged_in']) {
    $redirect = "adr_questbook_history.{$phpEx}";
    $redirect .= isset($user_id) ? '&user_id=' . $user_id : '';
    header('Location: ' . append_sid("login.{$phpEx}?redirect={$redirect}", true));
}
// Includes the tpl and the header
adr_template_file('adr_questbook_history_body.tpl');
include $phpbb_root_path . 'includes/page_header.' . $phpEx;
// Get the general config
$adr_general = adr_get_general_config();
adr_enable_check();
adr_ban_check($user_id);
adr_character_created_check($user_id);
// Check for any active quests
$sql = " SELECT * FROM " . ADR_QUEST_LOG_HISTORY_TABLE . "\r\n\tWHERE user_id = '{$user_id}'\r\n\tORDER BY quest_id DESC\r\n\t";
if (!($result = $db->sql_query($sql))) {
    message_die(GENERAL_ERROR, 'Could not obtain required quest information', "", __LINE__, __FILE__, $sql);
}
while ($quest_log = $db->sql_fetchrow($result)) {
    $quest_status = "";
    //Get all the information about the NPC
    $sql2 = " SELECT * FROM  " . ADR_NPC_TABLE . "\r\n    \tWHERE npc_id = '" . $quest_log['npc_id'] . "' \r\n\t\t";
define('IN_ADR_SHOPS', true);
define('IN_ADR_CHARACTER', true);
$phpbb_root_path = './';
include $phpbb_root_path . 'extension.inc';
include $phpbb_root_path . 'common.' . $phpEx;
include $phpbb_root_path . 'adr/includes/adr_global.' . $phpEx;
include_once $phpbb_root_path . 'adr/includes/adr_functions_armour_sets.' . $phpEx;
$loc = 'character';
$sub_loc = 'adr_character_armour_sets';
//
// Start session management
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
// End session management
//
adr_template_file('adr_character_armour_sets_body.tpl');
include $phpbb_root_path . 'includes/page_header.' . $phpEx;
// Sorry , only logged users ...
if (!$userdata['session_logged_in']) {
    $redirect = "adr_character_armour_sets.{$phpEx}";
    $redirect .= isset($user_id) ? '&user_id=' . $user_id : '';
    header('Location: ' . append_sid("login.{$phpEx}?redirect={$redirect}", true));
}
$user_id = $userdata['user_id'];
// Get the general settings
$adr_general = adr_get_general_config();
adr_enable_check();
adr_ban_check($user_id);
adr_character_created_check($user_id);
if (!(isset($HTTP_POST_VARS[POST_USERS_URL]) || isset($HTTP_GET_VARS[POST_USERS_URL])) || empty($HTTP_POST_VARS[POST_USERS_URL]) && empty($HTTP_GET_VARS[POST_USERS_URL])) {
    $view_userdata = $userdata;
Example #25
0
        if (!$result) {
            message_die(GENERAL_ERROR, "Couldn't obtain stock exchange from database", "", __LINE__, __FILE__, $sql);
        }
        $owned = $db->sql_fetchrow($result);
        $actions_owned = $owned['stock_amount'];
        if (!$actions_owned) {
            $actions_owned = $lang['Adr_vault_exchange_none'];
        }
        $stock_name = adr_get_lang($exchange[$i]['stock_name']);
        $stock_desc = adr_get_lang($exchange[$i]['stock_desc']);
        $template->assign_block_vars("exchange", array("ROW_COLOR" => "#" . $row_color, "ROW_CLASS" => $row_class, "STOCK_NAME" => $stock_name, "STOCK_DESC" => $stock_desc, "STOCK_AMOUNT" => number_format($exchange[$i]['stock_price']), "STOCK_PREVIOUS" => number_format($exchange[$i]['stock_previous_price']), "STOCK_WORST" => number_format($exchange[$i]['stock_worst_price']), "STOCK_BEST" => number_format($exchange[$i]['stock_best_price']), "STOCK_BUY" => $buy_item[$a], "STOCK_SELL" => $sell_item[$a], "STOCK_OWNED" => $actions_owned));
    }
    $template->assign_vars(array('L_STOCK_EXCHANGE_ACTIONS' => $lang['Adr_vault_exchange_actions'], 'L_STOCK_NAME' => $lang['Adr_vault_exchange_actions_name'], 'L_STOCK_DESC' => $lang['Adr_vault_exchange_actions_desc'], 'L_STOCK_AMOUNT' => $lang['Adr_vault_exchange_actions_amount'], 'L_STOCK_PREVIOUS' => $lang['Adr_vault_exchange_previous_price'], 'L_STOCK_WORST' => $lang['Adr_vault_exchange_worst_price'], 'L_STOCK_BEST' => $lang['Adr_vault_exchange_best_price'], 'L_STOCK_OWNED' => $lang['Adr_vault_exchange_owned'], 'L_STOCK_BUY' => $lang['Adr_vault_exchange_buy'], 'L_STOCK_SELL' => $lang['Adr_vault_exchange_sell'], 'L_USERNAME' => $lang['Username'], 'L_PROFILE' => $lang['Profile'], 'L_SUBMIT' => $lang['Submit']));
}
if ($list) {
    adr_template_file('adr_vault_list_body.tpl');
    if ($board_config['stock_use']) {
        $template->assign_block_vars('stock', array());
    }
    $start = isset($_GET['start']) ? intval($_GET['start']) : 0;
    if (isset($_GET['mode']) || isset($_POST['mode'])) {
        $mode = isset($_POST['mode']) ? htmlspecialchars($_POST['mode']) : htmlspecialchars($_GET['mode']);
    } else {
        $mode = 'username';
    }
    if (isset($_POST['order'])) {
        $sort_order = $_POST['order'] == 'ASC' ? 'ASC' : 'DESC';
    } else {
        if (isset($_GET['order'])) {
            $sort_order = $_GET['order'] == 'ASC' ? 'ASC' : 'DESC';
        } else {
Example #26
0
                } while ($row = $db->sql_fetchrow($result));
            }
            $cat_sql = $cat ? 'AND item_type_use = ' . $cat : '';
            $sql = "SELECT count(*) AS total FROM " . ADR_SHOPS_ITEMS_TABLE . " \n\t\t\t\tWHERE item_owner_id = '{$user_id}'\n\t\t\t\t{$cat_sql}\n\t\t\t\tAND item_duration > '0'";
            if (!($result = $db->sql_query($sql))) {
                message_die(GENERAL_ERROR, 'Error getting total users', '', __LINE__, __FILE__, $sql);
            }
            if ($total = $db->sql_fetchrow($result)) {
                $total_items = $total['total'];
                $pagination = generate_pagination("admin_adr_users.{$phpEx}?mode=inventory&amp;order={$sort_order}&amp;cat={$cat}&amp;user_id=" . $user_id . "", $total_items, $board_config['topics_per_page'], $start) . '&nbsp;';
            }
            $template->assign_vars(array('ORDER_BY' => $order_by, 'ACTION_SELECT' => $action_select, 'SELECT_CAT' => $select_category, 'SELECT_QUANTITY' => $select_quantity, 'SHOP_OWNER_ID' => $shop_owner, 'OWNER_S' => $lang['Adr_warehouse_s'], 'WAREHOUSE_NAME' => $lang['Adr_warehouse_name'], 'OWNER_NAME' => $userdata['username'], 'OWNER_NAME' => $other_user_infos['character_name'], 'INVENTORY_NAME' => $lang['Adr_character_inventory_title'], 'L_CHECK_ALL' => $lang['Adr_check_all'], 'L_UNCHECK_ALL' => $lang['Adr_uncheck_all'], "L_SELECT_CAT" => $lang['Adr_items_select'], "L_SELECT_QUANTITY" => $lang['Adr_items_select_quantity'], "L_ITEM_NAME" => $lang['Adr_shops_categories_item_name'], "L_ITEM_DESC" => $lang['Adr_shops_categories_item_desc'], "L_ITEM_QUALITY" => $lang['Adr_items_quality'], "L_ITEM_POWER" => $lang['Adr_items_power'], "L_ITEM_DURATION" => $lang['Adr_items_duration'], "L_ACTION" => $lang['Adr_items_action'], "L_ITEM_IMG" => $lang['Adr_races_image'], "L_ITEM_PRICE" => $lang['Adr_items_price'], "L_ITEM_TYPE" => $lang['Adr_items_type_use'], "L_NO_ITEMS" => $lang['Adr_items_none'], 'L_SELECT_SORT_METHOD' => $lang['Select_sort_method'], 'L_ORDER' => $lang['Order'], 'L_SORT' => $lang['Sort'], 'L_SUBMIT' => $lang['Submit'], 'S_MODE_SELECT' => $select_sort_mode, 'S_ORDER_SELECT' => $select_sort_order, 'PAGINATION' => $pagination, 'PAGE_NUMBER' => sprintf($lang['Page_of'], floor($start / $board_config['topics_per_page']) + 1, ceil($total_items / $board_config['topics_per_page'])), 'L_GOTO_PAGE' => $lang['Goto_page'], 'S_MODE_ACTION' => append_sid("admin_adr_users.{$phpEx}?mode=inventory")));
            break;
    }
} else {
    adr_template_file('admin/config_adr_user_select_body.tpl');
    $sql = "SELECT u.user_id, u.username FROM " . USERS_TABLE . " u, " . ADR_CHARACTERS_TABLE . " c\n\t\tWHERE u.user_id = c.character_id\n\t\tAND c.character_class <> '0' \n\t\tORDER BY u.username";
    if (!($result = $db->sql_query($sql))) {
        message_die(GENERAL_ERROR, 'Could not obtain characters list', "", __LINE__, __FILE__, $sql);
    }
    $chars = $db->sql_fetchrowset($result);
    $chars_list = '<select name="' . POST_USERS_URL . '">';
    for ($i = 0; $i < count($chars); $i++) {
        $chars_list .= '<option value = "' . $chars[$i]['user_id'] . '" >' . $chars[$i]['username'] . '</option>';
    }
    $chars_list .= '</select>';
    $template->assign_vars(array('CHARS_LIST' => $chars_list, 'L_USER_TITLE' => $lang['Adr_user_admin'], 'L_USER_EXPLAIN' => $lang['Adr_user_admin_explain'], 'L_USER_SELECT' => $lang['Select_a_User'], 'L_LOOK_UP' => $lang['Look_up_user'], 'L_FIND_USERNAME' => $lang['Find_username'], 'U_SEARCH_USER' => append_sid("./../search.{$phpEx}?mode=searchuser"), 'S_USER_ACTION' => append_sid("admin_adr_users.{$phpEx}?mode=edit"), 'S_USER_SELECT' => $select_list));
}
$template->assign_vars(array('L_USER_TITLE' => $lang['Adr_user_admin'], 'L_USER_EXPLAIN' => $lang['Adr_user_admin_explain'], 'L_NAME' => $lang['Adr_races_name'], 'L_LEVEL' => $lang['Adr_character_level'], 'L_CHARACTER_OF' => sprintf($lang['Adr_character_of'], $this_userdata['username']), 'S_CHARACTER_ACTION' => append_sid("admin_adr_users.{$phpEx}?" . POST_USERS_URL . "=" . $searchid)));
$template->pparse('body');
include './page_footer_admin.' . $phpEx;
                $item_price = $item_power > 1 ? $item_price + $item_price * (($item_power - 1) * ($adr_general['item_modifier_power'] - 100) / 100) : $item_price;
                // Apply the duration penalty
                $item_price = abs($item_price / ($item_duration_max / $item_duration));
                // Finally let's use a non decimal value & add 10 %
                $item_price = ceil($item_price * 1.1);
            }
            $sql = "INSERT INTO " . ADR_BEGGAR_DONATIONS . "\r\n\t\t\t\t( item_id , item_owner_id , item_chance , item_type_use , item_name , item_desc , item_icon , item_price , item_quality , item_duration , item_duration_max , item_power , item_add_power , item_mp_use , item_weight , item_max_skill , item_element , item_element_str_dmg , item_element_same_dmg , item_element_weak_dmg )\r\n\t\t\t\tVALUES ( {$item_id} , 1 , {$item_chance} , {$item_type} , '" . str_replace("\\'", "''", $item_name) . "', '" . str_replace("\\'", "''", $item_desc) . "' , '" . str_replace("\\'", "''", $item_icon) . "' , {$item_price} , {$item_quality} , {$item_duration} , {$item_duration_max} , {$item_power} , {$item_add_power} , {$item_mp_use} , {$item_weight} , {$item_max_skill} , {$item_element} , {$item_element_str} , {$item_element_same} , {$item_element_weak} )";
            $result = $db->sql_query($sql);
            if (!$result) {
                message_die(GENERAL_ERROR, "Couldn't insert new item", "", __LINE__, __FILE__, $sql);
            }
            adr_previous(Adr_shops_items_successful_added, admin_adr_beggar_donations, '');
            break;
    }
} else {
    adr_template_file('admin/config_adr_beggar_donations_list_body.tpl');
    $start = isset($HTTP_GET_VARS['start']) ? intval($HTTP_GET_VARS['start']) : 0;
    if (isset($HTTP_GET_VARS['mode2']) || isset($HTTP_POST_VARS['mode2'])) {
        $mode2 = isset($HTTP_POST_VARS['mode2']) ? htmlspecialchars($HTTP_POST_VARS['mode2']) : htmlspecialchars($HTTP_GET_VARS['mode2']);
    } else {
        $mode2 = 'itemname';
    }
    if (isset($HTTP_POST_VARS['order'])) {
        $sort_order = $HTTP_POST_VARS['order'] == 'ASC' ? 'ASC' : 'DESC';
    } else {
        if (isset($HTTP_GET_VARS['order'])) {
            $sort_order = $HTTP_GET_VARS['order'] == 'ASC' ? 'ASC' : 'DESC';
        } else {
            $sort_order = 'ASC';
        }
    }
            $sql = "INSERT INTO " . ADR_SHOPS_ITEMS_TABLE . " \r\n\t\t\t\t( item_id , item_owner_id , item_type_use , item_name , item_desc , item_icon , item_price , item_quality , item_duration , item_duration_max , item_power , item_add_power , item_mp_use , item_weight , item_auth , item_max_skill, item_sell_back_percentage, item_steal_dc , item_store_id , item_element , item_element_str_dmg , item_element_same_dmg , item_element_weak_dmg, item_brewing_items_req, item_effect )\r\n\t\t\t\tVALUES ( {$item_id} , 1 , {$item_type} , '" . str_replace("\\'", "''", $item_name) . "', '" . str_replace("\\'", "''", $item_desc) . "' , '" . str_replace("\\'", "''", $item_icon) . "' , {$item_price} , {$item_quality} , {$item_duration} , {$item_duration_max} ,{$item_power} , {$item_add_power} , {$item_mp_use} , {$item_weight} , {$item_auth} , {$item_max_skill}, {$item_sell_back_percent}, {$item_steal_dc} , {$item_store} , {$item_element} , {$item_element_str} , {$item_element_same} , {$item_element_weak}, '" . $final_req_list . "', '" . $recipe_effects . "' )";
            $result = $db->sql_query($sql);
            if (!$result) {
                message_die(GENERAL_ERROR, "Couldn't insert new potion", "", __LINE__, __FILE__, $sql);
            }
            //add recipe
            $sql = "INSERT INTO " . ADR_SHOPS_ITEMS_TABLE . " \r\n\t\t\t\t( item_id , item_owner_id , item_type_use , item_name , item_desc , item_icon , item_price , item_quality , item_duration , item_duration_max , item_power , item_weight , item_auth , item_sell_back_percentage, item_steal_dc , item_store_id , item_brewing_recipe, item_brewing_items_req, item_effect, item_recipe_linked_item, item_original_recipe_id )\r\n\t\t\t\tVALUES ( {$recipe_id} , 1 , {$recipe_type} , '" . str_replace("\\'", "''", $recipe_name) . "', '" . str_replace("\\'", "''", $recipe_desc) . "' , '" . str_replace("\\'", "''", $recipe_img) . "' , {$recipe_price} , {$recipe_quality} , {$recipe_duration} , {$recipe_duration_max} ,{$recipe_power} , {$recipe_weight} , {$recipe_auth} , {$recipe_sell_back_percent}, {$recipe_steal_dc} , {$recipe_store}, 1, '" . $final_req_list . "', '" . $recipe_effects . "', {$item_id}, {$recipe_id} )";
            $result = $db->sql_query($sql);
            if (!$result) {
                message_die(GENERAL_ERROR, "Couldn't insert new recipe", "", __LINE__, __FILE__, $sql);
            }
            adr_previous(Adr_recipe_successful_added, admin_adr_brewing_recipes, '');
            break;
    }
} else {
    adr_template_file('admin/config_adr_brewing_recipes_list_body.tpl');
    $start = isset($HTTP_GET_VARS['start']) ? intval($HTTP_GET_VARS['start']) : 0;
    if (isset($HTTP_GET_VARS['mode2']) || isset($HTTP_POST_VARS['mode2'])) {
        $mode2 = isset($HTTP_POST_VARS['mode2']) ? htmlspecialchars($HTTP_POST_VARS['mode2']) : htmlspecialchars($HTTP_GET_VARS['mode2']);
    } else {
        $mode2 = 'name';
    }
    if (isset($HTTP_POST_VARS['order'])) {
        $sort_order = $HTTP_POST_VARS['order'] == 'ASC' ? 'ASC' : 'DESC';
    } else {
        if (isset($HTTP_GET_VARS['order'])) {
            $sort_order = $HTTP_GET_VARS['order'] == 'ASC' ? 'ASC' : 'DESC';
        } else {
            $sort_order = 'ASC';
        }
    }
Example #29
0
define('IN_ADR_CHARACTER', true);
$phpbb_root_path = './';
include_once $phpbb_root_path . 'extension.inc';
include_once $phpbb_root_path . 'common.' . $phpEx;
//
// Start session management
$userdata = session_pagestart($user_ip, PAGE_ADR);
init_userprefs($userdata);
// End session management
//
$user_id = $userdata['user_id'];
include_once $phpbb_root_path . 'adr/includes/adr_global.' . $phpEx;
// Sorry , only logged users ...
if (!$userdata['session_logged_in']) {
    $redirect = "adr_character.{$phpEx}";
    $redirect .= isset($user_id) ? '&user_id=' . $user_id : '';
    header('Location: ' . append_sid("login.{$phpEx}?redirect={$redirect}", true));
}
// Includes the tpl and the header
adr_template_file('adr_tower_body.tpl');
include_once $phpbb_root_path . 'includes/page_header.' . $phpEx;
// Get the general config and character infos
$adr_general = adr_get_general_config();
adr_enable_check();
adr_ban_check($user_id);
adr_character_created_check($user_id);
$adr_user = adr_get_user_infos($user_id);
$template->assign_vars(array('L_ZONE_TOWER' => $lang['Adr_zone_tower_title'], 'L_ZONE_CHARACTER_SKILLS' => $lang['Adr_zone_character_skills'], 'L_ZONE_CHARACTER_EQUIP' => $lang['Adr_zone_character_equip'], 'U_ZONE_CHARACTER_SKILLS' => append_sid("adr_character_skills.{$phpEx}"), 'U_ZONE_CHARACTER_EQUIP' => append_sid("adr_character_equipment.{$phpEx}"), 'S_ZONES_ACTION' => append_sid("adr_tower.{$phpEx}")));
include $phpbb_root_path . 'adr/includes/adr_header.' . $phpEx;
$template->pparse('body');
include_once $phpbb_root_path . 'includes/page_tail.' . $phpEx;
            $item_logo = $row['spell_icon'];
            if ($row['spell_icon'] != '') {
                $item_img = '<img src="adr/images/items/' . $item_logo . '">';
            } else {
                $item_img = '';
            }
            if ($row['element_img'] != '' && $row['spell_element'] != 0) {
                $element_img = '<img src="adr/images/elements/' . $row['element_img'] . '">';
            } else {
                $element_img = $lang['Adr_store_element_none'];
            }
            $template->assign_vars(array("ROW_CLASS" => $theme['td_class1'], "ROW_CLASS_2" => $theme['td_class2'], "ACTION_SELECT" => $action_select, "ITEM_ID" => $row['spell_id'], "ITEM_NAME" => $row['spell_name'], "ITEM_DESC" => $row['spell_desc'], "ITEM_IMG" => $item_img, "ITEM_TYPE" => $lang[$row['item_type_lang']], "ITEM_POWER" => $row['spell_power'], "ITEM_ELEMENT" => $element_img, "ITEM_ADD_POWER" => $row['spell_add_power'], "ITEM_MP" => $row['spell_mp_use'], "ITEM_POINTS" => $points_name, "SHOP_OWNER_ID" => $store_owner_id, "L_ITEM_POWER" => $lang['Adr_items_power'], "L_ITEM_ADD_POWER" => $lang['Adr_items_dex'], "L_ITEM_MP" => $lang['Adr_items_mp_use'], "L_ITEM_DESC" => $lang['Adr_store_desc'], "L_ITEM_DURA" => $lang['Adr_store_duration'], "L_ITEM_IMG" => $lang['Adr_races_image'], "L_ITEM_PRICE" => $lang['Adr_store_price'], "L_ITEM_TYPE" => $lang['Adr_items_type_use'], "L_ITEM_WEIGHT" => $lang['Adr_store_weight'], "L_ITEM_ELEMENT" => $lang['Adr_store_element'], "L_ACTION" => $lang['Adr_items_action'], "L_SUBMIT" => $lang['Submit']));
            break;
    }
} else {
    adr_template_file('adr_inventory_body_spells.tpl');
    $template->assign_block_vars('main', array());
    $sql = "SELECT i.* , t.item_type_lang FROM " . ADR_SHOPS_SPELLS_TABLE . " i\r\n\t\t\tLEFT JOIN " . ADR_SHOPS_ITEMS_TYPE_TABLE . " t ON ( i.item_type_use = t.item_type_id )\r\n\t\tWHERE i.spell_owner_id = {$searchid}\r\n\t\t{$cat_sql}\r\n\t\tORDER BY {$order_by}";
    if (!($result = $db->sql_query($sql))) {
        message_die(GENERAL_ERROR, 'Could not query users items', '', __LINE__, __FILE__, $sql);
    }
    if ($row = $db->sql_fetchrow($result)) {
        $i = 0;
        do {
            $row_class = !($i % 2) ? $theme['td_class1'] : $theme['td_class2'];
            $template->assign_block_vars('main.items', array("ROW_CLASS" => $row_class, "ITEM_NAME" => adr_get_lang($row['spell_name']), "ITEM_DESC" => adr_get_lang($row['spell_desc']), "ITEM_IMG" => $row['spell_icon'], "ITEM_TYPE" => $lang[$row['item_type_lang']], "ITEM_POWER" => $row['spell_power'], "ITEM_ID" => $row['spell_id'], "U_ITEM_GIVE" => append_sid("adr_character_inventory_spells.{$phpEx}?mode=give&amp;item_id=" . $row['spell_id']), "U_ITEM_SELL" => append_sid("adr_character_inventory_spells.{$phpEx}?mode=sell&amp;item_id=" . $row['spell_id']), "U_ITEM_EDIT" => append_sid("adr_character_inventory_spells.{$phpEx}?mode=edit&amp;item_id=" . $row['spell_id']), "U_ITEM_SHOP" => append_sid("adr_character_inventory_spells.{$phpEx}?mode=shop&amp;item_id=" . $row['spell_id']), "U_ITEM_INFO" => append_sid("adr_character_inventory_spells.{$phpEx}?mode=view_item&amp;item_owner_id=" . $row['spell_owner_id'] . "&amp;item_id=" . $row['spell_id'] . "")));
            if ($user_id == $searchid) {
                $template->assign_block_vars("main.items.owner", array());
            }
            $i++;
        } while ($row = $db->sql_fetchrow($result));