Advertisement:

Author Topic: for modding smf 2.1 add 'call_integration_hook...' in the function timeformat()  (Read 1120 times)

Offline Pipke

  • Full Member
  • ***
  • Posts: 478
    • [NRNS]
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.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,641
    • StoryBB/StoryBB on GitHub
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.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline albertlast

  • Development Contributor
  • Full Member
  • *
  • Posts: 589
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.

Offline Pipke

  • Full Member
  • ***
  • Posts: 478
    • [NRNS]
thx for the answers, i will try to find another way around it ;)