/**
 *
 * @param type $row
 * @return string 
 */
function spell_buff_render($row)
{
    global $DB;
    $x = '<table><tr>';
    // Имя баффа
    $x .= '<td><b class="q">' . $row['spellname'] . '</b></td>';
    // Тип диспела
    if ($row['dispeltypeID']) {
        $dispel = $DB->selectCell('SELECT name_loc' . $_SESSION['locale'] . ' FROM ?_aowow_spelldispeltype WHERE id=? LIMIT 1', $row['dispeltypeID']);
        $x .= '<th><b class="q">' . $dispel . '</b></th>';
    }
    $x .= '</tr></table>';
    // Подсказка для баффа
    $x .= '<table><tr><td>';
    $x .= spell_desc2($row, 'buff') . '<br>';
    // Длительность баффа
    $duration = $DB->selectCell("SELECT durationBase FROM ?_aowow_spellduration WHERE durationID=? LIMIT 1", $row['durationID']);
    if ($duration > 0) {
        $x .= '<span class="q">' . $duration / 1000 . ' seconds remaining</span>';
    }
    $x .= '</td></tr></table>';
    return $x;
}
Beispiel #2
0
function spell_buff_render($row)
{
    global $DB;
    $x = '<table><tr>';
    // Имя баффа
    $x .= '<td><b class="q">' . htmlspecialchars($row['spellname_loc' . $_SESSION['locale']]) . '</b></td>';
    // Тип диспела
    if ($row['dispeltypeID']) {
        $dispel = $DB->selectCell('SELECT name_loc' . $_SESSION['locale'] . ' FROM ?_spelldispeltype WHERE id=? LIMIT 1', $row['dispeltypeID']);
        $x .= '<th><b class="q">' . htmlspecialchars($dispel) . '</b></th>';
    }
    $x .= '</tr></table>';
    // Подсказка для баффа
    $x .= '<table><tr><td>';
    $x .= spell_desc2($row, 'buff') . '<br>';
    // Длительность баффа
    $duration = $DB->selectCell("SELECT durationBase FROM ?_spellduration WHERE durationID=? LIMIT 1", $row['durationID']);
    if ($duration / 1000 < 60 && $duration > 1) {
        $x .= '<span class="q">' . $duration / 1000 . ' ' . LOCALE_SECONDS_REMAINING . '</span>';
    } elseif ($duration / 1000 > 60) {
        $x .= '<span class="q">' . $duration / 60000 . ' ' . LOCALE_MINUTES_REMAINING . '</span>';
    } elseif ($duration / 1000 == 60) {
        $x .= '<span class="q">' . $duration / 60000 . ' ' . LOCALE_MINUTE_REMAINING . '</span>';
    } elseif ($duration / 1000 == 1) {
        $x .= '<span class="q">' . $duration / 1000 . ' ' . LOCALE_SECOND_REMAINING . '</span>';
    }
    $x .= '</td></tr></table>';
    return $x;
}