• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Repair Power Gamers

kowal67612

New Member
Joined
Nov 7, 2023
Messages
40
Reaction score
4
Bpower gamers.webp



<div class="right_box">
<div class="corner_lt"></div><div class="corner_rt"></div><div class="corner_lb"></div><div class="corner_rb"></div>
<div class="title"><img src="<?= $template_path; ?>/images/exp.gif"><span style="background-image: url(<?= $template_path; ?>/widget_texts/powergamers.png);"></span></div>
<div class="content">
<div class="rise-up-content">
<ul class="toplvl">
<?php
function coloured_value($valuein)
{
$value2 = $valuein;
while(strlen($value2) > 3)
{
$value .= '.'.substr($value2, -3, 3);
$value2 = substr($value2, 0, strlen($value2)-3);
}
@$value = $value2.$value;
if($valuein > 0)
return '<b><font color="green">+'.$value.'</font></b>';
elseif($valuein < 0)
return '<font color="red">'.$value.'</font>';
else
return $value;
}

$powergamers = getPowergamers();
if(count($powergamers) > 0) {
foreach($powergamers as $player)
{
$nam = $player['name'];
if (strlen($nam) > 15)
{$nam = substr($nam, 0, 12) . '...';}
echo '<li style="margin: 6px 0;"><div style="position:relative; left:-48px; top:-48px;"><div style="background-image: url(' . $config['outfit_images_url'] . '?id='.$player['looktype'].'&head='.$player['lookhead'].'&body='.$player['lookbody'].'&legs='.$player['looklegs'].'&feet='.$player['lookfeet'].');width:64px;height:64px;position:absolute;background-repeat:no-repeat;background-position:right bottom;"></div></div>
<a style="margin-left: 19px;" href="' . getPlayerLink($player['name'], false). '">'
.$nam. '</a>';

echo '<span style="float: right;">'.coloured_value($player['experience']-$player['exphist_lastexp']).'</span></li>';
}
}
?>
</ul>
</div>
</div>
<div class="border_bottom"></div>
</div>
 
Please edit your post, remove the code, then re copy the code and paste it into the code function our OTLand Admins have provided for us to make this sort of thing much neater and easier to read. No one is going to fix the code layout to attempt to read it to help you.

Provide AAC Make and version, and provide a brief description of what stats your power gamers are based on, IE level. Is this a function that already existed? Are you attempting to add this to your AAC? Was this feature a release from another individual here? If so link us to where you retrieved it from.

We know none of this information with a screen shot, a very poorly laid out code paste.

Thank you,
 
Please edit your post, remove the code, then re copy the code and paste it into the code function our OTLand Admins have provided for us to make this sort of thing much neater and easier to read. No one is going to fix the code layout to attempt to read it to help you.

Provide AAC Make and version, and provide a brief description of what stats your power gamers are based on, IE level. Is this a function that already existed? Are you attempting to add this to your AAC? Was this feature a release from another individual here? If so link us to where you retrieved it from.

We know none of this information with a screen shot, a very poorly laid out code paste.

Thank you,
Monkey Skateboarding GIF

repair

PHP:
<div class="right_box">
<div class="corner_lt"></div><div class="corner_rt"></div><div class="corner_lb"></div><div class="corner_rb"></div>
<div class="title"><img src="<?= $template_path; ?>/images/exp.gif"><span style="background-image: url(<?= $template_path; ?>/widget_texts/powergamers.png);"></span></div>
<div class="content">
<div class="rise-up-content">
<ul class="toplvl">
<?php
function coloured_value($valuein)
{
$value2 = $valuein;
while(strlen($value2) > 3)
{
$value .= '.'.substr($value2, -3, 3);
$value2 = substr($value2, 0, strlen($value2)-3);
}
@$value = $value2.$value;
if($valuein > 0)
return '<b><font color="green">+'.$value.'</font></b>';
elseif($valuein < 0)
return '<font color="red">'.$value.'</font>';
else
return $value;
}

$powergamers = getPowergamers();
if(count($powergamers) > 0) {
foreach($powergamers as $player)
{
$nam = $player['name'];
if (strlen($nam) > 15)
{$nam = substr($nam, 0, 12) . '...';}
echo '<li style="margin: 6px 0;"><div style="position:relative; left:-48px; top:-48px;"><div style="background-image: url(' . $config['outfit_images_url'] . '?id='.$player['looktype'].'&head='.$player['lookhead'].'&body='.$player['lookbody'].'&legs='.$player['looklegs'].'&feet='.$player['lookfeet'].');width:64px;height:64px;position:absolute;background-repeat:no-repeat;background-position:right bottom;"></div></div>
<a style="margin-left: 19px;" href="' . getPlayerLink($player['name'], false). '">'
.$nam. '</a>';

echo '<span style="float: right;">'.coloured_value($player['experience']-$player['exphist_lastexp']).'</span></li>';
}
}
?>
</ul>
</div>
</div>
<div class="border_bottom"></div>
</div>


getPowergamers()
getPowergamers()
getPowergamers()getPowergamers()
getPowergamers()
getPowergamers()getPowergamers()
getPowergamers()
getPowergamers()getPowergamers()
getPowergamers()
getPowergamers()getPowergamers()
getPowergamers()
getPowergamers()getPowergamers()
getPowergamers()
getPowergamers()getPowergamers()
getPowergamers()
getPowergamers()getPowergamers()
getPowergamers()
getPowergamers()getPowergamers()
getPowergamers()
getPowergamers()getPowergamers()
getPowergamers()
getPowergamers()getPowergamers()
getPowergamers()
getPowergamers()getPowergamers()
getPowergamers()
getPowergamers()
we need thi s function
 
You accomplished half of one task. Now looked at the way other codes are laid out in this forum by our regular users and OG members, lay the code out this way and then answer the questions in the post above, if not we will ignore this post from this point forward.
 
html.webp
CTRL+F inside app called notepad++
then Find in files
input the function then in
Directory guide to your html folder in xampp or wherever you have it on drive. C:/users/bla/desktop or
 
Myacc


PHP:
<div class="right_box">
<div class="corner_lt"></div><div class="corner_rt"></div><div class="corner_lb"></div><div class="corner_rb"></div>
<div class="title"><img src="<?= $template_path; ?>/images/exp.gif"><span style="background-image: url(<?= $template_path; ?>/widget_texts/powergamers.png);"></span></div>
<div class="content">
<div class="rise-up-content">
<ul class="toplvl">
<?php
function coloured_value($valuein)
{
$value2 = $valuein;
while(strlen($value2) > 3)
{
$value .= '.'.substr($value2, -3, 3);
$value2 = substr($value2, 0, strlen($value2)-3);
}
@$value = $value2.$value;
if($valuein > 0)
return '<b><font color="green">+'.$value.'</font></b>';
elseif($valuein < 0)
return '<font color="red">'.$value.'</font>';
else
return $value;
}

$powergamers = getPowergamers();
if(count($powergamers) > 0) {
foreach($powergamers as $player)
{
$nam = $player['name'];
if (strlen($nam) > 15)
{$nam = substr($nam, 0, 12) . '...';}
echo '<li style="margin: 6px 0;"><div style="position:relative; left:-48px; top:-48px;"><div style="background-image: url(' . $config['outfit_images_url'] . '?id='.$player['looktype'].'&head='.$player['lookhead'].'&body='.$player['lookbody'].'&legs='.$player['looklegs'].'&feet='.$player['lookfeet'].');width:64px;height:64px;position:absolute;background-repeat:no-repeat;background-position:right bottom;"></div></div>
<a style="margin-left: 19px;" href="' . getPlayerLink($player['name'], false). '">'
.$nam. '</a>';

echo '<span style="float: right;">'.coloured_value($player['experience']-$player['exphist_lastexp']).'</span></li>';
}
}
?>
</ul>
</div>
</div>
<div class="border_bottom"></div>
</div>
Post automatically merged:

LAYOUT LAYOUT
22 hits in 11 files
LUA:
\html\system\pages\system\cache\plugins\myaac-old-school-template\templates\old-school\index.php (2 trafień)
\html\system\pages\system\pages\system\cache\plugins\myaac-old-school-template\templates\old-school\index.php (2 trafień)
\html\system\pages\system\pages\system\pages\system\cache\plugins\myaac-old-school-template\templates\old-school\index.php (2 trafień)
\html\system\pages\system\system\cache\plugins\myaac-old-school-template\templates\old-school\index.php (2 trafień)
\html\system\pages\system\system\pages\system\cache\plugins\myaac-old-school-template\templates\old-school\index.php (2 trafień)
\html\system\pages\system\system\pages\system\pages\system\cache\plugins\myaac-old-school-template\templates\old-school\index.php (2 trafień)
\html\system\pages\system\system\pages\system\pages\system\pages\system\cache\plugins\myaac-old-school-template\templates\old-school\index.php (2 trafień)
\html\system\pages\system\system\pages\system\system\cache\plugins\myaac-old-school-template\templates\old-school\index.php (2 trafień)
\html\system\pages\system\system\pages\system\system\pages\system\cache\plugins\myaac-old-school-template\templates\old-school\index.php (2 trafień)
\html\system\pages\system\system\pages\system\system\pages\system\pages\system\cache\plugins\myaac-old-school-template\templates\old-school\index.php (2 trafień)
\html\templates\old-school\index.php (2 trafień)





Wyszukanie "getPowergamers()" (22 trafień w 11 plikach z 23924 przeszukiwanych) [Normalny]
  C:\Users\zanet\OneDrive\Pulpit\Mapa dobra\html\system\pages\system\cache\plugins\myaac-old-school-template\templates\old-school\index.php (2 trafień)
    Linia 292:                         $powergamers = getPowergamers();
    Linia 367: function getPowergamers() {
  C:\Users\zanet\OneDrive\Pulpit\Mapa dobra\html\system\pages\system\pages\system\cache\plugins\myaac-old-school-template\templates\old-school\index.php (2 trafień)
    Linia 292:                         $powergamers = getPowergamers();
    Linia 367: function getPowergamers() {
  C:\Users\zanet\OneDrive\Pulpit\Mapa dobra\html\system\pages\system\pages\system\pages\system\cache\plugins\myaac-old-school-template\templates\old-school\index.php (2 trafień)
    Linia 292:                         $powergamers = getPowergamers();
    Linia 367: function getPowergamers() {
  C:\Users\zanet\OneDrive\Pulpit\Mapa dobra\html\system\pages\system\system\cache\plugins\myaac-old-school-template\templates\old-school\index.php (2 trafień)
    Linia 292:                         $powergamers = getPowergamers();
    Linia 367: function getPowergamers() {
  C:\Users\zanet\OneDrive\Pulpit\Mapa dobra\html\system\pages\system\system\pages\system\cache\plugins\myaac-old-school-template\templates\old-school\index.php (2 trafień)
    Linia 292:                         $powergamers = getPowergamers();
    Linia 367: function getPowergamers() {
  C:\Users\zanet\OneDrive\Pulpit\Mapa dobra\html\system\pages\system\system\pages\system\pages\system\cache\plugins\myaac-old-school-template\templates\old-school\index.php (2 trafień)
    Linia 292:                         $powergamers = getPowergamers();
    Linia 367: function getPowergamers() {
  C:\Users\zanet\OneDrive\Pulpit\Mapa dobra\html\system\pages\system\system\pages\system\pages\system\pages\system\cache\plugins\myaac-old-school-template\templates\old-school\index.php (2 trafień)
    Linia 292:                         $powergamers = getPowergamers();
    Linia 367: function getPowergamers() {
  C:\Users\zanet\OneDrive\Pulpit\Mapa dobra\html\system\pages\system\system\pages\system\system\cache\plugins\myaac-old-school-template\templates\old-school\index.php (2 trafień)
    Linia 292:                         $powergamers = getPowergamers();
    Linia 367: function getPowergamers() {
  C:\Users\zanet\OneDrive\Pulpit\Mapa dobra\html\system\pages\system\system\pages\system\system\pages\system\cache\plugins\myaac-old-school-template\templates\old-school\index.php (2 trafień)
    Linia 292:                         $powergamers = getPowergamers();
    Linia 367: function getPowergamers() {
  C:\Users\zanet\OneDrive\Pulpit\Mapa dobra\html\system\pages\system\system\pages\system\system\pages\system\pages\system\cache\plugins\myaac-old-school-template\templates\old-school\index.php (2 trafień)
    Linia 292:                         $powergamers = getPowergamers();
    Linia 367: function getPowergamers() {
  C:\Users\zanet\OneDrive\Pulpit\Mapa dobra\html\templates\old-school\index.php (2 trafień)
    Linia 292:                         $powergamers = getPowergamers();
    Linia 367: function getPowergamers() {
Post automatically merged:

PHP:
function getPowergamers() {
    if (!fieldExist('exphist_lastexp', 'players')) {
        return [];
    }

    $cache = Cache::getInstance();
    if ($cache->enabled()) {
        $tmp = '';
        if ($cache->fetch('powergamers', $tmp)) {
            return unserialize($tmp);
        }
    }

    global $db, $deleted, $config;
    $results = [];
    $query = $db->query('SELECT * FROM players WHERE players.id NOT IN (' . implode(', ', $config['highscores_ids_hidden']) . ') AND players.' . $deleted . ' = 0 AND players.group_id < '.$config['highscores_groups_hidden'].' ORDER BY  experience - exphist_lastexp DESC LIMIT 5;');
    if ($query->rowCount() > 0) {
        $results = $query->fetchAll(\PDO::FETCH_ASSOC);
    }

    if ($cache->enabled()) {
        $cache->set('powergamers', serialize($results), 180); // update every 3 minutes
    }

    return $results;
}
 
Last edited:
// cache system. by default file cache is used
'cache_engine' => 'auto', // apc, apcu, eaccelerator, xcache, file, auto, or blank to disable.
'cache_prefix' => 'myaac_', // have to be unique if running more MyAAC instances on the same server (except file system cache)
Post automatically merged:

chmody 777 In all
 
Last edited:
Can u try enable dev mode in config.local.php,

by setting this:

Code:
$config['env'] = 'dev';

And see if the problem persist?
 
PHP:
Exception class: PDOException()

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '= 0 AND players.group_id < 3 ORDER BY experience - exphist_lastexp DESC LIMIT 5' at line 1

File: /var/www/html/system/libs/pot/OTS_Base_DB.php
Line: 86


Backtrace:

#0 /var/www/html/system/libs/pot/OTS_Base_DB.php(86): PDO->query()
#1 /var/www/html/system/libs/pot/OTS_DB_PDOQuery.php(13): OTS_Base_DB->doQuery()
#2 /var/www/html/templates/old-school/index.php(382): OTS_Base_DB->query()
#3 /var/www/html/templates/old-school/index.php(292): getPowergamers()
#4 /var/www/html/index.php(382): require('/var/www/html/t...')
#5 {main}
 

Similar threads

Back
Top