(2021-02-17, 01:52 AM)Omar G. Wrote: Hi, I updated to the latest package from Github and it seems to be working now. It seems like a helpful plugin to use.
Excellent - glad to hear it's now working.
(2021-02-17, 01:52 AM)Omar G. Wrote: Also, it seems like editing the linktools_linkpreview_default
has no effect, something should be wrong.
It has an effect, but only on previews generated since the edit. Previews for the default helper are cached (in the DB table
mybb_url_previews
), and the caching code has no way of knowing that the template has been edited so as to know that the preview needs to be regenerated (or, at least, if there is a way of finding out, I haven't yet learnt it myself and implemented it).You can though regenerate previews via the Recount & Rebuild entry "Rebuild Link Previews for Link Tools", making sure that you have first set the plugin's "Scope of Rebuild Link Previews entry" setting to "All".
Another approach: set the "Link preview expiry period" setting to "1", and wait a day for the template change to take effect.
Also, if you are interested only in testing the change to the template on a single link, then, in the footer of the post containing the link, right-aligned where "IP logged" is left-aligned, you can click on "Regenerate preview".
(2021-02-17, 01:52 AM)Omar G. Wrote: Also, it seems like editing the linktools_linkpreview_default
has no effect, something should be wrong.
(2021-02-17, 02:15 AM)Laird Wrote: It has an effect, but only on previews generated since the edit. Previews for the default helper are cached (in the DB table mybb_url_previews
), and the caching code has no way of knowing that the template has been edited so as to know that the preview needs to be regenerated (or, at least, if there is a way of finding out, I haven't yet learnt it myself and implemented it).
Re the bit I've emphasised: I found a way to do this by hooking in to the template saving functionality. Now, when the template of a Link Helper that caches link previews is saved, the admin sees a page like this:
And if the admin clicks on the button to invalidate the cache, then s/he sees a page like this:
I'll probably release a development version of this plugin with the new link preview feature to its Extend page in the next day or two.