vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=34)
-   -   [HTL] & [Normal] Persistant Mark Forum Read (https://vborg.vbsupport.ru/showthread.php?t=67154)

edschaum 07-13-2004 10:00 PM

[HTL] & [Normal] Persistant Mark Forum Read
 
Here's the core of a Persistant Mark Forum Read routine.

What it does and How it works:
Clicking the Mark Forum Read link in a forum now adds a record to the database and marks that forum read as of the moment you click the link. New messages posted after you mark a forum read will remain "new" until you click Mark Forum Read again in that forum.

To view ONLY new messages, click on the lightbulb instead of on the forum name. You'll only see threads that have been active since you marked the forum read.

The mod requires 2 new tables. Displaying new messages simply hijacks the $ daysprune function by plugging in the time that the forum was last marked read.

The standard Active Topics (View New Posts) function is unaffected, except that the lightbulb is no longer connected to that routine(optional). The lightbulb now indicates if the forum has been marked read with this routine.

There's also a QuickScan feature which shows the unread topics in all forums (similar to the regular View New Posts routine, but the threads remain on display until you mark each forum (or all forums) read.

Quickscan can be turned on and off for each forum separately.

Don't install this in a production environment, try it on a test system first.

Feedback and help appreciated.

Ed

July 14, 2004: Updated package to v0.3. This version includes a new file that will Mark ALL Forums Read.

July 22, 2004: Updated package to v0.4. This version includes QuickScan.

July 25, 2004: The basic package is now complete with the addition of individual forum on/off control in the quickscan.

Aug 7, 2004: Added text to make navigation easier. Added additional support for subforums

Aug 9, 2004: Added HTL installer

Jolten 07-14-2004 12:45 AM

Is there a demo somewhere?

edschaum 07-14-2004 12:56 AM

Quote:

Originally Posted by Jolten
Is there a demo somewhere?

pm me for the info

???`S?LV?R???` 07-14-2004 03:17 AM

lol is there a problem with making it a public demo? haha

edschaum 07-14-2004 11:48 AM

Quote:

Originally Posted by ???`S?LV?R???`
lol is there a problem with making it a public demo? haha

No, I just didn't think it was necessary to advertise my boards.

You can see this mod operating on these forums:

www.yestalk.org and www.afterhoursbbs.com

Ed

edschaum 07-14-2004 05:37 PM

I've updated the package to include "Mark ALL Forums Read"

mmw 07-14-2004 08:43 PM

Very nice thanks for sharing shall install tomorrow :)

Tailfeathers 07-16-2004 06:35 PM

I assume that posts won't automatically be marked read after you enter them under this system, right? It'd be nice if posts you entered/posted in were to be marked read like usual but the rest would stay unread until you either went into them or marked forum read (sort of like a combo of how it works now and the persistant mark forum read).

edschaum 07-17-2004 10:01 AM

Quote:

Originally Posted by Dan1113
I assume that posts won't automatically be marked read after you enter them under this system, right? It'd be nice if posts you entered/posted in were to be marked read like usual but the rest would stay unread until you either went into them or marked forum read (sort of like a combo of how it works now and the persistant mark forum read).

You can kinda use the 2 features together. When you click into a forum via the lightbulb in order to view your unread threads, the little "read first unread" icons appear.

However, if you come back later and view the same threads and there's been no activity, the icons are gone. In order to completely tie those icons in to the new system, I'd have to get rid of the mark read cookie entirely, which would break the old system.

I understand that the vBulletin team might impletement a "mark thread read" feature at some point, but that's beyond the scope of this hack.

Ed

Berethorn 07-17-2004 05:28 PM

This is AWESOME! :D Just what I've been looking for since coming to VB! Thank you! I shall try it, and hope it works. If not, we can work out the bugs. :)


EDIT: Initial testing reveals no problems! :D

(other than an issue with my database table prefixes, solved by adding 'prefix_' before 'lastreads' in your mysql query. that's not something you can fix though, it's an induvidual case) :tired:

edschaum 07-22-2004 04:25 PM

Thanks for the feedback, I'll look into the tableprefix issue.

I've also added the Quickscan routine, which is the first step towards making this hack practical.

Next on the list is to add the ability to turn individual forums on or off regarding inclusion in the quickscan.

After that, what I'd really like to do is fully integrate the package with vB. Ideally, there'd be an option to select which version of Mark Read to use - the version that's included with vB, or this one. I wonder if it would be possible to set it up so each user could choose which system they prefer. For example, it would be nice to be able to toggle the use of the "go to first unread" link to be part of this routine so that the icons stay visible until the forum is explicitly marked read.

That level of integration would probably require too many changes though. I wonder how I could convince Jelsoft to add this as a feature.

Ed

Berethorn 07-23-2004 06:54 PM

I'm afraid one of my users is getting this error: I think it may be in regards to this hack. Before this, I've had no problems, and I'm still using your the version without quickscan.

Quote:

Invalid SQL:
SELECT *
FROM [prefix]_lastreads
WHERE lr_member = AND lr_forum = 2

mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND lr_forum = 2' at line 3

mysql error number: 1064
Think this can be solved? :)

edschaum 07-23-2004 08:58 PM

Quote:

Originally Posted by Berethorn


Think this can be solved? :)


It kinda looks like the user is not logged in since there's no userid coming up in the query.

If the user IS logged in, then I'll need to know exactly what the user is doing, then I'll have to sign up on your forum and try to reproduce the error.

Note that error-checking is limited at this stage... I'm still in shock that it works at all :nervous:

edschaum 07-23-2004 11:59 PM

Quote:

Originally Posted by Berethorn
I'm afraid one of my users is getting this error: I think it may be in regards to this hack. Before this, I've had no problems, and I'm still using your the version without quickscan.



Think this can be solved? :)

I just noticed this in your report:
"FROM [prefix]_lastreads"

The table should be lr_lastreads, I wonder what happened there? You mentioned a problem with the table prefix, I wonder if this could be related.

Berethorn 07-24-2004 08:48 PM

It was originally "FROM bere_lastreads", but I changed it to [prefix] to avoid confusion. This isn't an issue, it's just my database adds a prefix before the table name.

But I fixed it, I think. The issue was, the user somehow ended up without a userid. Possibly mySQL failed during registration. I fixed it by getting them to sign up again. I don't think it was your hack causing the problem. Thanks, though. :)

edschaum 07-25-2004 09:36 PM

Ok, if any other problems, let me know. The latest version seems be working really well. And with the ability to quickscan selected forums, the main coding is done. All I have to do now is bring it up to vB coding standards and work out a few small details.

Tailfeathers 07-26-2004 06:35 AM

Can't wait for the final version. :)

I have a quick question -- what is this lightbulb you speak of?

edschaum 07-26-2004 11:28 AM

Quote:

Originally Posted by Tailfeathers
Can't wait for the final version. :)

I have a quick question -- what is this lightbulb you speak of?

On the main forum display page, there are icons to the left of each forum name. When there is new activity, those icons change...they "light up". On this site, the icons are little squares with check marks - there's a dull gray background when there's no activity, the background brightens up considerably when there are new messages.

The lightbulb terminology comes from the code... the routine to display that icon is called "getforumlightbulb".

Re the final version - writing the routine was the easy part. Bringing the code up to vBulletin standards will be the hard part! :cross-eyed:

I also have a better idea on displaying the quickscan results, but I don't know how to accomplish it programmatically, so that will have to wait until I learn a little more about the vB code.

In the meantime, I'll continue to clean up the current code in order to bring it to v1.0 so I can give it a full release.

Ed

Tailfeathers 07-27-2004 11:12 PM

Ahhh ok, thanks for the explanation. :)

Tailfeathers 07-29-2004 02:25 AM

One more question -- does this hack slow down the board or have any impact on the server or anything like that at all?

edschaum 07-29-2004 01:48 PM

Quote:

Originally Posted by Tailfeathers
One more question -- does this hack slow down the board or have any impact on the server or anything like that at all?

I would expect only minimal impact, but I can't really be certain. It hasn't had any effect on either of the 2 boards I'm running it on, so I don't think it will cause much additional server load.

Tailfeathers 08-02-2004 03:33 AM

I read in your instructions that it's pretty much crazy to install this on a live board right now...but do you think there'd actually be a problem? What could happen?

The board I am thinking of installing this on: http://www.tailfeathersnetwork.com/community/

edschaum 08-02-2004 03:53 AM

Quote:

Originally Posted by Tailfeathers
I read in your instructions that it's pretty much crazy to install this on a live board right now...but do you think there'd actually be a problem? What could happen?

The board I am thinking of installing this on: http://www.tailfeathersnetwork.com/community/

Chances are it would work just fine. I have it running on 2 boards with light traffic, and haven't experienced any problems.

I would suggest setting up a backup board first and running through the install to make sure it works on your setup. If it installs ok for you, then make a backup of your database, vBulletin directories and styles, and then do the installation, being very careful to add little signposts in the code so you can uninstall if needed.

Add some info to your faq or some other place to tell people how to use the mod. It's kind of confusing figuring out the diffs between the 2 mark read systems.

I'm pretty comfortable using it, since I know what to expect on which page, but that isn't always obvious to someone using it for the first time.

The bottom line is that there isn't much direct interaction between this module and the rest of the database, so the chances for messing up data are slim. I've only tested this on basic configurations, so I'm not quite sure how it will act on a more complex or really busy board in terms of queries and loads.

I'm happy to try to help if a problem arises, but I don't guarantee success.

Ed

weaver 08-06-2004 02:40 PM

I'm confused about step #9 in the instructions. It says to:

Quote:

9. Follow the same instructions for #7 except make the changes to "forumhome_forumbit_level1_post"
but my template forumhome_forumbit_level1_post doesn't have that original bit of code from step 7. Since you said to eliminate (or reverse if already done) step 7 it's confusing... Was that supposed to be an 8 instead?

I did search for the original code in step 8 and couldn't find it exactly in level 1's template. But I did find this code:

Quote:

<td><img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" /></td>
Is that what I'm supposed to replace with

Quote:

<td class="alt2">
<a href="forumdisplaynew.php?$session[sessionurl]f=$forum[forumid]">
<img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" /></a></td>

edschaum 08-06-2004 02:53 PM

Quote:

I'm confused about step #9 in the instructions
Yes, you're absolutely right. I changed the numbering in the instructions, but failed to update the reference in instruction 9. You are supposed to repeat the instructions from step 8 in the forumhome_forumbit_level1_post template.

You correctly figured out what to do. The code to display the lightbulb is right near the top, and we're just wrapping the link code around the image so that it becomes a hot link.

The instruction should read:
9. Follow the same instructions for #8 except make the changes to "forumhome_forumbit_level1_post"

I'll check my original templates to make sure that the code being searched for is an exact match, if not I'll update the instructs next time around.

Thanks for letting me know about mistake, and let me know if you have any other problems installing or using.

Ed

weaver 08-06-2004 03:11 PM

Also when doing the navbar edits... I didn't have this code:

Quote:

<if condition="$vboptions['enablesearches']"><tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getnew">$vbphrase[new_posts_nav]</a></td></tr>
</if>
but I did have

Quote:

<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getnew">$vbphrase[new_posts_nav]</a></td></tr>
At any rate I've finished installing and am trying it out...

weaver 08-06-2004 03:12 PM

Thanks Ed... You are a quick replier and that is much appreciated. :)

weaver 08-06-2004 03:19 PM

Here is a question. Right now when you do a quickscan it shows new posts but forum by forum. Is there a way where it will show new posts across forums in the order they were posted instead of grouping them by forum? I hope my question makes sense.

weaver 08-06-2004 03:21 PM

Also - will it support subforums? I'd like to be able to mark subforums read individually. Because of the way my site's set up main forums are more like categories with subforums being the actual forums for posting.

Editted - Okay I think I've figured out how to mark subforums read. What I meant was the ability to click on the forum icon and view new posts. I'd like that for subforums as well. Is that possible?

edschaum 08-06-2004 03:30 PM

Quote:

Originally Posted by snobbymom
Also when doing the navbar edits... I didn't have this code:



Hmmm, the getnew link appears several times in the navbar template.

I checked my default navbar template and I find that exact text but if you have a different style running, it might be slightly different. It's not that important though, that's just the place I selected to display those links, you might prefer them elsewhere anyway. The location of those links should not affect the operation of the mod.

Ed

edschaum 08-06-2004 03:40 PM

Quote:

Originally Posted by snobbymom
Here is a question. Right now when you do a quickscan it shows new posts but forum by forum. Is there a way where it will show new posts across forums in the order they were posted instead of grouping them by forum? I hope my question makes sense.

Yes, it makes perfect sense, I changed the display order in the mod.

Go into the file quickscan.php and find this:

ORDER BY forumid ASC,lastpost DESC

Change it to:

ORDER BY lastpost DESC

That should return the threads in date/time order without regard to which forum they are in.

weaver 08-06-2004 03:43 PM

Is that what places them in the quicklinks area? I'm having fun looking around after installing.

edschaum 08-06-2004 03:46 PM

Quote:

Originally Posted by snobbymom
Also - will it support subforums? I'd like to be able to mark subforums read individually. Because of the way my site's set up main forums are more like categories with subforums being the actual forums for posting.

Editted - Okay I think I've figured out how to mark subforums read. What I meant was the ability to click on the forum icon and view new posts. I'd like that for subforums as well. Is that possible?

I don't have any subforums set up, so I wasn't sure if it would work with subforums.

I'll set up a test board tonight with subforums and see what needs to be added. Chances are the hot link just has to be added to the forumbit that displays the subforums.

I don't know what happens when you add subforums, are there new level3 forumbits in the style editor? If so, just do the steps from 8 and 9 in the level 3 forumbits. If not, hang on and I'll look into it tonight.

edschaum 08-06-2004 03:47 PM

Quote:

Originally Posted by snobbymom
Is that what places them in the quicklinks area? I'm having fun looking around after installing.

I don't understand what you're asking.

weaver 08-06-2004 03:51 PM

Quote:

Originally Posted by edschaum
I don't understand what you're asking.

I was talking about the navbar edits. Asking if that edit is what places them in the quicklinks area. I like them there but I might move them so they are more noticeable to my members.

The main thing with the subforums is that clicking "mark forum read" through the forum tools option will not mark the forum read. So I'd need to be able to click on the icon to enter and then mark it read. At least that's what I think is supposed to happen from reading your explanation in the install instructions.

weaver 08-06-2004 04:04 PM

Quote:

Originally Posted by edschaum
I don't have any subforums set up, so I wasn't sure if it would work with subforums.

I'll set up a test board tonight with subforums and see what needs to be added. Chances are the hot link just has to be added to the forumbit that displays the subforums.

I don't know what happens when you add subforums, are there new level3 forumbits in the style editor? If so, just do the steps from 8 and 9 in the level 3 forumbits. If not, hang on and I'll look into it tonight.

Just checked and there isn't a level 3 forumbits but there are some subforum templates. Here's one - forumhome_subforumbit_post.

edschaum 08-06-2004 05:26 PM

Quote:

Originally Posted by snobbymom
I was talking about the navbar edits. Asking if that edit is what places them in the quicklinks area. I like them there but I might move them so they are more noticeable to my members.

Yes, the links in quicklinks are in the navbar.

Quote:


The main thing with the subforums is that clicking "mark forum read" through the forum tools option will not mark the forum read. So I'd need to be able to click on the icon to enter and then mark it read. At least that's what I think is supposed to happen from reading your explanation in the install instructions.
That is correct. The item called "mark this forum read" acts differently depending on whether you go into the forum by clicking on the lightbulb or by clicking the forum name text.

When you go into the forum using the lightbulb link, Mark Forum Read will work with my mod.

When you go into the forum using the text link, Mark Forum Read will only mark the "Active Topics" as being read. I agree that this is a source of some confusion at this time. When you mouseover the selections in the drop down menu, check your status bar to see what the link looks like.

If the link has this in it: "forumdisplay.php?do=markread" , then it's marking Active Topics read.

If the link has this in it: "markforumread.php?do=markread", then it's marking it read for this mod.

One last thing - seems I've killed the navbar entirely when reading New. You can restore it by going into the template file called fdisplaynew.

Find this:
$header
$navbarX
$qsthisforum

Remove the X from the end of $navbar and your navbar will come back when viewing threads with new posts :)

weaver 08-06-2004 05:42 PM

Okay I made the change. Thanks. :) I hadn't noticed it not working but maybe I just missed it.

Quote:

That is correct. The item called "mark this forum read" acts differently depending on whether you go into the forum by clicking on the lightbulb or by clicking the forum name text.

When you go into the forum using the lightbulb link, Mark Forum Read will work with my mod.

When you go into the forum using the text link, Mark Forum Read will only mark the "Active Topics" as being read. I agree that this is a source of some confusion at this time. When you mouseover the selections in the drop down menu, check your status bar to see what the link looks like.

If the link has this in it: "forumdisplay.php?do=markread" , then it's marking Active Topics read.

If the link has this in it: "markforumread.php?do=markread", then it's marking it read for this mod.
That explained it perfectly thanks. :) I just posted to my members about the new system so hopefully I'll get some feedback. I think they will love it because not many were able to get to all of the new posts within that 15 minute window before they'd time out and no longer show up as new posts. I was looking for a way to have more control over "being done" with a forum and this hack is it. Much appreciated. :)

weaver 08-06-2004 06:12 PM

Here's something else I'd like to see. When you click on Mark Forum Read on the results screen it directs you back to the main forum page. I'd like to see it redirect back to the results. Can that be made an option? Or can you help me make that change for my board?

edschaum 08-07-2004 01:32 AM

I've just uploaded v0.6.

This should clear up a lot of confusion about what is being marked while navigating.

If you installed this previously, you should go over the installation text carefully to make sure you don't miss any of the new phrases.

I've set up a test forum for myself with subforums. So far the mod seems to work with the subforums ok without any additional changes. I'll check further though.

Changing the final link shouldn't be a problem, I can probably set that up tomorrow.


All times are GMT. The time now is 06:16 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01484 seconds
  • Memory Usage 1,863KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (24)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete