by Dakin Quelia » Sun Jan 13, 2008 5:35 pm
Tu veux le code de la page php de la barre?
Le voici:
Code: Select all
<?php
header ("Content-type: image/png");
$percent = 0;
if (isset($_GET['p']))
{
$percent = $_GET['p'];
$perx = $percent + 3;
}
else
{
$percent = 0;
}
$percent = str_replace(' ', '', $percent);
$percent = round($percent);
if ($percent >= 100)
{
$percent = 100;
$perx = 179;
}
elseif ($percent < 1)
{
$percent = 0;
$perx = 190;
}
elseif ($percent < 10)
{
$perx = 190;
}
else
{
$perx = 185;
}
$text = '';
if (isset($_GET['t']))
{
$text = $_GET['t'];
}
if (strlen($text) > 34)
{
$text = substr($text, 0, 34);
}
$r = 255-(.83*$percent);
$g = 63+(1.92*$percent);
$b = 66-(.03*$percent);
$img = imagecreatetruecolor(202, 10);
$bg = imagecolorallocate($img, 100, 100, 100);
$fg = imagecolorallocate($img, 255, 255, 255);
$pg = imagecolorallocate($img, $r, $g, $b);
imagefilledrectangle($img, 0, 0, 202, 10, $bg);
imagefilledrectangle($img, 1, 1, 200, 8, $fg);
if ($percent != 0)
{
imagefilledrectangle($img, 1, 1, $percent*2, 8, $pg);
}
imagestring($img, 1, 2, 1, $text, $bg);
imagestring($img, 1, $perx, 1, $percent.'%', $bg);
imagepng($img);
imagedestroy($img);
?>
Une fois la page crée, il faut l'uploader!
Dans l'adresse, il faut faire ceci:
http://www.tonsite.com/pbart.php?p=10&t=Administration
Balise:
Code: Select all
[Progression={NUMBER}]{TEXT}[/Progression]
Remplacement HTML:
Code: Select all
<img src="http://tonadresse.com/pbart.php?p={NUMBER}&t={TEXT}" alt="{NUMBER}%" />
Tu veux le code de la page php de la barre?
Le voici:
[code=php]
<?php
header ("Content-type: image/png");
$percent = 0;
if (isset($_GET['p']))
{
$percent = $_GET['p'];
$perx = $percent + 3;
}
else
{
$percent = 0;
}
$percent = str_replace(' ', '', $percent);
$percent = round($percent);
if ($percent >= 100)
{
$percent = 100;
$perx = 179;
}
elseif ($percent < 1)
{
$percent = 0;
$perx = 190;
}
elseif ($percent < 10)
{
$perx = 190;
}
else
{
$perx = 185;
}
$text = '';
if (isset($_GET['t']))
{
$text = $_GET['t'];
}
if (strlen($text) > 34)
{
$text = substr($text, 0, 34);
}
$r = 255-(.83*$percent);
$g = 63+(1.92*$percent);
$b = 66-(.03*$percent);
$img = imagecreatetruecolor(202, 10);
$bg = imagecolorallocate($img, 100, 100, 100);
$fg = imagecolorallocate($img, 255, 255, 255);
$pg = imagecolorallocate($img, $r, $g, $b);
imagefilledrectangle($img, 0, 0, 202, 10, $bg);
imagefilledrectangle($img, 1, 1, 200, 8, $fg);
if ($percent != 0)
{
imagefilledrectangle($img, 1, 1, $percent*2, 8, $pg);
}
imagestring($img, 1, 2, 1, $text, $bg);
imagestring($img, 1, $perx, 1, $percent.'%', $bg);
imagepng($img);
imagedestroy($img);
?>
[/code]
Une fois la page crée, il faut l'uploader!
Dans l'adresse, il faut faire ceci: http://www.tonsite.com/pbart.php?p=10&t=Administration
Balise:
[code][Progression={NUMBER}]{TEXT}[/Progression][/code]
Remplacement HTML:
[code=php]<img src="http://tonadresse.com/pbart.php?p={NUMBER}&t={TEXT}" alt="{NUMBER}%" /> [/code]