-
Posts
182 -
Joined
-
Last visited
-
Days Won
2
Content Type
Profiles
Forums
Events
Everything posted by TheMasterGeneral
-
MakeWebGames is back, 2019 edition
TheMasterGeneral replied to Dave's topic in News and Announcements
Glad its back. ? -
He messaged me on Skype. I *think* we've got it squared away.
-
Which Mobile operating system do you prefer?
TheMasterGeneral replied to Jan Kaufmann's topic in Tech News
Personally, I loved my Pocket PC that ran on Windows Mobile 5. Ended up flashing WinMo6 to it just so I could use the Facebook app. Phone bit the dust a couple years ago, then I adopted a Samsung SM765C for my daily driver (Android). -
Do a check to make sure the spouse has the house? I don't have the specific code and I haven't messed with MCC in a long while, but I'd assume that it'd involve a similar check when the single user buys an estate.
-
- 1
-
-
$query=$db->query("bleh"); while ($result=$db->fetch_row($query)) { //herp the derp } 1) Have you tried adding "LIMIT 1" to the end of the query? 2) Are you only selecting one data row? If so, I think you'd want fetch_single rather than fetch_row.
-
Its quite... chaotic now. Pretty hard to glance over the "Latest Topics" list to see if someone needs help or whatever. ._. Edit: And the "Working..." when you post/reply. Its stuck like this until you F5. Kinda annoying.
-
Sorry, allow me to elaborate. I had this instance setup so that the user gets 100 "searches" per day. Database holds the value of 100. Each iteration through, it subtracts 1 from the "search" variable from both the database and the loop. Once the loop hits 0, it finishes. Yes, it will echo out each output.
-
<?php while ($searchleft > 0) { $db->query("UPDATE `users` SET `searched` = `searched` - 1, `autohex` = `autohex` - 1 WHERE `userid` = $userid"); $searchleft=($searchleft-1); $chance = mt_rand(1,100); if ($chance <= 10) { //Queries, print, etc. } //continue on and on... } That's the basics of it.
-
In PHPMyAdmin, check the "Check All" box at the bottom of the table listing, then click the dropdown next to it and click empty. This'll keep the table setup, but just clear the information stored in the tables.
-
If its for permission to use or whatever, go right on ahead. No royalties owed to me. If its for something else, send me a PM and we'll talk. :D
-
mccode-v2 anyone know off the top of their head..?
TheMasterGeneral replied to boionfire81's topic in Modification Support
Include the Javascript in the endpage(); function in the header file. Just make sure you end each file with $h->endpage();- 2 replies
-
- mccode-v2
- mccode-lite
-
(and 3 more)
Tagged with:
-
mccode-v2 Updating Profile Image
TheMasterGeneral replied to Samurai Legend's topic in Modification Support
Weirdly enough, it works in a single file (test.php) However, in a live (in-dev) application, it does not. I find this quite strange. Code, if you need it. That's exactly how it is handled right now in my application. function isImage($url = null) { $url = filter_var($url, FILTER_VALIDATE_URL) ? filter_var($url, FILTER_SANITIZE_URL) : null; if(empty($url)) return false; $params = ['http' => ['method' => 'HEAD']]; $ctx = stream_context_create($params); $fp = @fopen($url, 'rb', false, $ctx) or false; if(!$fp) return false; // Problem with url $meta = stream_get_meta_data($fp); if ($meta === false) { fclose($fp); return false; // Problem reading data from url } $wrapper_data = $meta['wrapper_data']; if(is_array($wrapper_data)) foreach(array_keys($wrapper_data) as $hh) if (substr($wrapper_data[$hh], 0, 19) == "Content-Type: image") { fclose($fp); return true; } fclose($fp); return false; }- 15 replies
-
- mccode-v2
- mccode-lite
-
(and 3 more)
Tagged with:
-
mccode-v2 Updating Profile Image
TheMasterGeneral replied to Samurai Legend's topic in Modification Support
The issue appears to only happen when the URL itself does not return a "Success" header. (404, 403, etc.) When I input "http://somerandomwebsite.com/fake/url/image/watever.png" it failed on the fopen. "PHP Warning: fopen(http://somerandomwebsite.com/fake/url/image/watever.png): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden (2) Perhaps test for the returned header/response?- 15 replies
-
- mccode-v2
- mccode-lite
-
(and 3 more)
Tagged with:
-
Don't mind him, [uSER=65371]sniko[/uSER], he'll just block you if you try addressing him.
-
Would probably help to post a budget. I have a feeling that #3 is going to run you the most time, effort (and assumed cash) out of all that. Just my $0.02
-
mccode-v2 in array() expects at most 3 parameters, 11 given
TheMasterGeneral replied to boionfire81's topic in PHP
Oh, my apologies. Made a sleepy coder derp. Replace the $IDs line with: $IDs=array(18,16,15,13,3,4,2);- 11 replies
-
- mccode-v2
- mccode-lite
-
(and 3 more)
Tagged with:
-
mccode-v2 in array() expects at most 3 parameters, 11 given
TheMasterGeneral replied to boionfire81's topic in PHP
If I understood correctly, yes. Just for confirmation: $ArrayToTest=$db->fetch_array($query); $IDs=('id1','id2','etc'); if (in_array($ArrayToTest,$IDs)) { //yeah }- 11 replies
-
- mccode-v2
- mccode-lite
-
(and 3 more)
Tagged with:
-
mccode-v2 in array() expects at most 3 parameters, 11 given
TheMasterGeneral replied to boionfire81's topic in PHP
One moment... $FieldToTest=$Array; //The array to test $WhatToTestFor=array('foo','bar','etc'); //What to test for if (in_array($FieldToTest,$WhatToTestFor)) { //success }- 11 replies
-
- mccode-v2
- mccode-lite
-
(and 3 more)
Tagged with:
-
attack script not returning name, just numbers
TheMasterGeneral replied to boionfire81's topic in Engine Support
I know it worked right off the bat in stock MCCraps, and I'm fairly confident in saying that a file rename wouldn't break a script like that. (The file name changed, not the logic, right?) See if you gave $odata['username'] another value somewhere to cause it to derp. -
attack script not returning name, just numbers
TheMasterGeneral replied to boionfire81's topic in Engine Support
Their name isn't numbers, is it? -
Trunicating log enteries after 24 hours
TheMasterGeneral replied to boionfire81's topic in Requests & In Production
$Time=time(); $DeleteTime=$Time-86400; //86400 is 24 hours $db->query("DELETE FROM `table` WHERE `timestamp` <= {$DeleteTime}"); -
require('globals.php'); $endtime=140000000; $starttime=130000000; $currenttime=time(); if ($endtime < $currenttime) { //nope }