JAMESOMIGHTY Posted March 25, 2010 Posted March 25, 2010 rather than waste your time adding a whole new file for the starter pack just add this to the top of loggedin.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. and run this [mysql]ALTER TABLE users ADD starter INT(11) DEFAULT 0;[/mysql] Quote
JAMESOMIGHTY Posted March 25, 2010 Author Posted March 25, 2010 or you can put it in header.php if you want Quote
seanybob Posted March 25, 2010 Posted March 25, 2010 Nifty. However, you save save yourself the extra field in the user's table by just adding this to the register page, immediately after inserting data into the user's table. ;) Quote
AlabamaHit Posted March 25, 2010 Posted March 25, 2010 You should check into item_add() function. Will make your life alot easier. Quote
seanybob Posted March 25, 2010 Posted March 25, 2010 You should check into item_add() function. Will make your life alot easier. I may have missed something, but I see no need for item_add here... item_add just adds a new item to a user's inventory, quantifying it with other items that exist within a user's inventory. However, a new user is guaranteed to have an empty inventory. So... no reason to quantify it. Quote
AlabamaHit Posted March 25, 2010 Posted March 25, 2010 Yeah new user has nothing, but only about 20% will actually claim a starter pack first. 80% will checdk the game out first to see if it is a waist of time. And in the adventure will get stuff. Besides it is good habit to use your funciton regardless if you need it or not. Quote
seanybob Posted March 25, 2010 Posted March 25, 2010 Yeah new user has nothing, but only about 20% will actually claim a starter pack first. 80% will checdk the game out first to see if it is a waist of time. And in the adventure will get stuff. I don't mean to keep disagreeing with you, but... that is irrelevant. The mod he posted in the first post automatically grants the user the bonus when they first login. There is no 'claiming' involved, just login for the first time and 'poof' you get it. Besides it is good habit to use your funciton regardless if you need it or not. Meh, to each his own. I disagree completely - no need to use a function that is full of bloated junk you don't need, but you're way works just fine too here. Quote
Joshua Posted March 25, 2010 Posted March 25, 2010 I would do this however james ;) shorten your darn queries :P and if you are going to use $db you dont need to use $c. so You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Guest Drizzle Posted March 26, 2010 Posted March 26, 2010 or u can just add a $user query and fetch their userid(after inserted) in register, which will then allow it to send an event before they even login, acting like the same thing your talking about, with one less column in the users table to worry about :) Quote
Guest Drizzle Posted March 26, 2010 Posted March 26, 2010 if ur gonna be putting $c at the end of your queries u might as well just use mysql_query and save some variables from loading lol. Quote
Guest Drizzle Posted March 26, 2010 Posted March 26, 2010 rather than waste your time adding a whole new file for the starter pack just add this to the top of loggedin.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. mysql_query(sprintf("UPDATE `users`" . "SET `crystals`=%u,"."`money`=%u,"."`donatordays`=%u"." WHERE `userid`=%u",100,10000,5,$_POST['user'],$c)); mysql_query(sprintf("INSERT INTO "."`inventory` "."VALUES('',%u,'%u',%u)",1,$_POST['user'],100,$c)); mysql_query(sprintf("INSERT INTO "."`inventory` "."VALUES('',%u,'%u',%u)",2,$_POST['user'],100,$c)); event_add($_POST['user'],"Yo bro you juz got the hook-upz! Check yur inventory for your new stuff. Peace out, - Admin",$c); I actually have that on my game lol. well the event part. the rest isnt tested, but should work. Quote
Joshua Posted March 26, 2010 Posted March 26, 2010 why... You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. $db->query("UPDATE users SET crystals=crystals+100 WHERE userid=$userid",$c); $db->query("UPDATE users SET money=money+10000 WHERE userid=$userid",$c); $db->query("UPDATE users SET donatordays=donatordays+5 WHERE userid=$userid",$c); $db->query("UPDATE users SET starter=1 WHERE userid=$userid"); can all be ONE query. Quote
JAMESOMIGHTY Posted March 26, 2010 Author Posted March 26, 2010 yes i get the message, anyway i was just saying you could just do this rather than making a whole new file, its up to you what you put in it Quote
Guest Drizzle Posted March 26, 2010 Posted March 26, 2010 Hey, ive been wondering is it possible to merge two kinds of queries into one? LIke mysql_query(UPDATE table SET value=whatever WHERE user=blah, INSERT INTO table VALUES('blah'), etc.); ive never tried but it seems logical Quote
Jordan Palmer Posted March 26, 2010 Posted March 26, 2010 Hey, ive been wondering is it possible to merge two kinds of queries into one? LIke mysql_query(UPDATE table SET value=whatever WHERE user=blah, INSERT INTO table VALUES('blah'), etc.); ive never tried but it seems logical And you call you're self a programmer? Quote
CrazyT Posted March 26, 2010 Posted March 26, 2010 2 I would do this however james ;) shorten your darn queries :P and if you are going to use $db you dont need to use $c. so You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Yet still a failure why would you run more queries when you don't need to? n00b. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Changed into one: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Simple n000b. Quote
Guest Drizzle Posted March 26, 2010 Posted March 26, 2010 Hey, ive been wondering is it possible to merge two kinds of queries into one? LIke mysql_query(UPDATE table SET value=whatever WHERE user=blah, INSERT INTO table VALUES('blah'), etc.); ive never tried but it seems logical And you call you're self a programmer? Ive only been at it for like a year. Quote
ViolentTerra Posted March 27, 2010 Posted March 27, 2010 Hey, ive been wondering is it possible to merge two kinds of queries into one? LIke mysql_query(UPDATE table SET value=whatever WHERE user=blah, INSERT INTO table VALUES('blah'), etc.); ive never tried but it seems logical And you call you're self a programmer? Ive only been at it for like a year. Well guys after all the talk that Drizzle was a noob that thought taking back up of sites that he was working on it seems that he decided to single me out in his bid to win over the community... (oh how honored i feel right now....) After a message that was more snotty than anything else i sent him a piece of my mind waking him up to a number of truths that came out about him while he was trying to fight his corner... I told him that reputation for doing things like this would ruin his chances of work and what do i get back from him in a following message? This: "i really dont care if you tell ppl to read the post, because i really dont care. Is it hard to just make a new account, email, and make some free mods, and then get some clients? no it isnt. But id rather try to rebuild my name instead of doing that." Well it goes to show that scammers, blackmailers and complete an utter tossers who feel that a browse over the php tutorials on youtube make them a coder could really be the same person... All i said was that after all this, anyone i know within the industry will be avoiding his so called services... although have to say that a back up service that i haven't paid for sounds great.... oh wait... erm no, no its not. The guy is a jumped up kid that needs to stop trying to belittle other members before someone takes his lunch money from him.... Quote
Jordan Palmer Posted March 27, 2010 Posted March 27, 2010 Hey, ive been wondering is it possible to merge two kinds of queries into one? LIke mysql_query(UPDATE table SET value=whatever WHERE user=blah, INSERT INTO table VALUES('blah'), etc.); ive never tried but it seems logical And you call you're self a programmer? Ive only been at it for like a year. I've not been at programming that long, maybe a year - year and a half so.. :whistling: Quote
Guest Drizzle Posted March 27, 2010 Posted March 27, 2010 Hey, ive been wondering is it possible to merge two kinds of queries into one? LIke mysql_query(UPDATE table SET value=whatever WHERE user=blah, INSERT INTO table VALUES('blah'), etc.); ive never tried but it seems logical And you call you're self a programmer? Ive only been at it for like a year. Well guys after all the talk that Drizzle was a noob that thought taking back up of sites that he was working on it seems that he decided to single me out in his bid to win over the community... (oh how honored i feel right now....) After a message that was more snotty than anything else i sent him a piece of my mind waking him up to a number of truths that came out about him while he was trying to fight his corner... I told him that reputation for doing things like this would ruin his chances of work and what do i get back from him in a following message? This: "i really dont care if you tell ppl to read the post, because i really dont care. Is it hard to just make a new account, email, and make some free mods, and then get some clients? no it isnt. But id rather try to rebuild my name instead of doing that." Well it goes to show that scammers, blackmailers and complete an utter tossers who feel that a browse over the php tutorials on youtube make them a coder could really be the same person... All i said was that after all this, anyone i know within the industry will be avoiding his so called services... although have to say that a back up service that i haven't paid for sounds great.... oh wait... erm no, no its not. The guy is a jumped up kid that needs to stop trying to belittle other members before someone takes his lunch money from him.... ehh.. you sure do type alot. Quote
Jordan Palmer Posted March 27, 2010 Posted March 27, 2010 Yes he does, but he types the truth.. which cannot be said for you..go back to youtube lmfao Quote
Guest Drizzle Posted March 27, 2010 Posted March 27, 2010 actually, ive never bothered to look at a tutorial on youtube. and im not going to. Quote
Jordan Palmer Posted March 27, 2010 Posted March 27, 2010 actually, ive never bothered to look at a tutorial on youtube. and im not going to. http://thedrizzlenetwork.com/ -- A FAILED WEBSITE ALREADY!! LMFAO!!! Â You might benefit from a few tutorials you noob Quote
ViolentTerra Posted March 27, 2010 Posted March 27, 2010 ehh.. you sure do type alot.Wow, check you out... You comment on other peoples coding and its clear to see that your copy and paste coding effort on the thedrizzlenetwork.com is going to make you rich! Mate, i have never had issues with your coding but you come to me after i tell you to stop been an arse and trying to blackmail someone who you stole a back up of his site and you come to me looking to explain yourself....? Thing is you have admitted the fact that you took it and tried to sell it back and went on to point out your TOS which were so brief i could have wiped my arse with them and thats about it... Truth of the matter is, alter your username and email all you want... your coding and your talk all smells the same.... Quote
Guest Drizzle Posted March 27, 2010 Posted March 27, 2010 and i dont have a problem with you. i'd admit that it was wrong to take the backup, and then try to sell it back. But i dont copy and paste code. Maybe if its my code, i will, but i dont copy other ppls code. thats just plain wrong. And where do you get this "blackmail" part? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.