[edit: effective as of phpbb3.0.6, phpbb now includes a view unread posts link so this mod no longer adds that, but it stll toggles the text from view unread posts ot you have no unread posts depending on whether there are any unread posts and it still performs the other functions of the original mod]Adds a 'View unread posts' or 'You have no unread posts' link on the index page (and, for subsilver2, each other page). Also adds a 'Mark post as unread' link at the bottom of each post and a mark pm as unread link at the bottom of each private message as well as a folder in the private messages part of the UCP for unread pms.
In prosilver this mod adds the link "View your unread posts" only to the index page. If you want the link to appear on other prosivler pages, see http://www.phpbb.com/community/viewtopi ... 5#p8267965The code this mod uses to figure out if there are unread posts is from phpbb3's core code in functions_display(). It is quite efficient and should not weigh down a board. If you change the code to count topics that have unread posts in them, that will begin to weigh down large boards (and may confuse people because the number of topics with unread posts is different from the number of unread posts). And if you change the code to count unread posts (rather than just topics that have unread posts), I suspect that will substantially weigh down boards (perhaps enough to be noticeable on boards that aren't that big). I don't think the overhead is worth it, and as a result I don't plan to add that feature.
However, anyone who wants to write the code is free to do that and post it here for people to try (I don't think it would be that hard if you know your way around php and mysql).
[added by edit: if you want to add this functionality despite the drag on your board (e.g. if you have a small board and aren't too worried about some extra queries), see http://www.phpbb.com/community/viewtopi ... 5#p8265455 ]
I would suggest that if you are going to be installing mods and you don't have a feel for html, you are way better off sticking with prosilver or subsilver2 since most mod authors are not going to go through the hassle of figuring out changes for templates other than the standard ones.sovietpop wrote:Has anyone installed this mod on a board that uses the Ubuntu* template? I can't work out what changes I need to make to the template files as my html is pretty damn weak.
Code: Select all
##############################################################
## MOD Title: View or mark unread posts - ubuntu changes
## MOD Author: asinshesq < N/A > (Alan) N/A
## MOD Description: Ubuntu changes for the view or mark unread posts mod
##
## MOD Version: 1.0.4
##
## Installation Level: Easy
## Installation Time: 5 Minutes
##
## Files To Edit: styles/ubuntu/template/overall_header.html
## styles/ubuntu/template/search_results.html
## styles/ubuntu/template/ucp_pm_viewmessage.html
## styles/ubuntu/template/viewtopic_body.html
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes: N/A
##
##############################################################
## MOD History:
##
## see mod history in main install file
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
styles/ubuntu/template/overall_header.html
#
#-----[ FIND ]------------------------------------------
# note: actual line is longer
<a href="{U_SEARCH_NEW}"><img src="./styles/ubuntu/theme/images/bullet.gif" border="0"/>{L_SEARCH_NEW}</a>
#
#-----[ IN-LINE FIND ]------------------------------------------
#
<a href="{U_SEARCH_NEW}"><img src="./styles/ubuntu/theme/images/bullet.gif" border="0"/>{L_SEARCH_NEW}</a>
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
<!-- IF S_INC_UNREAD_LINK --><!-- IF S_EXISTS_UNREADS --> <a href="{U_SEARCH_UNREAD}">{L_VIEW_UNREADS}</a><!-- ELSE --> <a href="{U_SEARCH_UNREAD}">{L_NO_UNREADS}</a><!-- ENDIF --><!-- ENDIF -->
#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- start mod view or mark unread posts (and end mod too) ... added unread references in the preceding line -->
#
#-----[ FIND ]------------------------------------------
# note: actual line is longer
<a href="{U_SEARCH_NEW}"><img src="./styles/ubuntu/theme/images/bullet.gif" border="0"/>{L_SEARCH_NEW}</a>
#
#-----[ IN-LINE FIND ]------------------------------------------
#
<a href="{U_SEARCH_NEW}"><img src="./styles/ubuntu/theme/images/bullet.gif" border="0"/>{L_SEARCH_NEW}</a>
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
<!-- IF S_INC_UNREAD_LINK --><!-- IF S_EXISTS_UNREADS --> <a href="{U_SEARCH_UNREAD}">{L_VIEW_UNREADS}</a><!-- ELSE --> <a href="{U_SEARCH_UNREAD}">{L_NO_UNREADS}</a><!-- ENDIF --><!-- ENDIF -->
#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- start mod view or mark unread posts (and end mod too) ... added unread references in the preceding line -->
#
#-----[ OPEN ]------------------------------------------
#
styles/ubuntu/template/search_results.html
#
#-----[ FIND ]------------------------------------------
#
<td colspan="2"><span class="titles"><!-- IF SEARCH_TITLE -->{SEARCH_TITLE}<!-- ELSE -->{SEARCH_MATCHES}<!-- ENDIF --></span><br /></td>
#
#-----[ IN-LINE FIND ]------------------------------------------
#
<br />
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
<!-- IF S_SHOW_MARK_FORUMS_LINK --><p class="gensmall"><a href="{U_MARK_FORUMS}">{L_MARK_FORUMS_READ}</a></p><br /><!-- ENDIF -->
#
#-----[ OPEN ]------------------------------------------
#
styles/ubuntu/template/ucp_pm_viewmessage.html
#
#-----[ FIND ]------------------------------------------
# Note: actual line is longer
<td class="gensmall" align="{S_CONTENT_FLOW_END}">
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<td valign="bottom"><a href="{U_MARK_UNREAD}" class="gensmall" title="{L_MARK_PM_UNREAD}">{L_MARK_PM_UNREAD}</a></td>
<!-- start mod view or mark unread posts (and end mod too) ... added preceding line -->
#
#-----[ OPEN ]------------------------------------------
#
styles/ubuntu/template/viewtopic_body.html
#
#-----[ FIND ]------------------------------------------
#
<td class="gensmall" align="{S_CONTENT_FLOW_END}">
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<!-- IF S_INC_UNREAD_LINK --><td valign="bottom"><a href="{postrow.U_MARK_UNREAD}" class="gensmall" title="{L_MARK_POST_UNREAD}">{L_MARK_POST_UNREAD}</a></td><!-- ENDIF -->
<!-- start mod view or mark unread posts (and end mod too) ... added mark_post_unread references in the preceding line -->
#
#-----[ DIY INSTRUCTIONS ]-------------------------------------------------
#
Go into the ACP styles section and click 'refresh' (and confirm) for
ubuntu's templates.
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM
I'm glad you took it that way...I intended it to be helpful but I realize that it may have sounded snippy. Good luck.sovietpop wrote:Thats probably very good advice Alan. Thanks for the code, I'll have a go implementing it tomorrow.
Thanks for letting me know you like it (that feedback is much appreciated). I'm curious, though, about why this mod turns out to be so useful for your board (since to me it seem somewhat useful but not earthshattering):Forke wrote:I've just installed this mod, and let me tell you that it is GREAT!
One of the best ones I've seen so far. I'm sure it'll be one of the most popular.
Thanks for making this mod!
Take a look on the index page of your forum right next to the "View new posts" link. You should see a "View unread posts" link...is it there? And at the bottom of each post in viewtopic, do you see a "Mark post as unread" link?Renodil wrote:I don't see any change. Could I see a demo?
No idea. What's the post count on index mod and where is it? There is no user named 'christian' on phpbb.com.Renodil wrote:Would the New post count on index by christian be interfering?