-
Posts
1,009 -
Joined
-
Last visited
-
Days Won
3
Content Type
Profiles
Forums
Events
Everything posted by Nickson
-
The database question is actually rather simple to solve while it doesn't require a lot of work actually... read up on database abstraction layers. If you keep that design in mind, you only need to develop say the mysql connector and the wrapper itself. Later, when the time is right or the need is there, you could just add another connector. and support 2 database systems at once without having to touch your code. Application <-> Database Wrapper <-> Database system And if that seems to much work, or people are too afraid of losing speed, you could always work with a database object. Design it properly and you could have drop in replacements of various database systems. Just keep in mind that no non-standard queries can be send from the application unless you want to run into trouble somewhere. But if you want to support multiple databases it's certainly possible, and with doing this you have a work around for the pdo dependency ;).
-
Well try it out and see what happens, writing theories is good, but it doesn't solve your issues. Trial and error is fun! Including your newly made function into a new file is, somewhat overdone, yet ease to reuse. Like so many things it has pros and cons. If it's never to be reused, I don't see the point. However, you could write your function more efficiently by using returns inside a function. The function will stop processing as soon as it reaches a return statement. Surely, it won't shave off seconds of processing times. But why not? Take a look at this logical. function getMissionLevel($level = false) { if(!$level || !is_numeric($level)) return -1; if($level <= 10) return 1; if($level <= 20) return 2; if($level <= 30) return 3; return 0; } This snippet offers quite some flexibility and robustness while using a logical way to solve the problem, but it can still get pretty long depending on how many mission levels you want to get. The difference with your script is that this one first checks whether the value that is passed is in fact, a numeric value. If not it returns a -1 and it stops. When the level is a numeric value it will continue and start continue to do checks until it meets an expression which is true. If it doesn't, it will meet an return 0; at the end of the function. Using this function by $missionlevel = getMissionLevel($ir['level']); We know that the range of $mission level can be -1 to MAX, simple checks can be done in the actual code where a -1 equals an incorrect value, a 0 would mean a 'not found' and anything above specifies a mission level to which you can let the script act accordingly. However, you can solve the problem more mathematical ;) Look at this.. function getMissionLevel($level = false) { if(!$level || !is_numeric($level)) return -1; return ( ceil($level / 10) ); } This function is much shorter, but will require a mathematical calculation. You can make it as easy (as shown) or as hard as you want, but it could offer a great flexibility. The "dummy check" is here as well, booleans, non-numeric strings, and a 0 ;) return -1, the rest is returned by the simple formula. Whatever level you pass on to the function will divide it by ten, and then round it up to the nearest integer. 9 / 10 = 0.9, rounded up by ciel() => 1 10 / 10 = 1, rounded up by ciel() => 1 (as it's an integer value already) 11 / 10 = 1.1, rounded up by ciel() => 2 So in short, if you're not reusing this function anywhere, you add the function to the page itself. But try it out and play around a bit ;) I'm quite sure you'll get there.
-
chavdave, open up a new thread under the support section for each issue you're having, with a clear title. eg: You're having an issue with the gym, the title would be "Gym - critical error", inside of the post specify as much information as possible. If you haven't enabled debugging yet, please do. It shows more information around the issue. Also, check your apache error logs, more information may be there. I'm quite sure someone will have a solution or an answer for you, once you have posted all of that. Hijacking this thread for support isn't really done and I doubt someone will give you email support on their own, so your best bet is to make a post.
-
names is not really the issue, whether it's named abc or xyz will not have any effect, the data type is one thing yes. But I believe that the whole database design is much more important. Sure you can optimize those 80 tables in the user table, but why not reduce those to 40? I know it's possible and rather easy to do, but it will require quite some work, that's the downside. But I think you'll get much more out of that, than going from int to smallint.
-
Not a problem! Let us know how your code-conquest works out ;)
-
Duplicate thread of http://makewebgames.io/showthread.php/41679-Domain-bundl-deal Topic locked.
-
Duplicate sales thread of http://makewebgames.io/showthread.php/41678-www-criminalisland-co-uk. Please only use ONE thread for it, no point having doubles, it won't increase the chances on sales. The other issue is a discussion between you two guys... Other topic locked.
-
It's a good thread. It certainly shows that time is a valuable but difficult thing to control. Good time management skills are hard to find. And you've forgotten to add the hours you work or study (I suppose this is the case for most people). You've also left out any other hobby or sports you might take part in. So let's make a more calculated example, based on what a person might be able to work on their ideas. I hope I can shed a little bit more details on this "time management". A week consists out of 7 days, 24hours a day, which equals 168hours to spend on basically everything you do. * You sleep 7days a week, 8hours on average, this equals 56hours. * Lets say that your personal & household (washing, eating, cleaning, cooking, shopping, traveling ...) tasks take up to 5h a day, 7 days a week. Equals 35h a week. * You work or study (your real job, go to school, educational tasks, ...) 5days a week, 8hours a day. This equals 40hours a week. Till this point, I think everything is the same for us all, unless you're married to a great person, or are unemployed. 168 - ( 56 + 35 + 40) = 37 37h left, actually just enough to take on a second job if you can cut back some time here or there, but then your week would be fully booked. But let us assume that you do not have a second job, and rather work on your hobby / project instead while still maintaining a social life. So it doesn't stop there! * Going to the pub -3h * 2x practice a week + matchday, -10h 24h left of that whole week that can be spend on working on that project. And now, you can start to procrastinate ;) #note: These are times estimated, they might be different for each person. I just wanted to show that there is more than what sniko has listed and that you should try to take them all into account when thinking about "how much time do I have or will I need?" It might not be motivational, but you should have a clear look on how much time you can spend on your project. Thinking you can work for 75h each week on it, and then realizing you're getting nowhere because you can only work for 20hours on the project, is much more of a motivation killer.
-
Yes something like that should work. I'm not convinced on this though. Could just pass the variable straight away to the function. Just make sure that the variable you're passing on is always of the range you expect it to be. You don't want to pass a non-numeric string to that function if it isn't capable of processing it correctly. $level = $userid['level'] did you mean ? $level = $ir['level'] or have you defined the $userid array somewhere else? As this is not a standard array in mcc as far as I can remember.
-
Well, the 'etc., etc.' is somewhat important too. The check itself is fine, however the function must have a return statement! If it does not, your missionlevel might not hold the value that you expect. Also to avoid developer mistakes, or if you really want to be sure, you could add a check on the data type of $level as well. PHP allows different data types to be bound to the same variables, thus strings as well. This way, you can be sure that the value is what you expect it to be. If you are 100% sure that $level will always be a numeric value, you don't really have to do this check. As 3rd remark, the $mpoint var will only hold a false (if the query failed) or a #resource id and not the 'pointsneeded' out of your database table. You still need to fetch the data.
-
I find that there is a huge difference between other players talking about other games in a respectable manner, whether these conversations take place in public game boards or private messages. I don't find that an issue, in fact it's rather normal that it happens I'd say. However, I do have an issue though with the real spammers that send links to every player they can think of, or make a reply on every thread. And that's the behaviour that needs to go. And the worst behaviour I can think of is when a game onwer goes around other games to just spam his link...
-
Don't worry orb, I was just pointing out that your post had a rather high amount of spelling mistakes, even the names of the football clubs were typo'd :). While not having a perfect spelling is normal, but do try to pay some attention to it. I'm from Belgium (flanders) myself, so I know it's not that easy to switch from german to english when you're not used to it.
-
Sigh, sometimes one wonders what's good enough as you'll never be able to please everyone while this is, in fact,very easy. I'll explain it again. Posts with "add me [email protected]" will be deleted. It's not a discussion, this is a clarification. Communicate privately securely however you wish, we don't really care how or where, but when a thread has 10 replies with an "add me [email protected]" it is a worthless thread to anyone else who's reading it. The scammers around make enough use of these email addresses to scam people, the boards are publicly readable by ANYONE, it's not very hard to add someone to an msn account and try to sell you some illegal or broken mods. By not allowing these kind of posts we already reduce the amount of scamming a little bit. I'm fully aware that it doesn't stop people from getting scammed at all, so you don't have to point that out, but at least we're trying to do something. If you wish to use an alternative way of communication, you are free to do so, no one is holding you back, we're not limiting you. We make use of IRC networks ourself, IMs and what not. It's sad though, that one cannot see the difference between what's being posted in this thread and what you are making of it. If you can't agree with a simple thing like this, which doesn't limit anyone to anything, you are free to leave the forums and move on to greener grounds. You are free to use the forums, but you will do this within the guidelines of the forum, which is rather obvious no? @SRB: read post #1 & #3, I know you can! I believe in you ;) @Spud: You should receive your own usertitle...
-
Please read http://makewebgames.io/showthread.php/40846-Recent-MSN-posts
-
ugh *sigh* even if it's true sniko, it's nothing to do with the original post, try to keep it at that. If you really wish to discuss such thing, make a thread where it's appropriate, but otherwise this will just become a totally different discussion. City might have been bought by Arabs who invested a lot of money, but what was United's debt again? 400million quid? So okay, the figures are even then :p Quite a lot of the European top teams are in this boat, they either have a sugardaddy or a huge debt. Anyhow, Kompany (the Belgian) scored, what a beast. I kind of hope City will win the title though. And I think Bayern will win, and I hope it too for the Belgian champion. PS: The number of typos is extremely high though, and try to make a different poll next time. People can only vote on one option for two different kinds of questions :)
-
Locking... RoZ has a point there, a new thread can be opened when required.
-
He doesn't need to post his methods on here, in fact I encourage it to not post them here as we have enough people on MWG that will just try it out on other games for their own "fun". It will take time of course to do a full scan of the site. But be honest, if he's good and he can't find something within a day. What makes you think that 99.9% of the people on that website will ever find it? Writing proper code is one thing, managing the system another, and having a good network setup a different one. But that still doesn't make it impenetrable... I doubt that Michael’s prices are in the same line of a real "pen-testing" company, and with the security standard of most people on here. I think it's more than reasonable to offer this service for a small fee and help those game owners out that want to make a difference.
-
Your opinion, or yourself? :-P On topic: NWE isn't complicated for me, it's like learning to work with any other engine/framework, however it's different that what I mostly run into or what I'm used too..
-
I think I'd say programming, just alone because it's closer to my native tongue. Truth be told though, I don't care about what one says. I care more about how you are doing it ;)
-
Closed. Ravan is illegal..
-
I certainly wouldn't mind! He had some nice ideas.
-
Keep it on topic... tbh with a little bit of work, mostly positioning, I think it could be an excellent profile page.
-
I'm still not sure why it's posting the *-characters. There is another post which has the very same issue. I know it's not the editor, as I'm using that one myself and as you can see, it shows the code just fine :/ stange strange, I hope we can fix it soon. You got it working now?