d2jsp
Log InRegister
d2jsp Forums > d2jsp > Ladder Slasher > Guide: How-to Make A Dynamic Ladder-slasher Sig > In A Few Easy Steps With Pics
Prev1505152535460Next
Add Reply New Topic New Poll
Member
Posts: 26,026
Joined: Jun 13 2007
Gold: 23.70
Aug 10 2009 11:51am
Quote (GimmeCoffee @ Mon, Aug 10 2009, 01:50pm)
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.



www.000webhost.com works fine.


man I wish 000webhost work on me as well :cry: . Is there any1 here know any other free site? other than 000webhost and freehostia?
Member
Posts: 14,202
Joined: May 14 2008
Gold: 2.85
Aug 10 2009 11:53am
thank u GimmeCoffee
Member
Posts: 3,392
Joined: Jul 11 2008
Gold: 4,279.75
Aug 10 2009 11:56am
nice guide :lol:
Member
Posts: 26,026
Joined: Jun 13 2007
Gold: 23.70
Aug 10 2009 12:18pm
Quote (GimmeCoffee @ Sun, Aug 9 2009, 11:42pm)
here is an example of 2 chars on 1 sig.
its very basic.. but hopefully youll get the gist.

http://freewaffles.hostoi.com/ls/test/don.png

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

?>


man, This is weird I copied the file and look what i got:

Member
Posts: 15,364
Joined: May 11 2003
Gold: 11,084.90
Aug 10 2009 12:56pm
Quote (pu3ska @ Mon, Aug 10 2009, 02:18pm)
man, This is weird I copied the file and look what i got:

http://img20.imageshack.us/img20/7279/syntax.jpg


first guess is you didnt change the font.

This post was edited by GimmeCoffee on Aug 10 2009 12:56pm
Member
Posts: 14,313
Joined: Jun 3 2007
Gold: 5,850.00
Aug 11 2009 01:16am
Quote (pu3ska @ Mon, 10 Aug 2009, 20:18)
man, This is weird I copied the file and look what i got:

http://img20.imageshack.us/img20/7279/syntax.jpg



no break here:
Code
// This is where you load your own info from the xml d2jsp gives. This is a PHP5 only command!


and here
Code
//Example; ImageTTFText ($image, textsize, angle, right indent, down indent, color, font, "text");


This post was edited by guMKa on Aug 11 2009 01:16am
Member
Posts: 14,202
Joined: May 14 2008
Gold: 2.85
Aug 11 2009 11:05am
iso help :

Parse error: syntax error, unexpected ';' in /home/a5895540/public_html/ls/konqk/don.png.php5 on line 81






That i get when i try to show my sig :(
Member
Posts: 17,311
Joined: Mar 21 2009
Gold: 3,604.22
Aug 11 2009 12:16pm
Quote (Konqk @ Tue, 11 Aug 2009, 18:05)
iso help :

Parse error: syntax error, unexpected ';' in /home/a5895540/public_html/ls/konqk/don.png.php5 on line 81






That i get when i try to show my sig :(


go into your code, and look at line 91, better to use coding engines and things like this, like crimson editor etc
Member
Posts: 26,026
Joined: Jun 13 2007
Gold: 23.70
Aug 11 2009 10:25pm
can any1 tell me why the "Second(s) is not showing?"



This is the code I used.

$lastaction = (int)$data->lastaction;
$lastaction2 = (int)$data2->lastaction;
$time = time() - $lastaction;
$time2 = time() - $lastaction2;
$lastplayed = sec2hms($time);
$lastplayed2 = sec2hms($time2);


function sec2hms ($sec, $padHours = false)
{

$days = intval(intval($sec) / 86400);
$hours = intval(($sec / 3600) % 24);
$minutes = intval(($sec / 60) % 60);

if ($days > 0) {
$hms = $days. ' days, ';

$hms .= ($padHours)
? str_pad($hours, 2, "0", STR_PAD_LEFT). ' hours ago'
: $hours. ' hours ago';
} else {
$hms = "";
$hms .= ($padHours)
? str_pad($hours, 2, "0", STR_PAD_LEFT). ' hours, '
: $hours. ' hours, ';

$hms .= str_pad($minutes, 2, "0", STR_PAD_LEFT). ' minutes ago';
}

return $hms;

}
Member
Posts: 14,202
Joined: May 14 2008
Gold: 2.85
Aug 12 2009 01:23am
http://konqk.hostei.com/ls/konqk/don.png

Guys look what error i get ......
Go Back To Ladder Slasher Topic List
Prev1505152535460Next
Add Reply New Topic New Poll