d2jsp
Log InRegister
d2jsp Forums > d2jsp > Ladder Slasher > Guide: How-to Make A Dynamic Ladder-slasher Sig > In A Few Easy Steps With Pics
Prev1111213141560Next
Add Reply New Topic New Poll
Banned
Posts: 39,679
Joined: Mar 9 2007
Gold: 153.16
Warn: 30%
Oct 9 2008 01:35pm
Quote (KIDRitch @ Sun, Oct 5 2008, 02:37am)
So how do you convert the lastaction to hours/ minutes / seconds?

Code
<lastaction>1223188360</lastaction>


Code
$lastaction = (int)$data->lastaction;
$time1 = time() - $lastaction;
$lastplayed = sec2hms($time1);

ImageTTFText ($image, 8, 0, 222, 82, $plasmictext, $font, $lastplayed);

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


There ya go. smile.gif
Member
Posts: 10,594
Joined: Oct 12 2007
Gold: 56.19
Oct 9 2008 01:36pm
thought about making a sig myself but .. is it possible as "code-newcomer" ?^^
Banned
Posts: 39,679
Joined: Mar 9 2007
Gold: 153.16
Warn: 30%
Oct 9 2008 01:41pm
Quote (bierpatriot @ Thu, Oct 9 2008, 03:36pm)
thought about making a sig myself but .. is it possible as "code-newcomer" ?^^


It's quite simple, actually.
You're probably going to have some questions, but I can help you if you need it. smile.gif
Member
Posts: 10,594
Joined: Oct 12 2007
Gold: 56.19
Oct 9 2008 01:45pm
Quote (Murtocs @ Thu, 9 Oct 2008, 21:41)
It's quite simple, actually.
You're probably going to have some questions, but I can help you if you need it. smile.gif


would be great ;D not sure if i should start it today icon_pointr.gif had some beer allready tongue.gif but might i'll read the whole guide and start one tomorrow smile.gif
Member
Posts: 41,017
Joined: Jul 4 2005
Gold: 871.28
Oct 16 2008 05:15am
I'd like to make my guild players list, but I got no idea how to start... Already tried to copy some part of code from this guide, etc. but it's not working.

Could some1 help me?
Member
Posts: 23,088
Joined: Mar 29 2007
Gold: 4.20
Oct 22 2008 07:14am
Is there any way to have the file in .jpg / .jpeg format rather than in .png?

In Photoshop I can't control the file size saving in format .png so that is why I'm asking about it.

Thanks.
Member
Posts: 4,620
Joined: Aug 3 2008
Gold: 525.25
Oct 22 2008 04:17pm
Quote

$image = imagecreatefrompng('bg.png');



Change that line to


Quote

$image = imagecreatefromjpg('bg.jpg');



and it should work fine with a jpg image

any other questions http://www.php.net/gd is a good place to look.
Or if you want, shoot me a pm I'll help if i can.

This post was edited by SilentXer0 on Oct 22 2008 04:25pm
Member
Posts: 1,909
Joined: May 8 2007
Gold: 2,507.26
Oct 22 2008 04:47pm
Quote (markov @ Thu, 16 Oct 2008, 13:15)
I'd like to make my guild players list, but I got no idea how to start... Already tried to copy some part of code from this guide, etc. but it's not working.

Could some1 help me?


What do you mean? One picture with all the guildies in it?

//edit
hm, seems my testing on own site ruined my multiviews smile.gif. Have to fix that one of those days.

This post was edited by flapmo on Oct 22 2008 04:53pm
Member
Posts: 23,088
Joined: Mar 29 2007
Gold: 4.20
Oct 22 2008 05:13pm
Quote (flapmo @ Wed, 22 Oct 2008, 23:47)
What do you mean? One picture with all the guildies in it?

//edit
hm, seems my testing on own site ruined my multiviews smile.gif. Have to fix that one of those days.


Yes, he means one big picture with 2 or more people (chars).
Member
Posts: 1,909
Joined: May 8 2007
Gold: 2,507.26
Oct 23 2008 01:14pm
Quote (NewAnalphabetal @ Thu, 23 Oct 2008, 01:13)
Yes, he means one big picture with 2 or more people (chars).


$data_nickname = simplexml_load_file('http://ladderslasher.d2jsp.org/xmlChar.php?i=146106');
$name = $data_nickname->name;
$kills = $data_nickname->kills;
$class = $class_name[(int)$data_nickname->classid];

would do the job, then copy the

$data_nickname for every nickname and load their xml in that data variable.
Go Back To Ladder Slasher Topic List
Prev1111213141560Next
Add Reply New Topic New Poll