Wicher's phpBB2 Mods Forum Index Wicher's phpBB2 Mods
On this board you will find all phpBB2 mods that i have created over the years. Most mods are on this board installed. Before asking for support, be sure to have your board updated to the latest phpBB2 version.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Simple db_update generatorSimple db_update generator   Advanced db_update generatorAdvanced db_update generator 
 This board is protected by Phpbbantispam 

Newest Posts First With First Post on Top

 
Board Alert Board Message
There are in this topic 49 posts to view if you are logged in.

You can log in or register via the login / registerlink here or in the header.
Back to top  Login here and be redirected to this TopicLogin here and be redirected to this Topic RegisterRegister
Reply to topic    Wicher's phpBB2 Mods Forum Index -> Wicher's phpBB Mods Was this Topic Helpful?  
Points for this topic: 5
Topic gradiation: 
View previous topic :: View next topic  
Author Newest Posts First With First Post on Top
Wicher
Site Admin


Joined: 16 Dec 2005
Posts: 1144
User's local time:
2017 Sep 19 - 2:31 PM
Country IP         : Netherlands
Country of choice: Netherlands


Was This Post Helpful?

 
Users postingpoints:
57
Posts points:
0
Post gradiation:
PostPosted: Thu Jul 26, 2007 12:28 pm    Post subject: Reply with quote

Code:
  1. ##############################################################
  2. ## MOD Title:       Newest Posts First With First Post on Top
  3. ## MOD Author:      Wicher <N> (N/A) http://www.wichersmods.nl
  4. ## MOD Description: This mod places standard the newest posts first in viewtopic
  5. ##                  with the first post on top.
  6. ##
  7. ## MOD Version:     1.0.2
  8. ##
  9. ## Installation Level: Easy
  10. ## Installation Time: 15 Minutes
  11. ##
  12. ## Files To Edit:  viewtopic.php
  13. ##                 admin/admin_board.php
  14. ##                 includes/functions_post.php
  15. ##                 language/lang_english/lang_admin.php
  16. ##                 templates/subSilver/viewtopic_body.tpl
  17. ##                 templates/subSilver/admin/board_config_body.tpl
  18. ##
  19. ## Included Files:   <n>
  20. ##
  21. ## License:      http://opensource.org/licenses/gpl-license.php GNU General Public License v2
  22. ##
  23. ##############################################################
  24. ## For security purposes, please check: http://www.phpbb.com/mods/
  25. ## for the latest version of this MOD. Although MODs are checked
  26. ## before being allowed in the MODs Database there is no guarantee
  27. ## that there are no security problems within the MOD. No support
  28. ## will be given for MODs not found within the MODs Database which
  29. ## can be found at http://www.phpbb.com/mods/
  30. ##############################################################
  31. ## Author Notes:   
  32. ##         This mod has been tested on phpbb 2.0.22
  33. ##
  34. ##############################################################
  35. ## MOD History:
  36. ##
  37. ##   2007-09-09 - Version 1.0.2
  38. ##    - Added user choice wether to display the newest posts first or the oldest.
  39. ##   2007-07-29 - Version 1.0.1
  40. ##    - Added newtopic and reply buttons above the replies.
  41. ##   2007-07-26 - Version 1.0.0
  42. ##    - Started this mod
  43. ##
  44. ##############################################################
  45. ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
  46. ##############################################################


Newest_Posts_First_With_First_Post_on_Top_1.0.2.zip

Demo:


When you have installed Keep unread flags MOD then do the following after installing this mod:
Code:
  1. #
  2. # OPEN
  3. #
  4. viewtopic.php
  5. #
  6. # FIND
  7. #
  8. if ($topic_last_post_id == $postrow[$lastpost]['post_id'])
  9. {
  10.    //Read up to time of retrieval of this topic
  11.    $board_config['tracking_unreads'][$topic_id] = time();
  12. }
  13. //Reading a page, but not the last one, in a topic with new posts
  14. elseif (isset($board_config['tracking_unreads'][$topic_id]))
  15. {
  16.    //Set the highest of current topic_last_read and time of last post on page
  17.    $board_config['tracking_unreads'][$topic_id] = max($topic_last_read, $postrow[$lastpost]['post_time']); 
  18. }
  19. #
  20. # REPLACE WITH
  21. #
  22.    if ($board_config['newest_posts_first'] && $userdata['user_post_order'])
  23. {
  24.    if ($topic_last_post_id == $postrow[1]['post_id'])
  25.    {
  26.       //Read up to time of retrieval of this topic
  27.       $board_config['tracking_unreads'][$topic_id] = time();
  28.    }
  29.    //Reading a page, but not the last one, in a topic with new posts
  30.    elseif (isset($board_config['tracking_unreads'][$topic_id]))
  31.    {
  32.       //Set the highest of current topic_last_read and time of last post on page
  33.    $board_config['tracking_unreads'][$topic_id] = max($topic_last_read, $postrow[$lastpost]['post_time']); 
  34.    }
  35. }
  36. else
  37. {
  38.    if ($topic_last_post_id == $postrow[$lastpost]['post_id'])
  39.    {
  40.       //Read up to time of retrieval of this topic
  41.       $board_config['tracking_unreads'][$topic_id] = time();
  42.    }
  43.    //Reading a page, but not the last one, in a topic with new posts
  44.    elseif (isset($board_config['tracking_unreads'][$topic_id]))
  45.    {
  46.       //Set the highest of current topic_last_read and time of last post on page
  47.       $board_config['tracking_unreads'][$topic_id] = max($topic_last_read, $postrow[$lastpost]['post_time']); 
  48.    }
  49. }
  50. #
  51. # EoF
  52. #

_________________

Wicher's phpBB2 Mods | Wicher's phpBB3 Mods | Statistics Mod 4.x.x


Last edited by Wicher on Sun Sep 09, 2007 9:18 pm; edited 7 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Post new topic    Reply to topic    Wicher's phpBB2 Mods Forum Index -> Wicher's phpBB Mods
Author Newest Posts First With First Post on Top Replies
Display posts from previous:   
Post new topic   Reply to topic    Wicher's phpBB2 Mods Forum Index -> Wicher's phpBB Mods All times are GMT

Was this Topic Helpful?  
Points for this topic: 5
Topic gradiation: 
Page 3 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

This board is protected by Phpbbantispam
Powered by phpBB © 2001, 2005 phpBB Group

Googlepage: GooglePullerPage
IP Country Flag 2.9.4 © 2005, 2007 - 3Di (aka 3D)