d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Teach Me How To Put Stats In Sig > For Ladder Slasher Please
12Next
Closed New Topic New Poll
Member
Posts: 2,128
Joined: Aug 18 2009
Gold: 0.15
Nov 23 2018 12:50pm
all information much apprechiated, guides, knowhow, knowledge in general, much apprichiated
Member
Posts: 5,348
Joined: Sep 15 2017
Gold: Locked
Nov 23 2018 02:40pm
well, as far as i know if you want a dynamic signature you need to generate it with some serverside code.
i did something similar where on every refresh your sig would change randomly (picked in a set of images)

in short you need to write a server side script(php / java / javascript / ruby / python ...) that will :
1. retrieve your ladder slasher data
* no idea how to do this and lazy to search but if u pay / donate good i can prolly find out ;)
2. generate an image with your data
3. output your new generated image to the client (the web browser)

a basic example in PHP would look like this ( i skipped part 1 cause lazy to search how to do :P )
* for this example to work you will need a font file in the same directory as the script that generate the image
in my example i used 'ARIAL' font from https://www.wfonts.com/font/arial


Code
<?php
// set header so browser know we send a png image
header('Content-type: image/png');

// set PHPGD font path to the current working directory
putenv('GDFONTPATH=' . realpath('.'));
/*
here you're supposed to write the code to gather data about your ladder slasher char(s).
I used '$char' variable fake data below as static example
*/
$char = [
'name' => 'Suika',
'category' => 'paladin',
'level' => '65',
'experience' => 64788118
];

// jsp rule max signature width = 400px
$sig_width = 400;
// jsp rule max signature height = 150px
$sig_height = 150;

$font = "ARIALI.ttf";

// create the image, '@' make errors silent on the function call so it go smooth in case of error
$im = @imagecreatetruecolor($sig_width, $sig_height)
or die('Impossible de créer un flux d\'image GD');
// setting text color to white (rgb style: 255 255 255)
$text_color = imagecolorallocate($im, 255, 255, 255);

// http://php.net/manual/fr/function.imagettftext.php
imagettftext($im, 20, 0, 10, 25, $text_color, $font, "Ladder Slasher stats");
$y = 50;
foreach ($char as $key => $value) {
imagettftext($im, 10, 0, 10, $y, $text_color, $font, $key . ':' . $value);
$y += 25;
}
imagepng($im);
imagedestroy($im);

?>


of course, you will need to host the script and the font file on a web hosting so its available on internet.
Ultimately, you can use the URL of that script to generate an image in your sig with the usual img bbcode tag

Code
[IMG]http://your_host.com/your_script.php[/IMG]


i spent ~ 1hr on this, feel free to donate fg's :P


This post was edited by minuteMed95 on Nov 23 2018 02:41pm
Member
Posts: 1,039
Joined: Jul 8 2008
Gold: 1,939.50
Nov 23 2018 04:03pm
I'm pretty sure this isn't legal because you're not supposed to access the website in an automated fashion.
Member
Posts: 5,348
Joined: Sep 15 2017
Gold: Locked
Nov 23 2018 07:36pm
Quote (waraholic @ 24 Nov 2018 00:03)
I'm pretty sure this isn't legal because you're not supposed to access the website in an automated fashion.


he donated me 2fg, what a tightass :rofl:

indeed its illegal to "access the website in an automated fashion"

but this is a good base for displaying anything not "website data" related :)
Member
Posts: 2,128
Joined: Aug 18 2009
Gold: 0.15
Nov 23 2018 08:22pm
Quote (minuteMed95 @ Nov 23 2018 08:36pm)
he donated me 2fg, what a tightass :rofl:

indeed its illegal to "access the website in an automated fashion"

but this is a good base for displaying anything not "website data" related :)


"11‎/‎23‎/‎2018‎ ‎6‎:‎39‎:‎07‎ ‎PM
Sent
-2.00
(115.33 -> 113.33)
to minuteMed95
(25,191.00 -> 25,193.00)
donate for helping, wish it could be more."


illegal, but I still see people with it...? :wallbash:
welp, not gunna donate anymore for that, that's for sure. :thumbsup: would have been more but your loose mouth needs something big to fit into it. :bonk:

spent an hour on all that, its still appreciated as an example, if you cant accept my gratitude like I've shown you, your welcomed to take your presence elsewhere.

This post was edited by dejuia on Nov 23 2018 08:27pm
Member
Posts: 5,348
Joined: Sep 15 2017
Gold: Locked
Nov 23 2018 08:32pm
Quote
not gunna donate anymore


xDDDD

shit, you ain't gonna send me 2fg more ? fuck my life i'm gonna suicide myself :rofl:

and yes bro, i'm professional developer and i charge 500euro per day for freelance work (that's 62 euro per hour)

you could have kept your 2fg donation if 2fg is so much for you, are you a hobbo ? lol ...
Member
Posts: 14,298
Joined: Jun 27 2015
Gold: 9,563.00
Nov 23 2018 08:41pm
Quote (dejuia @ 23 Nov 2018 14:50)
all information much apprechiated, guides, knowhow, knowledge in general, much apprichiated


ok
Member
Posts: 5,348
Joined: Sep 15 2017
Gold: Locked
Nov 23 2018 08:49pm
Quote (Diablo_Friend @ 24 Nov 2018 04:41)
ok


yes
Member
Posts: 2,128
Joined: Aug 18 2009
Gold: 0.15
Nov 23 2018 08:52pm
Quote (minuteMed95 @ Nov 23 2018 09:32pm)
im sad that I got chump change for hard work that didn't help anyway


you got my two cents, ungrateful? make a meme about it. shouldn't be as hard.

but you should definitely take your work and do something with it, like a new topic, or a different site, and profit off it.


This post was edited by dejuia on Nov 23 2018 08:57pm
Member
Posts: 5,348
Joined: Sep 15 2017
Gold: Locked
Nov 23 2018 09:25pm
Quote (dejuia @ 24 Nov 2018 04:52)
you got my two cents, ungrateful? make a meme about it. shouldn't be as hard.

but you should definitely take your work and do something with it, like a new topic, or a different site, and profit off it.


don't worry about my profit, 3k euro net per month from my job is enough for now :lol:

you'd better worry about your lack of programming skills, btw if you want i can give you your 2fg back, so you can pay english/programming lessons with it ?
Go Back To Programming & Development Topic List
12Next
Closed New Topic New Poll