News:

Wondering if this will always be free?  See why free is better.

Main Menu

Topic First Image Rotator

Started by Diego Andrés, September 11, 2021, 09:26:44 AM

Previous topic - Next topic

Diego Andrés

Need at least 7.0 I think.
Also your forum is outdated, 2.0.19 is the latest patch for 2.0.x

SMF Tricks - Free & Premium Responsive Themes for SMF.

IP_Board_Rules

Quote from: Diego Andrés on August 05, 2022, 03:22:03 PMNeed at least 7.0 I think.
Also your forum is outdated, 2.0.19 is the latest patch for 2.0.x

Thank you for letting me know. This is probably the reason then

Rgvill

Quote from: Diego Andrés on September 11, 2021, 05:51:40 PMFor attachments it only works if the attachments are inserted (embedded) in the post, it's mentioned in the description.

Quote from: Diego Andrés on September 11, 2021, 09:26:44 AMInclude inserted attachments in posts (SMF 2.1.x)

If they just attached it without inserting then it won't work, the mod doesn't do that.


This is what exactly I need! Do you know of any mod that automatically attach and insert an attachment?

Rgvill

I want this only to show in the homepage. How do I remove it from the MessageIndex?

Diego Andrés

Quote from: Rgvill on October 06, 2022, 01:44:03 PMThis is what exactly I need! Do you know of any mod that automatically attach and insert an attachment?

No mods for this atm.

Quote from: Rgvill on October 06, 2022, 07:39:41 PMI want this only to show in the homepage. How do I remove it from the MessageIndex?

Change this line:
if (((!empty($modSettings['firsttopicimage_enable_index']) && !empty($context['current_action'])) || !empty($topic)) || ((empty($board) || !empty($topic)) && empty($modSettings['firsttopicimage_enable_index'])))
To this:
if (!empty($context['current_action']) || !empty($board))

SMF Tricks - Free & Premium Responsive Themes for SMF.

Rgvill

How do I prevent this from happening every time I refresh my page? It's very fast, but it's a bit annoying.


Tricky-Ricky

How would i code a portal block for this Amazing mod?.

Diego Andrés

Quote from: Rgvill on October 11, 2022, 05:09:20 AMHow do I prevent this from happening every time I refresh my page? It's very fast, but it's a bit annoying.

I don't think much can be done about this, but still added something to address it.



1.3.1 - 25 October 2022
  • Improvement Always load the images horizontally.

SMF Tricks - Free & Premium Responsive Themes for SMF.

Diego Andrés

Quote from: Tricky-Ricky on October 25, 2022, 03:56:52 PMHow would i code a portal block for this Amazing mod?.

How would that look? I'm not sure it would work well in a portal block because it's essentially a carousel

SMF Tricks - Free & Premium Responsive Themes for SMF.

EthanR

This is a really cool mod! 8)  Is it possible to have it display random images from the attachment directories and link to the thread that the image is from?

I have thousands of images and it would be a great way expose the pictures on the homepage as another way to engage the users :)

Diego Andrés

At this time it only displays inserted attachments.
The same thing was asked a few posts above.

Perhaps I'll add an option for this in the future. The main issue with it, is that the mod doesn't look for attachments specifically, it looks for bbc tags.

SMF Tricks - Free & Premium Responsive Themes for SMF.

EthanR

Ah, I understand  :)

I believe it would be an awesome mod if it could display the attachments randomly. I think I have around 30000 attachment images all buried in threads somehere. To have a random selection exposed on the homepage would cool and encourage users to interact (nothing like an interesting picture to catch someone's interest  ;) )

cheers  :)

Diego Andrés

1.3.2 - 26 March 2023
  • Improvement Added .gif and .jpeg extensions for attachments.




Quote from: EthanR on January 27, 2023, 08:57:15 PMAh, I understand  :)

I believe it would be an awesome mod if it could display the attachments randomly. I think I have around 30000 attachment images all buried in threads somehere. To have a random selection exposed on the homepage would cool and encourage users to interact (nothing like an interesting picture to catch someone's interest  ;) )

cheers  :)
I've decided against this once more, the mod intention is to work as a 'cover' system displaying only the first image (img or attachment). Displaying random attachments would turn it into something else.

I'd advice you to use https://custom.simplemachines.org/index.php?mod=4318 :)

SMF Tricks - Free & Premium Responsive Themes for SMF.

brynn

Hi Friends,
We love the concept for this mod, and we're trying to make it work for us.  Our forum will be a community gathering site for users of Inkscape, which is an open source vector graphics editor.

For our purposes, we expect most of our users will be displaying their artwork (created with Inkscape). Since the images are artwork, they can come in any conceivable combination of dimensions, as opposed to photos, which seem to be more homogenous in size. So we're having a hard time finding a good "average" size for the images in the carousel.  Some are getting cut off on their sides. We have not tried one that is taller than wide yet, but I'm guessing it would get cut off top and bottom?  And while yet others which are smaller than the set size, they get stretched, and therefore pixelated.

I don't know enough about programming to look at the code and understand how a mod is supposed to work. So it's possible I have some misunderstanding.

At the moment, I'm thinking the best way to use this, for us anyway, is to show only one image at a time.  That would not necessarily be a bad thing -- we might very happily settle on that for a solution.

But I wanted to ask if anyone can think of another solution for displaying maybe the default 5 images at a time. Since we're still in testing and learning mode, our forum is not public yet, but I can show a screenshot.

You cannot view this attachment.

Those 2 pink images which look identical....well, they came from the same image.  The one on the right is the original size (639 x 445 px).  I thought if I used the bbcode to set the size smaller than the size set for the rotator images, I might see the whole image - smaller, but whole.  But that didn't happen.  I can't figure out if the mod just used the full size for both, or....well, I don't know what really happened. Anyway, the one on the left was set for 128 x 89 px (using the message editor).

The rotator image size is set for 150 x 150 px. The one on the left is smaller than 150, so it became pixelated when it stretched to fit. We tried the Center Mode, but it does not seem to work for us.

Could there be some way to use thumbnails to solve this problem?  Like if we use only inserted attachments, with an appropriate thumbnail setting....and we set the rotator image for the same size as the thumbnail -- could that solve this problem? Would the mod show the thumbnails or the full size images?

It seems like if my test above didn't work, that the thumbnail solution won't work either. But again, I don't understand how it works very well. 

Do you think this thumbnail idea might work? Or could there be some other way to deal with this unpredictable image sizes? Or is this just a problem without a good solution?

Thanks for any comments or ideas  :D

Diego Andrés

The mod was intended to display covers.
If you are displaying random things including logos, I guess it would be better to display them in a smaller size like thumbnails as you said.
I'll have a look tomorrow I'd that's what you want to do, you can probably accomplish it by only editing the css.

SMF Tricks - Free & Premium Responsive Themes for SMF.

brynn

Thanks  :)

No rush.  I'm just logging off now and won't be back online for another day or 2.

brynn

Ok, I've re-read this topic, and I realize that it won't work with attachments. So I guess my idea about thumbnails probably won't work either.

I'm not sure what a cover is, but I guess maybe something like a magazine cover, since CD or album covers are square. Or anything where the images are all the same size? Or maybe is has to be images in the portrait orientation (rather than landscape)?

After reviewing my test, I thought it might have failed because I used an SVG image, which some mods can't handle.  I think it's awesome that this mod can display them, btw.  But apparently that's not why my test failed.  I've just done the same test with a PNG, and it still fails.  So I want to try to understand why.

Here are the details.  The original image is 567 x 465 px.  Our Rotator mod is set for images 150 x 150 px.  So I thought if we resized the images smaller than that, we would see the whole image.  Smaller of course, but whole.

So I made it 25% size, which is approx 142 x 116 px. But still, the sides of the image are cut off.

Does that mean that it only recognizes img tags (not width or height)?

The strange thing is that this concept does seem to work, if the original image is taller than wide.  It even picked up an inserted attachment, in one of our tests! The original was 564 x 783, resized only by width, to 250 px.  And even though that is still larger than the Rotator image size (150 px), the full image is displayed.

So is it correct to say that this mod could work for images, if they are in the portrait orientation, not square or landscape?

brynn

Hhm, sometimes I tend to use too many words when asking a question.  Here's the shorter version.

Why does this mod work so well for images which are taller than wide (portrait orientation), and not so well for square, or images which are wider than tall (landscape orientation)?

Is there any simple way make it work for all three varieties?

Diego Andrés

Edit Themes/default/css/FirstTopicImage/styles.css and add at the end of the file:

.firstopicimage-slick div.resize_image > a > img {
object-fit: contain;
}

SMF Tricks - Free & Premium Responsive Themes for SMF.

brynn

Hey Diego Andres  :D

That works GREAT!  It's perfect - just what I wanted!

I'm not sure if a screenshot is really needed. But to help other users understand, in case it's not clear what the extra code does, here's a shot with most of the same images from my previous screenshot.

You cannot view this attachment.

So you can see those pink images and the blue VW bug (all 3 are SVG images 8) btw) are whole, as well as the logo/title image. We'll probably do a little adjusting, so there's a little less white space between and around each one.  And hopefully our whole site will be online before too much longer.

Anyway, thank you so very, very much!  We are happy campers  ;D



Advertisement: