• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Finding users by reg.date

R

ragtek

Guest
#2
There's no way for this in xf, so IMO you'll need to use phpmyadmin / or an add-on

OR, in acp => search user => Visited since date:xxx
 
F

Floris

Guest
#3
Code:
SELECT * FROM `xf_user` WHERE `register_date`= 1286344241
random number = timestamp of the date you're looking for.

output: http://xenfans.com/_heyho/
input:
PHP:
<?php // nice and dirty code

mysql_connect("localhost", "dbuser", "dbpass") or die(mysql_error()); // connect to database
mysql_select_db("dbname") or die(mysql_error()); // select database

$timestamp = '1286344241';

$page_query = mysql_query("SELECT * FROM xf_user WHERE register_date = $timestamp") or die(mysql_error());

// using while in case we wanna do more stuff or have to handle more results (unlikely since we're dealing with timstamps though)
while ($row = mysql_fetch_assoc($page_query)) {
$username = $row['username'];
}

$datetime = date("Y-m-d H:i:s", $timestamp);

echo "timestamp $timestamp = date: $datetime and it seems that it's $username";
 
R

ragtek

Guest
#4
or

SELECT * FROM xf_user WHERE register_date
BETWEEN UNIX_TIMESTAMP('2010-01-01 00:00:00') AND UNIX_TIMESTAMP('2001-01-02 00:00:00')

(it's easier to read & understand, or?;)
 
F

Floris

Guest
#5
Not just easier ragtek, it means you can ignore "time" since it's very very precise and super hard to 'guess'.
Adding a form with input fields to let you find in between dates + output multiple results == very handy.