vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Listing members who joined in the past week? (https://vborg.vbsupport.ru/showthread.php?t=35150)

rawnet 02-17-2002 08:27 AM

Hello All!!

I appreciate that this may be too simple to be a hack, as it doesn't really integrate with vBulletin - not sure. Basically, I'd like to just list all my members who have joined in the past week.

This is so I can include the info in my weekly newsletter, and point visitors towards a page which just lists those who joined in the past week.

I'm just confused as to what I should use in the WHERE clause of my query - can someone enlighten me? Not sure how I select records from exactly the last week?

Cheers,

Ross

Admin 02-17-2002 10:29 AM

Code:

WHERE user.joindate > NOW()-(60*60*24*7)

rawnet 02-17-2002 10:46 AM

Hi Chen,

Thanks for such a quick response. I've tried that code - no records are being returned, so maybe I'm being a bit stupid? :

PHP Code:

$query="SELECT    user.userid, user.joindate, userfield.field11, userfield.field12, userfield.field14, userfield.field15, userfield.field24
                FROM user
                LEFT JOIN userfield USING (userid)
                WHERE user.joindate > NOW()-(60*60*24*7)
                ORDER BY user.joindate DESC"


Without the WHERE clause it returns members okay (I had a LIMIT 10 on previously)

Results can be seen at http://www.servicepals.com/latestmembers.php

Is there anything else I might be missing?

Thanks for your help,

Ross

Admin 02-17-2002 10:51 AM

Duh, my bad. Use this:
Code:

WHERE user.joindate > UNIX_TIMESTAMPT(NOW())-(60*60*24*7)

rawnet 02-17-2002 10:56 AM

Hi Chen,

Does UNIX_TIMESTAMPT work on Windows2k? Running MySQL on Win2k and PHP4.1.0

Cheers,

Ross

rawnet 02-17-2002 10:59 AM

Yes, that works a treat!!

PHP Code:

WHERE user.joindate UNIX_TIMESTAMP(NOW())-(60*60*24*7

Many thanks Chen,

All the best,

Ross

Admin 02-17-2002 11:02 AM

:)

UNIX_TIMESTAMP() is because the time format vB uses is the Unix timestamp... doesn't mean it doesn't work on Win. Although I bet that if there were a Win timestamp it wouldn't work on *nix. ;)

rawnet 02-17-2002 11:09 AM

Thanks - yup, works well. I hope to move to a Linux platform shortly - hence why I moved the site from Cold Fusion to PHP. I just need to get up to speed properly on PHP first which will take a few months.

Thanks so much for your help - on a Sunday too!!

:D

Ross

Admin 02-17-2002 11:33 AM

For us Jews Sunday is just like any other day... :)


All times are GMT. The time now is 08:57 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.01031 seconds
  • Memory Usage 1,730KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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