Jump to content
MakeWebGames

Recommended Posts

Posted

Re: [v2] Event add on first loggin.

 

that would be register.php

It just depends how he is wanting to do it. I do something with register.php too, but he made it sound like he wants an event on first login, which would be different than giving every account made a new event.

Posted

Re: [v2] Event add on first loggin.

Yes i edited the register file before but kept getting some errors, i tried putting the event_add after the first userstats query but then got an error on signing up.

 

}
require "global_func.php";
$db->query("INSERT INTO users (username, login_name, userpass, level, money, crystals, donatordays, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, gender, signedup, email, bankmoney, lastip, lastip_signup) VALUES( '{$username}', '{$username}', md5('{$_POST['password']}'), 1, $sm, 0, 0, 1, 12, 12, 100, 100, 5, 5, 100, 100, 1, '{$_POST['gender']}', unix_timestamp(), '{$_POST['email']}', -1, '$IP', '$IP')");
$i=$db->insert_id();
$db->query("INSERT INTO userstats VALUES($i, 10, 10, 10, 10, 10)");
if($_POST['ref']) {
$db->query("UPDATE users SET crystals=crystals+2 WHERE userid={$_POST['ref']}");
require "global_func.php";
event_add($_POST['ref'],"For refering $username to the game, you have earned 2 valuable crystals!",$c);
$db->query("INSERT INTO referals VALUES('', {$_POST['ref']}, $i, unix_timestamp(),'{$r['lastip']}','$IP')");
}
Posted

Re: [v2] Event add on first loggin.

QUERY ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNIX_TIMESTAMP(),0,'Some message')' at line 1

Query was INSERT INTO events VALUES('',,UNIX_TIMESTAMP(),0,'Some message')

Posted

Re: [v2] Event add on first loggin.

 

if you modify register obviously your only going to get it on first login.

My point was that on some games some accounts are never logged into. So it just depends on what he was wanting to do.

Posted

Re: [v2] Event add on first loggin.

 

QUERY ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNIX_TIMESTAMP(),0,'Some message')' at line 1

Query was INSERT INTO events VALUES('',,UNIX_TIMESTAMP(),0,'Some message')

Ah your trying to do it when they login so you need to do like

event_add($mem['userid'], "some message", $c);

make sure you require_once 'global_func.php'; .. see if it works.

Posted

Re: [v2] Event add on first loggin.

 

My point was that on some games some accounts are never logged into. So it just depends on what he was wanting to do.

How about you do it on login then so it sends them one everytime ROFL....register.php would be your best bet...you only register once...

Posted

Re: [v2] Event add on first loggin.

 

My point was that on some games some accounts are never logged into. So it just depends on what he was wanting to do.

How about you do it on login then so it sends them one everytime ROFL....register.php would be your best bet...you only register once...

:roll:

Obviously since we are talking about the very first login, you wouldnt set it up so that they receive an event everytime they login. I already indicated that i use code in register.php. What i was trying to get across is that you could also set it up so that an event occurs the FIRST time a person logs in. This may or may not be useful since some games have accounts that were registered BUT NEVER LOGGED INTO. THis way you dont have events sitting out there. But please, assume that i meant an event each time a person logs in.

Posted

Re: [v2] Event add on first loggin.

 

I did this also, although I coded it so it does it when someone validates them self and it sends to all staff :lol:

 

Now that would be very annoying, say you left for a few hour's and then come back to have 50+ events lol

Thats a good way of clogging the DB up with uneeded data.

Posted

Re: [v2] Event add on first loggin.

 

I did this also, although I coded it so it does it when someone validates them self and it sends to all staff :lol:

 

Now that would be very annoying, say you left for a few hour's and then come back to have 50+ events lol

Thats a good way of clogging the DB up with uneeded data.

True, but they have staff events to it goes there, that way they are more organized ;)

Posted

Re: [v2] Event add on first loggin.

my own way to add an event....

I don't make userstats upon registering, but on first users login... simply checking if userstats for that user are there... if not, create the userstats, and then add the event.

1 time and it becomes surely at 1st login :)

Posted

Re: [v2] Event add on first loggin.

got rid of the error but didnt add the event. :/

 

QUERY ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNIX_TIMESTAMP(),0,'Some message')' at line 1

Query was INSERT INTO events VALUES('',,UNIX_TIMESTAMP(),0,'Some message')

Ah your trying to do it when they login so you need to do like

event_add($mem['userid'], "some message", $c);

make sure you require_once 'global_func.php'; .. see if it works.

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.

×
×
  • Create New...