Jump to content


  • Posts

  • Joined

  • Last visited


Everything posted by Labradoodle-360

  1. Is there a reason that you're using the file functions rather than just using file_put_contents?
  2. My avatar is me Oh, I would definitely agree with that, although as of SMF 2.0 RC4 (I do believe) quite a few hooks were added, and now we're in SMF 2.0.2, and there are many more hooks available for use. Hooks are not required, by any means, but we definitely suggest that mod authors utilize hooks to broaden the use range of their modification. SMF 2.1 will have more extensibility for hooks, as of now most majour arrays have hooks, and definitely by the next release more useful ones will be included as well.
  3. If it's a form being submitted, you are correct. But if he's simply trying to output the number, disabling it wouldn't cause any issues, although in that case, it probably shouldn't be an input element, anyway.
  4. Thank you for the username change. *Labradoodle-360 facepalm.
  5. Sorry, but is that a joke? I'm over twenty posts now. I had 18 posts when I requested my name change, and was going back to help more people, so I didn't think you guys would be so nit-picky about someone who clearly isn't just going to disappear. Now that I fit the requirements fully I would appreciate if my name could be changed to "Labradoodle-360". Thanks!
  6. The scootstah's example is exactly how I'd do it, although I might personally also add disabled="disabled" to the input so it can't be directly modified, but they can still copy / paste the number ( I assume that's your goal )
  7. I'd personally suggest using the code I posted, I completely rewrote the block for you to be more efficient...
  8. Not to be rude, at all, but if you don't know PHP too extremely well, I doubt you'll want to venture down the road of AJAX as you'll need to know PHP, and JavaScript (fairly well). Might I suggest looking into the possibility of just using jQuery? If you don't need to fetch anything dynamic, jQuery should work just fine.
  9. Are you looking for something like echo ''; or print(); ? If not, in JavaScript, something like alert();?
  10. Not really sure I understand what you mean. Can you provide a link, more detailed explanation or some screenshots so I can better assist you with your issue?
  11. If I understand you correctly, you're attempting to center your navigation bar in the browser? Why not just wrap the ul in a div, with the style text-align: center;? (You'd also need a width)
  12. I know that I'm a couple posts ahead of 20, although I'd appreciate if my username could be changed to "Labradoodle-360". Thanks!
  13. How are you trying to execute the replace? If you're trying to replace the code client side, you'll need to use JavaScript, or jQuery/AJAX. If you can do it server side (via PHP) great. Here's the PHP code. $search = '<div class="postbody">'; $replace = '<div class="postbody <vb:if condition="$show[\'moderated\']">moderated</vb:if>">'; if (!empty($your_variable)) str_replace($search, $replace, $your_variable); # Make sure "$your_variable" is an existing variable that contains your HTML.
  14. A plugin system is a simple theory, although it can be more complicated to actually write it. There are two general approaches: hooks and modifications. The differences are very important to understand. Modifications make actual edits to file(s) and therefore can be more buggy, because actual code has to be modified; while hooks are a more clean approach because you can modify arrays dynamically therefore circumventing potentially buggy hacks/modifications. Both approaches can be found in SMF itself (this forum software), it allows mod authors to utilize hooks, yet still allows actual modification to its' files.
  15. So basically, you're wanting the user to be able to select a name from a list, the value of which contains a phone number? Once they select a number, you want to then output that number to the user? Have you considered using jQuery for this? It'd be extremely simple to accomplish.
  16. It might be worth cleaning up the line-spacing, and tabbing before someone reviews it. It'd be much easier for us to help you.
  17. Here you go. // TMU if ($row['TMU'] == 'x') $extended = 'N/A'; // Salvage Title elseif ($row['cleantitle'] != 'x') $extended = 'N/A'; // 150,000+ miles elseif ($row['mileage'] > 150000) $extended = 'N/A'; // Snowplow elseif ($row['ftr003'] == 'x') $extended = 'N/A'; // Category 3 elseif ($row['make'] == 'Jaguar' || $row['make'] == 'Land Rover') $extended = 'N/A'; // 10+ cyls elseif ($row['engine_cylinders'] > $extended = 'N/A'; // Older than 13 years elseif ($year < date("Y")-12) $extended = 'N/A'; // Qualifies for warranty else { $surcharge = 0; switch ($row['mileage']) { case ($row['mileage'] > 99999): $surcharge += 200; break; case ($row['mileage'] > 99999 && $row['mileage'] < 125000) $surcharge += 200; break; case ($row['mileage'] > 125000 && $row['mileage'] < 150001) $surcharge += 400; break; } if ($row['drivetrain'] == 'AWD' || $row['drivetrain'] == '4x4') $surcharge += 150; if ($row['fuel'] == 'Diesel') $surcharge += 100; switch ($row['make']) { case 'Audi': case 'BMW': case 'Cadillac': case 'Infiniti': case 'Lexus': case 'Lincoln': case 'Mercedes-Benz': case 'Mini': case 'Saab': case 'Volvo': $surcharge += 550; break; } if (date('Y') - 11 == $year) $surcharge += 50; elseif (date('Y') - 12 == $year) $surcharge += 100; elseif (date('Y') - 13 == $year) $surcharge += 200; $extended = '$' . number_format(1380 + $surcharges); }
  18. Just thought I'd start a topic to add a quick suggestion regarding the forum version. SMF 2.0 stable was released, along with two patches (2.0.2 is the latest public version) and I'd HIGHLY suggest upgrading, many bugs have been fixed since SMF 2.0 RC5. Best Regards, Labradoodle-360
  19. You'd want to define $surcharge above the if condition. You'll also want to change if ($surcharge) to if (!empty($surcharge)) to make sure there were actually item(s) added to the array.
  20. Anyhow, I have resolved this. Thank you guys for the posts
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.