Advertisement:

Author Topic: Thumbnail on Topic Listing  (Read 178262 times)

Offline SMFHacks.com Team

  • Jr. Member
  • **
  • Posts: 356
    • smfhacks on Facebook
    • @smfhacks on Twitter
    • SMFHacks.com
Thumbnail on Topic Listing
« on: April 04, 2008, 01:05:48 PM »
Link to Mod

This modification takes a thumbnail attachment attached to the first post of the topic and shows this thumbnail on the topic listing page of a forum.

Version 3.0.1
!Fixed bug SMF 2.0.x not saving new board thumbnail topic settings

Version 3.0
+Added support for img tags inside the first forum post for SMF 2.0 thanks to br360
Setting to control height width found under Modification Settings. Use zero in both values to disable it.
!Fixed board level permissions to hide thumbnails

Version 2.0
Big thanks to dougiefresh for this update.
+Adds an interface in the manage boards area to checkbox if the board has the thumbnail topic system enabled for it or not.

Version 1.1
!Fixed showing an image if there was another attachment of a different type before it.
!Also fixed issue with posts disappearing.
« Last Edit: June 11, 2011, 09:19:35 PM by vbgamer45 »
Disclaimer: SMFHacks.com Team is not affiliated with the SMF Team or the SimpleMachines NPO.

http://ForumRankings.net - Get Forum Ranked!
SMFHacks.com -  Paid Modifications for SMF
Latest Mods:
Community Suite
Newsletter Pro SMF Gallery Pro SMF Classifieds SMF Store

Offline dannbass

  • Sr. Member
  • ****
  • Posts: 768
  • Ex.php?erto
Re: Thumbnail on Topic Listing
« Reply #1 on: April 04, 2008, 01:47:21 PM »
Great! thanks for the mod! I have an idea, how about making it a board-based mod, so there one can choose where to put it in the ?action=manageboards section.

Great mod!

Offline RoarinRow

  • Full Member
  • ***
  • Posts: 662
  • Gender: Male
  • Ride my AV!
    • Avalanche Style
Re: Thumbnail on Topic Listing
« Reply #2 on: April 04, 2008, 04:35:54 PM »
Dang that is cool.  I'm just afraid what picture I'd see.  Knowing my members they will start a topic and put a funky picture up just to mess with me   >:(

SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

Offline GliG

  • Jr. Member
  • **
  • Posts: 105
  • Gender: Male
  • Only Develop.
Re: Thumbnail on Topic Listing
« Reply #3 on: April 04, 2008, 04:38:21 PM »
Great modification. Thank you vbgamer45...

Only Develop

Offline madman71

  • Full Member
  • ***
  • Posts: 652
Re: Thumbnail on Topic Listing
« Reply #4 on: April 04, 2008, 05:16:35 PM »
Just what I was almost looking for.  I think im gonna try it.  Just how bad does the server resources take a hit because of all of the queries??

How would one modify this to pick up hot linked images?
This is what im truly looking for ;D
« Last Edit: April 04, 2008, 06:53:05 PM by madman71 »

Offline madman71

  • Full Member
  • ***
  • Posts: 652
Re: Thumbnail on Topic Listing
« Reply #5 on: April 04, 2008, 06:52:34 PM »
one more thing.  Where in the script can i adjust the thumbnail size? They are quite large :)

Offline dannbass

  • Sr. Member
  • ****
  • Posts: 768
  • Ex.php?erto
Re: Thumbnail on Topic Listing
« Reply #6 on: April 04, 2008, 07:11:54 PM »
For that you'll need to go here /index.php?action=manageattachments and change the
Maximum width of thumbnails:     
Maximum height of thumbnails:

That should do it.

Offline madman71

  • Full Member
  • ***
  • Posts: 652
Re: Thumbnail on Topic Listing
« Reply #7 on: April 04, 2008, 10:01:14 PM »
For that you'll need to go here /index.php?action=manageattachments and change the
Maximum width of thumbnails:     
Maximum height of thumbnails:

That should do it.

Hummm, that didnt work :(

It changed the size of the thumbnails inside  the thread but not outside.  Is this how you did it (assuming that you have this mod)?

Offline madman71

  • Full Member
  • ***
  • Posts: 652
Re: Thumbnail on Topic Listing
« Reply #8 on: April 04, 2008, 10:17:33 PM »
NM, it works now.  Just took a bit  ;D

Online vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,477
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Thumbnail on Topic Listing
« Reply #9 on: April 04, 2008, 10:25:58 PM »
Great! thanks for the mod! I have an idea, how about making it a board-based mod, so there one can choose where to put it in the ?action=manageboards section.

Great mod!
That's planned for the next release.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline dannbass

  • Sr. Member
  • ****
  • Posts: 768
  • Ex.php?erto
Re: Thumbnail on Topic Listing
« Reply #10 on: April 04, 2008, 10:34:53 PM »
That's planned for the next release.

Fabulous! For now I'll get by with conditionals and $context['current_board'] and so on!

Thanks vbgamer45!

Offline drHaus

  • Semi-Newbie
  • *
  • Posts: 96
Re: Thumbnail on Topic Listing
« Reply #11 on: April 06, 2008, 07:54:16 PM »
I have eror

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LEFT(ml.body, 384) AS lastBody, LEFT(mf.body, 384) AS firstBody, ml.smileysEnabl' at line 11



 when write this line modifitacion:
IFNULL(big.ID_ATTACH, 0) AS bigId, big.filename AS bigFilename, big.width AS bigWidth, big.height AS bigHeight,
            IFNULL(thn.ID_ATTACH, 0) AS thnId, thn.filename AS thnFilename, thn.width AS thnWidth, thn.height AS thnHeight

Online vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,477
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Thumbnail on Topic Listing
« Reply #12 on: April 06, 2008, 08:16:49 PM »
I would need to see the whole query to see what is causing that error.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline drHaus

  • Semi-Newbie
  • *
  • Posts: 96
Re: Thumbnail on Topic Listing
« Reply #13 on: April 06, 2008, 08:29:55 PM »
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LEFT(ml.body, 384) AS lastBody, LEFT(mf.body, 384) AS firstBody, ml.smileysEnabl' at line 11
File: /home/phonedat/public_html/upoznavanje/Sources/MessageIndex.php
Line: 459

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 1.1.4, while your database is at version 1.1.2. The above error might possibly go away if you execute the latest version of upgrade.php.





this si cod , where is problem on messageindex.php:


mf.subject AS firstSubject, mf.icon AS firstIcon, mf.posterName AS firstMemberName,
            mf.ID_MEMBER AS firstID_MEMBER, IFNULL(memf.realName, mf.posterName) AS firstDisplayName,IFNULL(big.ID_ATTACH, 0) AS bigId, big.filename AS bigFilename, big.width AS bigWidth, big.height AS bigHeight,
            IFNULL(thn.ID_ATTACH, 0) AS thnId, thn.filename AS thnFilename, thn.width AS thnWidth, thn.height AS thnHeight
            LEFT(ml.body, 384) AS lastBody, LEFT(mf.body, 384) AS firstBody, ml.smileysEnabled AS lastSmileys,
            mf.smileysEnabled AS firstSmileys



Online vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,477
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Thumbnail on Topic Listing
« Reply #14 on: April 06, 2008, 08:32:09 PM »
Change this part
Code: [Select]
IFNULL(thn.ID_ATTACH, 0) AS thnId, thn.filename AS thnFilename, thn.width AS thnWidth, thn.height AS thnHeight
            LEFT(ml.body, 384) AS lastBody, LEFT(mf.body, 384) AS firstBody, ml.smileysEnabled AS lastSmileys,
            mf.smileysEnabled AS firstSmileys
To
Code: [Select]
IFNULL(thn.ID_ATTACH, 0) AS thnId, thn.filename AS thnFilename, thn.width AS thnWidth, thn.height AS thnHeight,
            LEFT(ml.body, 384) AS lastBody, LEFT(mf.body, 384) AS firstBody, ml.smileysEnabled AS lastSmileys,
            mf.smileysEnabled AS firstSmileys

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline drHaus

  • Semi-Newbie
  • *
  • Posts: 96
Re: Thumbnail on Topic Listing
« Reply #15 on: April 06, 2008, 08:45:41 PM »
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LEFT(ml.body, 384) AS lastBody, LEFT(mf.body, 384) AS firstBody, ml.smileysEnabl' at line 12
File: /home/phonedat/public_html/upoznavanje/Sources/MessageIndex.php
Line: 459

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 1.1.4, while your database is at version 1.1.2. The above error might possibly go away if you execute the latest version of upgrade.php




 part of cod:

mf.subject AS firstSubject, mf.icon AS firstIcon, mf.posterName AS firstMemberName,
            mf.ID_MEMBER AS firstID_MEMBER, IFNULL(memf.realName, mf.posterName) AS firstDisplayName,IFNULL(thn.ID_ATTACH, 0) AS thnId, thn.filename AS thnFilename, thn.width AS thnWidth, thn.height AS thnHeight,
            LEFT(ml.body, 384) AS lastBody, LEFT(mf.body, 384) AS firstBody, ml.smileysEnabled AS lastSmileys,
            mf.smileysEnabled AS firstSmileys
            LEFT(ml.body, 384) AS lastBody, LEFT(mf.body, 384) AS firstBody, ml.smileysEnabled AS lastSmileys,
            mf.smileysEnabled AS firstSmileys



Online vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,477
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Thumbnail on Topic Listing
« Reply #16 on: April 06, 2008, 08:48:02 PM »
You have the same code repeated remove one of the
Code: [Select]
LEFT(ml.body, 384) AS lastBody, LEFT(mf.body, 384) AS firstBody, ml.smileysEnabled AS lastSmileys,
            mf.smileysEnabled AS firstSmileys
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline drHaus

  • Semi-Newbie
  • *
  • Posts: 96
Re: Thumbnail on Topic Listing
« Reply #17 on: April 06, 2008, 08:55:44 PM »
it is work, you are best

Offline madman71

  • Full Member
  • ***
  • Posts: 652
Re: Thumbnail on Topic Listing
« Reply #18 on: April 06, 2008, 08:57:06 PM »
Vbgamer,

Do you know what would cause this glitch?  When i uninstall the mod the posts show up, but if i reapply it they disappear.   If i do a search for these missing posts they do show up though.

 

Online vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,477
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Thumbnail on Topic Listing
« Reply #19 on: April 06, 2008, 08:59:09 PM »
Vbgamer,

Do you know what would cause this glitch?  When i uninstall the mod the posts show up, but if i reapply it they disappear.   If i do a search for these missing posts they do show up though.

 
Not sure yet would need to do some more testing like what is contained in those posts?
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro