Advertisement
Guest User

heavenwow website arena team

a guest
Apr 11th, 2012
531
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 18.61 KB | None | 0 0
  1. Edited Files:
  2. --------------------------------------------------------------------------
  3. --------------------------------------------------------------------------
  4. --------------------------------------------------------------------------
  5. - styles/default/sidebar.php
  6.  
  7. <!-- Arena Stats -->
  8.     <!-- if(TopArena) -->
  9.         {HTML}
  10.     <!-- else(TopArena) -->
  11.     <!-- endif(TopArena) -->
  12. <!-- Arena Stats.End -->
  13.  
  14. --------------------------------------------------------------------------
  15. --------------------------------------------------------------------------
  16. --------------------------------------------------------------------------
  17. - Added File
  18. - js/toparena.js
  19.  
  20. //Top Arena Teams javascript handlers by ChoMPi
  21.  
  22. function resolveFaction(elementId, captain, realm)
  23. {
  24.     var $elementId = elementId;
  25.     var $captain = captain;
  26.     var $realm = realm;
  27.    
  28.     var $cont = $('#'+elementId);
  29.    
  30.     //prepare the ajax error handlers
  31.     $.ajaxSetup({
  32.         error:function(x,e){
  33.             if(x.status==500){
  34.                 resolveFaction($elementId, $captain, $realm);
  35.             }else if(e=='parsererror'){
  36.                 resolveFaction($elementId, $captain, $realm);
  37.             }else if(e=='timeout'){
  38.                 resolveFaction($elementId, $captain, $realm);
  39.             }else{
  40.                 resolveFaction($elementId, $captain, $realm);
  41.             }
  42.         }
  43.     });
  44.            
  45.     $.post(
  46.         "ajax_top_arena.php",
  47.         {
  48.             resolveFaction: true,
  49.             realm: $realm,
  50.             guid: $captain,
  51.         },
  52.         function(data){
  53.             //if error
  54.             if (data == '0')
  55.             {
  56.                 $cont.html('Unknown');
  57.             }
  58.             else
  59.             {
  60.                 if (data == 'Horde')
  61.                 {
  62.                     $cont.html('<font color="#9d261d">Horde</font>');
  63.                 }
  64.                 else if (data == 'Alliance')
  65.                 {
  66.                     $cont.html('<font color="#1b5183">Alliance</font>');
  67.                 }
  68.                 else
  69.                 {
  70.                     $cont.html('Unknown');
  71.                 }
  72.             }
  73.         }
  74.     );
  75. }
  76.  
  77. $(document).ready(function()
  78. {
  79.     var $a_tooltips = 1;
  80.    
  81.     //Select all anchor tag with rel set to tooltip
  82.     $('a[rel=top-arena-tooltip]').mouseover(function(e)
  83.     {
  84.         var $realm = $(this).attr('realm');
  85.         var $teamid = $(this).attr('teamid');
  86.        
  87.         //get the element data in order to find our tooltip
  88.         var data = $(this).data('top-arena-tooltip-id');
  89.        
  90.         //check if the data is not yet set
  91.         if (typeof data == 'undefined')
  92.         {
  93.             data = $a_tooltips;
  94.            
  95.             $(this).data('top-arena-tooltip-id', data);        
  96.            
  97.             //Append the tooltip template and its value
  98.             $('body').append('<div class="top-arena-tooltip" id="top-arena-tooltip-'+data+'"><div class="tipHeader"></div><div class="tipBody">Loading...</div><div class="tipFooter"></div></div>');    
  99.  
  100.             //get the Tooltip HTML with ajax
  101.             $.post(
  102.                 'ajax_top_arena.php',
  103.                 {
  104.                     lookupArenaTeam: true,
  105.                     realm: $realm,
  106.                     arenateamid: $teamid,
  107.                 },
  108.                 function(dataResponse, textStatus)
  109.                 {
  110.                     var cont = $('#top-arena-tooltip-'+data).find('.tipBody');
  111.                    
  112.                     //check for error
  113.                     if (dataResponse == '0')
  114.                     {
  115.                         $(cont).html('Failed to load HTML data.');
  116.                     }
  117.                     else
  118.                     {
  119.                         $(cont).html(dataResponse);
  120.                     }
  121.                 }
  122.             );
  123.            
  124.             $a_tooltips = $a_tooltips + 1;
  125.         }
  126.        
  127.         //find our tooltip element
  128.         var tooltip = $('#top-arena-tooltip-'+data);
  129.        
  130.         //Set the X and Y axis of the tooltip
  131.         $(tooltip).css('top', e.pageY + 10 - 200);
  132.         $(tooltip).css('left', e.pageX + 20 );
  133.          
  134.         //Show the tooltip with faceIn effect
  135.         $(tooltip).fadeIn(200);
  136.          
  137.     }).mousemove(function(e)
  138.     {
  139.         var data = $(this).data('top-arena-tooltip-id');
  140.         var tooltip = $('#top-arena-tooltip-'+data);
  141.        
  142.         //Keep changing the X and Y axis for the tooltip, thus, the tooltip move along with the mouse
  143.         $(tooltip).css('top', e.pageY + 10 );
  144.         $(tooltip).css('left', e.pageX + 20 );
  145.          
  146.     }).mouseout(function()
  147.     {
  148.         var data = $(this).data('top-arena-tooltip-id');
  149.         var tooltip = $('#top-arena-tooltip-'+data);
  150.        
  151.         //hide the tooltip
  152.         $(tooltip).fadeOut(100);
  153.     });
  154.  
  155. });
  156.  
  157. --------------------------------------------------------------------------
  158. --------------------------------------------------------------------------
  159. --------------------------------------------------------------------------
  160. - Added File
  161. - ajax_top_arena.js
  162.  
  163. <?php
  164. require("config.php");
  165.  
  166. if ($server_core=='')
  167.     $server_core='trinity';
  168.    
  169. require_once './include/dblayer/common_db.php';
  170. require_once './include/core/'.$server_core.'.php';
  171.  
  172. //check if we want to resolve faction of character
  173. if (isset($_POST['resolveFaction']))
  174. {
  175.     $error = false;
  176.     //check if the realm and character are passed
  177.     if (isset($_POST['realm']) and isset($_POST['guid']))
  178.     {
  179.         $realmid = (int)$_POST['realm'];
  180.         $guid = (int)$_POST['guid'];
  181.        
  182.         $teams = new TopArenaTeams();
  183.        
  184.         //open database connection
  185.         $REALM_DB = newRealmPDO($realmid);
  186.        
  187.         //check if we got realm database connection
  188.         if ($REALM_DB)
  189.         {
  190.             $teams->setDatabase($REALM_DB);
  191.             $faction = $teams->resolveFaction($guid);
  192.            
  193.             //check if the faction resolve has failed
  194.             if (!$faction)
  195.             {
  196.                 $error = true;
  197.             }
  198.         }
  199.         else
  200.         {
  201.             $error = true;
  202.         }
  203.         unset($REALM_DB);
  204.         unset($teams);
  205.     }
  206.     else
  207.     {
  208.         $error = true;
  209.     }
  210.    
  211.     //if the faction is resolved
  212.     if (!$error)
  213.     {
  214.         //only first letter capital
  215.         echo ucfirst(strtolower($faction));
  216.         die;
  217.     }
  218.     else
  219.     {
  220.         echo '0';
  221.         die;
  222.     }
  223. }
  224.  
  225. //check if we need to lookup arena team
  226. if (isset($_POST['lookupArenaTeam']))
  227. {
  228.     $error = false;
  229.     //check if the realm and arenateamid are passed
  230.     if (isset($_POST['realm']) and isset($_POST['arenateamid']))
  231.     {
  232.         $realmid = (int)$_POST['realm'];
  233.         $teamid = (int)$_POST['arenateamid'];
  234.        
  235.         $teams = new TopArenaTeams();
  236.        
  237.         //open database connection
  238.         $REALM_DB = newRealmPDO($realmid);
  239.        
  240.         //check if we got realm database connection
  241.         if ($REALM_DB)
  242.         {
  243.             $teams->setDatabase($REALM_DB);
  244.             //get team details
  245.             $info = $teams->getTeamInfo($teamid);
  246.            
  247.             if (!$info)
  248.             {
  249.                 $error = true;
  250.             }
  251.             else
  252.             {
  253.                 //get the team captain
  254.                 $captain = $teams->getTeamCaptain($teamid);
  255.                 //get team members
  256.                 $membersRes = $teams->getTeamMembers($teamid);
  257.  
  258.                 //predefined variables
  259.                 $captainHTML = false;
  260.                 $membersHTML = false;
  261.            
  262.                 //if we got team members
  263.                 if ($membersRes)
  264.                 {
  265.                     $membersHTML = '';
  266.                     $i = 1;
  267.                     while ($row = $membersRes->fetch(PDO::FETCH_ASSOC))
  268.                     {
  269.                         //check if the current members is the captain
  270.                         if ($row['guid'] == $captain)
  271.                         {
  272.                             $captainHTML = '<ul>
  273.                                             <li class="col-title">Team Captain:</li>
  274.                                             <li class="col-info">'.$row['name'].'</li>
  275.                                         </ul>';
  276.                         }
  277.                         else
  278.                         {
  279.                             $membersHTML .= '<ul>
  280.                                             <li class="col-title">Member '.$i.':</li>
  281.                                             <li class="col-info">'.$row['name'].'</li>
  282.                                         </ul>';
  283.                             $i++;
  284.                         }
  285.                     }
  286.                     unset($membersRes);
  287.                 }
  288.             }
  289.         }
  290.         else
  291.         {
  292.             $error = true;
  293.         }
  294.         unset($REALM_DB);
  295.         unset($teams);
  296.     }
  297.     else
  298.     {
  299.         $error = true;
  300.     }
  301.    
  302.     if (!$error)
  303.     {
  304.         $html = '<ul>
  305.                     <li class="team-name">'.$info['name'].'</li>
  306.                 </ul>
  307.                 <ul>
  308.                     <li class="col-title">Games:</li>
  309.                     <li class="games-won">'.$info['wins'].' Won</li>
  310.                     <li class="games-lost">'.$info['lost'].' Lost</li>
  311.                 </ul>
  312.                 <ul>
  313.                     <li class="col-title">Type:</li>
  314.                     <li class="col-info">'.$info['type'].'</li>
  315.                 </ul>
  316.                 <ul>
  317.                     <li class="col-title">Rating:</li>
  318.                     <li class="col-info">'.$info['rating'].'</li>
  319.                 </ul>';
  320.                
  321.         //if we have team captain
  322.         if ($captainHTML)
  323.         {
  324.             $html .= $captainHTML;
  325.         }
  326.         //if we have team members
  327.         if ($membersHTML)
  328.         {
  329.             $html .= $membersHTML;
  330.         }
  331.        
  332.         echo $html;
  333.         die;
  334.     }
  335.     else
  336.     {
  337.         echo '0';
  338.         die;
  339.     }
  340. }
  341.  
  342.  
  343. --------------------------------------------------------------------------
  344. --------------------------------------------------------------------------
  345. --------------------------------------------------------------------------
  346. - styles/default/style.css
  347.  
  348. /* Top Arena Teams */
  349.  
  350. .top-arena-tooltip {
  351.     position: absolute !important;
  352.     color:#fff;
  353.     z-index: 9999;
  354.     font-size:10px;
  355.     min-width:150px;
  356.     background: #131516;
  357.     display: none;
  358.     opacity: 0.9;
  359.     -moz-box-shadow:0 0 6px rgba(255,255,255,.3), inset 0 0 3px rgba(0,0,0,.4);
  360.     -webkit-box-shadow:0 0 6px rgba(255,255,255,.3), inset 0 0 3px rgba(0,0,0,.4);
  361.     box-shadow:0 0 6px rgba(255,255,255,.3), inset 0 0 3px rgba(0,0,0,.4);
  362.     -webkit-border-radius: 4px;
  363.     -moz-border-radius: 4px;
  364.     border-radius: 4px;
  365. }
  366.  
  367. .top-arena-tooltip .tipHeader {
  368. }
  369.  
  370. /* IE hack */
  371. *html .top-arena-tooltip .tipHeader {margin-bottom:-6px;}
  372.  
  373. .top-arena-tooltip .tipBody {
  374.     padding:15px;
  375.     color: #4e4e4e;
  376.     font-size: 12px;
  377.     font-family: Arial, Helvetica, sans-serif;
  378.     text-shadow: 0 1px 2px rgba(0,0,0,1),  1px 0 2px rgba(0,0,0,1);
  379. }
  380.  
  381. .top-arena-tooltip .tipBody ul {
  382.     display: block;
  383.     list-style: none;
  384.     margin-bottom: 2px;
  385. }
  386. .top-arena-tooltip .tipBody ul:last-child {
  387.     margin-bottom: 0px;
  388. }
  389.  
  390. .top-arena-tooltip .tipBody ul li {
  391.     display: inline-block;
  392.     margin-right: 4px;
  393. }
  394.  
  395. .top-arena-tooltip .tipBody ul li.team-name {
  396.     font-size: 18px;
  397.     margin-bottom: 7px;
  398.     top: -5px;
  399. }
  400. .top-arena-tooltip .tipBody ul li.games-won {
  401.     color: #1b5183;
  402. }
  403. .top-arena-tooltip .tipBody ul li.games-lost {
  404.     color: #9d261d;
  405. }
  406. .top-arena-tooltip .tipBody ul li.col-info {
  407.     color: #908074;
  408. }
  409.  
  410. .top-arena-tooltip .tipFooter {
  411. }
  412.  
  413.  
  414. --------------------------------------------------------------------------
  415. --------------------------------------------------------------------------
  416. --------------------------------------------------------------------------
  417. - index.php
  418.  
  419. ###############################################
  420. ## TOP ARENA TEAMS by ChoMPi
  421. ###############################################
  422. $teams = new TopArenaTeams();
  423.  
  424. //loop the realms
  425. foreach ($TopArenaTeams as $data)
  426. {
  427.     $REALM_DB = newRealmPDO($id);
  428.    
  429.     if ($REALM_DB)
  430.     {
  431.         $teams->setDatabase($REALM_DB);
  432.        
  433.         //get the team resources
  434.         $res = $teams->getTeams($data['limit']);
  435.         //if we have resources
  436.         if ($res)
  437.         {
  438.             $html = '
  439.             <div class="sidebar_box">
  440.                 <div class="sidebar_box_head"><p>TOP '.$data['limit'].' ARENA ('.$realm[$data['realmid']]['name'].')</p><span></span></div>
  441.                 <div class="sidebar_box_cont arena_top_teams">
  442.                     <ul>
  443.                         <li id="head">
  444.                             <span class="number">N</span>
  445.                             <span class="t_name">Team Name</span>
  446.                             <span class="t_rating">Rating</span>
  447.                             <span class="t_faction">Faction</span>
  448.                         </li>';
  449.            
  450.             $i = 1;
  451.             while ($row = $res->fetch(PDO::FETCH_ASSOC))
  452.             {
  453.                 $html .= '
  454.                     <li>
  455.                         <span class="number">'.$i.'</span>
  456.                         <span class="t_name">
  457.                             <a style="cursor: pointer;" rel="top-arena-tooltip" realm="'.$data['realmid'].'" teamid="'.$row['arenateamid'].'">
  458.                                 '.$row['name'].'
  459.                             </a>
  460.                         </span>
  461.                         <span class="t_rating">'.$row['rating'].'</span>
  462.                         <span class="t_faction" id="'.$data['realmid'].'-'.$i.'">
  463.                             &nbsp;Loading...
  464.                             <script type="text/javascript">
  465.                                 $(document).ready(function()
  466.                                 {
  467.                                     resolveFaction(\''.$data['realmid'].'-'.$i.'\', \''.$row['captain'].'\', \''.$data['realmid'].'\');
  468.                                 });
  469.                             </script>
  470.                         </span>
  471.                     </li>';
  472.                 $i++;
  473.             }
  474.             unset($res);
  475.            
  476.             $html .= '
  477.                     </ul>
  478.                 </div>
  479.             </div>';
  480.             $tpl_sidebar->gotoNext("TopArena");
  481.             $tpl_sidebar->setVar("TopArena.HTML", $html);
  482.         }
  483.     }
  484.     unset($REALM_DB);
  485. }
  486. unset($teams);
  487.  
  488.  
  489. --------------------------------------------------------------------------
  490. --------------------------------------------------------------------------
  491. --------------------------------------------------------------------------
  492. - include/core/trinity_ra.php
  493. - include/core/trinity.php
  494. - include/core/mangos.php
  495.  
  496. /***************************************
  497. *         TOP ARENA FUNCTIONS
  498. ***************************************/
  499.  
  500. class TopArenaTeams
  501. {
  502.     private $db = false;
  503.     private $translate = NULL;
  504.    
  505.     public function __construct()
  506.     {
  507.         global $db_translation;
  508.        
  509.         $this->translate = $db_translation;
  510.                
  511.         return true;
  512.     }
  513.        
  514.     public function setDatabase($db)
  515.     {
  516.         $this->db = $db;
  517.        
  518.         return true;
  519.     }
  520.    
  521.     /**
  522.     **  function getTeams(count) designed to get database resources by specified count
  523.     **
  524.     **  Parameters:
  525.     **  ------------------------------------------------------
  526.     **  $count - limit the resources gethered from the database
  527.     **
  528.     **  Returns:
  529.     **  ------------------------------------------------------
  530.     **  PDO Statement executed and ready for fetching or false if there are no records
  531.     **  - Columns:
  532.     **       `arenateamid`
  533.     **       `rating`
  534.     **       `rank`
  535.     **       `name`
  536.     **       `captain`
  537.     **       `type`
  538.     **
  539.     **/
  540.     public function getTeams($count = 5)
  541.     {
  542.         //make sure the count param is digit
  543.         if (!ctype_digit($count))
  544.         {
  545.             $count = 5;
  546.         }
  547.        
  548.         $res = $this->db->prepare("
  549.                                 SELECT
  550.                                     `arena_team_stats`.`arenateamid` AS arenateamid,
  551.                                     `arena_team_stats`.`rating` AS rating,
  552.                                     `arena_team_stats`.`rank` AS rank,
  553.                                     `arena_team`.`name` AS name,
  554.                                     `arena_team`.`captainguid` AS captain,
  555.                                     `arena_team`.`type` AS type
  556.                                 FROM `arena_team_stats`
  557.                                 LEFT JOIN `arena_team` ON `arena_team_stats`.`arenateamid` = `arena_team`.`arenateamid`
  558.                                 ORDER BY rating DESC
  559.                                 LIMIT " . $count);
  560.         $res->execute();
  561.        
  562.         if ($res->rowCount() > 0)
  563.         {
  564.             return $res;
  565.         }
  566.         else
  567.         {
  568.             unset($res);
  569.             return false;
  570.         }
  571.     }
  572.  
  573.     /**
  574.     **  function getTeamMembers(team) designed to get database resources about specifed team
  575.     **
  576.     **  Parameters:
  577.     **  ------------------------------------------------------
  578.     **  $team - the arena team id
  579.     **
  580.     **  Returns:
  581.     **  ------------------------------------------------------
  582.     **  PDO Statement executed and ready for fetching or false if there are no records
  583.     **  - Columns:
  584.     **       `arenateamid`
  585.     **       `guid`
  586.     **       `name`
  587.     **
  588.     **/
  589.     public function getTeamMembers($team)
  590.     {
  591.         $res = $this->db->prepare("
  592.                                 SELECT
  593.                                     `arena_team_member`.`arenateamid` AS arenateamid,
  594.                                     `arena_team_member`.`guid` AS guid,
  595.                                     `".$this->translate['characters']."`.`".$this->translate['characters_name']."` AS name
  596.                                 FROM `arena_team_member`
  597.                                 RIGHT JOIN `".$this->translate['characters']."` ON `".$this->translate['characters']."`.`".$this->translate['characters_guid']."` = `arena_team_member`.`guid`
  598.                                 WHERE `arena_team_member`.`arenateamid` = :team ORDER BY guid ASC");
  599.         $res->bindParam(':team', $team, PDO::PARAM_INT);
  600.         $res->execute();
  601.        
  602.         if ($res->rowCount() > 0)
  603.         {
  604.             return $res;
  605.         }
  606.         else
  607.         {
  608.             unset($res);
  609.             return false;
  610.         }
  611.     }
  612.    
  613.     public function getTeamCaptain($team)
  614.     {
  615.         $res = $this->db->prepare("SELECT `captainguid` FROM `arena_team` WHERE `arenateamid` = :team LIMIT 1");
  616.         $res->bindParam(':team', $team, PDO::PARAM_INT);
  617.         $res->execute();
  618.        
  619.         if ($res->rowCount() > 0)
  620.         {
  621.             $row = $res->fetch(PDO::FETCH_ASSOC);
  622.             unset($res);
  623.             return $row['captainguid'];
  624.         }
  625.         else
  626.         {
  627.             unset($res);
  628.             return false;
  629.         }
  630.     }
  631.  
  632.     /**
  633.     **  function getTeamInfo(team) designed to get database resources, fetch and parse
  634.     **
  635.     **  Parameters:
  636.     **  ------------------------------------------------------
  637.     **  $team - the arena team id
  638.     **
  639.     **  Returns:
  640.     **  ------------------------------------------------------
  641.     **  false (bool) - on failure
  642.     **  Columns:
  643.     **       `arenateamid`
  644.     **       `rating`
  645.     **       `rank`
  646.     **       `games`
  647.     **       `wins`
  648.     **       `lost`
  649.     **       `name`
  650.     **       `type`
  651.     **
  652.     **/
  653.     public function getTeamInfo($team)
  654.     {
  655.         $res = $this->db->prepare("SELECT
  656.                                     `arena_team_stats`.`arenateamid` AS arenateamid,
  657.                                     `arena_team_stats`.`rating` AS rating,
  658.                                     `arena_team_stats`.`rank` AS rank,
  659.                                     `arena_team_stats`.`played` AS games,
  660.                                     `arena_team_stats`.`wins2` AS wins,
  661.                                     `arena_team`.`name` AS name,
  662.                                     `arena_team`.`type` AS type
  663.                                 FROM `arena_team_stats`
  664.                                 LEFT JOIN `arena_team` ON `arena_team_stats`.`arenateamid` = `arena_team`.`arenateamid`
  665.                                 WHERE `arena_team_stats`.`arenateamid` = :team
  666.                                 ORDER BY rating DESC
  667.                                 LIMIT 1");
  668.         $res->bindParam(':team', $team, PDO::PARAM_INT);
  669.         $res->execute();
  670.                
  671.         if ($res->rowCount() > 0)
  672.         {
  673.             $arr = $res->fetch(PDO::FETCH_ASSOC);
  674.            
  675.             //define array
  676.             $row = array();
  677.             $row['arenateamid'] = $arr['arenateamid'];
  678.             $row['rating'] = $arr['rating'];
  679.             $row['rank'] = $arr['rank'];
  680.             $row['games'] = $arr['games'];
  681.             $row['wins'] = $arr['wins'];
  682.             $row['lost'] = $arr['games'] - $arr['wins'];
  683.             $row['name'] = $arr['name'];
  684.            
  685.             //transalte the arena type
  686.             if ($arr['type'] == 2)
  687.             {
  688.                 $row['type'] = '2v2';
  689.             }
  690.             else if ($arr['type'] == 3)
  691.             {
  692.                 $row['type'] = '3v3';
  693.             }
  694.             else
  695.             {
  696.                 $row['type'] = '5v5';
  697.             }
  698.            
  699.             unset($arr);
  700.            
  701.             return $row;
  702.         }
  703.         else
  704.         {
  705.             unset($res);
  706.             return false;
  707.         }
  708.     }
  709.    
  710.     /**
  711.     **  function resolveFaction finds out from wich faction the team is by looking at the team's captain record
  712.     **
  713.     **  Parameters:
  714.     **  ----------------------------------------------
  715.     **  $captain - character GUID of the team's captain
  716.     **
  717.     **  Returns:
  718.     **  ----------------------------------------------
  719.     **  alliance (string)   - for alliance
  720.     **  horde (string)      - for horde
  721.     **  false (bool)        - on failure
  722.     **
  723.     **/
  724.     public function resolveFaction($captain)
  725.     {
  726.         $res = $this->db->prepare("SELECT ".$this->translate['characters_guid'].", ".$this->translate['characters_race']." FROM `".$this->translate['characters']."` WHERE `".$this->translate['characters_guid']."` = :guid LIMIT 1");
  727.         $res->bindParam(':guid', $captain, PDO::PARAM_INT);
  728.         $res->execute();
  729.        
  730.         if ($res->rowCount() > 0)
  731.         {
  732.             $row = $res->fetch(PDO::FETCH_ASSOC);
  733.            
  734.             $race = $row[$this->translate['characters_race']];
  735.            
  736.             //check if the faction is alliance
  737.             if ($race == 1 or $race == 3 or $race == 4 or $race == 7 or $race == 11 or $race == 22)
  738.             {
  739.                 unset($res);
  740.                 return 'alliance';
  741.             }
  742.             else
  743.             {
  744.                 unset($res);
  745.                 return 'horde';
  746.             }
  747.         }
  748.         else
  749.         {
  750.             unset($res);
  751.             return false;
  752.         }
  753.     }
  754.    
  755.     public function __destruct()
  756.     {
  757.         unset($this->db);
  758.     }
  759. }
  760.  
  761. --------------------------------------------------------------------------
  762. --------------------------------------------------------------------------
  763. --------------------------------------------------------------------------
  764. - config.php
  765.  
  766. //Top Arena Teams config
  767. $TopArenaTeams = array(
  768.     array('realmid' => 1, 'limit' => 5),
  769.     array('realmid' => 2, 'limit' => 5),
  770. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement