-
Posts
2,210 -
Joined
-
Last visited
-
Days Won
47
Content Type
Profiles
Forums
Events
Everything posted by sniko
-
Then use a link and style it like a button. As you're not using any form elements within your form, it seems a little wasted.
-
I wouldn't. You will need to cover the cost of your investment (your time) You will need to cover the cost of the "24/7 support" But hey, it's up to you...
-
Man.... use your logic! :mad:
-
Where do you put what exactly? :confused: Look into item_add() or add_item() function in global_func.php (I can't remember the exact function name, but....) //Maybe this will work //Maybe it won't //I don't know the exact function name or the order of the parameters... item_add($_SESSION['userid'], 277, mt_rand(1,6));
-
Can you help me with adding queries please? Give me an example, and tell me where to put it? Not sure what query you want... I only want one sql and that is 'brew' and it will be in the 'users' table. What do you want the query to do? (ie: Update `brew` value to what?) Also, I want it so when you brew you get an item, and set the rand between 1 and 6 or something.. rand() / mt_rand() And also, if you have brewed 10 times in one day, how do I get it so it says "You have already brewed 10 times today, come back tomorrow" Create a new table to record how many times a user has brewed When a user brews insert into said table On page load, calculate the amount of times they've brewed If equal to 10, show the message $strDbQuery = "SELECT COUNT(id) AS `times_brewed` FROM `users_brew` WHERE `userid`=". $_SESSION['userid']; $resTimesBrewed = $db->query($strDbQuery); if( is_resource($resTimesBrewed) === FALSE ) { //Something went wrong. //Say something to user die; } $arrResults = $db->fetch_row($resTimesBrewed); if($arrResults['times_brewed'] > 10) { echo 'You have already brewed 10 times today, come back tomorrow'; $h->endpage(); die; } Then in your daily cron, truncate `users_brew` table.
-
You might want to redo that code :p It's going to error when a case is true because the function will be not defined (because it's still in the switch() and terminated by the break;) switch( strtolower($_GET['action']) ) { case 'beer': beer(); break; case 'whiskey': whiskey(); break; case 'cider': cider(); break; case 'vodka': vodka(); break; default: exit("Requires and action"); break; } function cider(){ //Code right here } //Define all other functions
-
You don't need to start print ""; then end it and start echo ""; to output different text blocks. There is really no PHP, so you could just close the PHP tags on line 4 and output HTML without using PHP You haven't ended the headers (displayed the footer) at the end, ie: $h->endpage(); Your current set-up indicated that types of brewery actions will be hardcoded. See http://makewebgames.io/showthread.php/46088-In-Production-Brewery-Mod?p=311918&viewfull=1#post311918 ( [MENTION=68711]KyleMassacre[/MENTION] )
-
Static means you can call the property/method without instantiating the object. It's quite handy. See: http://verraes.net/2014/06/when-to-use-static-methods-in-php/
-
It's a great way to create easily-extendible, organised applications involving the DRY principle. Also, you can have some fun with it ;) https://eval.in/377301
-
[MENTION=68406]-BRAIDZ-[/MENTION] You will find programming much more practical if you didn't use a mobile editor. Why would you even attempt to program on your phone?! Like wuttttttt.....
-
New RPG browser game - beta testing signup!
sniko replied to realmoflegends's topic in General Discussion
I'm game to do some testing :) I'll Skype you later. -
20GBP isn't too expensive for someones time. [MENTION=69823]jcvenom[/MENTION] how flexible are the awards? Ie: Do you have to hardcode the criteria or can you put the awards into a database and they'll get given via cron logic?
-
Nice! Though, your regex is flawed on line 64+. Using [A-z] will include all ASCII characters from the range A to z, which isn't intended (I would assume). See ASCII table. [A-z] will allow special characters like [, ], /, ^ - See example You're missing your anchors to match the entire string. For example; ^[A-z]+$ I wouldn't advise building the JSON string manually, either. I would build the array, then use JSON.stringify.
-
Can you add the following to your first post then? - hopefully it'll clear the confusion. [noparse] This modification is for Raven, not McCodes. [/noparse]
-
Look into Same origin policy. Note: As the policy name suggests, this will only work with iFrames with the same origin (same domain; ie: sub.domain.com and domain.com can access each others content. It won't work with domain.com and other.com) This StackOverflow thread will be of use to you :)
-
TFA = The Forbidden Age It was a awesome concept that was being developed by [MENTION=64684]Dayo[/MENTION] and [MENTION=66223]DreamCoder[/MENTION]. Blog entry Forum thread Another forum thread
-
I was actually really looking forward to TFA, perhaps finish that up if you don't find anything?
-
Depends. What issues/errors are you facing? What debugging processes have you adopted? Did you find anything out with debugging? Perhaps a server misconfiguration? When you did this, I don't believe you when you say it didn't bring back anything... In your original post you have some syntax errors which would be revealed with error reporting. Your code is hideous. Please look into PSR standards You don't need to global in the same scope. Line 9 functions shouldn't really echo/print anything, but return. Line 19 Your query is insecure. Line 61 Escape or change your quotes. This is a syntax error. Line 67 When you submit the form, you aren't going to the logic to process the form. Line 25 You've ended your function too early, I would assume. Line 59 This die(); isn't needed it and should be handled in sglobals.php, IIRC. Most of these would have been shown to you with error_reporting. I hope now that you understand my frustration with you.
-
Ugh. I give up trying to help this guy. I tag [MENTION=68711]KyleMassacre[/MENTION], [MENTION=69670]Script47[/MENTION], [MENTION=70347]NonStopCoding[/MENTION] and everyone else in. Goodluck.
-
Yes, but you'd need extra configuration on the server to get get_browser() to work. [MENTION=70485]G7470[/MENTION] was saying he prefers the other method (ie: not get_browser()). He wasn't saying that it's more reliable in the sense of what it brings back.
-
See this. Have you tried it? What went wrong? Was there an error message? Did you try and debug? If so, what did you do? The forum software is adding spaces randomly in the code, so here's a mirror
-
I remember when this thread was about trying to procure a McCodesv2 license. [MENTION=68711]KyleMassacre[/MENTION] can you split this?
-
Just to throw this into the mix, a user agent string is supplied by the user (ie: you), and this string is easily spoofed so you can't rely on it too much. Though, it depends what you need to detect it for. [MENTION=65073]lucky3809[/MENTION] has a nice solution, let's build on it. $objBrowser = get_browser(); if( in_array( strtolower($objBrowser->browser), array('chrome', 'msie') )) { echo 'We detected you\'re using either chrome or internet explorer'; die; } echo 'You\'re okay'; Because get_browser() requires some extra configuration (outlined in the manual), it may be better (depending on your access level on the server) to use a solution like this: http://stackoverflow.com/questions/5302302/php-if-internet-explorer-6-7-8-or-9
-
Or go full pro with PHPStorm and get an awesome integrated environment.
-
About a year ago, not as little as 50%. I've seen v2 licenses being marketed for USD60$, USD40$ (not sold I don't think), USD60$ (sold). So, the price fluctuates between 60%+ (from old stats, if you want the sell/buy) You're probably looking at spending USD50$+ for a license in 2015; though I've not had first hand experience with selling a license recently, so I may be off.