-
Posts
2,142 -
Joined
-
Last visited
-
Days Won
148
Content Type
Profiles
Forums
Events
Everything posted by Magictallguy
-
mccode-v2 in array() expects at most 3 parameters, 11 given
Magictallguy replied to boionfire81's topic in PHP
SELECT `itmid`, `itmname` FROM `items` WHERE `itmtype` IN(1, 2, 3) Alter the IN clause to whitelist the item type IDs you want to use there- 11 replies
-
- mccode-v2
- mccode-lite
-
(and 3 more)
Tagged with:
-
mccode-v2 in array() expects at most 3 parameters, 11 given
Magictallguy replied to boionfire81's topic in PHP
Why aren't you going via itemtype? Isn't that generally what it's for; easier differentiation?- 11 replies
-
- 1
-
-
- mccode-v2
- mccode-lite
-
(and 3 more)
Tagged with:
-
mccode-v2 Updating Profile Image
Magictallguy replied to Samurai Legend's topic in Modification Support
$fp = @fopen($url, 'rb', false, $ctx) or exit('Couldn\'t load URL'); ?- 15 replies
-
- mccode-v2
- mccode-lite
-
(and 3 more)
Tagged with:
-
mccode-v2 Updating Profile Image
Magictallguy replied to Samurai Legend's topic in Modification Support
I suppose you could do this: $fp = @fopen($url, 'rb', false, $ctx);- 15 replies
-
- mccode-v2
- mccode-lite
-
(and 3 more)
Tagged with:
-
mccode-v2 Updating Profile Image
Magictallguy replied to Samurai Legend's topic in Modification Support
Set DEBUG to false in the error handler- 15 replies
-
- mccode-v2
- mccode-lite
-
(and 3 more)
Tagged with:
-
mccode-v2 Updating Profile Image
Magictallguy replied to Samurai Legend's topic in Modification Support
Exactly what Hax-guy said; that URL isn't an image Edit: Just tested with a direct URL given by PhotoBucket itself (http://i871.photobucket.com/albums/ab277/ANNNNNNNNA_bucket/Animated%20Gif/Psychedelic%20Animated%20Gifs/AnimatedAura.gif), seems to work fine for me- 15 replies
-
- mccode-v2
- mccode-lite
-
(and 3 more)
Tagged with:
-
attack script not returning name, just numbers
Magictallguy replied to boionfire81's topic in Engine Support
Suggestion: Make MySQL do the majority of the work here.. $odata_sql = 'SELECT `userid`, `hp`, `infirmary`, `jail` `username`, `gang`, `location`, `maxhp`, `gender` `guard`, `agility`, `strength` FROM `users` NATURAL JOIN `userstats` WHERE `userid` = '.$_GET['ID']; $q = $db->query($odata_sql); //[...] -
attack script not returning name, just numbers
Magictallguy replied to boionfire81's topic in Engine Support
Also, MC Craps can feck off - ain't our fault they created a script so buggy that an entire community has to repair it -
attack script not returning name, just numbers
Magictallguy replied to boionfire81's topic in Engine Support
Look at the main select query for grabbing the user's data (should be within the top 30 lines by default) -
PAID REQUEST - TC cloned member dropdown function
Magictallguy replied to boionfire81's topic in Requests & In Production
You appear to have a conflicting js imported in. Suggestion: Strip out *all* from the header. Add them back 1-by-1, starting with the JS required for the getList() (sent via PM). Once it stops working, you know which one is conflicting -
mccode-v2 Updating Profile Image
Magictallguy replied to Samurai Legend's topic in Modification Support
Heh, that's my isImage function..- 15 replies
-
- mccode-v2
- mccode-lite
-
(and 3 more)
Tagged with:
-
If you don't have to use RegEx, don't. You can simply explode() it out using the comma separators..
-
He also hasn't defined $page as an argument in the function.. function page($page = 0) { if(!$page || !ctype_digit($page)) return false; if($ir['page'] != $page) { $db->query('UPDATE `users` SET `page` = '.$page.' WHERE `userid` = '.$ir['userid']); $db->query('INSERT INTO `logs` VALUES (NULL, '.$ir['userid'].', '.$page.', '.time().')'); } return true; } //Usage: page($whatever_variable_holds_the_page_number);
-
...My intentions were to poke a little fun, then backup your statement in agreement with you >.>
-
For the record, it'd be page($page); And time() is a PHP funtion, not MySQL. You'll need to change it to either ".time()." or simply unix_timestamp() Oh, also [uSER=71663]IllegalPigeon[/uSER], lick my nipple! Backticks are useful! Then again, so are standardized naming conventions (not using things like `count`, `time`, `user`, `badly,named,table,with,commas`, etc. as table/column names) http://stackoverflow.com/a/11321508
-
A darker theme would be much appreciated
-
Trunicating log enteries after 24 hours
Magictallguy replied to boionfire81's topic in Requests & In Production
This can also be done as just the query $db->query('DELETE FROM `table` WHERE `timestamp` <= (unix_timestamp() - 86400)'); -
PAID REQUEST - TC cloned member dropdown function
Magictallguy replied to boionfire81's topic in Requests & In Production
I've tested this myself, it does work. I'd have to see your setup before I can diagnose further - feel free to shoot me a PM -
When coding late at night with all the lights off around you for 13 years almost non-stop, your eyes tend to hurt (or, at least, mine do!) So I've wrote up a dark CSS theme for MakeWebGames using the browser addon Stylish (Chrome/Firefox). It's easier on the eyes, I'll give it that much, but it's fugly as hell - still, it's a darker theme that makes my time on MWG easier for me. If anyone would like to chuck over updates/suggestions, please feel free! I can add them as options for customisation before installing the theme MakeWebGames Dark
-
PAID REQUEST - TC cloned member dropdown function
Magictallguy replied to boionfire81's topic in Requests & In Production
Indeed. We can therefore assume that the stock jQuery packaged with MC Craps is no good. Try using the latest jQuery found here -
PAID REQUEST - TC cloned member dropdown function
Magictallguy replied to boionfire81's topic in Requests & In Production
Here's an example of it in a form designed to send an event to a user. <?php require_once __DIR__ . '/globals.php'; // If the form has been submitted if(array_key_exists('submit', $_POST)) { // Basic sanitation $_POST['user'] = array_key_exists('user', $_POST) && is_string($_POST['user']) ? $db->escape(trim($_POST['user'])) : null; $_POST['event'] = array_key_exists('event', $_POST) && is_string($_POST['event']) ? trim($_POST['event']) : null; // Basic validation if(empty($_POST['user'])) { echo 'You didn\'t select a valid user'; exit($h->endpage()); } if(empty($_POST['event'])) { echo 'You didn\'t enter a valid event text'; exit($h->endpage()); } // Get the user $select = $db->query('SELECT `userid` FROM `users` WHERE `username` = "'.$_POST['user'].'"'); // Does the user exist? if(!$db->num_rows($select)) { echo 'The user you selected doesn\'t exist'; exit($h->endpage()); } // Return the userid $user = $db->fetch_single($select); // Send the event event_add($user, $_POST['event']); echo 'The event has been sent<br />'; } // Display the form ?><form action="send_event.php" method="post"> <table class="table" width="100%"> <tr> <th width="25%">User</th> <td width="75%"><?php echo getList('user');?></td> </tr> <tr> <th>Event</th> <td><input type="text" name="event" /></td> </tr> <tr> <td colspan="2" class="center"><input type="submit" name="submit" value="Send Event" /></td> </tr> </table> </form><?php // Page footer $h->endpage(); If you were to stick that in a file called send_event.php, you'd be able to simply start typing a name to select a user. With the way the getList() function works, it'll return a username as the value so, we select the user based on the username entered. If the user doesn't exist, end the page. If the user does exist, return their respective userid and continue. Long story short; getList() returns a username as a value. Do with it as you wish ;) -
and http://makewebgames.io/forum/game-engines/mccode-development-support/engine-support/377702-sql-errors I'm gonna say no. Thanks though
-
Do the same - restructure the query to have column name declarations $db->query('INSERT INTO `mail` (`mail_from`, `mail_to`, `mail_time`, `mail_subject`, `mail_text`) VALUES ('.$userid.', '.$to.', '.time().', "'.$subj.'", "'.$msg.'")');
-
PAID REQUEST - TC cloned member dropdown function
Magictallguy replied to boionfire81's topic in Requests & In Production
The MC Craps version of jQuery *should* suffice. As for the UI, https://code.jquery.com/ui/1.11.4/jquery-ui.min.js is what you're after -
Change if($ir['timecard'] = 1) to if($ir['timecard'] == 1)