Как правильно сортировать классы в DEW

Автор SunDogLuz, 2012 Март 13, 12:09

« назад - далее »

0 Пользователи и 1 гость просматривают эту тему.

Ключевые слова [SEO] mu onlineВеб-сайтыdewкодраспределять классы

SunDogLuz

есть код:
  switch($URL]) {
  case '1':  $m = '1';      break;
  case '2':  $m = '2';      break;
  case '3':  $m = '3';      break;
  case '4':  $m = '4';      break;

Мне нужно в
  case '5':  $m =  $m = '1'; +  $m = '2';+ $m = '3';  ' ';    break;

как это правильно зделать?

Vaflan

Что за головоломка, вообще ничего не понятно
Даже пример что надо непонятен, но всё равно:

case '5':
$m += '1';
$m += '2';
$m += '3';
break;

SunDogLuz

Спойлер
<?
################################################
#                                              #
#          Deathless Engine Web                #
#                                              #
#          Copyright: Deathless                #
#          Skype: MuAntrum                     #
#          E-Mail: [email protected]          #
#                                              #
################################################
?>
<?php

if(!defined('DEW_Engine')) {
Exit;
}

ob_start();
if (!$old_page_content = ReadCache("TOP100-".$Web_URL[1], $Web['cache_time']*60)) {
echo '<center><a href=''.$URL_class->DEW_Crypt('TOP100').''>Chars</a> ● ';
echo '<a href=''.$URL_class->DEW_Crypt('Killers').''>Killers</a> ● ';
if ($Extra['gens'] == 1) {
echo '<a href=''.$URL_class->DEW_Crypt('Gens').''>Gens</a> ● ';
}
echo '<a href=''.$URL_class->DEW_Crypt('Weddings').''>Weddings</a><br><br></center>';

$hide_nick_list   = explode(',', $Rankings['hide_nicks']);
$xxx = -1;
while($xxx < count($hide_nick_list)-1) {
++$xxx;
$nick_hide       .= "and Name != '".$hide_nick_list[$xxx]."' ";
}

if ($Rankings['blocked'] == 1) {
$hide_acc_list_   = $DB->Query("SELECT memb___id FROM MEMB_INFO WHERE bloc_code = '1'");
$yyy = 0;
while($hide_acc_list = $DB->FetchRow($hide_acc_list_)) {
++$yyy;
$acc_hide   .= "and AccountID != '".$hide_acc_list[0]."' ";
}
}

if ($Rankings['unactive'] > 0) {
$time_ago      = date('d/m/Y',(time() - 24*3600*$Rankings['unactive']));
$hide_acc_lis_   = $DB->Query("SELECT memb___id FROM MEMB_STAT WHERE CONVERT(char(10), ConnectTM, 103) <= '$time_ago'");
$zzz = 0;
while($hide_acc_lis = $DB->FetchRow($hide_acc_lis_)) {
++$zzz;
$acc_hid   .= "and AccountID != '".$hide_acc_lis[0]."' ";
}
}

if ($Rankings['hide_gm'] == 1) {
$gm_hide      = 'and CtlCode != 32 and CtlCode != 8';
}
$rdquest      = '50 && 3';
switch($rdclass) {
case 3:
case 35:
case 50:
case 19:
break;
}
switch($Web_URL[1]) {

case '3rd':               $class = += '3'; $class += '50'; $class += '35'; break;
default:                $class = '%';                break;


}

echo "<left><b>".phrase_all_filter.":</b>&nbsp;&nbsp;";
echo "<a href="".$URL_class->DEW_Crypt('TOP100')."">".phrase_all."</a>&nbsp;&nbsp;";
echo "<a href="".$URL_class->DEW_Crypt('TOP100/3rd').""><font color='#cccc66'>3rd</font></a>&nbsp;&nbsp;";
echo "</left>";

echo "
<table align="center" width="100%" class="list" border="0" cellpadding="2" cellspacing="0">
<thead>
<tr class="top_text_default">
<td align="center" width="4%" style="padding-left:1px;"><b><FONT COLOR=#FFFFFF>#</font></b></td>
<td align="center" width="15%"><FONT COLOR=#FFFFFF>".phrase_char_name."</font></td>
<td align="center" width="4%"><FONT COLOR=#FFFFFF>".phrase_class."</font></td>
<td align="center" width="5%"><FONT COLOR=#FFFFFF>".phrase_reset1."</font></td>
<td align="center" width="6%"><FONT COLOR=#FFFFFF>Lvl</font></td>
<td align="center" width="7%"><FONT COLOR=#FFFFFF>Str</font></td>
<td align="center" width="7%"><FONT COLOR=#FFFFFF>Agi</font></td>
<td align="center" width="7%"><FONT COLOR=#FFFFFF>Vit</font></td>
<td align="center" width="7%"><FONT COLOR=#FFFFFF>Ene</font></td>
<td align="center" width="7%"><FONT COLOR=#FFFFFF>Cmd</font></td>
<td align="center"><FONT COLOR=#FFFFFF>".phrase_guild."</font></td>
</tr>
</thead><tbody>";

$top_char_info_ = $DB->Query("SELECT TOP 100 * from Character where Class like '".$class."' ".$nick_hide.$gm_hide.$acc_hide.$acc_hid." order by GR desc, ".$Reset['column']." desc, cLevel desc");

while($top_char_info = $DB->FetchArray($top_char_info_)) {
++$count;

if   ($top_char_info['position_last'] < $count)   {   $dynamic   = 1;   }
if   ($top_char_info['position_last'] > $count)   {   $dynamic   = 2;   }
if   ($top_char_info['position_last'] == $count)   {   $dynamic   = 3;   }
if   ($dynamic == 2)   {   $dyn   = "<a onmouseover="Tip('<b>+".($top_char_info[position_last]-$count)."</b>')" onmouseout="UnTip();"><img alt='dynamic' src='Images/Misc/arrow-up.gif'></a>";      }
if   ($dynamic == 3)   {   $dyn   = "";   }
if   ($dynamic == 1)   {   $dyn   = "<a onmouseover="Tip('<b>".($top_char_info[position_last]-$count)."</b>')" onmouseout="UnTip();"><img alt='dynamic' src='Images/Misc/arrow-down.gif'></a>";   }


else                {   $rank   = $count;   }

$tr_color_1 = 'odd';
$tr_color_2 = '';
$tr_color = $count % 2 ? $tr_color_1 : $tr_color_2;

$online_info   = $DB->FetchRow($DB->Query("Select ConnectStat from MEMB_STAT where memb___id = '".$top_char_info['AccountID']."'"));
if ($online_info[0] == 1) {
$get_last_char   = $DB->FetchRow($DB->Query("Select GameIDC from AccountCharacter where Id = '".$top_char_info['AccountID']."'"));
if ($get_last_char[0] == $top_char_info['Name'])   {   $color   = '#afe579';   }
else                                    {   $color    = '#ff9999';   }
}
else   {   $color   = '#ff9999';   }

if ($Master['show'] == 1) {
$masterlevel   = $DB->FetchRow($DB->Query("SELECT ".$Master['namecol'].",".$Master['levelcol']." FROM ".$Master['masterlevel']." WHERE ".$Master['namecol']." = '".$top_char_info['Name']."'"));
$masterlvl      = $masterlevel[1];
if ($masterlvl != NULL && $masterlvl != '' && $masterlvl != ' ') {
$masterlvl_ = "[<font color=red>".$masterlvl."</font>]";
}
else {
$masterlvl_   = '';
}
}

$guild_name = $DB->FetchRow($DB->Query("SELECT G_Name from GuildMember where Name = '".$top_char_info['Name']."'"));
if($guild_name[0] != NULL) {
$guild_logo   = $DB->FetchRow($DB->Query("SELECT G_Mark from Guild WHERE G_Name = '".$guild_name[0]."'"));
$guild_mark   = GuildLogo($guild_logo[0],$guild_name[0],8);
}
else {
$guild_mark      = '';
}

if ($top_char_info['HideTime'] == '0') {
$hidetime   = $Current_Time - 1;
}
else {
$hidetime   = $top_char_info['HideTime'];
}

if ($Show['info'] == 1) {
if ($hidetime < $Current_Time) {
$str = GetStats65k($top_char_info['Strength']);
$agi = GetStats65k($top_char_info['Dexterity']);
$vit = GetStats65k($top_char_info['Vitality']);
$ene = GetStats65k($top_char_info['Energy']);
$cmd = GetStats65k($top_char_info['Leadership']);
}
else {
$str = "Hidden";
$agi = "Hidden";
$vit = "Hidden";
$ene = "Hidden";
$cmd = "Hidden";

}
}
else {
$str = "Hidden";
$agi = "Hidden";
$vit = "Hidden";
$ene = "Hidden";
$cmd = "Hidden";
}

{   $cmdinfo = $top_char_info['Leadership'];}


$char_class = GetCharClass($top_char_info['Class'],0);


echo "
<tr class='".$tr_color."'>
<td align='center' style='width:25px; height:20px; padding-left:1px; padding-right:1px;'><font color='".$color."'>".$rank."</font></td>
<td align='center'><a class='rankings' href='".$URL_class->DEW_Crypt('Char/'.$top_char_info['Name'])."'>".$top_char_info['Name']."</a></td>
<td align='center'><span class='class".$top_char_info['Class']."'>".$char_class."</span></td>
<td align='center'><span class='text_default'>".$top_char_info[$Reset['column']]."</span></td>
<td align='center'><span class='text_default'>".$top_char_info['cLevel']." ".$masterlvl_."</span></td>
<td align='center'><span class='text_default'>".$top_char_info['Strength']."</span></td>
<td align='center'><span class='text_default'>".$top_char_info['Dexterity']."</span></td>
<td align='center'><span class='text_default'>".$top_char_info['Vitality']."</span></td>
<td align='center'><span class='text_default'>".$top_char_info['Energy']."</span></td>
<td align='center'><span class='text_default'>".$top_char_info['Energy']."</span></td>
<td align='center'><a href='".$URL_class->DEW_Crypt('Guild/'.$guild_name[0])."'>".$guild_name[0]."</a></td>
</tr>";

$DB->Query("UPDATE Character SET dynamic_last = '".$dynamic."', position_last = '".$count."' WHERE Name = '".$top_char_info['Name']."'");
}

echo "</tbody></table>";

$new_page_content   = ob_get_contents();
ob_clean();
WriteCache($new_page_content, "TOP100-".$Web_URL[1]);
}
ob_end_clean();
echo $old_page_content.$new_page_content;

/*   Deathless Engine Web © 2010   */

?>
[свернуть]

нужно вывести топ по 3-тему класу !
как топ всех - только по 3 !

Как это сделать?

Deathless

if (isset($Web_URL[1]))
$top_char_info_ = $DB->Query("
SELECT TOP 100 *
from Character
where Class = '3' AND Class = '...' AND Class = '...'
".$nick_hide.$gm_hide.$acc_hide.$acc_hid." order by GR desc, ".$Reset['column']." desc, cLevel desc");
else
$top_char_info_ = $DB->Query("
SELECT TOP 100 *
from Character
where Class like '".$class."'
".$nick_hide.$gm_hide.$acc_hide.$acc_hid." order by GR desc, ".$Reset['column']." desc, cLevel desc");

SunDogLuz

Все работает. Спасибо большое!

Похожие темы (4)