Topgames
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

[Tuto|Site] Mostrando a Bandeira da Guild No Site

Ir para baixo

[Tuto|Site] Mostrando a Bandeira da Guild No Site Empty [Tuto|Site] Mostrando a Bandeira da Guild No Site

Mensagem  Admin Seg Set 29, 2008 5:44 am

Olá Galera.

Estou aqui de Novo Trazendo um Novo Tuto que eu nao vir aqui no Forum

Como colocar a Bandeira da Guild No Site Vamos ao Trabalho e esperem que Gostem ^^

1º Passo.

Crie um Php com nome guilds.php

guilds.php

CÓDIGO
<?PHP include("config.php");
require_once "sql_inject.php";
$bDestroy_session = TRUE;
$url_redirect = 'index.php';
$sqlinject = new sql_inject('log_file_sql.log',$bDestroy_session,$url_redirect);

$sqlinject->test($msquery);

$query = 'SELECT TOP 50 * from guild order by G_score desc';
$result = mssql_query($query);
$gmark = 'SELECT G_Mark from guild order by G_score desc';
$gresult = mssql_query($gmark);
echo '
<tr>
<td>Rank</td>
<td>Nome</td>
<td>Pontos</td>
<td>Guild Master</td>
<td>Membros</td>
<td>Logo</td>
</tr>

';
for($i=0;$i < mssql_num_rows($result);++$i)
{
$row = mssql_fetch_row($result);
$mark = mssql_fetch_row($gresult);
$rank = $i+1;
$query2= "SELECT count(*) from GuildMember where G_name='$row[0]'";
$result2 = mssql_query($query2);
$row2 = mssql_fetch_row($result2);
$logo = urlencode(bin2hex($mark [0]));
echo "
<td valign=top align=center>$rank.</td>
<td valign=top align=center>$row[0]</td>
<td valign=top align=center>$row[2]</td>
<td valign=top align=center>$row[3]</td>
<td valign=top align=center>$row2[0]</td>
<td valign=top align=center><img src='decode.php?decode=$logo' height=40 width=40></td>
</tr>
";
}
?>


agora crie o php decode.php

decode.php

CÓDIGO
<?php

function hex2bin ($RawInput)
{
$BinStr = '';
for ($i = 0; $i < strlen ($RawInput); $i += 2)
$BinStr .= '%'.substr ($RawInput, $i, 2);

return rawurldecode ($BinStr);
}

function binhex($bin) {
$hex = dechex(bindec($bin));
return $hex;
}

$size = 40;
$pixelSize=$size/8;
$hex = $_GET['decode'];
function color($mark) {
if($mark == 0){$color = "#ffffff";}
if($mark == 1){$color = "#000000";}
if($mark == 2){$color = "#8c8a8d";}
if($mark == 3){$color = "#ffffff";}
if($mark == 4){$color = "#fe0000";}
if($mark == 5){$color = "#ff8a00";}
if($mark == 6){$color = "#ffff00";}
if($mark == 7){$color = "#8cff01";}
if($mark == Cool{$color = "#00ff00";}
if($mark == 9){$color = "#01ff8d";}
if($mark == 'a'){$color = "#00ffff";}
if($mark == 'b'){$color = "#008aff";}
if($mark == 'c'){$color = "#0000fe";}
if($mark == 'd'){$color = "#8c00ff";}
if($mark == 'e'){$color = "#ff00fe";}
if($mark == 'f'){$color = "#ff008c";}
return $color;
}
for ($y=0;$y<8;$y++){
for ($x=0;$x<8;$x++){
$offset=($y*Cool+$x;
$Cuadrilla8x8[$y][$x]=substr($hex, $offset, 1);
}
}
$SuperCuadrilla=array();
for ($y=1; $y<=8; $y++) {
for ($x=1;$x<=8;$x++){
$bit=$Cuadrilla8x8[$y-1][$x-1];
for ($repiteY=0; $repiteY<$pixelSize; $repiteY++) {
for ($repite=0; $repite<$pixelSize; $repite++) {
$translatedY=((($y-1)*$pixelSize)+$repiteY);
$translatedX=((($x-1)*$pixelSize)+$repite);
$SuperCuadrilla[$translatedY][$translatedX]=$bit;
}
}
}
}
$img=ImageCreate($size,$size);
for ($y=0;$y<$size;$y++) {
for ($x=0;$x<$size;$x++) {
$bit=$SuperCuadrilla[$y][$x];
$color=substr(color($bit),1);
$r=substr($color,0,2);
$g=substr($color,2,2);
$b=substr($color,4,2);
$superPixel=ImageCreate(1,1);
$cl=imageColorAllocateAlpha($superPixel,hexdec($r),hexdec($g),hexdec($b),0);
ImageFilledRectangle($superPixel,0,0,1,1,$cl);
ImageCopy($img,$superPixel,$x,$y,0,0,1,1);
ImageDestroy($superPixel);
}
}
header("Content-type: image/jpeg");
ImageRectangle($img,0,0,$size-1,$size-1,ImageColorAllocate($img,0,0,0));
imagecolortransparent($img, 'FFFFFF');
ImageGif($img);
header('Content-type: image/bmp');
echo urldecode(hex2bin($_GET['decode']));
?>


E so Prontinho ja esta Pronto sua Guild Com bandeira para Mostra no site Basta vc colcar esse codigo no seu site.

CÓDIGO
<?
$query = 'SELECT TOP 5 * from guild order by G_score desc';
$result = mssql_query($query);
$gmark = 'SELECT G_Mark from guild order by G_score desc';
$gresult = mssql_query($gmark);
for($i=0;$i < mssql_num_rows($result);++$i)
{
$row = mssql_fetch_row($result);
$mark = mssql_fetch_row($gresult);
$rank = $i+1;
$query2= "Select count(*) from GuildMember where G_name='$row[0]'";
$result2 = mssql_query($query2);
$row2 = mssql_fetch_row($result2);
$logo = urlencode(bin2hex($mark [0]));
echo "<table width='93%' border='0' align='center' cellpadding='2' cellspacing='0'>
<tr>
<td><div align='center'><font color='#000000'>$rank</font></div></td>
<td><div align='center'><font color='#000000'>$row[0]</font></div></td>
<td><div align='center'><img src='decode.php?decode=$logo' height=20 width=20></div></td>
</tr>
</table>";
}
?>


Coloque esse codigo e Pornto ja vai esta Mostrando sua Guild Completinha Ok

Espero que Gostem e Descupa os erros de escrita Ok ^^

Admin
Admin

Mensagens : 97
Data de inscrição : 28/09/2008

https://topgames.canadian-forum.com

Ir para o topo Ir para baixo

Ir para o topo

- Tópicos semelhantes

 
Permissões neste sub-fórum
Não podes responder a tópicos