d2jsp
Log InRegister
d2jsp Forums > d2jsp > Ladder Slasher > Guide: How-to Make A Dynamic Ladder-slasher Sig > In A Few Easy Steps With Pics
Prev18910111260Next
Add Reply New Topic New Poll
Member
Posts: 5,009
Joined: Jan 10 2006
Gold: 1,013.50
Sep 22 2008 12:15am
how can i make my lil ls sig smaller to be the same length as my bigger signature?
Member
Posts: 10,824
Joined: Feb 11 2005
Gold: 8,603.39
Sep 22 2008 12:32am
Quote (buddywiser15 @ Sun, Sep 21 2008, 11:15pm)
how can i make my lil ls sig smaller to be the same length as my bigger signature?


make a background picture with the same length as ur sig which is 350px then you go to the codes in .php and change it to fit your new lil banner
Member
Posts: 5,009
Joined: Jan 10 2006
Gold: 1,013.50
Sep 22 2008 12:47am
Quote (Spartan)aS( @ Mon, Sep 22 2008, 01:32am)
make a background picture with the same length as ur sig which is 350px then you go to the codes in .php and change it to fit your new lil banner


exactly which codes are those? i made the background pic. smaller, but then it won't show "to lvl up:" i looked at all the codes yet i can't figure out which one it is...

<?php
Header ('Content-type: image/jpeg');
Header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
Header('Expires: Thu, 19 Nov 1981 08:52:00 GMT');
Header('Pragma: no-cache');

// create the image from a background jpg
$image = imagecreatefrompng('bg.png');

$expbar_width = 60;
$expbar_height = 5;

// set some colours for future use
$white = imagecolorallocate($image, 255, 255, 255);
$green1 = imagecolorallocate($image, 0, 240, 0);
$green2 = imagecolorallocate($image, 0, 220, 0);
$green3 = imagecolorallocate($image, 0, 200, 0);
$red = imagecolorallocate($image, 0, 180, 0);
$yellow = imagecolorallocate($image, 255, 181, 53);

// set the background colour
// number or is top left pixel x, top left pixel y, bottom right pixel x, bottom right pixel y

// set the font and print text
$font = 'Arial';
$font2 = '/MTCORSVA.TTF';

// Create an array for determining the class you play.
// In the XML this is saved as an int number, the conversion is shown below.
$class_name = array( -1 => 'None',
0 => 'Fighter',
1 => 'Barbarian',
2 => 'Rogue',
3 => 'Magician',
4 => 'Guardian',
5 => 'Samurai',
6 => 'Paladin',
7 => 'Monk',
8 => 'Ninja',
9 => 'Warlock',
10 => 'Headhunter',
11=> 'Alchemist');

// load xml data in vars

// This is where you load your own info from the xml d2jsp gives. This is a PHP5 only command!
$data = simplexml_load_file('http://ladderslasher.d2jsp.org/xmlChar.php?i=156032');
$name = $data->name;
$kills = $data->kills;
$class = $class_name[(int)$data->classid];
$exp = $data->exp;
$level = $data->level;
$hpmax = $data->hpmax;
$mqpasses = $data->mqpasses;
$mqattempts = $data->mqattempts;
$exp = (int)$exp;
$percent = calcExpPercent($exp);
$brpixelX = calcBrPixelX($exp,$expbar_width);

// Create an expbar with bg 'cool' color and the cover of your level in red.
//Example ; imagefilledrectangle(image, x1, y1, x2, y2, color);

ImageTTFText ($image, 11, 0, 5, 16, $white, $font2, "Ladder Slasher");

ImageTTFText ($image, 7, 0, 337, 11, $white, $font, "To level up:");

imagefilledrectangle($image, 330, 15, 390, 19, $white);
imagefilledrectangle($image, 330, 15, 330 + $brpixelX, 16, $green1);
imagefilledrectangle($image, 330, 16, 330 + $brpixelX, 17, $green2);
imagefilledrectangle($image, 330, 17, 330 + $brpixelX, 18, $green3);
imagefilledrectangle($image, 330, 18, 330 + $brpixelX, 19, $green4);

/******************************************************
* TEXT PART *
******************************************************/

//Example ; ImageTTFText ($image, textsize, angle, left, top, color, font, "text");

//show name
ImageTTFText ($image, 7, 0, 100, 10, $yellow, $font, "Name: ");
ImageTTFText ($image, 7, 0, 130, 10, $white, $font, $name);

//show class
ImageTTFText ($image, 7, 0, 100, 21, $yellow, $font, "Class: ");
ImageTTFText ($image, 7, 0, 130, 21, $white, $font, $class);

// show lvl
ImageTTFText ($image, 7, 0, 180, 10, $yellow, $font, "Level: ");
ImageTTFText ($image, 7, 0, 210, 10, $white, $font, $level);

// show kills
ImageTTFText ($image, 7, 0, 180, 21, $yellow, $font, "Kills: ");
ImageTTFText ($image, 7, 0, 210, 21, $white, $font, $kills);

// Show MQ attempts
ImageTTFText ($image, 7, 0, 250, 10, $yellow, $font, "MQ attempts: ");
ImageTTFText ($image, 7, 0, 315, 10, $white, $font, $mqattempts);

// Show MQ passed
ImageTTFText ($image, 7, 0, 250, 21, $yellow, $font, "MQ passes: ");
ImageTTFText ($image, 7, 0, 315, 21, $white, $font, $mqpasses);

// output and destroy
imagepng($image);
imagedestroy($image);

/***
* calculate the exp bar width.
***/
function calcBrPixelX($input,$xpbar_width)
{
$temp1 = fmod($input,1000000);
$temp1 = ($temp1/1000000);
$temp1 = $temp1 * $xpbar_width;

return (int)$temp1;
}

/***
* Calculate the percentage of level done
***/
function calcExpPercent($input)
{
$temp1 = fmod($input,1000000);
$temp1 = ($temp1/1000000);
$temp1 = $temp1 * 100;

return (int)$temp1;
}

?>
Banned
Posts: 5,906
Joined: Oct 30 2007
Gold: 9.53
Warn: 10%
Sep 22 2008 12:51am
Question:

Can someone with no experience learn how to do these from reading this, or do you have to know a bit?

If not, I'll look it over tomorrow and give it a shot.
Member
Posts: 22,875
Joined: Apr 7 2006
Gold: 1,250.46
Sep 22 2008 12:53am
Quote (Crazy_Mizfit @ Mon, Sep 22 2008, 02:51am)
Question:

Can someone with no experience learn how to do these from reading this, or do you have to know a bit?

If not, I'll look it over tomorrow and give it a shot.


everything is there
you can do a lot with the info provided here
and once you understand what it means, its easy to customize
Member
Posts: 1,523
Joined: Aug 6 2008
Gold: 213.03
Sep 22 2008 06:55am
another useful guide looking forward to trying this out biggrin.gif

thx
Paladin tongue.gif
Member
Posts: 324
Joined: Apr 21 2008
Gold: Locked
Sep 23 2008 12:41pm
I tried it out and uploaded it, but it doesn't show anything sad.gif
must have done something wrong...

Member
Posts: 1,084
Joined: Jul 21 2004
Gold: 49.26
Sep 24 2008 09:04am
hi there which parameter do i have to change to "move" the exp bar up and left from the original ?
Member
Posts: 1,084
Joined: Jul 21 2004
Gold: 49.26
Sep 24 2008 10:37am
Quote (fastjack99 @ Wed, 24 Sep 2008, 17:04)
hi there which parameter do i have to change to "move" the exp bar up and left from the original ?


got it. read in the php-api.
Member
Posts: 15,893
Joined: Sep 16 2007
Gold: 12,025.00
Sep 25 2008 03:56am
if i follow ur guide following problem appears:

when i copy .htaccess into my folder it disappears and cause a internal server error 505

any idea how to fix it?
Go Back To Ladder Slasher Topic List
Prev18910111260Next
Add Reply New Topic New Poll