Page 1 of 1
last entries Thumbnail
Posted: Sun Dec 11, 2022 11:21 pm
by dart
as the title reads...
Is it possible to add a thumbnail to show per last entries if an image is present in the topic ?
Re: last entries Thumbnail
Posted: Sat Dec 17, 2022 12:35 pm
by Arvid
Hi,
this would make a nice new plugin, say "LastEntriesWithThumbnails"
My thoughts: Take the original LastEntries plugin, rename it, and then:
- Set the fullparse parameter in the new FPDB_Query() call to true (line 29) to retrieve not only the metadata of the entries, but also their contents.
- In the while ($q->hasmore()) loop (line 39), you then have access to each entry's content via $entry ['content'] - parse the content for the first "img" tag and read its "src" parameter, and you have your thumbnail image path.
- Add the image path to the $string variable within a html <img> tag to actually display the image in the widget output.
Little coding fun, anyone?
Re: last entries Thumbnail
Posted: Thu Dec 29, 2022 2:41 pm
by dart
well, at least I know it's possible somehow