コード例 #1
0
 public function getMembers($forceReload = false)
 {
     if (!isset($this->members) || $forceReload) {
         $members = new DatabaseList('Player');
         $members->setFilter(new SQL_Filter(new SQL_Field('rank_id'), SQL_Filter::EQUAL, $this->getID()));
         $members->addOrder(new SQL_Order(new SQL_Field('name')));
         $this->members = $members;
     }
     return $this->members;
 }
コード例 #2
0
ファイル: guildrank.php プロジェクト: aottibia/www
 public function getMembers($forceReload = false)
 {
     if (!isset($this->members) || $forceReload) {
         $members = new DatabaseList('Player');
         $filterGuild = new SQL_Filter(new SQL_Field('rank_id', 'guild_membership'), SQL_Filter::EQUAL, $this->getID());
         $filterPlayer = new SQL_Filter(new SQL_Field('id', 'players'), SQL_Filter::EQUAL, new SQL_Field('player_id', 'guild_membership'));
         $members->setFilter(new SQL_Filter($filterGuild, SQL_Filter::CRITERIUM_AND, $filterPlayer));
         $members->addOrder(new SQL_Order(new SQL_Field('name', 'players')));
         $this->members = $members;
     }
     return $this->members;
 }
コード例 #3
0
ファイル: killstatistics.php プロジェクト: aottibia/www
<img id="ContentBoxHeadline" class="Title" src="layouts/tibiacom/images/header/headline-killstatistics.gif" alt="Contentbox headline">
<?php 
if (!defined('INITIALIZED')) {
    exit;
}
$players_deaths = new DatabaseList('PlayerDeath');
$players_deaths->setFilter(new SQL_Filter(new SQL_Field('id', 'players'), SQL_Filter::EQUAL, new SQL_Field('player_id', 'player_deaths')));
$players_deaths->addOrder(new SQL_Order(new SQL_Field('time'), SQL_Order::DESC));
$players_deaths->setLimit(50);
$players_deaths_count = 0;
foreach ($players_deaths as $death) {
    $bgcolor = $players_deaths_count++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
    $players_rows .= '<TR BGCOLOR="' . $bgcolor . '"><TD WIDTH="30"><center>' . $players_deaths_count . '.</center></TD><TD WIDTH="125"><small>' . date("j.m.Y, G:i:s", $death->getTime()) . '</small></TD><TD><a href="index.php?subtopic=characters&name=' . urlencode($death->data['name']) . '">' . htmlspecialchars($death->data['name']) . '</a> at level ' . $death->getLevel() . ' by ' . $death->getKillerString();
    if ($death->getMostDamageString() != '' && $death->getKillerString() != $death->getMostDamageString()) {
        $players_rows .= ' and ' . $death->getMostDamageString();
    }
    $players_rows .= '</TD></TR>';
}
if ($players_deaths_count == 0) {
    $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="' . $config['site']['vdarkborder'] . '"><TD CLASS=white><B>Last Deaths</B></TD></TR><TR BGCOLOR=' . $config['site']['darkborder'] . '><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1><TR><TD>No one died on ' . htmlspecialchars($config['server']['serverName']) . '.</TD></TR></TABLE></TD></TR></TABLE><BR>';
} else {
    $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="' . $config['site']['vdarkborder'] . '"><TD CLASS=white><B>Last Deaths</B></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>' . $players_rows . '</TABLE>';
}
コード例 #4
0
ファイル: guilds.php プロジェクト: s3kk/Gesior1.x
        } elseif ($redirect == 'guild') {
            header("Location: ?subtopic=guilds&action=show&guild=" . urlencode($guild));
        } else {
            $main_content .= 'Wrong address to redirect!';
        }
    }
}
//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------
//show list of guilds
if ($action == '') {
    $world_name = $config['server']['serverName'];
    $guilds_list = new DatabaseList('Guild');
    $guilds_list->addOrder(new SQL_Order(new SQL_Field('name'), SQL_Order::ASC));
    $main_content .= '<h2><center>Guilds on ' . htmlspecialchars($world_name) . '</center></h2><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>
	<TR BGCOLOR=' . $config['site']['vdarkborder'] . '><TD COLSPAN=3 CLASS=white><B>Guilds on ' . htmlspecialchars($world_name) . '</B></TD></TR>
	<TR BGCOLOR=' . $config['site']['darkborder'] . '><TD WIDTH=64><B>Logo</B></TD>
	<TD WIDTH=100%><B>Description</B></TD>
	<TD WIDTH=56><B>&#160;</B></TD></TR>';
    $showed_guilds = 1;
    if (count($guilds_list) > 0) {
        foreach ($guilds_list as $guild) {
            if (is_int($showed_guilds / 2)) {
                $bgcolor = $config['site']['darkborder'];
            } else {
                $bgcolor = $config['site']['lightborder'];
            }
            $showed_guilds++;
            $description = $guild->getDescription();
コード例 #5
0
<?php

if (!defined('INITIALIZED')) {
    exit;
}
$playerNamelocks = new DatabaseList('PlayerNamelocks');
$playerNamelocks->addOrder(new SQL_Order(new SQL_Field('date'), SQL_Order::DESC));
$main_content .= '<center><h2>Namelocks list</h2></center>';
$main_content .= "<table border=0 cellspacing=1 cellpadding=4 width=100%>\n\t<tr bgcolor=\"" . $config['site']['vdarkborder'] . "\">\n\t<td><font class=white><b>Current Name</b></font></td>\n\t<td><font class=white><b>Old Names</b></font></td>";
if (count($playerNamelocks) > 0) {
    $playersNamelocksInfo = array();
    foreach ($playerNamelocks as $namelock) {
        if (!isset($playersNamelocksInfo[$namelock->getID()])) {
            $playersNamelocksInfo[$namelock->getID()] = array();
            $playersNamelocksInfo[$namelock->getID()]['name'] = $namelock->getNewName();
            $playersNamelocksInfo[$namelock->getID()]['oldNames'] = array();
            $playersNamelocksInfo[$namelock->getID()]['oldNames'][] = $namelock;
        } else {
            $playersNamelocksInfo[$namelock->getID()]['oldNames'][] = $namelock;
        }
    }
    $old_names_text = array();
    foreach ($playersNamelocksInfo as $playerInfo) {
        $old_names_text = array();
        foreach ($playerInfo['oldNames'] as $oldName) {
            $old_names_text[] = 'until ' . date("j F Y, g:i a", $oldName->getDate()) . ' known as <b>' . htmlspecialchars($oldName->getName()) . '</b>';
        }
        $bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
        $main_content .= '<tr bgcolor="' . $bgcolor . '"><td style="vertical-align:top"><a href="?subtopic=characters&name=' . urlencode($playerInfo['name']) . '">' . htmlspecialchars($playerInfo['name']) . '</a></td><td>' . implode('<br />', $old_names_text) . '</td></tr>';
    }
} else {
コード例 #6
0
ファイル: guild.php プロジェクト: Pietia10/Gesior-for-OTServ
 public function acceptInvite($player)
 {
     $ranks = new DatabaseList('GuildRank');
     $ranks->setFilter(new SQL_Filter(new SQL_Field('guild_id'), SQL_Filter::EQUAL, $this->getID()));
     $ranks->addOrder(new SQL_Order(new SQL_Field('level'), SQL_Order::ASC));
     // load rank with lowest access level
     if ($rank = $ranks->getResult(0)) {
         $player->setRank($rank);
         $player->save();
         $player->removeGuildInvitations();
     } else {
         new Error_Critic('', 'There is no rank in guild <b>' . htmlspecialchars($guild->getName()) . '</b>, cannot add player <b>' . htmlspecialchars($player->getName()) . '</b> to guild.');
     }
 }
コード例 #7
0
ファイル: houses.php プロジェクト: Pietia10/Gesior-for-OTServ
$main_content .= '<tr><td colspan="3" style="text-align:right"><input type="image" name="Submit" alt="Submit" src="' . $layout_name . '/images/buttons/sbutton_submit.gif"></td></tr></table></form>';
if (isset($_REQUEST['town']) && isset($_REQUEST['owner']) && isset($_REQUEST['order'])) {
    $houses = new DatabaseList('House');
    $filterTown = new SQL_Filter(new SQL_Field('townid'), SQL_Filter::EQUAL, $_REQUEST['town']);
    if ($_REQUEST['owner'] == 0) {
        $filterOwner = new SQL_Filter(new SQL_Field('owner'), SQL_Filter::EQUAL, 0);
        $filter = new SQL_Filter($filterTown, SQL_Filter::CRITERIUM_AND, $filterOwner);
    } elseif ($_REQUEST['owner'] == 1) {
        $filterOwner = new SQL_Filter(new SQL_Field('owner'), SQL_Filter::NOT_EQUAL, 0);
        $filter = new SQL_Filter($filterTown, SQL_Filter::CRITERIUM_AND, $filterOwner);
    } else {
        $filter = $filterTown;
    }
    $houses->setFilter($filter);
    if ($_REQUEST['order'] == 'size') {
        $houses->addOrder(new SQL_Order(new SQL_Field('tiles', 'houses'), SQL_Order::DESC));
    } else {
        $houses->addOrder(new SQL_Order(new SQL_Field('name', 'houses')));
    }
    $housesText = '';
    if (count($houses) > 0) {
        // let's load house owners, all by 1 query
        $ownersIds = array();
        foreach ($houses as $house) {
            if ($house->getOwner() != 0) {
                $ownersIds[] = $house->getOwner();
            }
        }
        $owners = array();
        if (count($ownersIds) > 0) {
            $ownersList = new DatabaseList('Player');