Advertisement:

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

Offline Pipke

  • Full Member
  • ***
  • Posts: 505
    • #31970508 on GitHub
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.
“If something is wrong, fix it if you can. But train yourself not to worry. Worry never fixes anything.”

My Mods for SMF:
Avatars Display Integration
Avatars on Board and/or MessageIndex
Recent Forum Topics on Boardindex
Relative Time Formats

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,980
    • 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: 600
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: 505
    • #31970508 on GitHub
thx for the answers, i will try to find another way around it ;)
“If something is wrong, fix it if you can. But train yourself not to worry. Worry never fixes anything.”

My Mods for SMF:
Avatars Display Integration
Avatars on Board and/or MessageIndex
Recent Forum Topics on Boardindex
Relative Time Formats