PunBB Resource

Your ultimate PunBB resource!

Keywords:

    (Extended)

You are not logged in.


Login to move these ads to the bottom of the page

#1 2005-04-22 19:48:39

Miles
Member
Registered: 2005-01-27
Posts: 31

Mark topics as read 1.1.3

Code:

##
##
##        Mod title:  Mark topics as read
##
##      Mod version:  1.1.3
##   Works on PunBB:  1.2.5
##     Release date:  2005-04-22
##           Author:  Miles Kaufmann (webmaster@twmagic.com)
##
##      Description:  This mod makes it so that topics are no longer marked as
##                    "new" in the forum view after they have been read, if
##                    they have not been posted in since being read.  This 
##                    mod also works on the list of forums in index.php.
##
##   Affected files:  header.php
##                    include/functions.php
##                    index.php
##                    lang/English/common.php
##                    lang/English/misc.php
##                    login.php
##                    moderate.php
##                    misc.php
##                    search.php
##                    viewforum.php
##                    viewtopic.php
##
##       Affects DB:  Yes; adds column "read_topics" to table "users".
##
##            Notes:  For notes see the included readme.txt.
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##

###########################################################################
#                                                                         #
#     Mark topics as read v1.1.3                                          #
#     Copyright (C) 2005  Miles Kaufmann                                  #
#     PunBB 1.2.5 mod                                                     #
#                                                                         #
###########################################################################

--[ Description ]----------------------------------------------------------

"Mark topics as read" is a PunBB mod which makes topics which have been
viewed no longer appear as "new" in the forum view. It adds a single column
to the "users" table, and uses no cookies. Installing this mod adds about
6KB of code to PunBB.

If you install this mod, you should set the "timeout_visit" option to at
least 30 minutes.  After the user's visit times out, the data associated
with this mod will be cleared from the database, and all posts before the
user's last visit will be marked read.  I would recommend setting
"timeout_visit" to one hour.

Because of the difficulty of creating mods for PunBB, it has become
impossible for me to maintain concurrent versions of this mod.
Unfortunately this means I have been forced to discontinue support for
older versions of PunBB.  You really should be using the latest version
anyway, so head to http://www.punbb.org/ to grab it.

--[ Installation using patch files ]---------------------------------------

There is a unified diff file provided with this mod, which will allow you
to easily install the mod on an unmodified or lightly modded installation
of PunBB.

To install this mod via patch, first upload install_mod.php to the root of
your PunBB installation, run it, and delete it.  Then, place the patch.diff
in the PARENT directory of your PunBB root directory (i.e., if your forums
are located in public_html/forums/ you should place the patch file directly
in the public_html/ folder).  Then, issue the following command in your
shell:

  patch -ul -d [punbb_dir] -p1 < [patch_file]

Replace [punbb_dir] with the path to your forums root directory and
[patch_file] with the name of the patch file. If you are running an
unmodified version of PunBB, the command should finish quickly without any
failures. If it does fail, you will have to update the failed files
manually.

Remember that YOU MUST RUN INSTALL_MOD.PHP PRIOR TO INSTALLING THIS MOD
WITH A PATCH.  Failure to do so may render your PunBB installation 
INOPERABLE.  You have been warned :)

--[ Version history ]------------------------------------------------------

Changes in v1.1.3:
  o Updated for compatibility with PunBB 1.2.5.
  o Miscellaneous minor code improvements.

Changes in v1.1.2:
  o Topic-read data will now be cleared when the user logs out manually.

Changes in v1.1.1:
  o Fixed bug which caused mod to make database queries more often and 
    take up more database space than was necessary.  Thanks to Smartys for
    pointing out this issue.

Changes in v1.1.0:
  o Fixed major bug with display of index.php; reduced number of DB queries
    made by the mod in index.php to 1.  Reported by cheesypeanut.
  o Updated search.php to display search results with the correct state of
    "newness", like viewtopic.php and moderate.php
  o Added language definitions for mod text.
  o Changed database to use a MEDIUMTEXT column to store the data.
  o Topic is now only marked read if it needs to be.

v1.0.0:
  o Initial release.

Download here

Offline

 

#2 2005-04-28 01:24:15

rhan
New member
Registered: 2005-04-28
Posts: 7

Re: Mark topics as read 1.1.3

It doesn't works with active topics mod sad

Offline

 

#3 2005-07-09 02:49:35

Jérémie
New member
From: Paris, France
Registered: 2005-07-09
Posts: 2

Re: Mark topics as read 1.1.3

Did someone try it with PunBB 1.2.6 ?

Offline

 

#4 2005-07-09 09:57:26

Smartys
Member
Registered: 2005-03-17
Posts: 332
Website

Re: Mark topics as read 1.1.3

Did any of the changes affect places where code needs to be changed for this mod to work? If not, it will work just fine, although you'll need to edit install_mod.php


Free PunBB Hosting - lots of mods, easy to customize

Offline

 

#5 2005-07-10 08:22:44

Keulig
Member
From: France
Registered: 2005-06-29
Posts: 14
Website

Re: Mark topics as read 1.1.3

Thank you very much, it seems to work perfectly !

Offline

 

#6 2005-07-13 04:01:52

Jérémie
New member
From: Paris, France
Registered: 2005-07-09
Posts: 2

Re: Mark topics as read 1.1.3

Smartys wrote:

Did any of the changes affect places where code needs to be changed for this mod to work? If not, it will work just fine, although you'll need to edit install_mod.php

That's why I wanted to know if someone tried it with 1.2.6 ; before upgrading using the patch tool. It can merge, but he's not that smart smile

Offline

 

#7 2005-07-29 17:05:02

muaddib
Guest

Re: Mark topics as read 1.1.3

Works perfectly with 1.2.6 wink

 

#8 2005-08-03 11:12:30

hamax
Guest

Re: Mark topics as read 1.1.3

I install the mod on 1.2.6 and it's not work fine!

When i read the post, it write in database a:1:{s:1:"t";a:1:{i:6;i:1123092230;}}
then i go to index or viewforum and it erase a:1:{s:1:"t";a:1:{i:6;i:1123092230;}} from database
then i refresh or go to viewforum/index and it isn't read!
why??

 

#9 2005-09-10 04:12:31

Philippe Worontzoff
Member
Registered: 2005-09-08
Posts: 26

Re: Mark topics as read 1.1.3

First, I see that it is possible to install it in a latter version then the 1.2.5. When I run install_mod.php,  I have got a message telling me that I don't have the right version (I've got the 1.2.7). How do I do to install the mod anyway ?

Second, may we expect a version of this mod for the 1.2.7 version of PunBB ? This mod seems so great, it's sad that it's not availlable for the last version of PunBB.

Last edited by Philippe Worontzoff (2005-09-10 04:48:27)

Offline

 

#10 2005-09-13 11:06:26

StevenBullen
Administrator
Registered: 2005-09-13
Posts: 345
Website

Re: Mark topics as read 1.1.3

It does work with 1.2.7 as well. It does need a few code changes and what not to make it run but other than that it works pretty well. I found some more info on a post in the Punbb forum.

Sorry I couldnt help you anymore.


Blog - Follow Me and FluxBB on Twitter

Online

 

#11 2005-09-29 21:25:07

intolerance
New member
Registered: 2005-09-29
Posts: 2

Re: Mark topics as read 1.1.3

help pls !
i am getting  Error: Unable to update user visit data.
but when i refresh the page the page seems to load
as i have discovered the error appears when user has no cookies from the site
do you know where is the problem?
tnks

Last edited by intolerance (2005-10-01 08:45:36)

Offline

 

#12 2005-10-20 08:55:17

tamlyn
New member
Registered: 2005-10-14
Posts: 9

Re: Mark topics as read 1.1.3

Just installed on v1.2.8 and seems to be working fine. I had to really search for the insertion points sometimes as my bb is already heavily modded so the line numbers din't match. Maybe something to consider for anyone who updates this mod.

Offline

 

#13 2005-11-17 08:16:14

bkhl
New member
Registered: 2005-11-17
Posts: 2

Re: Mark topics as read 1.1.3

Did anyone apply this successfully on 1.2.10?

Offline

 

#14 2005-11-24 06:58:37

redshift
New member
Registered: 2005-02-02
Posts: 3

Re: Mark topics as read 1.1.3

bkhl wrote:

Did anyone apply this successfully on 1.2.10?

Yep - I've used this successfully on every version of PunBB since the mod was released.

Offline

 

#15 2005-11-24 09:18:39

bkhl
New member
Registered: 2005-11-17
Posts: 2

Re: Mark topics as read 1.1.3

OK. I get some errors running the install script. (Even when I change it to accept the new version string.)

Offline

 

#16 2005-11-30 19:36:35

Twig
New member
Registered: 2005-11-30
Posts: 2

Re: Mark topics as read 1.1.3

nm works. Thanks.

Last edited by Twig (2005-11-30 20:23:16)

Offline

 

#17 2005-12-06 05:32:46

tefloncyklist
New member
Registered: 2005-12-06
Posts: 2

Re: Mark topics as read 1.1.3

Hi.

How do i do this part of the installation in Windows 2000?:

Then, issue the following command in your
shell:

  patch -ul -d [punbb_dir] -p1 < [patch_file]

Offline

 

#18 2005-12-06 17:03:39

Smartys
Member
Registered: 2005-03-17
Posts: 332
Website

Re: Mark topics as read 1.1.3

You don't use the patch file on Windows wink
You have to manually edit the code


Free PunBB Hosting - lots of mods, easy to customize

Offline

 

#19 2005-12-07 07:59:49

tefloncyklist
New member
Registered: 2005-12-06
Posts: 2

Re: Mark topics as read 1.1.3

Smartys wrote:

You don't use the patch file on Windows wink
You have to manually edit the code

Oh. Well I have to try to use my small skills then smile

Offline

 

#20 2006-01-14 12:06:09

llanis
Member
Registered: 2005-11-05
Posts: 14

Re: Mark topics as read 1.1.3

Hi everybody,
I have run this mod on PunBB 1.2.10 and it's seems to run perfectly but i've a graphic bug, when i'm on a forum, the style is modified...
For example :

http://outremonde.info/forums/forum2.html

When i delete this ligne of code which be present in header.php, it's run ok !

Code:

// MOD: MARK TOPICS AS READ - 2 LINES NEW CODE FOLLOW
    else if (basename($_SERVER['PHP_SELF']) == 'viewforum.php')
        $tpl_temp .= '</ul>'."\n\t\t\t".'<p class="conr"><a href="misc.php?action=markforumread&id='.$id.'">'.$lang_common['Mark forum as read'].'</a></p>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';

Last edited by llanis (2006-01-14 12:18:34)


Sorry for my bad english, I'm french wink

Offline

 

#21 2006-01-22 12:46:20

OmniX
New member
Registered: 2005-10-04
Posts: 2

Re: Mark topics as read 1.1.3

I have a problem.. My punbb 1.2.10 display 1030 guests.. I think it comes from function update_users_online()
Can you help me ? (Sorry but I'm french)

Offline

 

#22 2006-01-22 16:06:44

Smartys
Member
Registered: 2005-03-17
Posts: 332
Website

Re: Mark topics as read 1.1.3

How is that even related to this? hmm


Free PunBB Hosting - lots of mods, easy to customize

Offline

 

#23 2006-02-22 10:21:55

skoruppa
Member
Registered: 2005-10-18
Posts: 25

Re: Mark topics as read 1.1.3

working for my smile but not working in function show_new in search sad someone pls help

Offline

 

#24 2006-02-25 13:24:31

skoruppa
Member
Registered: 2005-10-18
Posts: 25

Re: Mark topics as read 1.1.3

ow and someone can do this mod for a subforum mod in a viewforum.php? PLS

Offline

 

#25 2006-02-27 05:39:01

basilou
Guest

Re: Mark topics as read 1.1.3

skoruppa wrote:

working for my smile but not working in function show_new in search sad someone pls help

The same thing for me. Work perfectly, but when i want to show message since last visit, it's show me only new message, not the title of the topic. Help, please.

basilou

 

Board footer

Based on PunBB
© Copyright 2002–2005 Rickard Andersson

© Copyright 2004–2006 Kristoffer Jansson

User contributed files are property of their respective owners.