web script : top25 GRB

07/15/2011 22:56 bulgaria#1
Hi guys , dont like to speek more that case in need of that.
Just use copy/paste !



PHP Code:
<?php
$server 
'127.0.0.1';
$dbuser 'Shaiya';
$dbpass 'Shaiya123';
$count=1;


$conn mssql_connect($server$dbuser$dbpass)
  or die(
"Couldn't connect to SQL Server on $myServer");
  
$query "SELECT top 25* FROM PS_GameData.dbo.Guilds ORDER BY GuildPoint desc";

$result mssql_query($query);

echo 
"<html><head><STYLE TYPE=\"text/css\">
<!--
td { background:url(image.png) no-repeat; }
td.i0{ background-position: 0 0; width: 28px; height: 16px; } 
td.i1{ background-position: 0 -26px; width: 28px; height: 16px; } 
td.i2{ background-position: 0 -52px; width: 28px; height: 16px; } 
td.i3{ background-position: 0 -78px; width: 29px; height: 16px; } 
td.i4{ background-position: 0 -104px; width: 29px; height: 15px; } 
td.i5{ background-position: 0 -129px; width: 28px; height: 18px; } 
td.i6{ background-position: 0 -157px; width: 30px; height: 17px; } 
td.i7{ background-position: 0 -184px; width: 29px; height: 17px; } 
td.i8{ background-position: 0 -211px; width: 28px; height: 16px; } 
td.i9{ background-position: 0 -237px; width: 28px; height: 18px; } 
td.i10{ background-position: 0 -265px; width: 29px; height: 18px; } 
td.i11{ background-position: 0 -293px; width: 29px; height: 24px; } 
td.i12{ background-position: 0 -327px; width: 29px; height: 18px; } 
td.i13{ background-position: 0 -355px; width: 29px; height: 18px; } 
td.i14{ background-position: 0 -383px; width: 29px; height: 18px; } 
td.i15{ background-position: 0 -411px; width: 29px; height: 18px; } 
td.i16{ background-position: 0 -439px; width: 29px; height: 18px; } 
td.i17{ background-position: 0 -467px; width: 24px; height: 24px; } 
td.i18{ background-position: 0 -501px; width: 24px; height: 24px; } 
td.i19{ background-position: 0 -535px; width: 24px; height: 24px; } 
td.i20{ background-position: 0 -569px; width: 24px; height: 24px; } 
td.i21{ background-position: 0 -603px; width: 24px; height: 24px; } 
td.i22{ background-position: 0 -637px; width: 24px; height: 24px; } 
</STYLE>
<title>GRB top25</title></head>"
;
echo 
"<body><center>
      <table cellspacing=10 cellpadding=0 border=0 bgcolor=\"black\">
      <td style=\"color:#FC9700\" bgcolor=\"black\">Rank</td>
      <td style=\"color:#FC9700\" bgcolor=\"black\">Guild Name</td>
      <td style=\"color:#FC9700\" bgcolor=\"black\">GRB Point</td>
      <td style=\"color:#FC9700\" bgcolor=\"black\">Faction"
;
      

while(
$row mssql_fetch_array($result))
{    
  if(
$row[6] === 1)
    
$fact"UOF";
  else 
$fact"AOL"
  echo 
"<tr style=\"color:white\">";
  echo 
"<td> $count</td><td>"$row[2]  ."</td><td>"$row[8] ."</td><td>  $fact</td><td>";
  echo 
"</tr>";
  
$count++;
}
echo 
"</table>";
echo 
"</html>";

mssql_close($conn);
?>


Hope that script will be helpfull !
[GM]Joker
07/15/2011 23:16 Bаne#2
server = '127.0.0.1';
$dbuser = 'Shaiya';
$dbpass = 'Shaiya123';
$count=1;

That will need to be relapsed with your server info...lol
07/16/2011 00:04 bulgaria#3
:) sure

$server = '127.0.0.1';
$dbuser = 'Shaiya';
$dbpass = 'Shaiya123';

only :)
07/16/2011 03:23 sondo81#4
um, what is that which is a nice request I want to f*** you or you just want to attract the newcomers to post their ip?


sry for that meaning.
07/16/2011 03:34 Bаne#5
Quote:
Originally Posted by sondo81 View Post
um, what is that which is a nice request I want to f*** you or you just want to attract the newcomers to post their ip?


sry for that meaning.
You missed the entire point, that's a PhP script, the player has to replace there DB information with the top part for it to work, then they load it into a web server...They never have to publicy post there IP.
07/16/2011 03:52 sondo81#6
I've already noticed that this is a php script but I know him to ask the user here ... I've used it is not ***** but still does not work ... and I see no real use in this script except raise questions
07/16/2011 03:59 Bаne#7
Quote:
Originally Posted by sondo81 View Post
I've already noticed that this is a php script but I know him to ask the user here ... I've used it is not ***** but still does not work ... and I see no real use in this script except raise questions
He never asked for anything, and it's just a harmless script, I checked it..
07/16/2011 04:07 sondo81#8
ok super mega boss to see only the last one to post the mod here cares brimgt jump to my heart.

in deutsch : alein zu sehen das es hier endlich einen mod gibt der auch aufpasst lässt mein herz höher schlagen!
07/16/2011 07:21 RebeccaBlack#9
Err, I wrote this for someone who requested on skype. It's a bit different to yours o.O

MSSQL function based:
PHP Code:
<?php
//Connection configuration
$Host '127.0.0.1';
$User 'Shaiya';
$Password 'Shaiya123';
$conn mssql_connect($Host,$User,$Password);

//Do not edit below this line unless you know what you're doing
$Rank=$Light=$Fury=1;
$Faction = array (0=>'Alliance',1=>'Fury');
$result mssql_query("SELECT TOP 25* FROM PS_GameData.dbo.Guilds WHERE Del=0 ORDER BY GuildPoint DESC");

echo 
"<table border=1>";
echo 
"<tr><th>Rank</th>
        <th>Guild Name</th>
        <th>Members</th>
        <th>Leader</th>
        <th>Faction</th>
        <th>Faction Rank</th>
        <th>Points</th></tr>"
;

while(
$row mssql_fetch_array($result))
{
  echo 
"<tr>";
  echo 
"<td>".$Rank."</td>";
  echo 
"<td>".$row['GuildName']."</td>";
  echo 
"<td>".$row['TotalCount']."</td>";
  echo 
"<td>".$row['MasterName']."</td>";
if(
$row['Country']==0){
  echo 
"<td>".$Faction[$row['Country']]. "</td>";
  echo 
"<td>".$Light."</td>";
}else{
  echo 
"<td>".$Faction[$row['Country']]. "</td>";
  echo 
"<td>".$Fury."</td>";
}
  echo 
"<td>".$row['GuildPoint']."</td>";
  echo 
"</tr>";
switch(
$row['Country']){
case 
0$Light++;break;
case 
1$Fury++;break;
}
  
$Rank++;
}
echo 
"</table>";
?>
ODBC Function based:
PHP Code:
<?php
//Connection configuration
$Host '127.0.0.1';
$User 'Shaiya';
$Password 'Shaiya123';
$conn odbc_connect("Driver={SQL Server};Server=$Host"$User$Password);

//Do not edit below this line unless you know what you're doing
$Rank=$Light=$Fury=1;
$Faction = array (0=>'Alliance',1=>'Fury');
$result odbc_exec($conn,"SELECT TOP 25* FROM PS_GameData.dbo.Guilds WHERE Del=0 ORDER BY GuildPoint DESC");

echo 
"<table border=1>";
echo 
"<tr><th>Rank</th>
        <th>Guild Name</th>
        <th>Members</th>
        <th>Leader</th>
        <th>Faction</th>
        <th>Faction Rank</th>
        <th>Points</th></tr>"
;

while(
$row odbc_fetch_array($result))
{
  echo 
"<tr>";
  echo 
"<td>".$Rank."</td>";
  echo 
"<td>".$row['GuildName']."</td>";
  echo 
"<td>".$row['TotalCount']."</td>";
  echo 
"<td>".$row['MasterName']."</td>";
if(
$row['Country']==0){
  echo 
"<td>".$Faction[$row['Country']]. "</td>";
  echo 
"<td>".$Light."</td>";
}else{
  echo 
"<td>".$Faction[$row['Country']]. "</td>";
  echo 
"<td>".$Fury."</td>";
}
  echo 
"<td>".$row['GuildPoint']."</td>";
  echo 
"</tr>";
switch(
$row['Country']){
case 
0$Light++;break;
case 
1$Fury++;break;
}
  
$Rank++;
}
echo 
"</table>";
?>
07/17/2011 07:47 zargon05#10
In your script on the die statement for mssql_connect, There is no $myServer variable.