konzy wrote: Thu Jun 29, 2017 11:40 am
The thing is, however, some topics have now reached 50 or 100 pages, with hundreds of images posted, either as links (Flickr or similar) or uploads. Sometimes, you just want to browse through all the pictures posted in a topic, without searching all the pages one by one (some of which don't have any image inside).
So te recap: you want to search
per topic for all
posts with either
attachments or
embedded images, display all those images in a summary page. Correct?
Now I don't have an extension for you, but you can simply query the database for all attachments in a topic:
Code: Select all
SELECT * FROM phpbb_attachments
JOIN phpbb_extensions USING(extension)
WHERE group_id = 1 # images extension group
AND topic_id = 762; # your topic_id
For embedded images, it's a tad harder. You can of course take a LIKE query like such:
Code: Select all
SELECT * FROM phpbb_posts
WHERE topic_id = 762
AND post_visibility = 1
AND post_text LIKE '%<IMG src="%">%'
However, for larger topics with ± 100 pages (e.g. 2000 posts) with many images, this might turn into a slow query. Also, you might get some false positives. You should definitely test this with real world data from your board. Run this query for a large topic with many embedded images, see how long it takes.
After that, you need to also check if the requesting user has permissions to view the topics and extensions. For instance: in above query I added
post_visibility = 1
but a moderator might also want to check on unapproved / hidden posts.
What would you advise: a dedicated page, an Ajax lightbox..?
I wouldn't make this directly available on a topic page, since this would without any doubt cause your board to slow down, resulting in complaining users. I would make a nice button at the top and bottom of your viewtopic page that opens a dedicated page with all the found images (paginated/lazy loaded). Adding a lightbox to such a page is child's play and makes it much more accessible for your users to I would add that indeed.
1. It's a MOD, not an extension.
2. It never came further then early development stage.
3. It doesn't install properly for phpBB 3.2.
4. It's not intended for what the OP is asking for.
My extensions:
Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update, Modern Quote, Quoted Where (GDPR) and Autoresponder.
Newest: FAQ manager for 3.2
Like my work?
Buy me a coffee to keep it coming.
-Don't PM me for support-