-
Posts
2,146 -
Joined
-
Last visited
-
Days Won
149
Content Type
Profiles
Forums
Events
Everything posted by Magictallguy
-
That site is the API. Send a GET request to it in order to receive data. API, done.
-
-
I agree - for the expected use of it; might not mean much to a user specifically searching for weakness.
-
Perhaps you have suggestions on how to improve it?
-
Line 209: if($_POST['crys'] || $_POST['cash'] || $_POST['item'] || $_POST['rcrys'] || $_POST['rcash'] || $_POST['ritem']) { Your POST data hasn't been verified (or sanitised!). For your immediate fix: Ensure each key exists in the POST array Further processing: Recommend you check what's actually coming in - content types (at a guess, looks like all types are supposed to be int), content values (if int, then positive whole numbers), whether the referenced POST data exists (if $_POST['item'] equates something in your items table, for example.) Personally, here, I'd cheat a little.. $nums = ['crys', 'cash', 'item', 'rcrys', 'rcash', 'ritem']; foreach ($nums as $num) { $_POST[$num] = array_key_exists($num, $_POST) && is_numeric($_POST[$num]) && $_POST[$num] > 0 ? (int)$_POST[$num] : null; }
-
Depends on what's running before it, this snippet might result in an undefined index warning on lang. Simply verify its existence. if(array_key_exists('lang', $_GET) && in_array($_GET['lang'], $available_langs)) { $_SESSION['lang'] = $_GET['lang']; // Set session }
-
Cloudflare's having problems
-
Ya know what could solve that? Visiting Gravatar Gravatar is not an image editing service. It's a "match avatar to email if we can" service. So no, you can't edit images on Gravatar. You can, however, upload them directly
-
Strictly speaking, that line of code is fine. Whatever is being passed into the `parsings` array is the issue
-
How to integrate SMF into any McCodes Package
Magictallguy replied to sniko's topic in Free Modifications
MCCv2 is still supported, yes. This implementation, however, was written in v1 style with hardcoded calls to mysql_*() functions. I'm aware that @PHPStudent is running on PHP7.4.8 (support request). It's not the engines at fault, but the date of the snippets release - it's too old (as-is) to run on PHPStudent's system. -
How to integrate SMF into any McCodes Package
Magictallguy replied to sniko's topic in Free Modifications
This topic was originally created in 2012. SMF has been updated countless times since - as has PHP. In PHP7.4.8 (what you're using), mysql_*() functions have been completely removed. Long story short, this snippet will no longer work -
That's not a bug. Dealer shows the higher-value hand as achieved blackjack in less cards. In some casinos, a 5-card trick can override this.
-
mccode-v2 CSS Administration System [$10]
Magictallguy replied to Magictallguy's topic in Paid Modifications
I'm glad you do, because I don't! 😄 -
For once, I have to agree with Sim! A switch statement might be better suited here. It's a little more verbose, but that's part of the point here - easier to visually break the logic apart. Still, an if statement would suffice, though you do sacriface a little readability for it.
-
if($item_equip_area === 'head') { $col = 'equip_head'; } elseif($item_equip_area === 'shoulder') { $col = 'equip_shoulders'; } elseif($item_equip_area === 'knee') { $col = 'equip_knees'; } else { $col = 'equip_toes'; } $this->db->query('UPDATE character_list SET '.$col.' = ? WHERE userid = ?');
-
mccode-v2 Updated Newspaper - more than one page
Magictallguy replied to Magictallguy's topic in Free Modifications
- Rewrote staff functions - Rewrote newspaper Implemented self-scaling methods. See SQL Command's note -
Do any of your item names contain a closing bracket?
-
Speak to your host about installing the extension you need. Edit; Or, if your host supports Multi-PHP versions, then drop your PHP version down to something below PHP7
-
To clarify, are these issues you're experiencing with official GL stuff, or are you effectively tracking issues from your own modifications to your copy of GL?
-
dshafik's php7-mysql-shim may be of use to you here. Easiest way to implement, I feel, is through Composer. Simply require the package in, include the vendor's autoload.php, go! Failing that, grab a copy of src/mysql.php (in the same Git repo), upload said copy to your files, include it before running any code that requires PHP5.4. There are certain methods that cannot be replicated, even with a shim. However, you're less likely to run into these using game engines currently available on MWG.
-
Running multi-PHP versions side-by-side is possible. Getting relevant information now Addition; while I wouldn't recommend it as a long-term replacement, a "shim" can be a very useful tool while migrating versions. In this case, a PHP5.4 shim would allow you to continue running 5.4 code on a 7 system. Update: MWG does support PHP5.4! (along with 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, and 7.4 - at the time of writing)
-
JavaScript Display errors on Android Mobile
Magictallguy replied to Sim's topic in Programming Tools, Software and much more
If @gamble's solution isn't any good for you, I've seen this in use in the past -
JavaScript Display errors on Android Mobile
Magictallguy replied to Sim's topic in Programming Tools, Software and much more
You've misunderstood a joke and taken it as attitude, then a position check. Nice. I'm sooo inclined to actually help you now. Back when I was coding on a phone, I used Droid-Edit. It allowed console access for locally-running scripts. Failing that, head to about:debug in a Chromium-based Android browser to access console output -
JavaScript Display errors on Android Mobile
Magictallguy replied to Sim's topic in Programming Tools, Software and much more
Yes, a laptop 😛