Jump to content

Labradoodle-360

Members
  • Posts

    34
  • Joined

  • Last visited

    Never

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. Not a problem, I'm glad you got it all worked out
  5. 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 )
  6. I'd be very intrigued to hear your thoughts on it's clumsiness.
  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. I'm going to send you a PM.
  11. 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?
  12. 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)
  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. Welcome, Zola!
  20. 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.
  21. Anyhow, I have resolved this. Thank you guys for the posts
  22. First of all, I assumed you would be familiar with SMF, simply because this is an SMF forum. Secondly, I didn't specify that this was based on SMF code because it is a syntax error, not an error with the structure or a variable from SMF. So it's not directly related to SMF, it's related to the syntax. But, I do apologize for the misunderstanding. This reply, I feel was very rude and not very understanding or kind. And definitely a bad experience for coming to PHP Freaks. Regarding your response. A) I stated it was a syntax error, not an error with how SMF coded it, which is why I failed to mention this. B) The syntax error was inside those couple lines of query, which is why I posted them. However, the thing that bothered me most about this post was That is quite an assumption, that isn't very nice. I knew it was in these couple lines because I made multiple tests to confirm this. It is also implying that I know nothing about how coding works, which I take as an insult. A) Not bothering to tell someone that this is the SMF database abstraction layer and as such it is not directly a mysql question, B) Not bothering to post the actual syntax error, because that would help someone directly help you. C) Thinking that just because a syntax error is reported at that point in the query that it could not have actually been caused by something before that point.
  23. I take it that you are not familiar with how SMF works? And yes, that is a small part of the query, but the only part I need help with, and the part that's causing the error.
  24. Hey everybody! A simple query I am working on is throwing a syntax error out, and I can't seem to find anything wrong with it, I am obviously overlooking something. SELECT id, name FROM {db_prefix}mainmenu ORDER BY name WHERE is_top <> {int:true}', array( 'true' => 1, ) What am I overlooking?
×
×
  • 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.