-
Posts
2,140 -
Joined
-
Last visited
-
Days Won
148
Content Type
Profiles
Forums
Events
Everything posted by Magictallguy
-
It's one of the IPNs I wrote - attempting to load the file directly will result in this error as there's no POSTDATA being sent on a standard GET request for loading a page in browser. Use PayPal's Dev Sandbox to simulate real-world payments
-
More information required. What is the error message it spits at you? (If you haven't already and your script supports it, enable debug mode)
-
[mccode] Improved Estate Agents for v2.0
Magictallguy replied to Ghetto's topic in Free Modifications
More information required. An HTTP Error 500 is generic Check your error_log -
1 table, 3 columns; id, parent_id, name. We can make some guesses at what the data might actually be, based on what we see. For example, I see that `id` (the first column) is likely a primary key that auto-increments. Again, based on the data we've got and the explanation given with it, the parent_id relates to another row in the table if parent_id is greater than 0, or otherwise has no direct relation (and therefore is the parent category). Your instructions are to write a function that'll display this breadcrumb-style, based on parameters given to said function. As the question says, assume you've already got a function named getCategory() and it takes 1 parameter; the id. Can you write, say, showBreadcrumbs()? If you have a PHP-capable webserver and a DB server available to you, then start playing around (suggested only as I'm aware you're familiar with this)! Create the table with the 3 columns and insert the data as displayed - then query it. If not, or if you'd like to run this in a php sandbox online for free (hint hint), then write an array of the data instead; <?php $categories = [ [ 'id' => 1, 'parent_id' => 0, 'name' => 'Clothing', ], [ 'id' => 2, 'parent_id' => 0, 'name' => 'Accessories', ], // ... ]; There's a couple of "oh, duuuhhh" moments in this exercise. Remember; keep it simple!
-
* * * * * php path/to/file code=thecode arg=wutever arg3=..
-
Currently running AlmaLinux here for multiple purposes including the usual webserver setup. Beautiful OS, familiar CLI, no complaints!
-
Check that the result of the guard / 1.5 is above 0 before using it as part of the equation <?php // Check that the user's guard is above 0 and get the guard division result, otherwise it's 0 $guardResult = $youdata['guard'] > 0 ? $youdata['guard'] / 1.5 : 0; // Begin the damage calculation $dam = $enweps[$weptouse]['weapon'] * $odata['strength']; // If we've got something to divide by .. if ($guardResult > 0) { // .. divide it $dam /= $guardResult; } // Add the randomisation back in $dam *= rand(8000, 12000) / 10000; // And cast it to an integer $dam = (int)$dam; /** * Original line for reference * $dam = (int) (($enweps[$weptouse]['weapon'] * $odata['strength'] / ($youdata['guard'] / 1.5)) * (rand(8000, 12000) / 10000)); */
-
Enable Debug Mode - edit lib/basic_error_handler.php and set the DEBUG constant to true (line 31 by default)
-
And all of this is beside the point - if it doesn't make sense to you, that's fine. Ask, don't attack. Stay on topic, please
-
Error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given A null value was passed to a count() call. count() doesn't accept null values. nbbc.php line 155 is the call
-
$db->query('SELECT type, user, person FROM lists WHERE user = ? AND person = ?'); $db->execute([$i['userid'], $u['userid']]); $row = $db->fetch(true); if(empty($row)) { $fri = '<a href="friends?add='.$profile_info->name.'">Add friend</a>'; $ene = '<a href="enemys?add='.$profile_info->name.'">Add enemy</a>'; } elseif($row['type'] === 'friend') { $fri = 'Remove Friend'; $ene = ''; } else if($row['type'] === 'enemy') { $fri = ''; $ene = 'Remove enemy'; }
-
True! This grants those who prefer an in-site GUI over opening an editor that ability and was originally written with that in mind
-
And reality - this plane of existence, for example 😉 Better hills to die on, guys!
-
I believe he's using a PDO wrapper I released a few years ago
-
Remove the error suppressant from the session_start() call and get the information you need
-
I quite liked MCC's crime success chance calculation. I feel it was a little lacking on the modifiers side of it as default, but easy enough to extend. I'd suggest doing something similar to it, perhaps incrementally per level range or crime level (don't know what you're intending to do). Alternatively, keep it simple with an "easy", "medium", "hard" at varying integers and use an RNG? <?php // Example // Set array of difficulties with associated percentage of success $difficulties = [ 'easy' => 95, 'medium' => 50, 'hard' => 25, 'extreme' => 10, ]; // Assume $row is an array of crime data, assume "difficulty" is a valid column name with either "easy", "medium", "hard", or "extreme" set if ($difficulties[$row['difficulty']] >= mt_rand(0, 100)) { // success } else { // fail (maybe and/or jail?) } There are many ways to achieve your desired effect; experiment as see what works for you
-
Provide us with the code. We can't help you if you're only posting your guesses to it
-
That'd help 😉
-
Open a ticket about it. Dave may be able to work with you on this 🙂
-
If I understand correctly, effectively mirroring MCC v2's forums.php into GL
-
Mmkay, back on topic, please.
-
The template, in my opinion isn't great. The colour scheme hurts my eyes and reminds me of baby poop. Sections are spaced out well enough to set some eye-catching stuff. I'd say you've got a few concepts in there I like, but not the best of executions. As for the rest of you; you are welcome to share your opinion about this template on this topic as the OP requested it (a dangerous thing to do on the internet, but ya know..). At no point was slating each other on the table. Rein it in, please.
-
Community-driven translations from native speakers! Use constants, arrays, a database; whatever gets you valid translations in context.
-
Somewhat related to the topic; a shim is just a file of functions with the old names doing the new things. To use, you'd simply include it into a core file