vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Change Cookie timestamp? (https://vborg.vbsupport.ru/showthread.php?t=51039)

feldon23 03-31-2003 06:53 PM

Change Cookie timestamp?
 
To compensate for the madness of cookies in vBulletin (I love EVERY ASPECT of vB except this!), I'd like to write a hack to allow users to manually enter their last visit time if the forum decides to take a dump.

For instance, I last visited my forum 24 hours ago. I went to visit the Admin CP this morning and check on a few things. I did not know that this would mark my cookie on the forum as "viewed EVERYTHING".

So I went to the forum about 20 min later and View New Posts is EMPTY.

I tried to change the timestamp in the cookie, but it just keeps rejecting it and giving me the Unregistered page.


{EDIT: So I dug around for anywhere that used bblastvisit. Changing anything in sessions.php to look at $HTTP_GET_VARS was fruitless, but this worked!...}


To add a "roll the clock back" function to your vBulletin (tested with vB2.3.0):

1. Open /forums/member.php

2. Find
PHP Code:

// ############################### start mark all forums read
if ($action=="markread") { 

3. Above it, add:

PHP Code:

// ## Start Force New Timestamp
if ($action=="bblastvisit") {
  
$templatesused 'redirect_updatethanks';
  include(
"./global.php");
  if (
$bbuserinfo[userid]!=and $bbuserinfo[userid]!=-1) {
    
$DB_site->query("UPDATE user SET lastactivity='".$HTTP_GET_VARS['bblastvisit'].
"',lastvisit='".$HTTP_GET_VARS['bblastvisit']."' WHERE userid='$bbuserinfo[userid]'");
  } else {
    
vbsetcookie("bblastvisit",$HTTP_GET_VARS['bblastvisit']);
  }
  eval(
"standardredirect(\"".gettemplate("redirect_updatethanks").
"\",\"index.php?s=$session[sessionhash]\");");
}
// ## End Force New Timestamp 

4. Save and upload.

To roll back the clock, visit your forum with a valid unix timestamp on the end:
http://www.yourforum.com/forums/memb...t&bblastvisit=[unixtimestamp]

To generate a unix time stamp, try this:
http://www.4webhelp.net/us/timestamp.php

Eventually, I will create a template that lets people select the time they want to go back to.

feldon23 03-31-2003 07:38 PM

This can be moved to General Discussion. Eventually, it will be a genuine hack.

Paul 04-09-2003 08:15 AM

We've been considering a similar solution ourselves, however we were focusing on storing the timestamp in the database.

There is a hack on here somewhere that suggests that it might do this already. Persistent mark read I think? We started to look at it but had to put it aside for the 2.3.0 upgrade and associated bug fixing.

I'll keep you posted with any solutions we might look into.

Paul


All times are GMT. The time now is 06:22 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.01005 seconds
  • Memory Usage 1,722KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete