Gobb
Member
Hi all.
I'm looking to create an addon where users can select a small icon image to put before their username. I am intending the selection form to have functionality like the smilie search box in the editor. That's fine and well, but I'm really struggling to understand one part of how this works in particular.
Going from the top:
Do I even need to worry about recreating some sort of caching system for my addon's searcher? To give some context, there is probably up to 15 members online on our small forum during a 24 hour period, and the searching function of the addon is likely to be used not all too frequently.
I understand after the icons are fetched from the database, and matched based on the search term entered, I can just return the desired html, but I'm just concerned this wouldn't be the "correct" process. Following XenForo's original files, it seems to be using cached info to build the html, unless I'm not understanding this?
Any insight would be appreciated.
Thanks
Edit: I think I've figured it out that's it's called within the rebuildSmilieCache function of the Entity. I'd still like an opinion if it would be worth me trying to figure out how to get this working, or if it's simply better for me to skip trying to replicate it.
I'm looking to create an addon where users can select a small icon image to put before their username. I am intending the selection form to have functionality like the smilie search box in the editor. That's fine and well, but I'm really struggling to understand one part of how this works in particular.
Going from the top:
- In the editor controller, this is the search action: SmiliesEmojiSearch
- The database search is conducted via the Emoji Repo: getMatchingEmojiByString
- In the above function within the Emoji Repo, the following is called: $strFormatter = $this->app()->stringFormatter()
- After that, the smilies are fetched from the database
- Now, this is the bit that really is boggling my mind: $data['html'] = $strFormatter->replaceSmiliesHtml($data['shortname']);
Do I even need to worry about recreating some sort of caching system for my addon's searcher? To give some context, there is probably up to 15 members online on our small forum during a 24 hour period, and the searching function of the addon is likely to be used not all too frequently.
I understand after the icons are fetched from the database, and matched based on the search term entered, I can just return the desired html, but I'm just concerned this wouldn't be the "correct" process. Following XenForo's original files, it seems to be using cached info to build the html, unless I'm not understanding this?
Any insight would be appreciated.
Thanks
Edit: I think I've figured it out that's it's called within the rebuildSmilieCache function of the Entity. I'd still like an opinion if it would be worth me trying to figure out how to get this working, or if it's simply better for me to skip trying to replicate it.
Last edited: