当前位置: 首页>>代码示例>>PHP>>正文


PHP Website::getVocationName方法代码示例

本文整理汇总了PHP中Website::getVocationName方法的典型用法代码示例。如果您正苦于以下问题:PHP Website::getVocationName方法的具体用法?PHP Website::getVocationName怎么用?PHP Website::getVocationName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Website的用法示例。


在下文中一共展示了Website::getVocationName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: htmlspecialchars

     }
 }
 $threads = $SQL->query("SELECT " . $SQL->tableName('players') . "." . $SQL->fieldName('name') . ", " . $SQL->tableName('players') . "." . $SQL->fieldName('account_id') . ", " . $SQL->tableName('players') . "." . $SQL->fieldName('world_id') . ", " . $SQL->tableName('players') . "." . $SQL->fieldName('rank_id') . ", " . $SQL->tableName('players') . "." . $SQL->fieldName('vocation') . ", " . $SQL->tableName('players') . "." . $SQL->fieldName('level') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('id') . "," . $SQL->tableName('z_forum') . "." . $SQL->fieldName('first_post') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('section') . "," . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_text') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_topic') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_date') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_smile') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_aid') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_guid') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('last_edit_aid') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('edit_date') . " FROM " . $SQL->tableName('players') . ", " . $SQL->tableName('z_forum') . " WHERE " . $SQL->tableName('players') . "." . $SQL->fieldName('id') . " = " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_guid') . " AND " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('first_post') . " = " . (int) $thread_id . " ORDER BY " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_date') . " LIMIT " . $posts_per_page . " OFFSET " . $page * $posts_per_page)->fetchAll();
 if (isset($threads[0]['name'])) {
     $SQL->query("UPDATE " . $SQL->tableName('z_forum') . " SET " . $SQL->fieldName('views') . "=" . $SQL->fieldName('views') . "+1 WHERE " . $SQL->fieldName('id') . " = " . (int) $thread_id);
 }
 $main_content .= '<a href="?subtopic=forum">Boards</a> >> <a href="?subtopic=forum&action=show_board&id=' . $threads[0]['section'] . '">' . $sections[$threads[0]['section']] . '</a> >> <b>' . htmlspecialchars($thread_name['post_topic']) . '</b>';
 $main_content .= '<br /><br /><a href="?subtopic=forum&action=new_post&thread_id=' . $thread_id . '"><img src="images/forum/post.gif" border="0" /></a><br /><br />Page: ' . $links_to_pages . '<br /><table width="100%"><tr bgcolor="' . $config['site']['lightborder'] . '" width="100%"><td colspan="2"><font size="4"><b>' . htmlspecialchars($thread_name['post_topic']) . '</b></font><font size="1"><br />by <a href="?subtopic=characters&name=' . urlencode($thread_name['name']) . '">' . htmlspecialchars($thread_name['name']) . '</a></font></td></tr><tr bgcolor="' . $config['site']['vdarkborder'] . '"><td width="200"><font color="white" size="1"><b>Author</b></font></td><td>&nbsp;</td></tr>';
 foreach ($threads as $thread) {
     if (!is_int($number_of_rows / 2)) {
         $bgcolor = $config['site']['darkborder'];
     } else {
         $bgcolor = $config['site']['lightborder'];
     }
     $number_of_rows++;
     $main_content .= '<tr bgcolor="' . $bgcolor . '"><td valign="top"><a href="?subtopic=characters&name=' . urlencode($thread['name']) . '">' . htmlspecialchars($thread['name']) . '</a><br /><br /><font size="1">Profession: ' . htmlspecialchars(Website::getVocationName($thread['vocation'])) . '<br />Level: ' . $thread['level'] . '<br />';
     $rank = new GuildRank($thread['rank_id']);
     if ($rank->isLoaded()) {
         $guild = $rank->getGuild();
         if ($guild->isLoaded()) {
             $main_content .= htmlspecialchars($rank->getName()) . ' of <a href="?subtopic=guilds&action=show&guild=' . $guild->getId() . '">' . htmlspecialchars($guild->getName()) . '</a><br />';
         }
     }
     $posts = $SQL->query("SELECT COUNT(" . $SQL->fieldName('id') . ") AS 'posts' FROM " . $SQL->tableName('z_forum') . " WHERE " . $SQL->fieldName('author_aid') . "=" . (int) $thread['account_id'])->fetch();
     $main_content .= '<br />Posts: ' . (int) $posts['posts'] . '<br /></font></td><td valign="top">' . showPost(htmlspecialchars($thread['post_topic']), htmlspecialchars($thread['post_text']), $thread['post_smile']) . '</td></tr>
     <tr bgcolor="' . $bgcolor . '"><td><font size="1">' . date('d.m.y H:i:s', $thread['post_date']);
     if ($thread['edit_date'] > 0) {
         if ($thread['last_edit_aid'] != $thread['author_aid']) {
             $main_content .= '<br />Edited by moderator';
         } else {
             $main_content .= '<br />Edited by ' . htmlspecialchars($thread['name']);
开发者ID:Pietia10,项目名称:Gesior-for-OTServ,代码行数:31,代码来源:forum.php

示例2: array

$number_of_players_online = 0;
$vocations_online_count = array(0, 0, 0, 0, 0);
// change it if you got more then 5 vocations
$players_rows = '';
foreach ($players_online_data as $player) {
    $vocations_online_count[$player['vocation']] += 1;
    $bgcolor = $number_of_players_online++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
    $skull = '';
    if ($player['skull_type'] == 4) {
        $skull = "<img style='border: 0;' src='./images/skulls/redskull.gif'/>";
    } else {
        if ($player['skull_type'] == 5) {
            $skull = "<img style='border: 0;' src='./images/skulls/blackskull.gif'/>";
        }
    }
    $players_rows .= '<TR BGCOLOR=' . $bgcolor . '><TD WIDTH=5%><img src="' . $config['site']['outfit_images_url'] . '?id=' . $player['looktype'] . '&addons=' . $player['lookaddons'] . '&head=' . $player['lookhead'] . '&body=' . $player['lookbody'] . '&legs=' . $player['looklegs'] . '&feet=' . $player['lookfeet'] . '" alt="" /></td><TD WIDTH=65%><A HREF="?subtopic=characters&name=' . urlencode($player['name']) . '">' . htmlspecialchars($player['name']) . $skull . '<img src="' . $config['site']['flag_images_url'] . $player['flag'] . $config['site']['flag_images_extension'] . '" title="Country: ' . $player['flag'] . '" alt="' . $player['flag'] . '" /></A></TD><TD WIDTH=10%>' . $player['level'] . '</TD><TD WIDTH=20%>' . htmlspecialchars(Website::getVocationName($player['vocation'])) . '</TD></TR>';
}
if ($config['site']['private-servlist.com_server_id'] > 0) {
    $main_content .= '<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%><TR BGCOLOR="' . $config['site']['vdarkborder'] . '"><TD WIDTH=10% CLASS=white><center><B>Players Online Chart</B></TD></TR></TABLE><table align="center"><tr><td><img src="http://private-servlist.com/server-chart/' . $config['site']['private-servlist.com_server_id'] . '.png" width="500px" /></td></tr></table>';
}
if ($number_of_players_online == 0) {
    //server status - server empty
    $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="' . $config['site']['vdarkborder'] . '"><TD CLASS=white><B>Server Status</B></TD></TR><TR BGCOLOR=' . $config['site']['darkborder'] . '><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1><TR><TD>Currently no one is playing on <b>' . htmlspecialchars($config['site']['worlds'][$world_id]) . '</b>.</TD></TR></TABLE></TD></TR></TABLE><BR>';
} else {
    //server status - someone is online
    $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="' . $config['site']['vdarkborder'] . '"><TD CLASS=white><B>Server Status</B></TD></TR><TR BGCOLOR=' . $config['site']['darkborder'] . '><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1><TR><TD>Currently ' . $number_of_players_online . ' players are online - <b>' . $config['status']['serverStatus_players'] . ' ' . ($config['status']['serverStatus_players'] > 1 ? 'are' : 'is') . ' active</b> and <b>' . ($number_of_players_online - $config['status']['serverStatus_players']) . ' ' . ($number_of_players_online - $config['status']['serverStatus_players'] > 1 ? 'are' : 'is') . ' AFK</b> on <b>' . htmlspecialchars($config['site']['worlds'][$world_id]) . '</b>.</TD></TR></TABLE></TD></TR></TABLE><BR>';
    $main_content .= '<table width="200" cellspacing="1" cellpadding="0" border="0" align="center">
		<tbody>
			<tr>
				<tr bgcolor="' . $config['site']['darkborder'] . '">
				<td><img src="images/vocations/sorcerer.png" /></td>
开发者ID:Pietia10,项目名称:Gesior-for-OTServ,代码行数:31,代码来源:whoisonline.php

示例3: foreach

        $main_content .= '<TD bgcolor="yellow"><b><center><a href="?subtopic=onlinetime&type=' . $i . '">' . $i . ' Days Ago</a></center></B></TD>';
    }
}
if ($type == 1) {
    $main_content .= '<TD bgcolor="red"><b><center><a href="?subtopic=onlinetime&type=1">1 Day Ago</a></center></B></TD>';
} else {
    $main_content .= '<TD bgcolor="yellow"><b><center><a href="?subtopic=onlinetime&type=1">1 Day Ago</a></center></B></TD>';
}
if (empty($type)) {
    $main_content .= '<TD bgcolor="red"><b><center><a href="?subtopic=onlinetime">Today</a></center></B></TD>';
} else {
    $main_content .= '<TD bgcolor="yellow"><b><center><a href="?subtopic=onlinetime">Today</a></center></B></TD>';
}
$main_content .= '</TR>';
foreach ($players as $player) {
    if (!is_int($number_of_rows / 2)) {
        $bgcolor = $config['site']['darkborder'];
    } else {
        $bgcolor = $config['site']['lightborder'];
    }
    $number_of_rows++;
    $main_content .= '<tr bgcolor="' . $bgcolor . '"><td align="center">' . $number_of_rows . '. </td>';
    if (Player::isPlayerOnline($player['id'])) {
        $main_content .= '<td><a href="?subtopic=characters&name=' . urlencode($player['name']) . '"><b><font color="green">' . htmlspecialchars($player['name']) . '</font></b></a>';
    } else {
        $main_content .= '<td><a href="?subtopic=characters&name=' . urlencode($player['name']) . '"><b><font color="red">' . htmlspecialchars($player['name']) . '</font></b></a>';
    }
    $main_content .= '<br />' . $player['level'] . ' ' . htmlspecialchars(Website::getVocationName($player['vocation'])) . '</td><td align="right">' . hours_and_minutes($player['onlinetime1'] + $player['onlinetime2'] + $player['onlinetime3'] + $player['onlinetime4'] + $player['onlinetime5'] + $player['onlinetime6'] + $player['onlinetime7'] + $player['onlinetimetoday'], 0) . '</td>';
    $main_content .= '<td align="right">' . hours_and_minutes($player['onlinetime7']) . '</td><td align="right">' . hours_and_minutes($player['onlinetime6']) . '</td><td align="right">' . hours_and_minutes($player['onlinetime5']) . '</td><td align="right">' . hours_and_minutes($player['onlinetime4']) . '</td><td align="right">' . hours_and_minutes($player['onlinetime3']) . '</td><td align="right">' . hours_and_minutes($player['onlinetime2']) . '</td><td align="right">' . hours_and_minutes($player['onlinetime1']) . '</td><td align="right">' . hours_and_minutes($player['onlinetimetoday']) . '</td></tr>';
}
$main_content .= '</TABLE>';
开发者ID:aottibia,项目名称:www,代码行数:31,代码来源:onlinetime.php

示例4: htmlspecialchars

 $main_content .= '<tr bgcolor="' . $bgcolor . '"><td width="20%">Name:</td><td style="font-weight:bold;color:' . ($player->isOnline() ? 'green' : 'red') . '">' . htmlspecialchars($player->getName()) . ' ' . $skull . ' <img src="' . $config['site']['flag_images_url'] . $account->getFlag() . $config['site']['flag_images_extension'] . '" title="Country: ' . $account->getFlag() . '" alt="' . $account->getFlag() . '" />';
 if ($player->isBanned() || $account->isBanned()) {
     $main_content .= '<span style="color:red">[BANNED]</span>';
 }
 if ($player->isNamelocked()) {
     $main_content .= '<span style="color:red">[NAMELOCKED]</span>';
 }
 $main_content .= '<br /><img src="' . $config['site']['outfit_images_url'] . '?id=' . $player->getLookType() . '&addons=' . $player->getLookAddons() . '&head=' . $player->getLookHead() . '&body=' . $player->getLookBody() . '&legs=' . $player->getLookLegs() . '&feet=' . $player->getLookFeet() . '" alt="" /></td></tr>';
 if (in_array($player->getGroup(), $config['site']['groups_support'])) {
     $bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
     $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Group:</td><td>' . htmlspecialchars(Website::getGroupName($player->getGroup())) . '</td></tr>';
 }
 $bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
 $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Sex:</td><td>' . htmlspecialchars($player->getSex() == 0 ? 'female' : 'male') . '</td></tr>';
 $bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
 $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Profession:</td><td>' . htmlspecialchars(Website::getVocationName($player->getVocation())) . '</td></tr>';
 $bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
 $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Level:</td><td>' . htmlspecialchars($player->getLevel()) . '</td></tr>';
 $bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
 $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>World:</td><td>' . htmlspecialchars($config['site']['worlds'][$player->getWorldID()]) . '</td></tr>';
 $bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
 $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Residence:</td><td>' . htmlspecialchars($towns_list[0][$player->getTownID()]) . '</td></tr>';
 $rank_of_player = $player->getRank();
 if (!empty($rank_of_player)) {
     $bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
     $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Guild Membership:</td><td>' . htmlspecialchars($rank_of_player->getName()) . ' of the <a href="?subtopic=guilds&action=show&guild=' . $rank_of_player->getGuild()->getID() . '">' . htmlspecialchars($rank_of_player->getGuild()->getName()) . '</a></td></tr>';
 }
 $bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
 $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Balance:</td><td>' . htmlspecialchars($player->getBalance()) . ' gold coins</td></tr>';
 $bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
 $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Last login:</td><td>' . ($player->getLastLogin() > 0 ? date("j F Y, g:i a", $player->getLastLogin()) : 'Never logged in.') . '</td></tr>';
开发者ID:Pietia10,项目名称:Gesior-for-OTServ,代码行数:31,代码来源:characters.php

示例5: htmlspecialchars

$main_content .= '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD><IMG SRC="' . $layout_name . '/images/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD><TD><CENTER><H2>Ranking for ' . htmlspecialchars($list_name) . ' on ' . htmlspecialchars($world_name) . '</H2></CENTER><BR>';
$main_content .= '<br><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%></TABLE><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%><TR BGCOLOR="' . $config['site']['vdarkborder'] . '"><TD CLASS=whites><B>#</B></TD><TD CLASS=whites><b>Outfit</b></TD><TD WIDTH=75% CLASS=whites><B>Name</B></TD><TD WIDTH=15% CLASS=whites><b><center>Level</center></B></TD>';
if ($list == "experience") {
    $main_content .= '<TD CLASS=whites><b><center>Experience</center></B></TD>';
}
//$main_content .= '</TR><TR>';
$main_content .= '</TR>';
$number_of_rows = 0;
foreach ($skills as $skill) {
    if ($list == "magic") {
        $value = $skill->getMagLevel();
    } elseif ($list == "experience") {
        $value = $skill->getLevel();
    } else {
        $value = $skill->getScore();
    }
    $bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
    $main_content .= '<tr bgcolor="' . $bgcolor . '"><td style="text-align:right">' . ($offset + $number_of_rows) . '.</td><TD><img src="' . $config['site']['outfit_images_url'] . '?id=' . $skill->getLookType() . '&addons=' . $skill->getLookAddons() . '&head=' . $skill->getLookHead() . '&body=' . $skill->getLookBody() . '&legs=' . $skill->getLookLegs() . '&feet=' . $skill->getLookFeet() . '" alt="" /></TD><td><a href="?subtopic=characters&name=' . urlencode($skill->getName()) . '">' . ($skill->getOnline() > 0 ? "<font color=\"green\">" . htmlspecialchars($skill->getName()) . "</font>" : "<font color=\"red\">" . htmlspecialchars($skill->getName()) . "</font>") . '</a><img src="' . $config['site']['flag_images_url'] . $skill->getFlag() . $config['site']['flag_images_extension'] . '" title="Country: ' . $skill->getFlag() . '" alt="' . $skill->getFlag() . '" /><br><small>' . $skill->getLevel() . ' ' . htmlspecialchars(Website::getVocationName($skill->getVocation())) . '</small></td><td><center>' . $value . '</center></td>';
    if ($list == "experience") {
        $main_content .= '<td><center>' . $skill->getExperience() . '</center></td>';
    }
    $main_content .= '</tr>';
}
$main_content .= '</TABLE><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%>';
if ($page > 0) {
    $main_content .= '<TR><TD WIDTH=100% ALIGN=right VALIGN=bottom><A HREF="?subtopic=highscores&list=' . urlencode($list) . '&page=' . ($page - 1) . '&vocation=' . urlencode($vocation) . '&world=' . urlencode($world_id) . '" CLASS="size_xxs">Previous Page</A></TD></TR>';
}
if ($page < 50) {
    $main_content .= '<TR><TD WIDTH=100% ALIGN=right VALIGN=bottom><A HREF="?subtopic=highscores&list=' . urlencode($list) . '&page=' . ($page + 1) . '&vocation=' . urlencode($vocation) . '&world=' . urlencode($world_id) . '" CLASS="size_xxs">Next Page</A></TD></TR>';
}
$main_content .= '</TABLE></TD><TD WIDTH=5%><IMG SRC="' . $layout_name . '/images/blank.gif" WIDTH=1 HEIGHT=1 BORDER=0></TD><TD WIDTH=15% VALIGN=top ALIGN=right><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1><TR BGCOLOR="' . $config['site']['vdarkborder'] . '"><TD CLASS=whites><B>Choose a skill</B></TD></TR><TR BGCOLOR="' . $config['site']['lightborder'] . '"><TD><A HREF="?subtopic=highscores&list=experience&world=' . $world_id . '" CLASS="size_xs">Experience</A><BR><A HREF="?subtopic=highscores&list=magic&world=' . $world_id . '" CLASS="size_xs">Magic</A><BR><A HREF="?subtopic=highscores&list=shield&world=' . $world_id . '" CLASS="size_xs">Shielding</A><BR><A HREF="?subtopic=highscores&list=distance&world=' . $world_id . '" CLASS="size_xs">Distance</A><BR><A HREF="?subtopic=highscores&list=club&world=' . $world_id . '" CLASS="size_xs">Club</A><BR><A HREF="?subtopic=highscores&list=sword&world=' . $world_id . '" CLASS="size_xs">Sword</A><BR><A HREF="?subtopic=highscores&list=axe&world=' . $world_id . '" CLASS="size_xs">Axe</A><BR><A HREF="?subtopic=highscores&list=fist&world=' . $world_id . '" CLASS="size_xs">Fist</A><BR><A HREF="?subtopic=highscores&list=fishing&world=' . $world_id . '" CLASS="size_xs">Fishing</A><BR></TD></TR></TABLE></TD><TD><IMG SRC="' . $layout_name . '/images/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD></TR></TABLE>';
开发者ID:Pietia10,项目名称:Gesior-for-OTServ,代码行数:31,代码来源:highscores.php

示例6: foreach

        $main_content .= '<TD bgcolor="yellow"><b><center><a href="?subtopic=powergamers&type=' . $i . '">' . $i . ' Days Ago</a></center></B></TD>';
    }
}
if ($type == 1) {
    $main_content .= '<TD bgcolor="red"><b><center><a href="?subtopic=powergamers&type=1">1 Day Ago</a></center></B></TD>';
} else {
    $main_content .= '<TD bgcolor="yellow"><b><center><a href="?subtopic=powergamers&type=1">1 Day Ago</a></center></B></TD>';
}
if (empty($type)) {
    $main_content .= '<TD bgcolor="red"><b><center><a href="?subtopic=powergamers">Today</a></center></B></TD>';
} else {
    $main_content .= '<TD bgcolor="yellow"><b><center><a href="?subtopic=powergamers">Today</a></center></B></TD>';
}
$main_content .= '</TR>';
foreach ($players as $player) {
    if (!is_int($number_of_rows / 2)) {
        $bgcolor = $config['site']['darkborder'];
    } else {
        $bgcolor = $config['site']['lightborder'];
    }
    $number_of_rows++;
    $main_content .= '<tr bgcolor="' . $bgcolor . '"><td align="center">' . $number_of_rows . '. </td>';
    if ($player['online'] == 1) {
        $main_content .= '<td><a href="?subtopic=characters&name=' . urlencode($player['name']) . '"><b><font color="green">' . htmlspecialchars($player['name']) . '</font></b></a>';
    } else {
        $main_content .= '<td><a href="?subtopic=characters&name=' . urlencode($player['name']) . '"><b><font color="red">' . htmlspecialchars($player['name']) . '</font></b></a>';
    }
    $main_content .= '<br />' . $player['level'] . ' ' . htmlspecialchars(Website::getVocationName($player['vocation'])) . '</td><td align="right">' . coloured_value($player['exphist1'] + $player['exphist2'] + $player['exphist3'] + $player['exphist4'] + $player['exphist5'] + $player['exphist6'] + $player['exphist7'] + $player['experience'] - $player['exphist_lastexp']) . '</td>';
    $main_content .= '<td align="right">' . coloured_value($player['exphist7']) . '</td><td align="right">' . coloured_value($player['exphist6']) . '</td><td align="right">' . coloured_value($player['exphist5']) . '</td><td align="right">' . coloured_value($player['exphist4']) . '</td><td align="right">' . coloured_value($player['exphist3']) . '</td><td align="right">' . coloured_value($player['exphist2']) . '</td><td align="right">' . coloured_value($player['exphist1']) . '</td><td align="right">' . coloured_value($player['experience'] - $player['exphist_lastexp']) . '</td></tr>';
}
$main_content .= '</TABLE>';
开发者ID:Pietia10,项目名称:Gesior-for-OTServ,代码行数:31,代码来源:powergamers.php

示例7: Player

<?php

if (!defined('INITIALIZED')) {
    exit;
}
$player = new Player();
$player->find($_GET['name']);
if ($player->isLoaded()) {
    if (!file_exists('cache/signatures/' . $player->getID()) || filemtime('cache/signatures/' . $player->getID()) === false || filemtime('cache/signatures/' . $player->getID()) + 30 < time()) {
        $image = imagecreatefrompng('./images/signatures/signature.png');
        $color = imagecolorallocate($image, 255, 255, 255);
        imagettftext($image, 12, 0, 20, 32, $color, './images/signatures/font.ttf', 'Name:');
        imagettftext($image, 12, 0, 70, 32, $color, './images/signatures/font.ttf', $player->getName());
        imagettftext($image, 12, 0, 20, 52, $color, './images/signatures/font.ttf', 'Level:');
        imagettftext($image, 12, 0, 70, 52, $color, './images/signatures/font.ttf', $player->getLevel() . ' ' . Website::getVocationName($player->getVocation()));
        if ($player->getRank()) {
            imagettftext($image, 12, 0, 20, 75, $color, './images/signatures/font.ttf', 'Guild:');
            imagettftext($image, 12, 0, 70, 75, $color, './images/signatures/font.ttf', $player->getRank()->getName() . ' of the ' . $player->getRank()->getGuild()->getName());
        }
        imagettftext($image, 12, 0, 20, 95, $color, './images/signatures/font.ttf', 'Last Login:');
        imagettftext($image, 12, 0, 100, 95, $color, './images/signatures/font.ttf', $player->getLastLogin() > 0 ? date("j F Y, g:i a", $player->getLastLogin()) : 'Never logged in.');
        imagepng($image, 'cache/signatures/' . $player->getID());
        imagedestroy($image);
    }
    header("Content-type: image/png");
    echo file_get_contents('cache/signatures/' . $player->getID());
}
exit;
开发者ID:aottibia,项目名称:www,代码行数:28,代码来源:signature.php


注:本文中的Website::getVocationName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。