[Bb-trac] Re: [bbPress] #521: Audit bbPress' time functions.
bbPress
bb-trac at lists.bbpress.org
Sat Feb 3 21:50:03 GMT 2007
#521: Audit bbPress' time functions.
----------------------------+-----------------------------------------------
Reporter: mdawaffe | Owner: mdawaffe
Type: defect | Status: closed
Priority: highest | Milestone: 0.80
Component: Administration | Version: 0.73
Severity: normal | Resolution: fixed
Keywords: |
----------------------------+-----------------------------------------------
Comment (by mdawaffe):
How it works:
Template functions
1. Time functions return "X (hours|weeks|etc) ago" of current global
object by default.
1. Passing numeric argument returns time for object with that id.
1. Passing date-format-string argument returns time formatted accordingly
for current global.
1. Can also pass, 'timestamp', 'since' (default), and 'mysql' for unix
time, "X hours ago" or mysql formatted date.
1. Can pass query string or array with keys: id, format, more. More
returns "X hours, Y minutes" if format = 'since'.
Backend
1. bb_since(), bb_offset_time(), bb_gmtstrtotime(), should accept unix
time stamps, mysql formatted strings and some other strings.
1. gmdate() used exclusively no more date().
1. bb_gmtstrtotime() converts mysql dates (assumed to be GMT as all
dates/times in bbPress are) into unix time stamp.
1. bb_offset_time() filtering all echoing time functions but only
actually applied by if format != 'since'.
1. Calling bb_since() twice shouldn't break the date.
1. echoing and returning functions both pass mysql formatted time to
filters no matter what (and expect [but probably don't ''need''] to have
filters return mysql formatted dates).
1. _bb_parse_time_function_args() and _bb_time_function_return() helper
functions.
--
Ticket URL: <http://trac.bbpress.org/ticket/521#comment:4>
bbPress <http://bbpress.org/>
Innovative forum development
More information about the Bb-trac
mailing list