Jump to content

Labradoodle-360

Members
  • Posts

    34
  • Joined

  • Last visited

    Never

Posts posted by Labradoodle-360

  1. 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.

  2. 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!

     

    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!

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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);
    
    }

  8. 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

×
×
  • 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.