vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Release 0.1 Mark Forum Read/Mark All Read from database hack (https://vborg.vbsupport.ru/showthread.php?t=15986)

ethank 05-04-2001 10:00 PM

Here's the hack I worked on this week, in rough and not too pretty form. I'll be beautifying it soon.

You can download an rtf with all the code changes listed at http://murmurs.com/codechanges.rtf. Also in that file is the table creation statement.

Attached is a zip of all the changed files. Comments are included, but not consistant yet.

You can see this in action at http://tony.murmurs.com. Only two forums, but still.

I'll pretty up the code this weekend and make better install instructions.

This is way beta, so if there are any problems just post. Don't put this on a production board yet

Ethan

Mike Sullivan 05-05-2001 12:03 AM

ethank,

I had to remove your codechanges.zip file because it is in violation of the licensing agreement -- you may not post full files. You have to release them as instructions (or if you come up with a better way).

ethank 05-05-2001 12:06 AM

Doh! OK. Well, the rtf has the changed code, not full source. I'll figure out a better way to indicate where the changed code should go.

Anyhow, look at the rtf, as that will give you most of what you need, although its not as clear as it should be yet.

EThan

ethank 05-05-2001 04:43 AM

Two more additions. These two blocks assure that people get an initial Mark Read entry in the database if they don't have one. Its set to 0:00AM for the day they enter without one.

This goes in the login method in member.php, before the URL portion:

Code:

// *** CODE ADDED BY ETHANK
       
$record_exists=$DB_site->query("select userid from markread where userid='$userid' AND forumid = '0'");
    $num_records=$DB_site->num_rows($record_exists);
    if($num_records<1)
        {
                $firsttime=mktime(0,0,0);
                $DB_site->query("INSERT INTO markread (readtime, userid, forumid) VALUES ('$firsttime','$userid', '0')");
        }
// END ADD

And this goes in register.php, after the initial databse insert after the Start Add Member comment. This goes right before the big insert method...:

Code:


// *** ADDED BY ETHANK
                // Create Unix time for midnight...
                $firsttime=mktime(0,0,0);

                $DB_site->query("INSERT INTO markread (readtime, userid, forumid) VALUES ('$firsttime','$userid', '0')");


// END ADD


Onslo 05-05-2001 12:19 PM

One general inprovement that would be usefull (in general) for VBulletin.

If the link that marks read contained a timestamp of the time when you displayed the page, then anything posted after you read that page would still show as unread.

For instance.....

If you display the page at 12:00 ..
then sit there for an hour ..
then press Mark Read ..
anything posted after 12:00 will still be shown as unread.

The way that VB does it is it marks stuff as read from the moment that you hit the link, so there is a possiblity that you could miss postings made inbetween the period of actually displaying the page and hitting the read link.

Onslo

ethank 05-05-2001 03:39 PM

Quote:

Originally posted by Onslo
One general inprovement that would be usefull (in general) for VBulletin.

If the link that marks read contained a timestamp of the time when you displayed the page, then anything posted after you read that page would still show as unread.

For instance.....

If you display the page at 12:00 ..
then sit there for an hour ..
then press Mark Read ..
anything posted after 12:00 will still be shown as unread.

The way that VB does it is it marks stuff as read from the moment that you hit the link, so there is a possiblity that you could miss postings made inbetween the period of actually displaying the page and hitting the read link.

Onslo

That happened with Webboard too.. I guess the way we could do it is set a timestamp in a cookie on page load, then when they mark read, use that instead of the time they click the Mark Read. Maybe have it as an option?

The other bug I found was that if you mark a child forum read, the parent forums still are flagged "new" cause they just look at the "lastpost" from all their children. I need to have it make sure that that last post wasn't in a forum that was marked read, and if it was look at the second to the last post, etc. I'll work on that bug tonight.

EThan

Onslo 05-07-2001 01:36 PM

Hows it coming Ethan? :)

Onslo

ethank 05-07-2001 02:25 PM

I wasn't home all weekend so didn't have a chance to compile it all. I'll be working on it today as well as doing one last bug fix. There's a weird thing with subconferences....

Ethan

ethank 05-19-2001 08:29 PM

I'm back from Georgia and seeing as how final is being released Monday, I'll post an updated instructions document and the current iteration of the hack here on Tuesday (hopefully)!

Thanks for your patience.

EThan

Onslo 05-20-2001 06:00 AM

Excellent! :)

I await your masterpiece.

Top sport Ethan :)

Onslo


All times are GMT. The time now is 01:37 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.01139 seconds
  • Memory Usage 1,740KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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