| View previous topic :: View next topic |
| Author |
Message |
avolknet Peon
 Joined: 26 Jul 2007
|
Posted: Thu Jul 26, 2007 7:55 am Post subject: Top5 best admins |
|
|
Top5 best admins i website
Put this in jour web index
| Code: |
<?
include("top5bestbaners.php");
?>
|
DONWLOAD the file Top5bestbaners.php edit it and put ther wher is your index.php |
|
| Back to top |
|
 |
m@mBa Peon
Joined: 30 Apr 2007
|
Posted: Sun Aug 05, 2007 1:53 am Post subject: |
|
|
I copy top5bestbaners.php in amxbans main directory.
Add in this file mysql info.
I edit index.php & put your code:
| Code: | <?php
header( "Location:ban_list.php" );
include("top5bestbaners.php"); ?> |
I don't look a new mod, no changes
Where is problem?
Thanks  |
|
| Back to top |
|
 |
bglomax Peon
Joined: 23 Feb 2007
|
Posted: Fri Aug 10, 2007 11:23 am Post subject: |
|
|
| The problem is that you didn't edit the top5.....php file , it contains fields that are needed for the sql query to access the db - username pass ...etc. |
|
| Back to top |
|
 |
m@mBa Peon
Joined: 30 Apr 2007
|
Posted: Sat Aug 11, 2007 9:15 am Post subject: |
|
|
I'm add sql-info in this file!  |
|
| Back to top |
|
 |
avolknet Peon
 Joined: 26 Jul 2007
|
Posted: Fri Sep 07, 2007 1:59 am Post subject: |
|
|
| Code: | <?php
echo "<table id='admintop'>
<tr>
<th>Admin</th>
<th>Bans</th>
</tr>";
$con = mysql_connect("host","dbusername","dbpassword");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("yourdatbase", $con);
$result = mysql_query("SELECT count(*), admin_nick FROM amx_bans GROUP BY admin_nick ORDER BY count(*) DESC LIMIT 5"); // DESC LIMIT 5 noziimee, ka vinjsh paraadiis 5 aktiivaakos
while($row = mysql_fetch_array($result))
{
$admins = $row['admin_nick'];
$skaits = $row['count(*)'];
echo "<tr>
<td>$admins</td>
<td>$skaits</td>
</tr>";
}
mysql_close($con);
?>
</table> |
Please edit this 2 lines
dbusername = your mysql username
dbpassword = your mysql datbase password
host = localhost or your ip (if the amxbans is on your server wher is cs server)
your database = amxbans mysql datbase
$con = mysql_connect("host","dbusername","dbpassword");
'Could not connect: ' . mysql_error());
mysql_select_db("yourdatbase", $con); |
|
| Back to top |
|
 |
Never Peon
Joined: 09 Sep 2006
|
Posted: Thu Oct 25, 2007 4:31 am Post subject: |
|
|
Nice, realy Nice  _________________
 |
|
| Back to top |
|
 |
weegoing Peon
 Joined: 18 Sep 2006
|
Posted: Wed Dec 05, 2007 4:01 am Post subject: |
|
|
now fix? _________________
we build house |
|
| Back to top |
|
 |
Nofius Militia
 Joined: 31 Oct 2005 Location: Mora || Dalarna
|
Posted: Mon Dec 10, 2007 9:57 am Post subject: |
|
|
Well have upload file and wrote in db stuff and modified index.php but were are it going to show up, doesnt show anything on my page... Were will it show up ? _________________ Amxmodx 1.81.3722 - Amxbans 5.0
public.csgubbar.com:27015
=======================
Community | Webhosting | Clan
http://www.csgubbar.com |
|
| Back to top |
|
 |
test2 Peon
Joined: 05 Dec 2007
|
Posted: Tue Jan 08, 2008 10:07 am Post subject: |
|
|
avolknet forši skriptus pīzdo un padod, kā sevējos tjipo baigi krutais tēvīņš...
eng:
this noob (avolknet) is only a copy+paste noob, copying my scripts and posting it here |
|
| Back to top |
|
 |
Vazze Peon
Joined: 10 Mar 2008
|
Posted: Wed Mar 12, 2008 8:29 pm Post subject: |
|
|
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/info.php on line 18
Admin Bans |
|
| Back to top |
|
 |
sn0wbiatch Peon
Joined: 05 Jan 2009
|
Posted: Mon Jan 05, 2009 12:43 pm Post subject: |
|
|
well, i fixed it this way:
| Code: |
top5admins.php
<?php
echo "<table id='admintop'>
<tr>
<th>Admin</th>
<th>Bans</th>
</tr>";
if ($config->error_handler == "enabled") {
include("$config->error_handler_path");
}
$result = mysql_query("SELECT count(*), admin_nick FROM amx_bans GROUP BY admin_nick ORDER BY count(*) DESC LIMIT 5");
while($row = mysql_fetch_array($result))
{
$admins = $row['admin_nick'];
$bans = $row['count(*)'];
echo "
<br>
<tr>
<td>$admins</td>
<td>$bans</td>
</tr>";
}
?>
</table>
|
And in ban_list.php between:
| Code: |
$smarty->display('ban_list.tpl');
and
$smarty->display('main_footer.tpl');
include("top5admins.php");
So like:
$smarty->display('ban_list.tpl');
include("top5admins.php");
$smarty->display('main_footer.tpl');
|
|
|
| Back to top |
|
 |
avolknet Peon
 Joined: 26 Jul 2007
|
Posted: Sat Jan 10, 2009 4:48 pm Post subject: |
|
|
| test2 wrote: | avolknet forši skriptus pīzdo un padod, kā sevējos tjipo baigi krutais tēvīņš...
eng:
this noob (avolknet) is only a copy+paste noob, copying my scripts and posting it here |
Katrs otrais n00bs kas zin kautko no MySql var uztaisīt šādu skriptu lol !!! es viņu pats rakstijiu
This idiot is just jelous, because he don't know how to code php
| sn0wbiatch wrote: | well, i fixed it this way:
| Code: |
top5admins.php
<?php
echo "<table id='admintop'>
<tr>
<th>Admin</th>
<th>Bans</th>
</tr>";
if ($config->error_handler == "enabled") {
include("$config->error_handler_path");
}
$result = mysql_query("SELECT count(*), admin_nick FROM amx_bans GROUP BY admin_nick ORDER BY count(*) DESC LIMIT 5");
while($row = mysql_fetch_array($result))
{
$admins = $row['admin_nick'];
$bans = $row['count(*)'];
echo "
<br>
<tr>
<td>$admins</td>
<td>$bans</td>
</tr>";
}
?>
</table>
|
And in ban_list.php between:
| Code: |
$smarty->display('ban_list.tpl');
and
$smarty->display('main_footer.tpl');
include("top5admins.php");
So like:
$smarty->display('ban_list.tpl');
include("top5admins.php");
$smarty->display('main_footer.tpl');
|
|
Nice work ! |
|
| Back to top |
|
 |
zorba Peon
Joined: 25 Apr 2010
|
Posted: Mon Apr 26, 2010 1:21 pm Post subject: |
|
|
Thank you sn0wbiatch for the fix ! _________________ Best Rakeback Offers |
|
| Back to top |
|
 |
|
|
|