Phpretro register page

Status
Not open for further replies.

Eronisch

Web Developer
Jan 1, 2011
234
25
Hi,

I want that users automatically get hc and a badge, but for some reason it doesn't work.
My sql should be right, the register page doesn't give me any errors.

Code:
PHP:
// Gives a user 12 months of hc
$db->query("INSERT INTO ".PREFIX."users_club(userid,months_expired,months_left,date_monthstarted) VALUES ('".$row[0]."','0','12','".time()."')");
// Give that bitch a shiny badge, bitches loves shiny badges
$db->query("INSERT INTO ".PREFIX."users_badges(userid,badgeid,iscurrent,slotid,badge) VALUES ('".$row[0]."','HC2','1','1','NULL')");

I've added the code under the line:
PHP:
$db->query("INSERT INTO ".PREFIX."transactions (userid,time,amount,descr) VALUES ('".$row[0]."','".time()."','".$scredits."','Welcome to " . $sitename . "!')");
That should be the right place, does someon know why it doesn't work?
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,195
3,905
I don't recall PHPRetro modifying the default holograph tables to it's own prefix, try this:

PHP:
// Gives a user 12 months of hc
$db->query("INSERT INTO users_club(userid,months_expired,months_left,date_monthstarted) VALUES ('".$row[0]."','0','12','".time()."')");
// Give that bitch a shiny badge, bitches loves shiny badges
$db->query("INSERT INTO users_badges(userid,badgeid,iscurrent,slotid,badge) VALUES ('".$row[0]."','HC2','1','1','NULL')");
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,195
3,905
Adding the prefix would only try to do cms_users_club, just running it as mysql_query and adding or die(mysql_error()); on the end.
 

Eronisch

Web Developer
Jan 1, 2011
234
25
Ok, i'll give it a try

I know what the problem is, the time was wrong.
phpretro automatically deletes the badge and club.

I currently have got this:

$date = date("d-m-y");
$db->query("INSERT INTO users_club(userid,months_expired,months_left,date_monthstarted) VALUES ('".$row[0]."','0','12', ".$date.")");
But the $date is -2, how is that possible?
 

Eronisch

Web Developer
Jan 1, 2011
234
25
Still -2 for both answers.

$time = date('d-m-y');
$db->query("INSERT INTO users_club(userid,months_expired,months_left,date_monthstarted) VALUES ('".$row[0]."','0','12', ".$time.")");
 
Status
Not open for further replies.

Users who are viewing this thread

Top