Oops sorry, I use Geisor.are you expecting us to guess what website you are using?
It was not possible to use any type of form that I would like, I had already tested it I would like the record to always be on the character.php page[Gesior acc. maker][TFS 0.3]Powergamers and online time stats
EDIT: It work with TFS 0.2.13, but you must use version compiled with parameter -D__GLOBAL_STORAGE__ You can find TFS 0.2.13 for Tibia 8.21 compiled with this parameter in my thread in "Downloads" on forum. If you use TFS 0.2.13 replace function "historyPage" from this thread with: function...otland.netTFS 1.X+ - Powergamers GESIOR 2012
Hey! Can some1 help me with editing powergamers.php from Gesior 2012 Account maker to make it display Ranking of powergamers but unmultiplied by exp stages e.g. Player get +108.000.000 exp but from creating character through all exp stages 8 - 50 level, 100x 51 - 100 level, 50x 101 - 125...otland.net[Gesior Acc] need script powergamers
i Need script for powergamers i use this http://otland.net/f118/gesior-acc-maker-forgotten-server-0-3-powergamers-online-time-stats-8640/ but is old, and time dont work. like this Ambera.net :: The best Open Tibia Server! [8.6] Global! ;)otland.net
@Piifafa To correctly display the experience (exp), follow the Gesior tutorial that was posted there and add your database.[Gesio acc. maker][TFS 0.3]Powergamers e estatísticas de tempo online
EDIT: Funciona com TFS 0.2.13, mas você deve usar a versão compilada com o parâmetro -D__GLOBAL_STORAGE__ Você pode encontrar TFS 0.2.13 para Tibia 8.21 compilado com este parâmetro em meu tópico em "Downloads" no fórum.
// display exp history
$exp_history = $SQL->query('SELECT `exphist1`, `exphist2`, `exphist3`, `exphist4`, `exphist5`, `exphist6`, `exphist7`, `exphist_lastexp`, `experience` FROM `players` WHERE `id` = ' . $player->getID())->fetch();
$total_exp = $exp_history['exphist1'] + $exp_history['exphist2'] + $exp_history['exphist3'] + $exp_history['exphist4'] + $exp_history['exphist5'] + $exp_history['exphist6'] + $exp_history['exphist7'] + $exp_history['experience'];
$exp_today = $exp_history['exphist1'] - $exp_history['exphist_lastexp'];
if ($exp_today < 0) {
$exp_today = $exp_history['exphist_lastexp'];
}
$expHistoryContent = '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>';
$expHistoryContent .= '<TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD COLSPAN=2 WIDTH=90% CLASS=white><B>Experience History</B></TD></TR>';
$expHistoryContent .= '<tr BGCOLOR="'.$config['site']['lightborder'].'"><td width="150px"><u><b>E</b>XP <b>T</b>oday</u></td><td><font color="green">+' . $exp_today . '</font> <small>(experience total)</small></td></tr>';
$expHistoryContent .= '<tr BGCOLOR="'.$config['site']['darkborder'].'"><td>'.date('Y-m-d').'</td><td><font color="green">+' . $exp_history['exphist2'] . '</font> <small>(experience total)</small></td></tr>';
$expHistoryContent .= '<tr BGCOLOR="'.$config['site']['lightborder'].'"><td>'.date('Y-m-d', strtotime('-1 day')).'</td><td><font color="green">+' . $exp_history['exphist3'] . '</font> <small>(experience total)</small></td></tr>';
$expHistoryContent .= '<tr BGCOLOR="'.$config['site']['darkborder'].'"><td>'.date('Y-m-d', strtotime('-2 days')).'</td><td><font color="green">+' . $exp_history['exphist4'] . '</font> <small>(experience total)</small></td></tr>';
$expHistoryContent .= '<tr BGCOLOR="'.$config['site']['lightborder'].'"><td>'.date('Y-m-d', strtotime('-3 days')).'</td><td><font color="green">+' . $exp_history['exphist5'] . '</font> <small>(experience total)</small></td></tr>';
$expHistoryContent .= '<tr BGCOLOR="'.$config['site']['darkborder'].'"><td>Total Exp</td><td><font color="green">+' . $total_exp . '</font> <small>(experience total)</small></td></tr>';
$expHistoryContent .= '</TABLE>';
$main_content .= $expHistoryContent;
-- getEternalStorage and setEternalStorage
-- can be added to data/global.lua if you want to use eternal storage for another purpose than this.
-- Regular TFS global storage values get reset every time server reboots. This does not.
local function getEternalStorage(key, parser)
local value = result.getString(db.storeQuery("SELECT `value` FROM `znote_global_storage` WHERE `key` = ".. key .. ";"), "value")
if not value then
if parser then
return false
else
return -1
end
end
result.free(value)
return tonumber(value) or value
end
local function setEternalStorage(key, value)
if getEternalStorage(key, true) then
db.query("UPDATE `znote_global_storage` SET `value` = '".. value .. "' WHERE `key` = ".. key .. ";")
else
db.query("INSERT INTO `znote_global_storage` (`key`, `value`) VALUES (".. key ..", ".. value ..");")
end
return true
end
-- SQL Query to execute: --
--[[
ALTER TABLE `znote_players` ADD `exphist_lastexp` BIGINT UNSIGNED NOT NULL DEFAULT '0',
ADD `exphist1` BIGINT UNSIGNED NOT NULL DEFAULT '0',
ADD `exphist2` BIGINT UNSIGNED NOT NULL DEFAULT '0',
ADD `exphist3` BIGINT UNSIGNED NOT NULL DEFAULT '0',
ADD `exphist4` BIGINT UNSIGNED NOT NULL DEFAULT '0',
ADD `exphist5` BIGINT UNSIGNED NOT NULL DEFAULT '0',
ADD `exphist6` BIGINT UNSIGNED NOT NULL DEFAULT '0',
ADD `exphist7` BIGINT UNSIGNED NOT NULL DEFAULT '0',
ADD `onlinetimetoday` BIGINT NOT NULL DEFAULT '0',
ADD `onlinetime1` BIGINT NOT NULL DEFAULT '0',
ADD `onlinetime2` BIGINT NOT NULL DEFAULT '0',
ADD `onlinetime3` BIGINT NOT NULL DEFAULT '0',
ADD `onlinetime4` BIGINT NOT NULL DEFAULT '0',
ADD `onlinetime5` BIGINT NOT NULL DEFAULT '0',
ADD `onlinetime6` BIGINT NOT NULL DEFAULT '0',
ADD `onlinetime7` BIGINT NOT NULL DEFAULT '0',
ADD `onlinetimeall` BIGINT NOT NULL DEFAULT '0';
]]--
-- after that execute: --
--[[
UPDATE `znote_players` AS `z` INNER JOIN `players` AS `p` ON `p`.`id`=`z`.`player_id` SET `z`.`exphist_lastexp`=`p`.`experience`;
]]--
-- TFS 1.X (data/globalevents.xml)
-- <!-- Power Gamers -->
-- <globalevent name="PowerGamers" interval="60000" script="powergamers.lua"/>
function onThink(interval, lastExecution, thinkInterval)
if tonumber(os.date("%d")) ~= getEternalStorage(23856) then
setEternalStorage(23856, (tonumber(os.date("%d"))))
db.query("UPDATE `znote_players` SET `onlinetime7`=`onlinetime6`, `onlinetime6`=`onlinetime5`, `onlinetime5`=`onlinetime4`, `onlinetime4`=`onlinetime3`, `onlinetime3`=`onlinetime2`, `onlinetime2`=`onlinetime1`, `onlinetime1`=`onlinetimetoday`, `onlinetimetoday`=0;")
db.query("UPDATE `znote_players` `z` INNER JOIN `players` `p` ON `p`.`id`=`z`.`player_id` SET `z`.`exphist7`=`z`.`exphist6`, `z`.`exphist6`=`z`.`exphist5`, `z`.`exphist5`=`z`.`exphist4`, `z`.`exphist4`=`z`.`exphist3`, `z`.`exphist3`=`z`.`exphist2`, `z`.`exphist2`=`z`.`exphist1`, `z`.`exphist1`=`p`.`experience`-`z`.`exphist_lastexp`, `z`.`exphist_lastexp`=`p`.`experience`;")
end
db.query("UPDATE `znote_players` SET `onlinetimetoday` = `onlinetimetoday` + 600, `onlinetimeall` = `onlinetimeall` + 600 WHERE `player_id` IN (SELECT `player_id` FROM `players_online` WHERE `players_online`.`player_id` = `znote_players`.`player_id`)")
return true
end
<?php require_once 'engine/init.php'; include 'layout/overall/header.php'; ?>
<img src="layout/images/titles/t_characters.png"/><p>
<?php
if ($config['log_ip']) {
znote_visitor_insert_detailed_data(4);
}
if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
$name = $_GET['name'];
$user_id = user_character_exist($name);
if ($user_id !== false) {
if ($config['TFSVersion'] == 'TFS_10') {
$profile_data = user_character_data($user_id, 'name', 'level', 'vocation', 'lastlogin', 'sex', 'group_id', 'town_id');
$profile_data['online'] = user_is_online_10($user_id);
} else $profile_data = user_character_data($user_id, 'name', 'level', 'vocation', 'lastlogin', 'online', 'sex', 'group_id', 'town_id');
$profile_znote_data = user_znote_character_data($user_id, 'created', 'hide_char', 'comment');
$guild_exist = false;
if (get_character_guild_rank($user_id) > 0) {
$guild_exist = true;
$guild = get_player_guild_data($user_id);
$guild_name = get_guild_name($guild['guild_id']);
}
?>
<!-- PROFILE MARKUP HERE-->
<!-- CHARACTER INFORMAION -->
<table>
<tr><td colspan="2">Character Information</td></tr>
<tr><td width="20%">Name:</td>
<td><?php echo $profile_data['name']; ?></td></tr>
<tr><td>Sex:</td>
<td><?php
if ($profile_data['sex'] == 1) {
echo 'Male';
} else {
echo 'Female';
}
?></td></tr>
<tr><td>Vocation:</td>
<td><?php echo vocation_id_to_name($profile_data['vocation']); ?></td></tr>
<tr><td>Level:</td>
<td><?php echo $profile_data['level']; ?></td></tr>
<tr><td>World:</td>
<td><?php echo $config['site_title']; ?></td></tr>
<tr><td>Residence:</td>
<td><?php
foreach ($config['towns'] as $key=>$value) {
if ($key == $profile_data['town_id']) {
echo $value;
}
} ?></td></tr>
<?php $houses = array();
$houses = mysql_select_multi("SELECT `id`, `owner`, `name`, `town_id` FROM `houses` WHERE `owner` = $user_id ;");
if ($houses !== false) {
$playerlist = array();
foreach ($houses as $h)
if ($h['owner'] > 0)
$playerlist[] = $h['owner'];
if ($profile_data['id'] = $h['owner']) { ?>
<tr><td>House:</td>
<td><?php echo $h['name']; ?> (<?php
foreach ($config['towns'] as $key=>$value) {
if ($key == $h['town_id']) {
echo $value;
}
} ?>)</td></tr>
<?php
}
}
?>
<?php
if ($guild_exist) {
?>
<tr><td>Guild membership:</td>
<td><?php echo $guild['rank_name']; ?> of the <a href="guilds.php?name=<?php echo $guild_name; ?>"><?php echo $guild_name; ?></a></td></tr>
<?php
}
?>
<tr><td>Last login:</td>
<td><?php
if ($profile_data['lastlogin'] != 0) {
echo getClock($profile_data['lastlogin'], true, true);
} else {
echo 'never logged in';
}
?></td></tr>
<?php
if ($profile_data['group_id'] > 1) {
?>
<tr><td>Position:</td>
<td><?php
foreach ($config['ingame_positions'] as $key=>$value) {
if ($key == $profile_data['group_id']) {
echo $value;
}
} ?></td></tr>
<?php
}
?>
<?php if (isset($profile_znote_data['comment']) === true && empty($profile_znote_data['comment']) === false) { ?>
<tr><td>Comment:</td>
<td><?php echo $profile_znote_data['comment']; ?></td></tr>
<?php } ?>
<tr><td>Created:</td>
<td><?php echo getClock($profile_znote_data['created'], true); ?></td></tr>
</table>
<!-- END CHARACTER INFORMATION -->
<!-- DEATH LIST -->
<?php
if ($config['TFSVersion'] == 'TFS_02') {
$array = user_fetch_deathlist($user_id);
if ($array) { ?>
<table>
<tr><td colspan="2">Character Deaths</td></tr><?php
//data_dump($array, false, "Data:");
// Design and present the list
foreach ($array as $value) {
// $value[0]
$value['time'] = getClock($value['time'], true);
if ($value['is_player'] == 1) {
echo '<tr><td>'. $value['time'] .'</td><td> Killed at Level '. $value['level'] .' by <a href="characterprofile.php?name='. $value['killed_by'] .'">'. $value['killed_by'] .'</a></td></tr>';
} else {
echo '<tr><td>'. $value['time'] .'</td><td> Died at Level '. $value['level'] .' by '. $value['killed_by'] .'</td></tr>';
}
?>
</table><?php
}
}
//Done.
} else if ($config['TFSVersion'] == 'TFS_10') {
$deaths = mysql_select_multi("SELECT
`player_id`, `time`, `level`, `killed_by`, `is_player`,
`mostdamage_by`, `mostdamage_is_player`, `unjustified`, `mostdamage_unjustified`
FROM `player_deaths`
WHERE `player_id`=$user_id ORDER BY `time` DESC LIMIT 10;");
if (!$deaths) echo '';
else {
?>
<table>
<tr><td colspan="2">Character Deaths</td></tr><?php
foreach ($deaths as $d) {
echo "<tr><td width='20%'>".getClock($d['time'], true, true)."</td>";
$lasthit = ($d['is_player']) ? "<a href='characterprofile.php?name=".$d['killed_by']."'>".$d['killed_by']."</a>" : $d['killed_by'];
if ($d['is_player'] > 0) {
echo "<td> Killed at Level ".$d['level']." by $lasthit";
} else echo "<td> Died at Level ".$d['level']." by $lasthit";
if ($d['unjustified']) echo " <font color='red' style='font-style: italic;font-size:85%;'>(unjustified)</font>";
$mostdmg = ($d['mostdamage_by'] !== $d['killed_by']) ? true : false;
if ($mostdmg) {
$mostdmg = ($d['mostdamage_is_player']) ? "<a href='characterprofile.php?name=".$d['mostdamage_by']."'>".$d['mostdamage_by']."</a>" : $d['mostdamage_by'];
echo " and by $mostdmg.";
if ($d['mostdamage_unjustified']) echo " <font color='red' style='font-style: italic;font-size:85%;'>(unjustified)</font>";
}
}
//data_dump($deaths, false, "Deaths:");
?>
</td></tr></table><?php
}
} else if ($config['TFSVersion'] == 'TFS_03') {
//mysql_select_single("SELECT * FROM players WHERE name='TEST DEBUG';");
$array = user_fetch_deathlist03($user_id);
if ($array) { ?>
<table>
<tr><td colspan="2">Character Deaths</td></tr><?php
// Design and present the list
foreach ($array as $value) {
$value[3] = user_get_killer_id(user_get_kid($value['id']));
if ($value[3] !== false && $value[3] >= 1) {
$namedata = user_character_data((int)$value[3], 'name');
if ($namedata !== false) {
$value[3] = $namedata['name'];
$value[3] = '<a href="characterprofile.php?name='. $value[3] .'">'. $value[3] .'</a>';
} else {
$value[3] = 'deleted player.';
}
echo '<tr><td>'. getClock($value['date'], true) .'</td><td>Killed at Level '. $value['level'] .' by '. $value[3] .'</td></tr>';
} else {
$value[3] = user_get_killer_m_name(user_get_kid($value['id']));
if ($value[3] === false) $value[3] = 'deleted player.';
echo '<tr><td>'. getClock($value['date'], true) .'</td><td>Died at Level '. $value['level'] .' by '. $value[3] .'</td></tr>';
}
}
?>
</table><?php
}
}
?>
<!-- END DEATH LIST -->
<!-- QUEST PROGRESSION -->
<?php
$totalquests = 0;
$completedquests = 0;
$firstrun = 1;
if ($config['EnableQuests'] == true)
{
$sqlquests = mysql_select_multi("SELECT `player_id`, `key`, `value` FROM player_storage WHERE `player_id` = $user_id");
foreach ($config['Quests'] as $cquest)
{
$totalquests = $totalquests + 1;
foreach ($sqlquests as $dbquest)
{
if ($cquest[0] == $dbquest['key'] && $cquest[1] == $dbquest['value'])
{
$completedquests = $completedquests + 1;
}
}
if ($cquest[3] == 1)
{
if ($completedquests != 0)
{
if ($firstrun == 1)
{
echo '<table id="characterprofileQuest" class="table table-striped table-hover">';
echo '<tr class="yellow">';
echo '<td colspan="2">Quest Progress</td>';
echo '</tr>';
$firstrun = 0;
}
$completed = $completedquests / $totalquests * 100;
echo '<tr>';
echo '<td>'. $cquest[2] .'</td>';
echo '<td id="progress"><span id="percent">'.round($completed).'%</span><div id="bar" style="width: '.$completed.'%"></div></td>';
echo '</tr>';
}
$completedquests = 0;
$totalquests = 0;
}
}
}
if ($firstrun == 0)
{
echo '</table>';
}
?>
<!-- END QUEST PROGRESSION -->
<!-- CHARACTER LIST -->
<?php
if (user_character_hide($profile_data['name']) != 1) {
?>
<table>
<tr><td colspan="4">Characters</td></tr>
<?php
$characters = user_character_list(user_character_account_id($profile_data['name']));
// characters: [0] = name, [1] = level, [2] = vocation, [3] = town_id, [4] = lastlogin, [5] = online
if ($characters && count($characters) > 0) {
?>
<tr>
<td><b>Name</b></td>
<td width="55%"><b>Status</b></td>
<td><b>Level</b></td>
<td><b>Vocation</b></td>
</tr>
<?php
// Design and present the list
$number = 1;
foreach ($characters as $char) {
if (hide_char_to_name(user_character_hide($char['name'])) != 'hidden') {
echo '<tr>';
echo '<td>'. $number .'. <a href="characterprofile.php?name='. $char['name'] .'">'. $char['name'] .'</a></td>';
if ($char['name'] != $profile_data['name']) { echo '<td>'. $char['online'] .'</td>';
} else echo '<td>'. $char['online'] .' <span style="font-size:85%;opacity:.5;"><i> (currently viewing)</i></span></td>';
echo '<td>'. $char['level'] .'</td>';
echo '<td>'. $char['vocation'] .'</td>';
/* echo '<td>';
if ($profile_data['lastlogin'] != 0) {
echo getClock($profile_data['lastlogin'], true, true);
} else {
echo 'never logged in';
}
echo '</td>'; */
echo '</tr>';
$number = $number + 1;
}
}
?>
</table>
<?php
} else {
echo '<b><font color="green">This player has never died.</font></b>';
}
//Done.
?>
<?php
}
?>
<!-- END CHARACTER LIST -->
<?php /*
<table>
<tr><td><font class="profile_font" name="profile_font_share_url">Address</td></tr><tr><td><a href="<?php
if ($config['htwrite']) echo "http://".$_SERVER['HTTP_HOST']."/". $profile_data['name'];
else echo "http://".$_SERVER['HTTP_HOST']."/characterprofile.php?name=". $profile_data['name'];
?>"><?php
if ($config['htwrite']) echo "http://".$_SERVER['HTTP_HOST']."/". $profile_data['name'];
else echo "http://".$_SERVER['HTTP_HOST']."/characterprofile.php?name=". $profile_data['name'];
?></a></font></td></tr>
</table>
*/ ?>
<!-- END PROFILE MARKUP HERE-->
<?php
} else {
echo htmlentities(strip_tags($name, ENT_QUOTES)).' does not exist.';
}
} else {
header('Location: unnamed');
}?>
<p><table>
<tr><td>Search Character</td></tr>
<tr class="darkborder"><td>
<form type="submit" action="characterprofile.php" method="get">
Name: <input type="text" size="25" name="name" class="search">
<input type="submit" name="submitName" value="Submit">
</form>
</td></tr>
</table>
<?php include 'layout/overall/footer.php'; ?>
<!-- POWERGAMERS -->
<?php
if ($config['ServerEngine'] == 'TFS_10') { ?>
<table class="stripped" cellpadding="4">
<tr><th colspan="2">Experience History</th></tr>
<html>
<head>
<style>
.positive {
color: green;
}
.negative {
color: red;
}
</style>
</head>
<body>
<?php
//consulta sql
$result = mysql_select_single("SELECT
`a`.`id`, `a`.`experience`, `b`.`player_id`,
`b`.`exphist_lastexp`, `b`.`exphist1`, `b`.`exphist2`,
`b`.`exphist3`, `b`.`exphist4`, `b`.`exphist5`,
`b`.`exphist6`, `b`.`exphist7`,
(`a`.`experience` - `b`.`exphist_lastexp`) AS `expdiff`
FROM `players` `a`
JOIN `znote_players` `b`
ON `a`.`id` = `b`.`player_id`
WHERE `a`.`id` = $user_id");
if ($result) {
for ($i = 0; $i <= 7; $i++) {
if ($i == 0) {
$date = "Today";
$exp = $result["expdiff"];
} else {
$date = date('d/m/Y', strtotime("-$i day"));
$exp = $result["exphist$i"];
}
$formatted_exp = number_format($exp, 0, ',', '.');
echo "<tr>";
echo "<td>$date</td>";
if ($exp > 0) {
echo "<td class='positive'>+$formatted_exp experience points</td>";
} elseif ($exp < 0) {
echo "<td class='negative'>$formatted_exp experience points</td>";
} else {
echo "<td>no change</td>";
}
echo "</tr>";
}
} else {
// A consulta falhou, exiba uma mensagem de erro
echo 'not done yet.';
}
?>
</body>
</html>
</table>
<?php
}
?>
<!-- END POWERGAMERS -->