[Creaturescripts][PHP]Top Frags And second script only php

Tanken

New Member
Joined
Jun 15, 2007
Messages
20
Best answers
0
Reaction score
0
all i need is a way to add
case "frags";
$topic = "Top Frags";
$subtopic = "frags";
include("frags.php");
break;
that info in my aac...
 

Winnerandy

Experienced Web Design'er
Joined
Oct 23, 2008
Messages
2,251
Best answers
0
Reaction score
48
Location
Tellus.
I just want that layout :(

Btw, nice script xD
 

Bondy

New Member
Joined
Mar 28, 2009
Messages
282
Best answers
0
Reaction score
1
i did all and it doesnt work, i use gesior acc manager
 

elf

Sing, sing blue silver
Joined
Dec 11, 2007
Messages
3,665
Best answers
1
Reaction score
116
Location
Cracow, Poland
I don't understand why you need extra field in players table, nor script, which, afaik, may cause some unecessary load due to query you've placed in it.
Everything can be done with a single query through the deaths recording system.

Code:
SELECT `p`.`name` AS `name`, COUNT(`p`.`name`) as `frags`
	FROM `killers` k
	LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id`
	LEFT JOIN `players` p ON `pk`.`player_id` = `p`.`id`
WHERE `k`.`unjustified` = 1
	GROUP BY `name`
	ORDER BY `frags` DESC, `name` ASC
	LIMIT 0,30;
So you need only the webpage...
Code:
<?php
$main_content .= '<div style="text-align: center; font-weight: bold;">Top 30 Frags 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;">Frags</td>
	</tr>';

$i = 0;
foreach($SQL->query('SELECT `p`.`name` AS `name`, COUNT(`p`.`name`) as `frags`
	FROM `killers` k
	LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id`
	LEFT JOIN `players` p ON `pk`.`player_id` = `p`.`id`
WHERE `k`.`unjustified` = 1
	GROUP BY `name`
	ORDER BY `frags` DESC, `name` ASC
	LIMIT 0,30;') 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['frags'] . '</td>
	</tr>';
}

$main_content .= '</table>';
?>
 
Last edited:
OP
widnet

widnet

Banned User
Joined
Apr 11, 2009
Messages
920
Best answers
0
Reaction score
3
Location
Poland/Cracow
I don't understand why you need extra field in players table, nor script, which, afaik, may cause some unecessary load due to query you've placed in it.
Everything can be done with a single query through the deaths recording system.

Code:
SELECT `p`.`name` AS `name`, COUNT(`p`.`name`) as `frags`
	FROM `killers` k
	LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id`
	LEFT JOIN `players` p ON `pk`.`player_id` = `p`.`id`
WHERE `k`.`unjustified` IN (1,3)
	GROUP BY `name`
	ORDER BY `frags` DESC, `name` ASC
	LIMIT 0,30;
You are roxxx!!!
Rep ++
 

imsory

New Member
Joined
Oct 5, 2008
Messages
23
Best answers
0
Reaction score
0
hi

how instal it on nicaw acc? i do everything, but i have it
Code:
Fatal error: Call to a member function query() on a non-object in E:\xampp\htdocs\frags.php on line 2
frags.php
Code:
<?PHP
 $frags = $SQL->query('SELECT * FROM `players` ORDER BY `frags` DESC LIMIT 25;');
    foreach($frags as $show) {
     $noobs++;
            if(is_int($noobs / 2))
                $bgcolor = $config['site']['lightborder'];
            else
                $bgcolor = $config['site']['darkborder'];
        $load .= '<TR BGCOLOR='.$bgcolor.'><TD><center><a href="?subtopic=characters&name='.urlencode($show['name']).'">'.$show['name'].'</a></center></TD><TD><center>'.$show['frags'].'</center></TD></TR>';
    }
    $main_content .= '<b><center>Top 25 Frags on '.$config['server']['serverName'].'</center></b><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b><center>Name</center></b></TD><TD class="white"><b><center>Frags</center></b></TD></TR>'.$load.'</TABLE>';
    //Dont delate. Please respect my job :)
 $main_content .= 'Script by <b><a href="http://otland.net/members/widnet/">widnet</a></b>';
?>
 
Top