Page 1 of 1

Summary of images posted in a topic

Posted: Thu Jun 29, 2017 11:40 am
by konzy
Hello!
Here is my issue: my forum is dedicated to photography, and members can have their own topics, where they post their pictures. Other members can comment pictures, give advice, etc. There are also community topics with a theme (landscape, portrait, night photography...) where anyone can contribute.

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).

To your knowledge, do you know any mod that could allow members to do it?

If there is no mod to do that, do you have any idea how it could be done? What would you advise: a dedicated page, an Ajax lightbox..?

Thanks for your input! :)

Konzy

Re: Summary of images posted in a topic

Posted: Fri Jun 30, 2017 9:07 pm
by Toxyy
Maybe create a div above or below the topic header or footer, run an sql query to select posts with attachments, and populate the div with a list of the post links or the attachment links.

Re: Summary of images posted in a topic

Posted: Sat Jul 01, 2017 12:13 pm
by ViolaF

Re: Summary of images posted in a topic

Posted: Tue Jul 04, 2017 12:39 pm
by Ger
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.
ViolaF wrote:
Sat Jul 01, 2017 12:13 pm
this should work, also today..

info: viewtopic.php?f=70&t=2137700

download: https://github.com/digioz/phpbb-mods/tr ... ttachments
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.

Re: Summary of images posted in a topic

Posted: Thu Mar 22, 2018 7:58 pm
by Havym
Im looking for some kind of extension too ;)