vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Get new posts for unregistered users if cookied and at site in past (https://vborg.vbsupport.ru/showthread.php?t=40270)

Paul 06-25-2002 02:39 PM

Get new posts for unregistered users if cookied and at site in past
 
Hi all :)

I did a quick search and didn't see anything like this on here already, so I figured I'd give it a shot.

My forum has many unregistered users that prefer anonymity and feel safer not registering. I'd like to be able to show them any new posts since their last visit if they've been to the site before and the timestamp on their cookie is in the past.

I'd like a hack that would show a link to "See all new posts since your last visit" (using search.php?action=getnew) ONLY if the timestamp on their cookie is in the past. (If this is their first visit, I don't want to show them the link.)

Is this feasible? Would this work? Any pointers on how to do it? It doesn't seem like that much work, considering the getnew function is already built in and that vbulletin is already getting the time from the cookie (as displayed in "Your last visit was on")

Thanks!
Paul

Logician 06-25-2002 07:33 PM

this is a little tricky so I'm not sure if it will work (and too lazy to try myself) :) but give it a try:

edit search.php and find:

PHP Code:

$datesql=" AND thread.lastpost>=".(time() - (24 60 *60 $days)); 

and replace it as:
PHP Code:

if ($bbuserinfo[userid]==AND $bbuserinfo[lastvisit]>AND $bbuserinfo[lastvisit]<mktime (date("H"), date("i"), date("s"), date("m"), date("d")-1date("Y"))) 
    {
$datesql=" AND thread.lastpost>=".$bbuserinfo[lastvisit];}
else{ 
    
$datesql=" AND thread.lastpost>=".(time() - (24 60 *60 $days));


It looks like it will do the trick..

Logician


All times are GMT. The time now is 04:19 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.03386 seconds
  • Memory Usage 1,718KB
  • 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
  • (2)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