Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: dougiefresh on March 31, 2016, 05:11:47 PM

Title: Last Post From Previous Page
Post by: dougiefresh on March 31, 2016, 05:11:47 PM
Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=4102)



LAST POST FROM PREVIOUS PAGE 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=4102)



Introduction
This mod makes changes to the forum so that the last post from the previous page in that thread is displayed as the first post on the next page.  So if the forum only shows 10 posts per page, then page 1 has 10 posts (posts 1 thru 10), the page 2 and above will have 11 (posts 10 thru 20, 20 thru 30, etc)....

Admin Settings
There are 5 new settings under Admin -> Configuration -> Modification Settings.  They are:
o Show last post from previous page
o Dim last post from previous page by
o Undim the post by hovering the cursor over it?
o Remove images in last post from previous page?
o Remove functionality from last post from previous page?

Related Discussions
o Last post on each page (http://www.simplemachines.org/community/index.php?topic=493110.0) (Original Request)
o Last post on each page (http://www.simplemachines.org/community/index.php?topic=544738.0) (Split Topic)

Translations Courtsey of:
o French UTF8 translation by TourFL (http://www.simplemachines.org/community/index.php?action=profile;u=333196)
o Portuguese Brazilian translations by DSystem (http://www.simplemachines.org/community/index.php?action=profile;u=341618)
o Spanish Latin translations by Rock Lee [BC] (http://www.simplemachines.org/community/index.php?action=profile;u=322597)

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

Changelog
The changelog can be viewed at XPtsp.com (http://www.xptsp.com/board/free-modifications/last-post-from-previous-page/?tab=1).

License
Copyright (c) 2016 - 2019, 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: Last Post From Previous Page
Post by: Biology Forums on March 31, 2016, 05:29:30 PM
Yet another feature that should be included as a stock forum option...

Congratulations ;)
Title: Re: Last Post From Previous Page
Post by: -Rock Lee- on March 31, 2016, 05:37:04 PM
I took a few minutes to realize the change and how it works, really good change :-) bravo for the effort but I have one question to give the translation the "dim" and investigare :-P


Regards!
Title: Re: Last Post From Previous Page
Post by: Steve on March 31, 2016, 06:03:00 PM
I originally posted this in the mod request thread then thought it might be better here.


Cool beans on the approved mod!

I should have been more specific in my suggestion about image links. While what you did works fine and I'm happy to have it as is, I was thinking this:

[url=url of first image]Image 1[/url]

[url=url of first image]Image 2[/url]

[url=url of first image]Image 3[/url]

etc.
Title: Re: Last Post From Previous Page
Post by: dougiefresh on March 31, 2016, 07:08:54 PM
Uploaded v1.2 - March 31th, 2016
o Added support for SMF 2.0.x's Core template.
o Added support for SMF 2.1 Beta 2.
o Changed remove picture code to create numbered URL links instead of changing image IMGs into URLs.




@Steve: Your request has been implemented in version 1.2.  Thank you for explaining precisely what you wanted!

Quote from: Steve on March 31, 2016, 06:03:00 PM
[url=url of first image]Image 2[/url]
[url=url of first image]Image 3[/url]
O:) I hope you meant:
[url=url of SECOND image]Image 2[/url]
[url=url of THIRD image]Image 3[/url]
Title: Re: Last Post From Previous Page
Post by: Steve on March 31, 2016, 07:41:03 PM
Quote from: dougiefresh on March 31, 2016, 07:08:54 PMO:) I hope you meant:
[url=url of SECOND image]Image 2[/url]
[url=url of THIRD image]Image 3[/url]

Oopsie! Yep, that's what I meant of course. Thanks so much Dougie. ;D
Title: Re: Last Post From Previous Page
Post by: Steve on March 31, 2016, 07:49:58 PM
Unfortunately, there's an issue when there is more than one image. I put two images in the last post of a page and the first post of the next page gave me this:

Second image test: [img]url of image][ Image 1 ]
Title: Re: Last Post From Previous Page
Post by: dougiefresh on March 31, 2016, 08:43:56 PM
Quote from: Steve on March 31, 2016, 07:49:58 PM
Unfortunately, there's an issue when there is more than one image. I put two images in the last post of a page and the first post of the next page gave me this:

Second image test: [img]url of image][ Image 1 ]
:o Oh, regular expressions give me the worst headaches....  It worked for one image, and I assumed it would work for more than one.  I'll look into the issue....
Title: Re: Last Post From Previous Page
Post by: Steve on April 01, 2016, 07:25:37 AM
Thank ya. :)
Title: Re: Last Post From Previous Page
Post by: dougiefresh on April 01, 2016, 07:53:57 AM
Uploaded v1.3 - April 1st, 2016
o Fixed remove picture code to properly change multiple IMG tags to URL tags.
Title: Re: Last Post From Previous Page
Post by: DSystem on April 01, 2016, 09:13:27 AM
Another translation ...

Português Brazil

Title: Re: Last Post From Previous Page
Post by: DSystem on April 01, 2016, 09:19:07 AM
The activated this option in the profile:

Show most recent posts at the top.

The post is shown in the wrong place.
Title: Re: Last Post From Previous Page
Post by: -Rock Lee- on April 01, 2016, 10:43:35 AM
I had some doubts with a translation of "dim" now I leave the translation investigate :D

index.spanish_latin.php

$txt['post_from_previous_page'] = 'de la página anterior';

index.spanish_latin-utf8.php

$txt['post_from_previous_page'] = 'de la página anterior';


ManageSettings.spanish_latin.php

$txt['LPOEP_show_last_post'] = '¿Mostrar último mensaje de la página anterior?';
$txt['LPOEP_dim_css'] = 'Oscurecer &uacuteltimo mensaje de la p&aacute;gina anterior por:<div class="smalltext">Use <strong>0</strong> para deshabilitar esta opci&oacute;n.</div>';
$txt['LPOEP_undim_hover'] = '¿Aclarar el tema, con solo pasar el cursor sobre &eacute;l?';
$txt['LPOEP_remove_images'] = '¿Eliminar im&aacute;genes en el tema anterior de la p&aacute;gina anterior?';
$txt['LPOEP_remove_function'] = '¿Retirar la funcionalidad del &uacuteltimo mensaje de la p&aacute;gina anterior?<div class="smalltext">Los ejemplos incluyen citar, respuesta, borrado, etc.</div>';


ManageSettings.spanish_latin-utf8.php
$txt['LPOEP_show_last_post'] = '¿Mostrar último mensaje de la página anterior?';
$txt['LPOEP_dim_css'] = 'Oscurecer último mensaje de la página anterior por:<div class="smalltext">Use <strong>0</strong> para deshabilitar esta opción.</div>';
$txt['LPOEP_undim_hover'] = '¿Aclarar el tema, con solo pasar el cursor sobre él?';
$txt['LPOEP_remove_images'] = '¿Eliminar imágenes en el tema anterior de la página anterior?';
$txt['LPOEP_remove_function'] = '¿Retirar la funcionalidad del último mensaje de la página anterior?<div class="smalltext">Los ejemplos incluyen citar, respuesta, borrado, etc.</div>';



And also I leave you hope files are well

Regards!
Title: Re: Last Post From Previous Page
Post by: dougiefresh on April 01, 2016, 02:41:09 PM
Uploaded v1.4 - April 1st, 2016
o Fixed post sorting issue with "Show most recent posts at the top" option checked.
o Added Portuguese Brazilian translations by DSystem (http://www.simplemachines.org/community/index.php?action=profile;u=341618).
o Added Spanish Latin translations by Rock Lee [BC] (http://www.simplemachines.org/community/index.php?action=profile;u=322597).




@DSystem and @Rock Lee [BC]: Thank you for the translations!  They have been included in version 1.4!

Quote from: DSystem on April 01, 2016, 09:19:07 AM
The activated this option in the profile:

Show most recent posts at the top.

The post is shown in the wrong place.
I've fixed this particular bug report in version 1.4!  Thank you for reporting it!
Title: Re: Last Post From Previous Page
Post by: Steve on April 01, 2016, 03:34:45 PM
Works a treat now. Can't thank you enough! ;D
Title: Re: Last Post From Previous Page
Post by: aegersz on March 06, 2017, 12:03:34 AM
occasionally the original post on the previous page ALSO gets greyed out also when I set the dimming on.

Title: Re: Last Post From Previous Page
Post by: dougiefresh on March 06, 2017, 10:32:48 AM
Quote from: aegersz on March 06, 2017, 12:03:34 AM
occasionally the original post on the previous page ALSO gets greyed out also when I set the dimming on.
I'll look into it.
Title: Re: Last Post From Previous Page
Post by: dougiefresh on July 18, 2017, 12:19:49 AM
@aegersz:  I apologize for the latest of my reply.  Things got rather hectic in my life.....

Regarding your bug report, I can't see where the code might be producing the bug report you provided....  Can you be more specific on the circumstances where it happens?  Maybe even a admin credentials (via PM) and a link?
Title: Re: Last Post From Previous Page
Post by: aegersz on July 19, 2017, 08:30:17 AM
no worries ... try
https://forum.drugs-and-users.org/index.php/topic,3779.msg40971.html#msg40971
I appreciate your pursuit of perfection.  :)
Title: Re: Last Post From Previous Page
Post by: Steve on July 19, 2017, 08:51:15 AM
Does one need an account to look at that link or did you pm creds to him?
Title: Re: Last Post From Previous Page
Post by: aegersz on July 19, 2017, 06:14:16 PM
do you mind registering?

I will remove you afterwards if you wish.

or shall I copy it to a public area ? I'd rather not but it's your call.
Title: Re: Last Post From Previous Page
Post by: dougiefresh on July 19, 2017, 08:20:08 PM
@aegersz:  PM sent.  Still can't duplicate the bug report....

@Steve:  Yeah, one needs an account in order to view the topic linked to.
Title: Re: Last Post From Previous Page
Post by: aegersz on July 19, 2017, 09:09:11 PM
you are an administrator for a while, dougie
Title: Re: Last Post From Previous Page
Post by: dougiefresh on July 21, 2017, 12:09:13 AM
@aegersz:  PM Sent.  I've looked around your forum and I don't see anything that sticks out as a problem.  Can you attach your Sources/Display.php and Themes/Default/Display.template.php files so that maybe I can see what is going on with them?  Thanks!  (I'm going to bed now)
Title: Re: Last Post From Previous Page
Post by: aegersz on July 27, 2017, 01:47:55 AM
sorry about the delay but they are now attached. Thanks for taking the time.
Title: Re: Last Post From Previous Page
Post by: dougiefresh on July 28, 2017, 07:01:11 PM
Uploaded v1.5 - July 28th, 2017
o Added support for SMF 2.1 Beta 3.
o Removed support for SMF 2.1 Beta 1 and 2.
o Moved one section of code ahead by a few lines.
o Capped max dimming to 90% opacity, as opposed to 100% in previous versions.




@aegersz:  I still can't see any obvious reason for the bug report....  I made a few changes which MAY solve the issue, but it is impossible for me to know since I can't duplicate it, nor can I figure out the why your bug report happens....  Let me know if this update fixes the issue.  Thanks for the report!
Title: Re: Last Post From Previous Page
Post by: Steve on July 29, 2017, 08:36:09 AM
There's a problem Dougie. When I go into a board and click on a 'new' indicator for any thread that has new responses, I'm taken to the top of the last page instead of the new posts.

I reinstalled v1.4 and it works correctly.
Title: Re: Last Post From Previous Page
Post by: dougiefresh on July 29, 2017, 12:06:02 PM
Removed version 1.5 and reupped version 1.4 as the downloadable mod version....  (Sigh)
Title: Re: Last Post From Previous Page
Post by: aegersz on August 01, 2017, 05:45:30 AM
another clue for you, it never happens on the first page (no dimming on the first post of the second page either) and always happens afterwards.

shall i still try your latest version ?
Title: Re: Last Post From Previous Page
Post by: aegersz on September 12, 2017, 09:39:23 AM
solved. this is now working. i have no idea why but i since went to 2.0.14 and upgraded a bunch of your mods.
Title: Re: Last Post From Previous Page
Post by: dougiefresh on September 12, 2017, 09:56:38 AM
Good to hear.....
Title: Re: Last Post From Previous Page
Post by: dougiefresh on October 22, 2018, 04:08:03 PM
Uploaded v1.6 - October 19th, 2018
o Reverted code back to v1.4.
o No functionality change.
o Updated documentation to point to new website.
Title: Re: Last Post From Previous Page
Post by: dougiefresh on May 22, 2019, 06:56:15 PM
Uploaded v1.7 - May 22nd, 2019
o Added support for SMF 2.1 RC2.
o Removed support for SMF 2.1 Beta 3.
Title: Re: Last Post From Previous Page
Post by: Steve on August 31, 2022, 07:03:38 PM
I don't know when Dougie was last here but any chance of an update?
Title: Re: Last Post From Previous Page
Post by: GL700Wing on August 31, 2022, 07:13:53 PM
Quote from: Steve on August 31, 2022, 07:03:38 PMI don't know when Dougie was last here but any chance of an update?
He hasn't posted anything since mid 2019 (or responded to messages I've sent him since then about his mods I'm a co-author of) so someone might have to create a new mod with this feature ...
Title: Re: Last Post From Previous Page
Post by: Steve on August 31, 2022, 08:19:14 PM
Quote from: GL700Wing on August 31, 2022, 07:13:53 PM
Quote from: Steve on August 31, 2022, 07:03:38 PMI don't know when Dougie was last here but any chance of an update?
He hasn't posted anything since mid 2019 (or responded to messages I've sent him since then about his mods I'm a co-author of) so someone might have to create a new mod with this feature ...
And as you're a good mod writer ...  ;)

(And I'm willing to pay.)
Title: Re: Last Post From Previous Page
Post by: GL700Wing on August 31, 2022, 09:36:39 PM
Quote from: Steve on August 31, 2022, 08:19:14 PMAnd as you're a good mod writer ...  ;)
Already on to it (gonna try and 'hook' this one!) ...  ;)
Title: Re: Last Post From Previous Page
Post by: Steve on September 01, 2022, 07:13:14 AM
You're awesome.  ;D
Title: Re: Last Post From Previous Page
Post by: GL700Wing on September 02, 2022, 09:44:04 AM
@Steve - SMF 2.1 version of mod submitted for approval earlier today ...
Title: Re: Last Post From Previous Page
Post by: Steve on September 02, 2022, 09:49:30 AM
Thanks GL!  ;D