Skip to content

Commit

Permalink
[22] The additional list is added. He appears if to choose "spells", …
Browse files Browse the repository at this point in the history
…in it it is possible to choose a class of the character.

Added title text for all img-button.
You need to update a database from a folder sql/updates.

Signed-off-by: Ivan <Dfyztimy@list.ru>
  • Loading branch information
Hantet committed Jul 6, 2010
1 parent cd2b228 commit 68f852a
Show file tree
Hide file tree
Showing 9 changed files with 150 additions and 52 deletions.
2 changes: 1 addition & 1 deletion config.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function get($id)
## checkdiff: Different in days for recheck updates.
##################################################################################################*/
"CheckVersion" => false,
"version" => 21,
"version" => 22,
"checkdiff" => 2
);

Expand Down
3 changes: 2 additions & 1 deletion lib/classes.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public function LoadMap();
public function LoadList($status="all");
public function LoadPriority($id = "0");
public function LoadView($id);

public function LoadSubType();

public function login($login,$pass);
public function cookies($login,$pass);
public function AccountRepass($acc,$code);
Expand Down
17 changes: 15 additions & 2 deletions lib/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public function LoadList($status="all",$sort='')
$order = "ORDER BY `id` DESC";
if($sort != '')
$exp = explode("_",$sort);
if(intval($exp[1]) > 0 && ($exp[0] == "desc" || $exp[0] == "asc"))
if(isset($exp[1]) && intval($exp[1]) > 0 && ($exp[0] == "desc" || $exp[0] == "asc"))
switch($exp[1])
{
case 1: $exp[0] == "desc" ? $order = "ORDER BY `id` DESC" : $order = "ORDER BY `id` ASC";break;
Expand Down Expand Up @@ -265,6 +265,19 @@ public function LoadPriority($id="0",$all="0")
echo $txt;
}

public function LoadSubType()
{
$cfg = new config;
$sql = new sql;
$query = $sql->exe($cfg->get("realmd"),"SELECT `id`,`name` FROM `bt_SubType` ORDER BY `id` ASC");
$txt="";
while($row=mysql_fetch_array($query))
{
$txt.= '<option value="'.$row['id'].'">'.$row['name'].'</option>';
}
echo $txt;
}

public function LoadView($opt)
{
$cfg = new config;
Expand All @@ -278,7 +291,7 @@ public function LoadView($opt)
if($user['gmlevel'] >= $cfg->get("mingm"))
$name = '<a href="'.$cfg->get("LinkPlayer").intval($row['guid']).'">'.$name.'</a>';
echo '<div id="unic'.$u.'"><a href="javascript:viewdiv('.$u.')"><span style="position:relative;top:2px;" title="Просмотр"><img src="img/lens.png"></a></span> ['.$name.'] <a target="_blank" href="'.$row['link'].'">'.$row['name'].'</a><br></div>';
echo '<div id="save'.$u.'" style="display:none;">'.$row['method'].'^'.$row['guid'].'^'.$row['type'].'^'.$row['map'].'^'.$row['zone'].'^'.$row['name'].'^'.$row['link'].'</div>';
echo '<div id="save'.$u.'" style="display:none;">'.$row['method'].'^'.$row['guid'].'^'.$row['type'].'^'.$row['subtype'].'^'.$row['map'].'^'.$row['zone'].'^'.$row['name'].'^'.$row['link'].'</div>';
$u++;
}
echo '</div>';
Expand Down
27 changes: 19 additions & 8 deletions lib/html.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ public function send()
<select class="input" onchange="next(1)" id="type"><option DISABLED SELECTED>--</option>';$main->LoadSection();echo '</select>
</td>
</tr>
<tr id="var11" style="display:none;">
<td class="block2">Подтип: </td>
<td align="right">
<select class="input" onchange="next(11)" id="subtype"><option DISABLED SELECTED>--</option>';$main->LoadSubType();echo '<option DISABLED>--</option><option value="-1">Другое</option></select>
</td>
</tr>
<tr id="var2" style="display:none;">
<td class="block2">Местность: </td>
<td align="right">
Expand Down Expand Up @@ -193,6 +199,12 @@ public function detail($int)
<select class="input" onchange="next(1)" id="type"><option DISABLED SELECTED>--</option>';$main->LoadSection();echo '</select>
</td>
</tr>
<tr id="var11" style="display:none;">
<td class="block2">Подтип: </td>
<td align="right">
<select class="input" onchange="next(11)" id="subtype"><option DISABLED SELECTED>--</option>';$main->LoadSubType();echo '<option DISABLED>--</option><option value="-1">Другое</option></select>
</td>
</tr>
<tr id="var2" style="display:none;">
<td class="block2">Местность: </td>
<td align="right">
Expand Down Expand Up @@ -240,13 +252,6 @@ public function view()
$main = new main;
if(empty($_GET['detail']))
{
if($user['gmlevel'] >= $cfg->get("mingm") &&
isset($_GET['faststatus']) &&
isset($_GET['changeid']) &&
intval($_GET['faststatus']) > 0 &&
intval($_GET['changeid']) > 0)
$main->SetStatus($_GET['faststatus'],$_GET['changeid']);

if(isset($_GET['type']))
$type = intval($_GET['type']);
else
Expand Down Expand Up @@ -485,11 +490,17 @@ public function inc($content)
}
public function admin()
{
$main = new main;

if(isset($_GET['faststatus']) &&
isset($_GET['changeid']) &&
intval($_GET['changeid']) > 0)
$main->SetStatus($_GET['faststatus'],$_GET['changeid']);

if(isset($_GET['detail']))
$id = $_GET['detail'];
else
$id = "0";
$main = new main;
echo '<div class="border"><div id="hellotxt">';
echo 'Новых: <a href="index.php?a=list&type=1&sort=1&sortto=desc&last=1">'.$main->GetSections("new").'</a> | <a href="#">Панель управления</a>';

Expand Down
113 changes: 77 additions & 36 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ function send()
var map = document.getElementById("map");
var method = param[0];
var vplayer = player.options[param[1]].value;
var vmap = map.options[param[3]].value;
sql = sql + method+"^"+vplayer+"^"+param[2]+"^"+vmap+"^"+param[4]+"^"+param[5]+"^"+param[6]+"*";
// method player type map zone name db;
var vmap = map.options[param[4]].value;
sql = sql + method+"^"+vplayer+"^"+param[2]+"^"+param[3]+"^"+vmap+"^"+param[5]+"^"+param[6]+"^"+param[7]+"*";
// method player type subtype map zone name db;
i++;
}

Expand Down Expand Up @@ -233,45 +233,55 @@ function next(id)
break;

case 1:
var val = document.getElementById("type").options[document.getElementById("type").selectedIndex].value;
if(val == 2 || val == 4 || val == 5)
for(var i=2;i<7;i++)
{
for(var i=2;i<7;i++)
{
if(i<6)clear(i);
close(i);
}
document.getElementById("var2").style.display = "";
close(i);
if(i<6)clear(i);
}
document.getElementById("var11").style.display = "none";
document.getElementById("subtype").selectedIndex = 0;
var val = document.getElementById("type").options[document.getElementById("type").selectedIndex].value;
if(val == 2 || val == 4 || val == 5)
open(2);
else if(val == 1)
document.getElementById("var11").style.display = "";
else
{
document.getElementById("var2").style.display = "none";
document.getElementById("var3").style.display = "none";
for(var i=4;i<7;i++)
document.getElementById("var"+i).style.display = "";
}
open(i);
break;

case 11:
for(var i=4;i<7;i++)
{
if(i<6)clear(i);
open(i);
}
break;

case 2:
for(var i=3;i<7;i++)
{
if(i<6)clear(i);
close(i);
}
document.getElementById("var3").style.display = "";
open(3);
break;

case 3:
clear(4);
clear(5);
for(var i=4;i<7;i++)
document.getElementById("var"+i).style.display = "";
open(i);
break;
}
}

function open(t)
{
if(t == "all" || t == 11)
document.getElementById("var11").style.display = "";
if(t == 11)
return;
for(var i=1;i<7;i++)
if(t == (t == "all" ? t : i))
document.getElementById("var"+i).style.display = "";
Expand All @@ -282,6 +292,9 @@ function close(t)
for(var i=1;i<7;i++)
if(t == (t == "all" ? t : i))
document.getElementById("var"+i).style.display = "none";
for(var i=11;i<12;i++)
if(t == (t == "all" ? t : i))
document.getElementById("var"+i).style.display = "none";
}

function clear(t)
Expand All @@ -290,6 +303,7 @@ function clear(t)
{
document.getElementById("player").selectedIndex = 0;
document.getElementById("type").selectedIndex = 0;
document.getElementById("subtype").selectedIndex = 0;
document.getElementById("map").selectedIndex = 0;
document.getElementById("zone").selectedIndex = 0;
document.getElementById("name").value = "";
Expand All @@ -303,6 +317,7 @@ function clear(t)
if(t == 3)document.getElementById("zone").selectedIndex = 0;
if(t == 4)document.getElementById("name").value = "";
if(t == 5)document.getElementById("db").value = "";
if(t == 11)document.getElementById("subtype").selectedIndex = 0;
}
}

Expand All @@ -318,11 +333,11 @@ function GetNewId(name)
}
}

function savelist(method,player,type,map,zone,name,db)
function savelist(method,player,type,subtype,map,zone,name,db)
{
var tag = document.createElement("div");
tag.id = "save"+GetNewId("save");
tag.innerHTML = method+"^"+player+"^"+type+"^"+map+"^"+zone+"^"+name+"^"+db;
tag.innerHTML = method+"^"+player+"^"+type+"^"+subtype+"^"+map+"^"+zone+"^"+name+"^"+db;
document.getElementById("saveblock").appendChild(tag);
}

Expand All @@ -344,24 +359,28 @@ function tolink()
var selDb = document.getElementById("db");
var map = -1;
var zone = -1;

var subtype = -1;
var method;
if(document.getElementById("var2").style.display != "none")
{
var selMap = document.getElementById("map");
var map = selMap.options[selMap.selectedIndex].text;
map = selMap.options[selMap.selectedIndex].text;
}
if(document.getElementById("var3").style.display != "none")
{
var selZone = document.getElementById("zone");
var zone = selZone.options[selZone.selectedIndex].value;
zone = selZone.options[selZone.selectedIndex].value;
}
if(document.getElementById("var11").style.display != "none")
{
var sub = document.getElementById("subtype");
subtype = sub.options[sub.selectedIndex].value;
}

var player = selPlayer.options[selPlayer.selectedIndex].text;
var type = selType.options[selType.selectedIndex].value;
var name = selName.value;
var db = selDb.value;
method = 1;

if(type == 2 || type == 4 || type == 5)
{
if(map == -1 || zone == -1)
Expand All @@ -372,13 +391,18 @@ function tolink()
else
method = 2;
}
else if(type == 1)
method = 3;

var pLink = document.getElementById("link").innerHTML;
var newid = GetNewId("save");
document.getElementById("link").innerHTML = pLink+"<div id='unic"+newid+"'><a href=\"javascript:removediv('"+newid+"')\"><span style=\"position:relative;top:2px;\" title=\"Удалить\"><img src=\"img/trash.png\"></a></span><a href=\"javascript:viewdiv('"+newid+"')\"><span style=\"position:relative;top:2px;\" title=\"Подробнее\"><img src=\"img/lens.png\"></a></span> ["+player+"]"+" <a target=\"_blank\" href=\""+db+"\">"+name+"</a><br></div>";
if(method == 2){
savelist(2,selPlayer.selectedIndex,selType.selectedIndex,selMap.selectedIndex,selZone.selectedIndex,name,db);}
else{
savelist(1,selPlayer.selectedIndex,selType.selectedIndex,0,0,name,db);}
if(method == 3)
savelist(3,selPlayer.selectedIndex,selType.selectedIndex,subtype,0,0,name,db);
else if(method == 2)
savelist(2,selPlayer.selectedIndex,selType.selectedIndex,0,selMap.selectedIndex,selZone.selectedIndex,name,db);
else
savelist(1,selPlayer.selectedIndex,selType.selectedIndex,0,0,0,name,db);
clear("all");
close("all");
}
Expand Down Expand Up @@ -415,24 +439,39 @@ function viewdiv(u)
m_viewdiv = 1;
m_nowview = u;
changestatus(1);
if(param[0] == 2)
if(param[0] == 3)
{
document.getElementById("player").selectedIndex = param[1];
document.getElementById("type").selectedIndex = param[2];
document.getElementById("subtype").selectedIndex = param[3];
document.getElementById("name").value = param[6];
document.getElementById("db").value = param[7];
document.getElementById("retype").innerHTML = "Закрыть";
open(0);
open(1);
open(11);
open(4);
open(5);
open(6);
}
else if(param[0] == 2)
{
ChangeZones(param[3]);
document.getElementById("player").selectedIndex = param[1];
document.getElementById("type").selectedIndex = param[2];
document.getElementById("map").selectedIndex = param[3];
document.getElementById("zone").selectedIndex = param[4];
document.getElementById("name").value = param[5];
document.getElementById("db").value = param[6];
document.getElementById("map").selectedIndex = param[4];
document.getElementById("zone").selectedIndex = param[5];
document.getElementById("name").value = param[6];
document.getElementById("db").value = param[7];
document.getElementById("retype").innerHTML = "Закрыть";
open("all");
}
else
{
document.getElementById("player").selectedIndex = param[1];
document.getElementById("type").selectedIndex = param[2];
document.getElementById("name").value = param[5];
document.getElementById("db").value = param[6];
document.getElementById("name").value = param[6];
document.getElementById("db").value = param[7];
document.getElementById("retype").innerHTML = "Закрыть";
open(0);
open(1);
Expand All @@ -448,6 +487,7 @@ function changestatus(t)
{
document.getElementById("player").disabled = true;
document.getElementById("type").disabled = true;
document.getElementById("subtype").disabled = true;
document.getElementById("map").disabled = true;
document.getElementById("zone").disabled = true;
document.getElementById("name").readOnly = true;
Expand All @@ -457,6 +497,7 @@ function changestatus(t)
{
document.getElementById("player").disabled = false;
document.getElementById("type").disabled = false;
document.getElementById("subtype").disabled = false;
document.getElementById("map").disabled = false;
document.getElementById("zone").disabled = false;
document.getElementById("name").readOnly = false;
Expand Down
2 changes: 1 addition & 1 deletion search.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
$entry = $row[1];
$text.= '
<tr>
<td><div style="cursor:pointer;" onClick=\'document.getElementById("name").value="'.$name.'";searchresult('.$entry.');\'><img src="img/add.png"></div></td>
<td><div style="cursor:pointer;" onClick=\'document.getElementById("name").value="'.$name.'";searchresult('.$entry.');\' title="Добавить"><img src="img/add.png"></div></td>
<td><div class="search"><a href="http://ru.wowhead.com/'.$table.'='.$entry.'" target="_blank">'.$pname.'</a></div></td>
</tr>';
$i++;
Expand Down
4 changes: 2 additions & 2 deletions send.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
do
{
$row = explode("^",$opt[$i]);
$query.= "('".$id."','".$row[0]."','".$row[1]."','".$row[3]."','".$row[4]."','".$row[2]."','".$row[5]."','".$row[6]."'),";
$query.= "('".$id."','".$row[0]."','".$row[1]."','".$row[4]."','".$row[5]."','".$row[2]."','".$row[3]."','".$row[6]."','".$row[7]."'),";
$i++;
}while($opt[$i]);

Expand All @@ -41,7 +41,7 @@
echo 'Таблица `bt_message` недоступна или повреждена! Данные не записаны!';
$t1 = false;
}
if(!$sql->exe($cfg->get("realmd"),"INSERT INTO `bt_options` (`id`,`method`,`guid`,`map`,`zone`,`type`,`name`,`link`) VALUES ".$query))
if(!$sql->exe($cfg->get("realmd"),"INSERT INTO `bt_options` (`id`,`method`,`guid`,`map`,`zone`,`type`,`subtype`,`name`,`link`) VALUES ".$query))
{
echo 'Таблица `bt_options` недоступна или повреждена! Данные не записаны!';
$t2 = false;
Expand Down
Loading

0 comments on commit 68f852a

Please sign in to comment.