Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
XMA: "X Minutes Ago" Script
#3
shawn_a Wrote:Pretty neat

I think
$msg1 and $msg2 should be $prefix and $suffix, but I don't see why either are even necessary when they are not inside the actual calculated values and can be in your content instead.

Makes total sense - I'll change the value names soon. They are there mainly so that people can change the prefix/suffix for any purposes they have (to fit seamlessly to their content, to paste their own tags around it, to accomodate for their native language etc...). Also just for ease of use, so that when you simply call the function without any changes you know exactly what it does - otherwise you might be confused by just seeing the output "40 seconds" for example, thinking "what does that refer to exactly?"

shawn_a Wrote:Also it would be easier to turn your timestamp into a valid date stamp and simply pass it all as 1 argument.

Then its a 1 argument function, or maybe pass in the date string and the format string as 2 arguments.

A little confused since I'm not a very PHP person - do you mean just turning $timediff into:

Code:
$timediff = (time() - strtotime($date));

shawn_a Wrote:I would love to get togather a plugin for useful component functions, maybe incorporate it into shortcodes or something.

Stuff like this age function, an unlitmate excerpt function, etc.

That would be great if that could happen. What other functions are you thinking of (I'm a bit curious at this excerpt one)?
Reply


Messages In This Thread
XMA: "X Minutes Ago" Script - by Angryboy - 2012-05-30, 23:25:58
XMA: "X Minutes Ago" Script - by shawn_a - 2012-05-31, 00:53:56
XMA: "X Minutes Ago" Script - by Angryboy - 2012-05-31, 01:24:08



Users browsing this thread: 2 Guest(s)