x
 
Create New Page
 View Previous Changes    ( Last updated by Lisa Wess )

No Login In A Year

Question: How can I find out which users haven’t visited my site in a year?

Answer: EE stores the last visit date in the exp_members table. You can create a template to display the username or other details. In this example, you’ll need PHP to be turned on and parsing at input.

<? 
global $LOC

//--------------------------------- 
// Take away one year from now 
//--------------------------------- 

$lastyear $LOC->now-31536000
?> 

{exp
:query sql="SELECT * FROM `exp_members` where last_visit < <? echo $lastyear ?> and join_date < <? echo $lastyear ?>"
{username}
<br /> 
{/exp:query} 

Category:Members Category:Tips

Category:EE1

Categories: