• 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!

[Modern ACC/ Gesior link] Football highscores

Doggynub

LUA / C++
Joined
Sep 28, 2008
Messages
2,541
Reaction score
186
Footall highscores :]--Gesior link at end of page--
--To let you know , I dont know a shit about web related codings so this is only simple edits to cyber's tetris system, you can change it as you want--

Important You need to see this page before installing this in your site( to add needed qurys):
>>Football lua script<<

1- Go to "Public---> Images" [and paste theses]
Football image

As that link is dead go to this image Click and Save right click and save the image to the place i said up.[Save in the name of "ball.gif"]


2- Creat this through your adminPanel in moder acc / go to "System-->pages---> make new football.php"
[make sure to edit the $min varible in php file]
PHP:
<?php
//Script by Damadgerz based on Cyber's tetris
//Tetris Highscores Page for Modern AAC
//OTland.net
$min = 1;
require("config.php");
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = $ots->getDBHandle();
$record = $SQL->query('SELECT `name`,`goals`,`total`,`wins` FROM `players` ORDER BY (`wins`/`total`)*(`goals`+`wins`) DESC LIMIT 1')->fetch();
if ($record['total'] < $min ) {
echo'<div style="text-align: left; font-weight: bold">No highscore yet, to be on list: <br/>1- you need to participate in '.$min.'+ matches<br/>2- Have atleast 1 win.<br/>3- Have scored atleast 1 goal.  <br/></div>';
}else {
$rati = $record['wins']/$record['total'] * 100;
$ratio = ceil($rati);
echo'<div style="text-align: center; font-weight: bold">Football Highscores in '.$config['server_name'].'<br/></div>
<br/><center><table border="0" cellspacing="0" cellpadding="2" width="60%">
<tr bgcolor="black"><td style="text-align: left; font-weight: bold; font-size:medium;color : white">Top player</td><td></td></tr>
<tr ><td><span style="font-size:small;"><strong><script>
var text="'.$record['name'].' : '.$ratio.'%." // YOUR TEXT
var speed=100 // SPEED OF FADE
if (document.all || document.getElementById) {
    document.write(\'<span id="highlight">\' + text + \'</span>\')
    var storetext=document.getElementById ? document.getElementById("highlight") : document.all.highlight
    var hex = new Array("00","14","28","3C","50","64","78","8C","A0","B4","C8","DC","F0")
    var r=1
    var g=1
    var b=1
    var seq=1
    function changetext2() {
        rainbow = "#"+hex[r]+hex[g]+hex[b]
        storetext.style.color=rainbow
    }
    function change() {
        if (seq==6) {
            b--
            if (b==0) {
                seq=1
            }
        }
        if (seq==5) {
            r++
            if (r==12) {
                seq=6
            }
        }
        if (seq==4) {
            g--
            if (g==0) {
                seq=5
            }
        }
        if (seq==3) {
            b++
            if (b==12) {
                seq=4
            }
        }
        if (seq==2) {
            r--
            if (r==0) {
                seq=3
            }    
        }
        if (seq==1){
            g++
    
            if (g==12) {
                seq=2
            }
        }
        changetext2()
    }
    if (document.all || document.getElementById) {
        flash = setInterval("change()", speed)
    }
}
</script></strong></span><br/>&nbsp;&nbsp; Wins : ' . $record['wins'] . ' | Total : ' . $record['total'] . ' | Goals : ' . $record['goals'] . ' </a></td><td><img src="'.WEBSITE.'/public/images/ball.gif"></td></tr></table>
';
 
echo'<br/><center><table border="1" cellspacing="1" cellpadding="2" width="100%">
    <tr bgcolor="black">
        <td width="5%" class="white" style="text-align: left; font-weight: bold;color : white"></td>
        <td width="45%" class="white" style="text-align: left; font-weight: bold;color : white">Player</td>
        <td width="15%" class="white" style="text-align: left; font-weight: bold;color : white">Win%</td>
  <td width="10%" class="white" style="text-align: left; font-weight: bold;color : white">Goals</td>
  <td width="10%" class="white" style="text-align: left; font-weight: bold;color : white">Total</td>
     <td width="10%" class="white" style="text-align: left; font-weight: bold;color : white">Wins</td>
    </tr> ';
    $i = 0;
foreach($SQL->query('SELECT `name`,`total`,`goals`,`wins` FROM `players` ORDER BY (`wins`/`total`)*(`goals`+`wins`) DESC') as $result)
{  
if ($result['total'] >= $min && $result['goals'] >=1 && $result['wins'] >=1 ){
$i++;
echo'<tr class="highlight"><td style="text-align: left;">' . $i . '</td>
        <td><a href="'.WEBSITE.'/index.php/character/view/'.$result['name'].'">'.$result['name'].'</a></td>
        <td style="text-align: center;">'.ceil($result['wins']/$result['total']*100).'%</td>
  <td style="text-align: center;">'.$result['goals'].'</td>
  <td style="text-align: center;">'. abs($result['total']) .'</td>
  <td style="text-align: center;">'.$result['wins'].'</td>
  </tr>'; }}}
echo '</table><br/><br/><div align="right"><span style="font-size:smaller;text-align:left"><a href="http://otland.net/members/cybershot/">Made by : Damadger <br/>Based on :Cyber\'s tetris</a></span></div>'; 
 ?>

URL :
Code:
[URL]http://127.0.0.1//index.php/p/v/football[/URL]


For gesior visit this : Credits to the post poster
 
Last edited:
Approved. Thanks for your contribution. :D

Any import SQL queries we should know of before using this script?
 
Script missing end tag?

I shall just write "?>" at the end of the document to close the loop?
 
I dont think , The loop is already close with "}" ye but i forgot to put the endinn tag of the php lol :)
 
nwtr, can you show me where i can download modern aac ? '-'
I liked this system, and i use gesior...
but all the people say 'the modern is better than gesior'

Modern AAC works in 8.54 servers?
 
nwtr, can you show me where i can download modern aac ? '-'
I liked this system, and i use gesior...
but all the people say 'the modern is better than gesior'

Modern AAC works in 8.54 servers?

Modern AAC board: (with info, download etc).
Modern AAC

It works on all TFS 0.3 and 0.4 servers. So yes, it works on 8.54
 
Plx damadger never :p

@elexonic, use modern is better ;)
Gesior = Sux
Modern is ??? Modern


I know which is better: P e used but I need the script to gesior .. to test some things = D
 
@nwtr:
much blablabla and little help....



My lite version for gesior:
PHP:
<?php
$main_content .= '<div style="text-align: center; font-weight: bold;">Top 20 Goals on ' . $config['server']['serverName'] . '</div>
<table border="0" cellspacing="1" cellpadding="4" width="100%">
    <tr bgcolor="' . $config['site']['vdarkborder'] . '">
        <td class="white" style="text-align: center; font-weight: bold;">Name</td>
        <td class="white" style="text-align: center; font-weight: bold;">Goals</td>
        <td class="white" style="text-align: center; font-weight: bold;">Wins</td>
    </tr>';

$i = 0;
foreach($SQL->query('SELECT `name`,`goals`,`total`,`wins` FROM `players`
GROUP BY `name`
 ORDER BY (`wins`/`total`)*(`goals`+`wins`) DESC LIMIT 0,20') as $player)
{
    $i++;
    $main_content .= '<tr bgcolor="' . (is_int($i / 2) ? $config['site']['lightborder'] : $config['site']['darkborder']) . '">
        <td><a href="?subtopic=characters&name=' . urlencode($player['name']) . '">' . $player['name'] . '</a></td>
        <td style="text-align: center;">' . $player['goals'] . '</td>
        <td style="text-align: center;">' . $player['wins'] . '</td>
    </tr>';
}

$main_content .= '</table>';
?>
 
Last edited:
Back
Top