Jump to content

How to display message to users who registered within last 7 days?


paperweight

Recommended Posts

I am playing around with some code, but there is something missing. I think it may be the strtotime for Smarty that I researched, but I'm still unclear. I am now looking at the tblclients and trying to get the datecreated to work from "today"s date", etc. and then seeing if it is less than 8 days old.

 

Here is the basic code below and I know there are large gaps :?: , but I need assistance and advice on how to integrate the strtotime (if necessary) into this.

 

 

<!-- BEGIN TO CHECK IF USER IS NEW OR NOT (If they signed up within the last 7 days) -->
{php}
// take the user's id
$userID = $_SESSION["uid"];
// try to find that user among tblclients to see if they have registered in the last 7 days	
$sql = "SELECT id FROM tblclients WHERE datecreated = ".$userID;
$result = mysql_query($sql);
$rows = mysql_num_rows($result);
// if found
if ($rows < 
{
	$this->assign('isNewClient',"Y");
}
// if not
else
{
	$this->assign('isNewClient',"N");
}
{/php}
<!-- END TO CHECK IF USER IS NEW OR NOT (If they signed up within the last 7 days)  -->

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated