vb.org Archive

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

ender 04-29-2001 01:26 PM

How can I tell with a date string if the last activity # is two+ weeks old? Is there a number that can show two weeks?

LIke if I have the number: 988515692

How can I check to see if that number is two or more weeks old? Like what would the if statement look like and what else do I need?

ender 04-29-2001 04:21 PM

Basicially my question is: is that # above in seconds? And when from? If I minus 1209600 from it will that be two weeks ago?

Ahh, this is getting a bit confusing... how is the lastactivity string formatted?

If I do

Code:

$postsresult = mysql_query("SELECT userid,username,email,icq,posts,lastactivity FROM user WHERE usergroupid=9 ORDER BY lastactivity desc") or die("Unable to complete query");
while ($topposters = mysql_fetch_array($postsresult)):
        if (($counter++ % 2) != 0) {
                $bc=$bc1;
        } else {
                $bc=$bc2;
        }
$lasta = $topposters[lastactivity];
$date = date("D, F j, G:i:s",$lasta);
$datea = date("Y-m-d",$lasta);

if(($datea) < ((date("Y-m-d", mktime(0,0,0, date(m), date(d)-7,date(Y))))) {
            $bc=$wa;
}
if(($datea) < ((date("Y-m-d", mktime(0,0,0, date(m), date(d)-14,date(Y))))) {
            $bc=$wb;
}

Will this work?

Steve Machol 04-29-2001 04:34 PM

I believe it's seconds since 01-01-1970 and subtracting seconds should work.


All times are GMT. The time now is 03:48 PM.

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.00899 seconds
  • Memory Usage 1,710KB
  • 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
  • (1)bbcode_code_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