Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: dougiefresh on March 02, 2016, 04:54:11 PM

Title: Attachment List In Recent Posts
Post by: dougiefresh on March 02, 2016, 04:54:11 PM
Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=4090)



ATTACHMENT LIST IN RECENT POSTS v1.7
By Dougiefresh (http://www.simplemachines.org/community/index.php?action=profile;u=253913) -> Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=4090)



Introduction
This mod adds a simple list of attachments to any post that has attachments, if the user can view attachments in the board that the post is in.

Uninstalling Error for v1.0
If you have installed VERSION 1.0, you will have difficulty uninstalling this mod and I apologize for this!!!  Please replace your v1.0 mod with the attached mod in this post (http://www.simplemachines.org/community/index.php?topic=544046.msg3863987#msg3863987).  This will resolve the uninstall issue....

Related Discussion
o Show attachments (or links) in Recent Posts like templates. (http://www.simplemachines.org/community/index.php?topic=425338.0)

Compatibility Notes
This mod was tested on SMF 2.0.11 and SMF 2.1 Beta 2, but should work on SMF 2.0 and up.  SMF 1.x is not and will not be supported. 

Translators
o Spanish Latin: Rock Lee [BC] (http://www.simplemachines.org/community/index.php?action=profile;u=322597)

Changelog
The changelog has been removed and can be seen at XPtsp.com (http://www.xptsp.com/board/index.php?topic=665.msg982#msg982).

License
QuoteCopyright (c) 2016 - 2018, Douglas Orend
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Title: Re: Attachment List In Recent Posts
Post by: Antechinus on March 03, 2016, 12:36:27 AM
Nice one. Now wait for someone to ask if they can see the actual attachment directly in recent posts.

/me grabs his popcorn.
Title: Re: Attachment List In Recent Posts
Post by: dougiefresh on March 03, 2016, 10:03:59 AM
Was planning on doing exactly that for mod submission, until I realized how much code I'd have to duplicate....  Figured it be better later on....
Title: Re: Attachment List In Recent Posts
Post by: dougiefresh on March 04, 2016, 08:57:35 PM
Uploaded v1.1 - March 4th, 2016
o Added support for SMF 2.1 Beta 2.  No functionality change for SMF 2.0.x branch.
o Fixed broken uninstaller found in VERSION 1.0 mod.




@Everybody: If you have installed VERSION 1.0, you will have difficulty uninstalling this mod and I apologize for this!!!  Please replace your v1.0 mod with the attached revised mod.  This will resolve the uninstall issue....
Title: Re: Attachment List In Recent Posts
Post by: aegersz on April 04, 2016, 04:56:52 AM
Error in Package Installation

1.   Replace   ./Themes/default/Recent.template.php   Test failed

you expected:

</ul>
</div>';
}
echo '
<span class="botslice clear"><span></span></span>
</div>';


BUT this is here instead (with a few lines on either end):

                if ($post['can_reply'] || $post['can_mark_notify'] || $post['can_delete'])
                        echo '
                                        </ul>
                                </div>';

                echo '
                                <span class="botslice clear"><span></span></span>
                        </div>';

        }

        echo '
                <div class="pagesection">
                        <span>', $txt['pages'], ': ', $context['page_index'], '</span>
                </div>
        </div>';
}


can you help me make this fix please ? or is my system over-modified and too much of a hassle ?
Title: Re: Attachment List In Recent Posts
Post by: -Rock Lee- on April 04, 2016, 10:07:11 AM
Now we go one to not confuse lol @dougiefresh Great work indeed :D

index.spanish_latin.php and index.spanish_latin-utf8.php
$txt['airp_attachments'] = 'Archivo(s) Adjunto(s)';

Regards!
Title: Re: Attachment List In Recent Posts
Post by: dougiefresh on April 04, 2016, 04:04:00 PM
Uploaded v1.2 - April 4th, 2016
o Added Spanish Latin translation by Rock Lee [BC] (http://www.simplemachines.org/community/index.php?action=profile;u=322597).




@Rock Lee [BC]: Thank you for the translation!  It's been included in this version!
Title: Re: Attachment List In Recent Posts
Post by: Rob Lightbody on April 07, 2016, 01:46:41 PM
Quote from: aegersz on April 04, 2016, 04:56:52 AM
Error in Package Installation

I have the same problem!   (on 2.0.11)
Title: Re: Attachment List In Recent Posts
Post by: dougiefresh on April 07, 2016, 06:21:42 PM
Uploaded v1.3 - April 7th, 2016
o Fixed install operation in install_20x.xml for Recent.template.php that failed.




@The QE2 Story Forum and @aegersz: Thank you for reporting the installation error!  It has been fixed!
Title: Re: Attachment List In Recent Posts
Post by: Rob Lightbody on April 08, 2016, 05:05:30 AM
Thanks - now installed and working!
Title: Re: Attachment List In Recent Posts
Post by: aegersz on April 11, 2016, 04:54:20 AM
same here !

THANKS to you, too ... mine installed like a hand in a glove ((:))).
Title: Re: Attachment List In Recent Posts
Post by: Ninja ZX-10RR on January 13, 2018, 11:16:17 PM
Please check security reports. It's not "everyone can get admin" level of "bad", but still not nice. Me and a friend of mine found this issue while he was helping me to customize a couple of things for another area.
Title: Re: Attachment List In Recent Posts
Post by: dougiefresh on January 14, 2018, 07:04:36 AM
Quote from: Ninja ZX-10RR on January 13, 2018, 11:16:17 PM
Please check security reports. It's not "everyone can get admin" level of "bad", but still not nice. Me and a friend of mine found this issue while he was helping me to customize a couple of things for another area.
And how do I do that?
Title: Re: Attachment List In Recent Posts
Post by: Arantor on January 14, 2018, 07:14:15 AM
Security reports are sent to the SMF team and passed on to the mod author if they are found to be accurate. So many of the reports received are 'this mod is insecure because it broke my forum'.

For the record, and I can't even see the security report (not team, yo), but glancing at the code I'd assume the issue is 'unapproved attachments can be disclosed to non-approvers' but since the unapproved attachments should still be protected by the rest of the platform, it's probably not an immediate threat.
Title: Re: Attachment List In Recent Posts
Post by: dougiefresh on January 14, 2018, 08:40:43 PM
Uploaded v1.4 - January 14th, 2018
o Fixed security report that allowed unapproved attachments to be listed.




@Ninja ZX-10RR:  Thank you for reporting this particular little "nasty".  I've fixed this issue for this version!

@Arantor:  Right on the money, bro!  Thanks!
Title: Re: Attachment List In Recent Posts
Post by: Ninja ZX-10RR on January 20, 2018, 09:08:39 PM
Quote from: Arantor on January 14, 2018, 07:14:15 AM
Security reports are sent to the SMF team and passed on to the mod author if they are found to be accurate. So many of the reports received are 'this mod is insecure because it broke my forum'.
I could comment in a really nasty way guessing the reason would be because of the sender (which is not me, btw), but I'll let that pass ;D
Quote from: Arantor on January 14, 2018, 07:14:15 AM
For the record, and I can't even see the security report (not team, yo), but glancing at the code I'd assume the issue is 'unapproved attachments can be disclosed to non-approvers' but since the unapproved attachments should still be protected by the rest of the platform, it's probably not an immediate threat.
Yeah it was it, didn't feel like throwing it here in plain text regardless.
Quote from: dougiefresh on January 14, 2018, 08:40:43 PM
@Ninja ZX-10RR:  Thank you for reporting this particular little "nasty".  I've fixed this issue for this version!
Thank a former SMF dev, which will remain nameless as he does no longer post or login here ;) Glad you fixed it anyway, thank you too!
Title: Re: Attachment List In Recent Posts
Post by: dougiefresh on February 10, 2018, 10:37:47 PM
Uploaded v1.5 - February 10th, 2018
o No functionality changes.
o Added LICENSE file to satisfy licensing requirements.
o Added translators to mod documentation file readme.txt.
Title: Re: Attachment List In Recent Posts
Post by: Rob Lightbody on March 30, 2018, 11:34:25 AM
Hi there,

This mod causes a problem with my forum - I've attached an image to illustrate.  It only happens for guests, and only after post 5.  All browsers.

I'm uninstalling it until there's a fix, but happy to try it again!

Cheers,

- Rob
Title: Re: Attachment List In Recent Posts
Post by: dougiefresh on March 30, 2018, 12:33:59 PM
Yeah, that's a pretty big bug you found!  Let me look into it!
Title: Re: Attachment List In Recent Posts
Post by: dougiefresh on April 03, 2018, 06:39:52 PM
Reproduced the error as a Guest on a clean 2.0.15 localhost forum.
Title: Re: Attachment List In Recent Posts
Post by: dougiefresh on April 03, 2018, 06:53:13 PM
Uploaded v1.6 - April 3rd, 2018
o SMF 2.0: Fixed template so that showing attachment list doesn't break display.




@The QE2 Story Forum:  Thank you for reporting the bug!  It's been fixed for this version!
Title: Re: Attachment List In Recent Posts
Post by: Rob Lightbody on April 07, 2018, 02:26:22 PM
Yes it works!

THANK YOU SO MUCH !!
Title: Re: Attachment List In Recent Posts
Post by: minimono on July 05, 2018, 11:21:15 AM
Iam SMF 2.0.15 install this mod
Why not show Attachment List  ?
Title: Re: Attachment List In Recent Posts
Post by: dougiefresh on August 16, 2018, 10:54:31 PM
Quote from: minimono on July 05, 2018, 11:21:15 AM
Iam SMF 2.0.15 install this mod
Why not show Attachment List  ?
I apologize for the lateness of my reply.  The answer: I dunno.  It could be a bug, and it could not be a bug.....

Several questions:  What is the URL to the post?  Are there any attachments in that post?  Do you have the permission to approve attachments enabled?  Are all attachments in that post approved?   And one final bonus question:  Are you the adminstrator (or an admin) of that forum, and can PM me login credentials so that I can see if I can fix the issue?
Title: Re: Attachment List In Recent Posts
Post by: minimono on August 23, 2018, 06:51:57 AM
I'm test on main webboard and localhost not show Attachment List.
Please wait i create new webboard on web host for test again.
Title: Re: Attachment List In Recent Posts
Post by: dougiefresh on October 10, 2018, 02:12:57 AM
Uploaded v1.7 - October 9th, 2018
o No functionality change.
o Updated documentation to point to new website.