[2.0.21] Only View Topics From Last N Days

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
2
33%
Very Good
3
50%
Good
1
17%
Fair
0
No votes
Poor
0
No votes
 
Total votes: 6

Extensions Robot
Extensions Robot
Extensions Robot
Posts: 29220
Joined: Sat Aug 16, 2003 7:36 am

[2.0.21] Only View Topics From Last N Days

Post by Extensions Robot »

MOD Name: Only View Topics From Last N Days
Author: asinshesq
MOD Description: This mod allows a user to set his own default for how far back in time he wants to go when looking in viewforum at old topics that have not been posted to for a while.


MOD Version: 1.0.5a (Updated 06/11/06)

Download File: Only_view_topics_from_last_N_days_v_1-0-5a.zip
mods overview page: View
File Size: 2762 Bytes

Support for this MOD needs to be asked within this topic. The phpBB Teams are not responsible or required to give anyone support for this MOD. By installing this MOD, the phpBB Support Team or phpBB MODifications Team may not be able to provide support.

This MOD has only been tested by the phpBB MOD Team with the phpBB version in the topic title. It may not work in any other versions of phpBB.
Last edited by Extensions Robot on Mon Apr 30, 2007 12:28 am, edited 1 time in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)
ycl6
Registered User
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

MOD Validated/Released

Notes:
As title, this MOD allows user to set to view topics from the last N days in viewforum.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

Thanks for completing the validation, mod team.

To give you a better idea about whtthis mod does, here's the full description from the mod's heading:

Code: Select all

## MOD Description:   This mod allows a user to set his own default for how far
##         back in time he wants to go when looking in viewforum at
##         old topics that have not been posted to for a while. 
##         In the forum view on an unmodded board, the default is
##         always "All", and if a user changes it while looking at
##         the topics in a given forum, the setting gets reset back
##         to "All" as soon as he moves on to another forum (and
##         stays at "All" even if he goes back to the original forum
##         where he changed it).
##
##         This mod also corrects the behavior of the function so that
##         it finds all topics that have been posted to in the last N days
##         (on an unmodded board, if you set it to look at topics for the
##         last N days, it will show you topics that were started
##         N days ago, but the proper behavior is to look for topics
##         that have been posted to in the last N days; this mod
##         fixes that behavior).
##
##         Finally, this mod fixes a few bugs in phpbb that mess up
##         pagination in various circumstances...see
##         http://www.phpbb.com/phpBB/viewtopic.php?t=203533
##         for details.
##
##         The real author of most of this mod is Slimy, who started this at
##         http://www.phpbb.com/phpBB/viewtopic.php?t=147116 .
##         I merely refined what he had already done. 
I want to emphasize the last sentence of that description...the real author of this mod is Slimy and I thank him for his original code that I merely tweaked here and there.
User avatar
Grebog
Registered User
Posts: 33
Joined: Fri May 14, 2004 12:10 am

quick question

Post by Grebog »

Code: Select all

## Files To Edit: 	viewforum.php
##			includes/functions.php
I noticed you say there are 2 files to modify and in your mod, it only tells you to open 1 file and modify it. Did I miss something or was there something left out?

also I am getting a parse error on line 770 here are the lines around there.

Code: Select all

766	$template->assign_vars(array(
767		'PAGINATION' => generate_pagination("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&topicdays=$topic_days", $topics_count, $board_config['topics_per_page'], $start),
768		'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), max(1, ceil( $topics_count / $board_config['topics_per_page'] )), 
769
770		'L_GOTO_PAGE' => $lang['Goto_page'])
771	);
I now this is probably something stupid, but any help would be appreciated.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

You miissed a final close parens that the mod tells you should be there... there should be three close parens before the final comma in line 768 according to the mod (the inline replace langauge has a single paren that gets replaced with a double and the rest of the line already had another close paren so that's three parens total). That should fix the parse error.

(A for your other observation, you are correct that I listed an extra file that my mod actually doesn't modify (an earlier version modified that file but the current version doesn't; but if you follow the mod actions everything should work)
User avatar
Grebog
Registered User
Posts: 33
Joined: Fri May 14, 2004 12:10 am

Post by Grebog »

I am sort of new to PHP and was just fiddling with a test forum to help understand the workings of it all and modding of a forum. But, currently have a live forum for anyone to see, so I am still somewhat new to this stuff and seem to miss the simple things easily. Thanks for the help.

I like this mod, it makes it easy for you to cut down how many posts you are looking at if you want to and really could help on some large forums when people are gone for a few days and only want to find out what was posted since they left.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

Grebog wrote: ...Thanks for the help.

No problem. By the way, it is very easy to miss little things like that when you instal a mod by hand...you may want to consider using easymod in the future to install mods since that is 100% dependible on that kind of stuff (of course, if your board is starting to get heavily modded, easymod will begin to have trouble finding lines that are no longer there, but it tells you where it has problems and then you can tinker with the mod to make if fit your board.
I like this mod, it makes it easy for you to cut down how many posts you are looking at if you want to and really could help on some large forums when people are gone for a few days and only want to find out what was posted since they left.

Thanks for the feedback.
jay98s10
Registered User
Posts: 34
Joined: Thu Feb 06, 2003 7:17 pm
Location: louisville ky
Contact:

Post by jay98s10 »

i have installed this and now i get this error any ideals
Parse error: parse error, unexpected T_DOUBLE_ARROW in /usr/home/ohiovall/public_html/forum/viewforum.php on line 687



copy from line 687

'L_GOTO_PAGE' => $lang['Goto_page'])


thanks

Jay
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

Jay, you need to check how you installed the mod again. That error is probably as a result of you having mismtached parenthesis or a missed semicolon or comma somewhere before the line in question.

I'll hazard a guess and say take a look at the final IN-LINE REPLACE action in the mod, which contains two open parens and two close parens (you may have missed the second close parens?).
kellydebs
Registered User
Posts: 45
Joined: Sat Nov 13, 2004 11:45 pm

Post by kellydebs »

I'm new to this stuff. I've done all of the mod except what (and how?) do I do with this line?

ALTER TABLE phpbb_users ADD topic_view_time_id mediumint(8) default '0' AFTER user_regdate;

Thanks much!
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

kellydebs wrote: I'm new to this stuff. I've done all of the mod except what (and how?) do I do with this line?

ALTER TABLE phpbb_users ADD topic_view_time_id mediumint(8) default '0' AFTER user_regdate;

Thanks much!


That tells you to change the phpbb_users table table in your database by adding a new column called topic_view_time_id and tell your db that that column is mediumint(8) and should be set to a default of '0'.

You need to do that in whatever way you fool arround with your db. For example, you might use the command line in mysql. Or you might use any one of a number of database gui programs.

Or, if you prefer, you could install easymod and then use easymod to do all the work for you.
kellydebs
Registered User
Posts: 45
Joined: Sat Nov 13, 2004 11:45 pm

Post by kellydebs »

asinshesq wrote: Or, if you prefer, you could install easymod and then use easymod to do all the work for you.


Thanks for that! I installed easymod and so far have successfully installed :arrow:

1.) View posts since last visit
2.) Country Flags in profile
3.) Spell Check by SpellingCow.com
4.) Log me on automatically each visit checked by default
5.) Only View Topics From Last [N] Days

Thanks again :D
vilhena
Registered User
Posts: 5
Joined: Fri Feb 06, 2004 10:12 pm

Post by vilhena »

Does anybody tested in the 2.0.11 code? Since the last security problems reported in the old versions I'm very afraid of instaling any MOD. :cry:

Tks a lot!
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

This mod works fine with 2.0.11 (it doesn't change any files that the change from 2.0.10 to 2.0.11 impacts). And it uses the same intval command to prevent SQL injection that 2.0.11 uses so it should not create any new security issues. But I have not submitted this for another round of validation so take a look at the code and decide for yourself.
Xusqui
Registered User
Posts: 84
Joined: Wed Jun 02, 2004 10:35 pm
Contact:

Post by Xusqui »

I installed this mod at www.ka-tet-corp.com but I don't know how users can specify the amount of days they want to watch topics from...
Post Reply

Return to “[2.0.x] MOD Database Releases”