-
Posts
2,150 -
Joined
-
Last visited
-
Days Won
153
Content Type
Profiles
Forums
Events
Everything posted by Magictallguy
-
Your 'tradelogs' case in staff_logs.php is missing a colon. Simply add the missing colon. The missing column (trMONEY) doesn't exist in trades_logs. The equivalent appears to be trGOLD. Based on the implementation, I recommend you change the table structure to match. ALTER TABLE trades_logs CHANGE trGOLD trMONEY BIGINT NOT NULL DEFAULT 0;
-
Check your error log. A 500 can be thrown for a variety of reasons - your first port of call should always be your error log
-
Uh, no. You're compounding it here. The site is the API. The API doesn't support what you're after. I scraped the form to make using the API easier for you.
-
Their API doesn't support that. A quick scrape of their form, however, would suit your needs. Here, I'll even build the array for you All options that were available at the time of writing: $avatarConf = [ 'top' => [ 'NoHair', 'Eyepatch', 'Hat', 'Hijab', 'Turban', 'WinterHat1', 'WinterHat2', 'WinterHat3', 'WinterHat4', 'LongHairBigHair', 'LongHairBob', 'LongHairBun', 'LongHairCurly', 'LongHairCurvy', 'LongHairDreads', 'LongHairFrida', 'LongHairFro', 'LongHairFroBand', 'LongHairNotTooLong', 'LongHairShavedSides', 'LongHairMiaWallace', 'LongHairStraight', 'LongHairStraight2', 'LongHairStraightStrand', 'ShortHairDreads01', 'ShortHairDreads02', 'ShortHairFrizzle', 'ShortHairShaggyMullet', 'ShortHairShortCurly', 'ShortHairShortFlat', 'ShortHairShortRound', 'ShortHairShortWaved', 'ShortHairSides', 'ShortHairTheCaesar', 'ShortHairTheCaesarSidePart', ], 'accessories' => [ 'Blank', 'Kurt', 'Prescription01', 'Prescription02', 'Round', 'Sunglasses', 'Wayfarers', ], 'hair-colours' => [ 'Auburn', 'Black', 'Blonde', 'BlondeGolden', 'Brown', 'BrownDark', 'PastelPink', 'Platinum', 'Red', 'SilverGray', ], 'facial-hair' => [ 'Blank', 'BeardMedium', 'BeardLight', 'BeardMagestic', 'MoustacheFancy', 'MoustacheMagnum', ], 'clothes' => [ 'BlazerShirt', 'BlazerSweater', 'CollarSweater', 'GraphicShirt', 'Hoodie', 'Overall', 'ShirtCrewNeck', 'ShirtScoopNeck', 'ShirtVNeck', ], 'eyes' => [ 'Close', 'Cry', 'Default', 'Dizzy', 'EyeRoll', 'Happy', 'Hearts', 'Side', 'Squint', 'Surprised', 'Wink', 'WinkWacky', ], 'eyebrow' => [ 'Angry', 'AngryNatural', 'Default', 'DefaultNatural', 'FlatNatural', 'RaisedExcited', 'RaisedExcitedNatural', 'SadConcerned', 'SadConcernedNatural', 'UnibrowNatural', 'UpDown', 'UpDownNatural', ], 'mouth' => [ 'Concerned', 'Default', 'Disbelief', 'Eating', 'Grimace', 'Sad', 'ScreamOpen', 'Serious', 'Smile', 'Tongue', 'Twinkle', 'Vomit', ], 'skin' => [ 'Tanned', 'Yellow', 'Pale', 'Light', 'Brown', 'DarkBrown', 'Black', ], ];
-
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.