forked from septor/wowprogress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wowprogress_menu.php
96 lines (74 loc) · 3.79 KB
/
wowprogress_menu.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
if (!defined('e107_INIT')) { exit; }
include_lan(e_PLUGIN."wowprogress/languages/".e_LANGUAGE.".php");
define("WOWPROG", e_PLUGIN."wowprogress/");
$text = WPMENU_LAN001."<br /><br />";
$sql->db_Select("wowprogress_instances", "*") or die(mysql_error());
$heroic_image = (file_exists(THEME."images/heroic.gif") ? THEME."images/heroic.gif" : WOWPROG."images/heroic.gif");
$normal_image = (file_exists(THEME."images/normal.gif") ? THEME."images/normal.gif" : WOWPROG."images/normal.gif");
$notkilled_image = (file_exists(THEME."images/notkilled.png") ? THEME."images/notkilled.png" : WOWPROG."images/notkilled.png");
$killed_image = (file_exists(THEME."images/killed.png") ? THEME."images/killed.png" : WOWPROG."images/killed.png");
$attempting_image = (file_exists(THEME."images/attempting.png") ? THEME."images/attempting.png" : WOWPROG."images/attempting.png");
$sql3 = new db();
$sql4 = new db();
while($row = $sql->db_Fetch()){
$showinstances = explode(" ", $pref['wowprogress_showinstances']);
if(in_array($row['id'], $showinstances)){
$bosses = $sql3->db_Count("wowprogress_bosses", "(*)", "WHERE instance='".$row['zonename']."'");
$nkilled = $sql3->db_Count("wowprogress_bosses", "(*)", "WHERE instance='".$row['zonename']."' AND status='2'");
$hkilled = $sql3->db_Count("wowprogress_bosses", "(*)", "WHERE instance='".$row['zonename']."' AND heroic='2'");
if($pref['wowprogress_killstyle'] == "total"){
if($row['heroic'] == "1"){
$killstyle = "(".($nkilled + $hkilled)."/".($bosses * 2).") ";
}else{
$killstyle = "(".$nkilled."/".$bosses.") ";
}
}else if($pref['wowprogress_killstyle'] == "normal"){
$killstyle = "(".$nkilled."/".$bosses.") ";
}else if($pref['wowprogress_killstyle'] == "heroic"){
$killstyle = "(".$hkilled."/".$bosses.") ";
}else{
$killstyle = "";
}
$text .= "<div onclick='expandit(\"".$row['zoneid']."\");' class='".$pref['wowprogress_headerstyle']."' style='cursor: pointer;'>
".$killstyle.$row['zonename']."
</div>
<table style='width:90%; display:none;' id='".$row['zoneid']."'>
<tr>
<td style='width: 70%;'> </td>
<td style='text-align:center;'><img src='".$normal_image."' title='".WPMENU_LAN002."' /></td>
".($row['heroic'] == "1" ? "<td style='text-align:center;'><img src='".$heroic_image."' title='".WPMENU_LAN003."' /></td>" : "")."
</tr>";
$sql4->db_Select("wowprogress_bosses", "*", "instance='".$row['zonename']."'") or die(mysql_error());
while($row2 = $sql4->db_Fetch()){
if($row2['status'] == "0"){
$status = "<img src='".$notkilled_image."' title='".WPMENU_LAN004."' />";
}else if($row2['status'] == "1"){
$status = "<img src='".$attempting_image."' title='".WPMENU_LAN005."' />";
}else if($row2['status'] == "2"){
$status = "<img src='".$killed_image."' title='".WPMENU_LAN006."' />";
}
if($row2['heroic'] == "0"){
$heroic = "<img src='".$notkilled_image."' title='".WPMENU_LAN004."' />";
}else if($row2['heroic'] == "1"){
$heroic = "<img src='".$attempting_image."' title='".WPMENU_LAN005."' />";
}else if($row2['heroic'] == "2"){
$heroic = "<img src='".$killed_image."' title='".WPMENU_LAN006."' />";
}
$text .= "<tr>
<td style='width: 70%;'><a href='http://www.wowhead.com/".$row2['npctype']."=".$row2['npcid']."'>".$row2['bossname']."</a></td>
<td style='text-align:center;'>".$status."</td>
".($row['heroic'] == "1" ? "<td style='text-align:center;'>".$heroic."</td>" : "")."
</tr>";
}
$text .= "<tr>
<td style='width: 70%;'> </td>
<td style='text-align:center;'>(".$nkilled."/".$bosses.")</td>
".($row['heroic'] == "1" ? "<td style='text-align:center;'>(".$hkilled."/".$bosses.")</td>" : "")."
</tr>
</table>";
}
}
$text .= "<br /><br />\n<a href='".WOWPROG."progress.php'>".WPMENU_LAN008."</a>.";
$ns->tablerender(WPMENU_LAN007, $text);
?>