View Single Post
  #24  
Old 05-02-2001, 05:23 AM
ethank's Avatar
ethank ethank is offline
 
Join Date: Oct 2001
Location: Toluca Lake, CA
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I made the first step toward fixing the issue. I got it so that instead of relying on a cookie to do the "lastvisit," which is basically how it sets what is read and what isn't, I modified the code in sessions.php to use a database instead. Two columns.

Code:
+----------+------------------+
| Field    | Type             |
+----------+------------------+
| readtime | int(10) unsigned |
| userid   | int(10) unsigned |
+----------+------------------+
So all the code that uses $bbuserinfo[lastvisit] to set whether things are new or not now gets said date from the database instead. I also modified the code to "member.php" which contains the "mark all forums read" code.

Very simple, after I learned some PHP.

I should have the marking of individual forums as read done tommorow evening. It will use a seperate table. I could probably do them in one table (just using a null in the forumid field to indicate a global mark, or a 0), and I actually might now that I think about it.

To do the forum thing, I'll put a line in the global.php to check if the user is displaying anything within a forum (threads, forum listing) and if so, checks the forums mark-read timestamp, compares it against the master all forum mark read time, and if the one for the forum is more current, sets $bbuserinfo[lastvisit] to the forums instead.

The only thing that needs some tricky stuff is the "find new messages." I'm still not certain how I'm going to do it. What I think I'll do is have a "mark all read" clear the individual forum-marks when its clicked. So that way when a user checks for new messages, they could have a blanket "mark all read" and a few forum-specific timestamps. The search would look for anything newer than the mark-all-read timestamp for any forum, unless it has a timestamp that is newer than the all-forum one. In that case it looks at those forums individually for new messages....its an idea. Need to figure that one out a bit more.

Till tommorow!

I'll try to package this hack nicely. I'm really new to this whole vBulletin thing, so what is the best way for me to distribute this once its done?

EThan
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01085 seconds
  • Memory Usage 1,768KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete