Raised This Month: $12 Target: $400
 3% 

sqlstats


Post New Thread Reply   
 
Thread Tools Display Modes
xatazch
Member
Join Date: Jan 2005
Old 08-07-2006 , 20:37   Re: sqlstats
Reply With Quote #91

but i dont want it in the same table. i want 1 table for every server. and i have mysqlserver and web server.

is the plugin going to create the database it self? or can i download the database for this plugin somewhere?
xatazch is offline
madiaz3
New Member
Join Date: Aug 2006
Old 08-08-2006 , 16:47   Re: sqlstats
Reply With Quote #92

Hey is there an easy way to clear / reset the stats? I'm not very good at understanding this.
madiaz3 is offline
xatazch
Member
Join Date: Jan 2005
Old 08-10-2006 , 18:03   Re: sqlstats
Reply With Quote #93

just empty your tables on your mysql server =)
xatazch is offline
micromy
New Member
Join Date: Aug 2006
Old 08-30-2006 , 11:39   Re: sqlstats
Reply With Quote #94

//////////////////////////// PHP SCRIPT /////////////////////////////
$host = "host"; // MySQL database hostname
$user = "user"; // SQL Username
$dbank = "amx"; // SQL Database
$pw = "pass"; // SQL Password
$title = "Player Rankings"; // Title of the page
$showamount = 300; // Amount of players displayed per page
///////////////////////////////////////////////////////////////////////////
if ($_GET['type'] == "") {
$rankstable="sqlstatstable";
} else {
$rankstable=$_GET['type'];
}
?>
<title>
<? echo $title ?>
</title>
</Head>
<Body bgcolor=000000
bgproperties="fixed"
Topmargin="0"
Leftmargin="5"
Rightmargin="5"
Marginheight="0"
Marginwidth="0"
ALINK="999999"
VLINK="999999"
LINK="999999" >

<center>
<?php
$conn = mysql_connect($host, $user, $pw) or die("no connection to database, please try again later");
mysql_select_db ($dbank) or die ("no connection to database, please try again later");

$fonttitle="<font size=4 color=FFFFFF>";
$fontnormal="<font size=3 color=FFFFFF>";
$fonttiny="<font size=2 color=FFFFFF>";
$fonttinywhite="<font size=2 color=FFFFFF>";
$rankedcolor=22222;
if ($_GET['sortorder'] == ""){ $sortorder="score";}
else{ $sortorder= $_GET['sortorder']; }

if ($_GET['page'] == ""){ $pageBegin=0; $page=0;}
else{ $pageBegin = $_GET['page']*$showamount;$page=$_GET['page'];}
//get the number of ranked entries
$result2 = mysql_query("SELECT COUNT(*) FROM ".$rankstable);
while ($record2=mysql_fetch_array($result2)){
$itemCount=$record2[0];
}
//here we go ballistic on crappy code
$totalrank="<TABLE Cellpadding=0 bgcolor=000000 cellspacing=1 BORDER=0 width=95%%>";
//get the ranking
$result3 = mysql_query("SELECT * FROM ".$rankstable." ORDER BY ".$sortorder." DESC LIMIT ".$pageBegin.", ".$showamount);
$userRankNumber=$pageBegin+1;
while ($record3=mysql_fetch_array($result3)){
$date=$record3['date'];
$year = substr($date,0,2);
$month = substr($date,2,2);
$day = substr($date,4,2);
$hour = substr($date,6,2);
$minute = substr($date,8,2);
$year = "20".$year;
$time=$hour.":".$minute." ".$day."-".$month."-".$year;
$rankeduser="<td align=left bgcolor=222222 width=30>".$fonttinywhite."".$userRankNumber. "</td>";
$rankeduser=$rankeduser."<td align=left bgcolor=222222>".$fonttinywhite."".$record3['name']."</td>";
$rankeduser=$rankeduser."<td align=right bgcolor=222222 width=50>".$fonttinywhite."".$record3['kills']."</td>";
$rankeduser=$rankeduser."<td align=right bgcolor=222222 width=50>".$fonttinywhite."".$record3['headshots']."</td>";
$rankeduser=$rankeduser."<td align=right bgcolor=222222 width=50>".$fonttinywhite."".$record3['deaths']."</td>";
$rankeduser=$rankeduser."<td align=right bgcolor=222222 width=50>".$fonttinywhite."".$record3['score']."</td>";
$rankeduser=$rankeduser."<td align=right bgcolor=222222 width=70>".$fonttinywhite."".$record3['efficiency']."%</td>";
$rankeduser=$rankeduser."<td align=right bgcolor=222222 width=70>".$fonttinywhite."".$record3['accuracy']."%</td>";
$rankeduser=$rankeduser."<td align=right bgcolor=222222 width=70>".$fonttinywhite."".$record3['accuracyHS']."%</td>";
$rankeduser=$rankeduser."<td align=right bgcolor=222222 width=120>".$fonttinywhite."".$time."</td></tr>";
$userRankNumber++;
$totalrank=$totalrank.$rankeduser;
}
$totalrank=$totalrank."</table>";
//page controlling
//if ($page > 0)$pageDown=$page-1;
//else $pageDown=$page;
//if ($page < ($itemCount/$showamount)-1) $pageUp=$page+1;
//else $pageUp=$page;
if ($page == 0) {
$pageDown = 0;
} else {
$pageDown = $page-1;
}
$pageUp = $page+1;

if ($_GET['type'] == "sqlstatstable") {
$ttext = "Current";
} elseif ($_GET['type'] == "") {
$ttext = "Current";
} elseif ($_GET['type'] == "weektable") {
$ttext = "Weekly";
} elseif ($_GET['type'] == "monthtable") {
$ttext = "Monthy";
} elseif ($_GET['type'] == "yeartable") {
$ttext = "Yearly";
} elseif ($_GET['type'] == "15daytable") {
$ttext = "Daily top 15";
} elseif ($_GET['type'] == "15weektable") {
$ttext = "Weekly top 15";
} elseif ($_GET['type'] == "15monthtable") {
$ttext = "Monthly top 15";
} elseif ($_GET['type'] == "15yeartable") {
$ttext = "Yearly top 15";
}

$navigationlink1="".$fonttiny."<< back";
$pager = $page+1;
$navigationlink2=$fonttiny.$ttext." rank by ".$sortorder." - page ".$pager;
$navigationlink3="".$fonttiny."next >>";
$navigation="<table width='95%'><tr><td align='left'>".$navigationlink1."</td><td align='center'>".$navigationlink2."</td><td align='right'>".$navigationlink3."</td></tr></table>
";
$sortbar="<TABLE Cellpadding=0 bgcolor=000000 cellspacing=0 BORDER=0 width=95%%><tr>";
$sortlinkRank="".$fonttiny."rank";
$sortlinkName="".$fonttiny."name";
$sortlinkheadshots="".$fonttiny."headshots";
$sortlinkScore="".$fonttiny."score";
$sortlinkKills="".$fonttiny."kills";
$sortlinkDeaths="".$fonttiny."deaths";
$sortlinkEff="".$fonttiny."eff.";
$sortlinkShots="".$fonttiny."acc.";
$sortlinkHS="".$fonttiny."acc. hs";
$sortlinkUpdated="".$fonttiny."updated";
$sortbar=$sortbar."<td align=left height=15>".$sortlinkRank."</td>";
$sortbar=$sortbar."<td align=right height=15 width=60>".$sortlinkKills."</td>";
$sortbar=$sortbar."<td align=right height=15 width=70>".$sortlinkheadshots."</td>";
$sortbar=$sortbar."<td align=right height=15 width=50>".$sortlinkDeaths."</td>";
$sortbar=$sortbar."<td align=right height=15 width=60>".$sortlinkScore."</td>";
$sortbar=$sortbar."<td align=right height=15 width=70>".$sortlinkEff."</td>";
$sortbar=$sortbar."<td align=right height=15 width=70>".$sortlinkShots."</td>";
$sortbar=$sortbar."<td align=right height=15 width=70>".$sortlinkHS."</td>";
$sortbar=$sortbar."<td align=right height=15 width=120>".$sortlinkUpdated."</td>";


mysql_close($conn);

$statslink = "Current";
$weeklink = "Weekly";
$monthlink = "Monthly";
$yearlink = "Yearly";
$tdaylink = "Daily top 15";
$tweeklink = "Weekly top 15";
$tmonthlink = "Monthly top 15";
$tyearlink = "Yearly top 15";

$type = "<font size='-1'>".$statslink."".$weeklink."".$monthlink."" .$yearlink."".$tdaylink."".$tweeklink."".$tmo nthlink."".$tyearlink."</font>";

$title2 = "<font color='white'><h2><u>".$title."</font></h2></u>";

if ($_GET['type'] == "statstable") {
$ftext = "Stats are updated every map change, and dumped into the weekly stats every day";
} elseif ($_GET['type'] == "") {
$ftext = "Stats are updated every map change, and dumped into the weekly stats every day";
} elseif ($_GET['type'] == "weektable") {
$ftext = "Weekly stats are updated every day, and dumped into the monthly stats every week";
} elseif ($_GET['type'] == "monthtable") {
$ftext = "Monthy stats are updated every month and dumped into the yearlyly stats every week";
} elseif ($_GET['type'] == "yeartable") {
$ftext = "Yearly stats are updated every year and dumped every year";
} elseif ($_GET['type'] == "15daytable") {
$ftext = "Daily top 15 stats are updated every map change";
} elseif ($_GET['type'] == "15weektable") {
$ftext = "Weekly top 15 stats are updated every week";
} elseif ($_GET['type'] == "15monthtable") {
$ftext = "Monthly top 15 stats are updated every month";
} elseif ($_GET['type'] == "15yeartable") {
$ftext = "Yearly top 15 stats are updated every year";
}

$footer = "
<font color='white' size='-3'>".$ftext."</font>
";

if ($userRankNumber == 1) {
$totalrank2 = "<TABLE Cellpadding=0 bgcolor=000000 cellspacing=1 BORDER=0 width=95%%><td align=left bgcolor=222222 width=30><center>".$fonttinywhite."Empty</center></td></table>";
} else {
$totalrank2 = $totalrank;
}

echo $type.$title2.$navigation.$sortbar.$totalrank 2.$footer;
?>
</center>
</font>
</body>
</html>
/////////////////////////////////////////////////////////////////////////////
Really nice

http://makro.servebeer.com/Security/pn770/cs-s.html
http://1q.sytes.net CS Server
#sincerely. . . MicroMy's Kaoz server

Last edited by micromy; 08-30-2006 at 11:41.
micromy is offline
NiGHTFiRE
Senior Member
Join Date: Dec 2004
Location: Sweden
Old 09-24-2006 , 12:26   Re: sqlstats
Reply With Quote #95

Hello,
I know this thread has been dead for sometime but I've got a question but I haven't looked through all 7 pages so I don't know if it's been answered.
Does these stats show up when you write /rank in the chat?
Thanks,
David
NiGHTFiRE is offline
Send a message via AIM to NiGHTFiRE Send a message via MSN to NiGHTFiRE
NiGHTFiRE
Senior Member
Join Date: Dec 2004
Location: Sweden
Old 09-26-2006 , 14:50   Re: sqlstats
Reply With Quote #96

Hey,
Getting an error when using:
L 09/26/2006 - 20:50:45: [AMXX] Displaying debug trace (plugin "sqlstats.amxx")
L 09/26/2006 - 20:50:45: [AMXX] Run time error 11: divide
L 09/26/2006 - 20:50:45: [AMXX] [0] phptGHCJB.sma::gets_user_stats (line 390)
L 09/26/2006 - 20:50:45: [AMXX] [1] phptGHCJB.sma::client_disconnect (line 291)
L 09/26/2006 - 20:50:45: [sqlstats.amxx] [sqlStats] Saving 2 Players
L 09/26/2006 - 20:50:46: [MySQL] Invalid DBI result handle -1
L 09/26/2006 - 20:50:46: [AMXX] Displaying debug trace (plugin "sqlstats.amxx")
L 09/26/2006 - 20:50:46: [AMXX] Run time error 10: native error (native "dbi_nextrow")
L 09/26/2006 - 20:50:46: [AMXX] [0] phptGHCJB.sma::remove_bannedids (line 545)
L 09/26/2006 - 20:50:46: [AMXX] [1] phptGHCJB.sma::plugin_end (line 231)
NiGHTFiRE is offline
Send a message via AIM to NiGHTFiRE Send a message via MSN to NiGHTFiRE
#Reaper
Junior Member
Join Date: Mar 2006
Old 01-03-2007 , 06:59   Re: sqlstats
Reply With Quote #97

i also get this Error:

L 01/03/2007 - 11:56:08: [MySQL] Invalid DBI result handle -1
L 01/03/2007 - 11:56:08: [AMXX] Displaying debug trace (plugin "sqlstats.amxx")
L 01/03/2007 - 11:56:08: [AMXX] Run time error 10: native error (native "dbi_nextrow")
L 01/03/2007 - 11:56:08: [AMXX] [0] 2232.attach::remove_bannedids (line 545)
L 01/03/2007 - 11:56:08: [AMXX] [1] 2232.attach::plugin_end (line 231)


but it's the first one ;) (i hope its the last)
__________________
#Reaper is offline
Send a message via ICQ to #Reaper
#Reaper
Junior Member
Join Date: Mar 2006
Old 01-03-2007 , 07:02   Re: sqlstats
Reply With Quote #98

sry for doublepost, but where is the edit button?! (btw: lol, now its there o_O)

ok, there is the error again, but i think its because only 1 people are in the list..

its a realy nice plugin
__________________

Last edited by #Reaper; 01-03-2007 at 10:53.
#Reaper is offline
Send a message via ICQ to #Reaper
raa
Senior Member
Join Date: Oct 2005
Old 01-03-2007 , 22:52   Re: sqlstats
Reply With Quote #99

I am getting that error too. This plugin is pretty much abandoned though. I've been reading whatever info I can to try and fix it. Haven't found anything yet.

Maybe some other coders who know what the hell they are doing could comment?
raa is offline
#Reaper
Junior Member
Join Date: Mar 2006
Old 01-09-2007 , 15:54   Re: sqlstats
Reply With Quote #100

mm.. allways the same, also if there are more than 1 player in the database
__________________
#Reaper is offline
Send a message via ICQ to #Reaper
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode