Advertisement
Guest User

strongest

a guest
Oct 31st, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.50 KB | None | 0 0
  1. <?php
  2. /**
  3.  * User: epmak
  4.  * Date: 31.10.2014
  5.  * Time: 19:59
  6.  * MuWebClone
  7.  * legacy 1.5
  8.  * very legacy....
  9.  */
  10. if (!defined('insite')) die("no access");
  11.  
  12. $ntime = @filemtime("_dat/cach/top_strongest");
  13. require_once "configs/strongest_cfg.php";
  14.  
  15. if(!$ntime || (time()-$ntime>$strongest["cach"]))
  16. {
  17.     global $db,$config,$content;
  18.  
  19.     if($strongest["show_adm"]==0)
  20.         $ctlCode = " ch.CtlCode NOT IN(1,17)";
  21.     else
  22.         $ctlCode = " ch.CtlCode NOT IN(1,17,32)";
  23.  
  24.  
  25.     if(!empty($strongest["stron_hiden"]))
  26.     {
  27.         $hiden.=" AND Name NOT IN ({$strongest["stron_hiden"]})";
  28.     }
  29.     else
  30.         $hiden="";
  31.  
  32.     $resulttop5 = $db->query("SELECT TOP 5
  33. ch.Name,
  34. ch.cLevel,
  35. ch.Class,
  36. ch.{$strongest["res_colum"]},
  37. ch.PkCount,
  38. ch.PkLevel,
  39. gm.G_Name,
  40. CONVERT(varchar(max),gld.G_Mark,2) as g_mark,
  41. ms.ConnectStat,
  42. CONVERT(varchar(max),ms.ConnectTM,120) as ConnectTM,
  43. CONVERT(varchar(max), ms.DisConnectTM ,120) as DisConnectTM,
  44. ch.gr_res
  45. FROM  [Character] ch
  46. left join [GuildMember] gm ON gm.Name = ch.Name
  47. left join Guild gld on gm.G_Name = gld.G_Name
  48. inner join MEMB_STAT ms on ms.memb___id COLLATE DATABASE_DEFAULT = ch.AccountID COLLATE DATABASE_DEFAULT
  49. WHERE  $ctlCode $hiden ".$strongest["str_sort"]);
  50.  
  51.     ob_start();
  52.  
  53.     if ($strongest["top_type"]==1)
  54.     {
  55.         for($i=0;$i < 5;$i++)
  56.         {
  57.             $rowtop5 = $db->fetchrow($resulttop5);
  58.             $rowtop5[2] = classname($rowtop5[2]); //class
  59.             if($rowtop5[6]!= null) //guilds
  60.             {
  61.                 $guild = $rowtop5[6];
  62.             }
  63.             else
  64.                 $guild = "-/-";
  65.  
  66.             if($rowtop5[8] == 1)//online
  67.                 $online = $content->lng["sreongest_status"]." <span style='color:#04C200;font-weight:bold;font-size:12px;font-style:italic;'>Online</span> <br> ".$content->lng["sreongest_pr"]." ".$rowtop5[9];
  68.             else
  69.                 $online = $content->lng["sreongest_status"]." <span style='color:#FF0505;font-weight:bold;font-size:12px;font-style:italic;'>Online</span> <br>".$content->lng["sreongest_pr"]." ".$rowtop5[10];
  70.  
  71.             if ($strongest["greset"]==1 && $strongest["greset_st"]==1)
  72.             {
  73.                 $gr_star=" ";
  74.                 while ($rowtop5[11]>0)
  75.                 {
  76.                     $gr_star.="<img src=\"imgs/gres.gif\" border=\"0\" />";
  77.                     $rowtop5[11]--;
  78.                 }
  79.             }
  80.             else if ($str["greset"]==1 && $str["greset_st"]==0)
  81.             {
  82.                 $gr_star=" <br>Grand Reset:".$rowtop5[5];
  83.             }
  84.  
  85.             $oinfo = $content->lng["sreongest_guild"]." <i>$guild</i><br>".$content->lng["sreongest_class"]." <i>{$rowtop5[2]}</i><br>$online";
  86.             $content->set("|oinfo|", $oinfo);
  87.             $content->set("|level|", $rowtop5[1]);
  88.             $content->set("|reset|", $rowtop5[3]);
  89.             $content->set("|gstar|", $gr_star);
  90.             $content->set("|cname|", $rowtop5[0]);
  91.             $content->out_content("theme/".$config["theme"]."/them/strongest.html");
  92.         }
  93.     }
  94.     elseif ($strongest["top_type"]==2)
  95.     {
  96.         $class_list = explode(",", $strongest["stron_sh"]);
  97.         $st_show="";
  98.         foreach ($class_list as $n=>$v)
  99.         {
  100.             $st_show.=q_chr_top($v);
  101.         }
  102.         echo $st_show;
  103.     }
  104.     else echo "error: in top_type!";
  105.     $temp = ob_get_contents();
  106.     write_catch ("_dat/cach/top_strongest",$temp);
  107.     ob_end_clean();
  108. }
  109. else $temp = file_get_contents ('_dat/cach/top_strongest');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement