Simple Machines Community Forum

SMF Development => Feature Requests => Applied or Declined Requests => Topic started by: Pipke on May 07, 2019, 02:45:03 PM

Title: for modding smf 2.1 add 'call_integration_hook...' in the function timeformat()
Post by: Pipke on May 07, 2019, 02:45:03 PM
For smf 2.1: as the title says, can you developers add this hook into this function so modders can easily manipulate the timeformat (to lets say relative formats) output instead of changing about 138 hits for calling function timeformat.
Title: Re: for modding smf 2.1 add 'call_integration_hook...' in the function timeformat()
Post by: Arantor on May 07, 2019, 02:53:51 PM
Bad idea for performance for one of the most intensely time sensitive functions.

Better idea, have the function not change, but instead output a <time> tag around the result, with the time stamp in it, and do relative dates in the client in JS.
Title: Re: for modding smf 2.1 add 'call_integration_hook...' in the function timeformat()
Post by: albertlast on May 07, 2019, 04:05:15 PM
Like arantor mention,
the timeformat function is very likly to get called multiple hundred time per page view.

So you should solve this issue on js/client side.
Title: Re: for modding smf 2.1 add 'call_integration_hook...' in the function timeformat()
Post by: Pipke on May 08, 2019, 08:06:44 AM
thx for the answers, i will try to find another way around it ;)