Shorthand Time

Started by AzaToth, September 22, 2005, 02:20:32 PM

Previous topic - Next topic

AzaToth

Link to Mod

A simple mod using the time-tag to be able to use some common dates shorthanded.

Short hand is: [now], [tomorrow], [yesterday], [last day], [next day], [last hour], [next hour], [last year], [next year].

only for 1.1 RC1

Purplemadness

It's cool, it sometimes comes in handy, great job! 8)
Dutch power!

dtm.exe


AzaToth

Quote from: Purplemadness on September 23, 2005, 10:22:46 AM
It's cool, it sometimes comes in handy, great job! 8)
Thank you, I dont think it's a "great job" thou, it's one line of code and took me 2 minutes to implement, but thanks anyway  8)

Purplemadness

#4
Quote from: azatoth on September 23, 2005, 05:55:16 PM
Quote from: Purplemadness on September 23, 2005, 10:22:46 AM
It's cool, it sometimes comes in handy, great job! 8)
Thank you, I dont think it's a "great job" thou, it's one line of code and took me 2 minutes to implement, but thanks anyway  8)
Doesn't matter, it's good anyway ;)
But the [last year] doesn't work onmy forum :'(
Edit: Already solved it :D
Change:
This
$parts[$i] = preg_replace('~\[(now|tomorrow|yesterday|next (day|hour|year)|last (day|hour))\s*\/?\]~i', '[time]$1[/time]', $parts[$i]);

To This:
$parts[$i] = preg_replace('~\[(now|tomorrow|yesterday|next (day|hour|year)|last (day|hour|year))\s*\/?\]~i', '[time]$1[/time]', $parts[$i]);
Dutch power!

AzaToth

Quote from: Purplemadness on September 24, 2005, 03:32:09 AM
Quote from: azatoth on September 23, 2005, 05:55:16 PM
Quote from: Purplemadness on September 23, 2005, 10:22:46 AM
It's cool, it sometimes comes in handy, great job! 8)
Thank you, I dont think it's a "great job" thou, it's one line of code and took me 2 minutes to implement, but thanks anyway  8)
Doesn't matter, it's good anyway ;)
But the [last year] doesn't work onmy forum :'(
Edit: Already solved it :D
Change:
This
$parts[$i] = preg_replace('~\[(now|tomorrow|yesterday|next (day|hour|year)|last (day|hour))\s*\/?\]~i', '[time]$1[/time]', $parts[$i]);

To This:
$parts[$i] = preg_replace('~\[(now|tomorrow|yesterday|next (day|hour|year)|last (day|hour|year))\s*\/?\]~i', '[time]$1[/time]', $parts[$i]);
oops, fixed :)

Yuri


ltdeta


mark7144

Is there any way to do this in 1.1?

au8ust

Sorry for bumping :( Just wanna ask if there is anyway to get this mod work for 1.1.4?

Advertisement: