d2jsp
Log InRegister
d2jsp Forums > d2jsp > Ladder Slasher > Guide: How-to Make A Dynamic Ladder-slasher Sig > In A Few Easy Steps With Pics
Prev1495051525360Next
Add Reply New Topic New Poll
Member
Posts: 14,202
Joined: May 14 2008
Gold: 2.85
Jul 22 2009 07:40am
Quote (Homero @ Wed, 22 Jul 2009, 16:40)
Why don't you use the new LS sig creator, it's simple:

http://forums.d2jsp.org/index.php?showtopic=33266382&f=272&st=0


what is this ?
Member
Posts: 4,921
Joined: Mar 25 2008
Gold: 1.02
Jul 22 2009 09:02am
Quote (Konqk @ Wed, 22 Jul 2009, 15:40)
what is this ?


a program so people like you can make a dynamic sig :)
Member
Posts: 26,026
Joined: Jun 13 2007
Gold: 23.70
Jul 23 2009 09:23pm
Can somebody tell me what I did wrong? This is what I have right now

http://pu3ska.freehostia.com/

Why Does it goes to my INDEX OF?

This is what my File manager Look like:



I upload all the folder under the Sub-domain.

When I also take out the Last extension of the folder it gave me another error which read as:

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, support@freehostia.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

This post was edited by pu3ska on Jul 23 2009 09:42pm
Member
Posts: 4,154
Joined: Mar 16 2007
Gold: 0.34
Jul 24 2009 05:26am
Since it tried to make the image and failed its safe to assume your php is correct. Looked around a little, and without seeing an error log my only guess would be that the script is unable to locate the font file to use with "Imagettftext"

On most servers case DOES matter, upload the font you'd like, then find what ever string variable you are using to call said file and ensure the casing and location is correct.
Member
Posts: 5,053
Joined: Jul 3 2006
Gold: 198.86
Aug 9 2009 08:31pm
Can anyone tell me how I need to have things setup so that I can have multiple characters on a sig. Or multiple accounts (for Guild type images)
Member
Posts: 15,364
Joined: May 11 2003
Gold: 11,084.90
Aug 9 2009 09:42pm
Quote (stiffleronfire @ Sun, Aug 9 2009, 10:31pm)
Can anyone tell me how I need to have things setup so that I can have multiple characters on a sig. Or multiple accounts (for Guild type images)


here is an example of 2 chars on 1 sig.
its very basic.. but hopefully youll get the gist.



Code
<?php
Header ('Content-type: image/png');
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');

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

// set some colours for future use
$cool  = imagecolorallocate($image, 81, 86, 96);
$red   = imagecolorallocate($image, 255, 0, 0);
$yellow = imagecolorallocate($image, 255, 181, 53);

// set the font and print text
$font = '/ddbb.ttf';

/******************************************************
*                     LOAD DATA                      *
******************************************************/

// 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');

// 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=155121');
$data2 = simplexml_load_file('http://ladderslasher.d2jsp.org/xmlChar.php?i=105404');
$name = $data->name;
$name2 = $data2->name;
$class = $class_name[(int)$data->classid];
$class2 = $class_name[(int)$data2->classid];
$level = $data->level;
$level2 = $data2->level;

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

//Example; ImageTTFText ($image, textsize, angle, right indent, down indent, color, font,

"text");

//show name
ImageTTFText ($image, 9, 0, 120, 33, $yellow, $font, "Name: ");
ImageTTFText ($image, 9, 0, 150, 33, $red, $font, $name);

//show level
ImageTTFText ($image, 9, 0, 210, 33, $yellow, $font, "Level: ");
ImageTTFText ($image, 9, 0, 245, 33, $red, $font, $level);

//show class
ImageTTFText ($image, 9, 0, 270, 33, $yellow, $font, "Class: ");
ImageTTFText ($image, 9, 0, 310, 33, $red, $font, $class);

// show name2
ImageTTFText ($image, 9, 0, 120, 45, $yellow, $font, "Name: ");
ImageTTFText ($image, 9, 0, 150, 45, $red, $font, $name2);

//show level2
ImageTTFText ($image, 9, 0, 210, 45, $yellow, $font, "Level: ");
ImageTTFText ($image, 9, 0, 245, 45, $red, $font, $level2);

// show class 2
ImageTTFText ($image, 9, 0, 270, 45, $yellow, $font, "Class: ");
ImageTTFText ($image, 9, 0, 310, 45, $red, $font, $class2);

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

?>
Member
Posts: 7,091
Joined: Mar 20 2007
Gold: 0.10
Aug 10 2009 08:14am
ty giving this a test run B)
Member
Posts: 53,367
Joined: Jun 8 2007
Gold: 87,799.92
Aug 10 2009 11:10am
can some1 help me with ad "heal prof" to my code??
will be greatfull :D

Code
<?php
Header ('Content-type: image/png');
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');

/******************************************************
*                     BASICS                         *
******************************************************/

// set some dimensions for future use
$expbar_width = 130;
$expbar_height = 20;

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

// set some colours for future use
$black  = imagecolorallocate($image, 0, 0, 0);
$white   = imagecolorallocate($image, 255, 255, 255);
$pink = imagecolorallocate($image, 255, 0, 246);

// 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 = '/VENTA.TTF';

/******************************************************
*                     LOAD DATA                      *
******************************************************/

// 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=204972');
$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);

$wprof = $data->wprof;


$token = strtok($wprof,";");
$alleZahlen = array();
while($token !== false)
{ $tmp = explode(",",$token);
$alleZahlen [$tmp[0]]= $tmp[1];
$token = strtok(";");}


ImageTTFText ($image, 14, 0, 338, 65, $black, $font, $alleZahlen[3]);
ImageTTFText ($image, 14, 0, 231, 85, $black, $font, "Lvl ");
ImageTTFText ($image, 14, 0, 268, 85, $black, $font, $level);
ImageTTFText ($image, 14, 0, 302, 85, $black, $font, $class);
ImageTTFText ($image, 14, 0, 240, 105, $black, $font, "Kills ");
ImageTTFText ($image, 14, 0, 300, 105, $black, $font, $kills);
ImageTTFText ($image, 14, 0, 290, 125, $black, $font, "MQ ");
ImageTTFText ($image, 14, 0, 330, 125, $black, $font, $mqpasses."/".$mqattempts);





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


/******************************************************
*                     FUNCTIONS                      *
******************************************************/

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

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;
}

?>
Member
Posts: 14,202
Joined: May 14 2008
Gold: 2.85
Aug 10 2009 11:11am
Can anyone give me link to free website hoster and how to upload files on it :)

Pm me pls :)
Member
Posts: 15,364
Joined: May 11 2003
Gold: 11,084.90
Aug 10 2009 11:50am
Quote (jaku @ Mon, Aug 10 2009, 01:10pm)
can some1 help me with ad "heal prof" to my code??
will be greatfull :D

http://forums.d2jsp.org/index.php?showtopic=22792192&f=272&st=480

That post has all the code you need for profs :D

pm me if you need additional help.

Quote (Konqk @ Mon, Aug 10 2009, 01:11pm)
Can anyone give me link to free website hoster and how to upload files on it :)

Pm me pls :)


www.000webhost.com works fine.

Go Back To Ladder Slasher Topic List
Prev1495051525360Next
Add Reply New Topic New Poll