Page 1 of 4

[3.2][BETA] Topic Image Preview

Posted: Sat Feb 11, 2017 4:39 pm
by VSE
Extension Name: Topic Image Preview
Author: VSE

Extension Description: This is an extension that will display thumbnail previews of images in a topic when hovering the mouse over the topic. It's like my Topic Preview extension, except it only shows a preview of the images posted. It will preview either the oldest images posted, or the most recent images posted (they do not have to be in the first or last posts).

This should be useful for boards that focus on posting image galleries. I made this extension just to see if it could be done easily in an efficient way. Not sure what exactly users may be looking for, so please comment if you like.

Configuration settings can be found in ACP -> Post Settings

Extension Version: 1.0.0-b5

Requirements: phpBB 3.2.0

Features:
  • Previews images posted using the IMG bbcode (attachments are not supported)
  • Set the number images to show in a preview
  • Set the size of the preview images
  • Preview either the first images posted (oldest), or the last images posted (newest).
  • Users have preference to disable image previews if they want
  • Images are extracted from all posts from all topics on the page in 1 single SQL query, so it's very low impact on performance and resource usage.
Screenshots:
tip.jpg

Extension Download: https://github.com/VSEphpbb/TopicImageP ... 0.0-b5.zip
Repository: https://github.com/VSEphpbb/TopicImagePreview

Note: The preview effect is handled by a 3rd party tooltip plug in. For best results, the default settings are what I recommend. Of course you're free to make images bigger or smaller and as many or few as you like, but the preview tooltip could have undesirable results if you go too extreme with the settings.

Re: [3.2][ALPHA] Topic Image Preview

Posted: Sat Feb 11, 2017 4:51 pm
by lopoto
thx :)

Re: [3.2][ALPHA] Topic Image Preview

Posted: Sat Feb 11, 2017 9:39 pm
by ViolaF
Thx to this very great 2-FI-Clone :D
Designed and inspired by 4seven (full credit)

Re: [3.2][ALPHA] Topic Image Preview

Posted: Sat Feb 11, 2017 9:49 pm
by kim902
ViolaF wrote:
Sat Feb 11, 2017 9:39 pm
Thx to this very great 2-FI-Clone :D
Designed and inspired by 4seven (full credit)
Designed and inspired by 4seven but rewrote to come into ext form and that means alot of changes.

Re: [3.2][ALPHA] Topic Image Preview

Posted: Sat Feb 11, 2017 9:58 pm
by ViolaF
Oh yes, you're the greatest programmer in the world
and you can do all the things on your own.
I love you, you are great and awesome :D

Re: [3.2][ALPHA] Topic Image Preview

Posted: Sat Feb 11, 2017 10:08 pm
by kim902
Not at all i'm new to phpbb but did use it a few years ago just getting fed up with seeing 4seven this 4seven that hey he/she is banned :lol: If 4seven want full credit then get him to port a mod.

Is there ever going to be a ext thats not going to be linked to 4seven site claiming everything was written by 10seven?

Re: [3.2][ALPHA] Topic Image Preview

Posted: Sat Feb 11, 2017 11:33 pm
by VSE
kim902 wrote:
Sat Feb 11, 2017 9:49 pm
ViolaF wrote:
Sat Feb 11, 2017 9:39 pm
Thx to this very great 2-FI-Clone :D
Designed and inspired by 4seven (full credit)
Designed and inspired by 4seven but rewrote to come into ext form and that means alot of changes.
Image

Never heard of 4seven or that MOD. And frankly, it's quite insulting when one sits down and takes the time to figure out an extension that does not exist, and have someone else try to claim they had something to do with themselves. I built this extension for the challenge. And because I was able to pull it off I decided to share it.

This was inspired only by the requests I get to do images only in my topic preview extension.

Re: [3.2][ALPHA] Topic Image Preview

Posted: Sun Feb 12, 2017 8:34 pm
by kim902
Just as i was trying to say :lol:

It would seem just about every ext ViolaF is linking to 4seven site and in some cases screaming credit

Either way thankyou for this ext it's nice.

Re: [3.2][ALPHA] Topic Image Preview

Posted: Mon Feb 13, 2017 5:42 am
by Louis7777
Would it be possible to use this functionality for your Precise Similar Topics extension?

Imo it would be appealing to show the first image pulled from the first post along with the title and some of the text (and maybe the author's name and the date), just like blogs do it. If there isn't any image, then show a default "no image" image.

Image

Re: [3.2][ALPHA] Topic Image Preview

Posted: Mon Feb 13, 2017 6:54 am
by Stoker 4.0
I think its great when someone takes time to convert an old mod of mine and make it as an ext.
Its rare that we inspire people. Be proud when it happens ;)

Re: [3.2][ALPHA] Topic Image Preview

Posted: Mon Feb 13, 2017 9:00 am
by VSE
Not a MOD conversion. Far as I know, there has never been a MOD that does what this extension can do.
Louis7777 wrote:
Mon Feb 13, 2017 5:42 am
Would it be possible to use this functionality for your Precise Similar Topics extension?
Eventually. But Precise Sim Topics needs some rewriting to make it happen.

Re: [3.2][ALPHA] Topic Image Preview

Posted: Wed Feb 15, 2017 2:11 am
by VSE
I can no longer recommend installaing this extension on any board.

It worked great on my test board, but when I tried it on a board with almost a million posts, it brought the board to a screeching halt.

I may re-examine this extension if there is enough interest.

Re: [3.2][ALPHA] Topic Image Preview

Posted: Wed Feb 15, 2017 3:29 am
by JoshyPHP
Can't you rewrite the query to join the posts table using topic_first_post_id/topic_last_post_id? I haven't tested it, probably worth a try.

Code: Select all

$sql = 'SELECT t.topic_id, p.post_text
	FROM ' . TOPICS_TABLE . ' t
	JOIN ' . POSTS_TABLE . ' p ON p.post_id = t.topic_' . ($this->config->offsetGet('vse_tip_new') ? 'last' : 'first') . '_post_id
	WHERE ' . $this->db->sql_in_set('t.topic_id', $topic_list) . '
		AND p.post_text ' . $this->db->sql_like_expression($this->db->get_any_char() . '<IMG ' . $this->db->get_any_char()) . ')';

Re: [3.2][ALPHA] Topic Image Preview

Posted: Wed Feb 15, 2017 7:53 am
by VSE
JoshyPHP wrote:
Wed Feb 15, 2017 3:29 am
Can't you rewrite the query to join the posts table using topic_first_post_id/topic_last_post_id? I haven't tested it, probably worth a try.

Code: Select all

$sql = 'SELECT t.topic_id, p.post_text
	FROM ' . TOPICS_TABLE . ' t
	JOIN ' . POSTS_TABLE . ' p ON p.post_id = t.topic_' . ($this->config->offsetGet('vse_tip_new') ? 'last' : 'first') . '_post_id
	WHERE ' . $this->db->sql_in_set('t.topic_id', $topic_list) . '
		AND p.post_text ' . $this->db->sql_like_expression($this->db->get_any_char() . '<IMG ' . $this->db->get_any_char()) . ')';
Thats what my topic preview ext basically does. The goal with this one was to not be stuck with only the first or last post, however. Otherwise, this just won't work if somebody replies without posting images, for example. So it needed to search all the posts to find the first-most or last-most posts with images.

Re: [3.2][ALPHA] Topic Image Preview

Posted: Wed Feb 15, 2017 12:27 pm
by JoshyPHP
Oh ok, I understand now, both the purpose and why the query will end up being slow if topics get a bit too big. (assuming this isn't an issue with the query plan)

If you resume work on that extension you may want to try replacing the subquery with a derived table that you would join to the posts table using post_id. MySQL generally handles derived tables better.