Simple Smarty Question - $15 Paxum/PayPal In Thread :D

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Inter-Sex
    Confirmed User
    • Nov 2005
    • 2231

    #1

    Simple Smarty Question - $15 Paxum/PayPal In Thread :D

    For the first one that give me, a for me quick working solution.

    My path to .jpg files (as in the .tpl files)
    Code:
    <li><a href="{$name_name2}/path/{$xxx1.xxx2}/to/01.jpg"><img style="border-color:#000000;" border="2" src="{$name_name2}/path/{$xxx1.xxx2}/thumbnails/01.jpg" /></a></li>
    But now is the file .ext not always .jpg, but often .JPG

    What is the easiest way around this ?

    Don't forget to leave your contact details please.

    ~ Renaldo,

    (Disclaimer : max 1 winner)
  • darksoul
    Confirmed User
    • Apr 2002
    • 4997

    #2
    There is no smarty solution to this.
    The best solution would be to keep the extension/filename in the database along with the other details.
    Alternatively you can use onerror, although I don't really like it:
    src="{$name_name2}/path/{$xxx1.xxx2}/thumbnails/01.JPG" onerror='this.src={$name_name2}/path/{$xxx1.xxx2}/thumbnails/01.jpg'
    1337 5y54|)m1n: 157717888
    BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
    Cambooth

    Comment

    • DarkJedi
      No Refunds Issued.
      • Feb 2001
      • 28301

      #3
      run a script to convert your .JPG to .jpg

      Comment

      • darksoul
        Confirmed User
        • Apr 2002
        • 4997

        #4
        Or do this if its an option: http://www.osguides.net/tips-a-trick...sensitive.html
        1337 5y54|)m1n: 157717888
        BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
        Cambooth

        Comment

        • Inter-Sex
          Confirmed User
          • Nov 2005
          • 2231

          #5
          I've had hoped that this could be done by updating the smarty line a bit.
          Since that seems not the case, gonna upload those files again, but with the correct .ext, not uppercased.

          Comment

          • georgeyw
            58008 53773
            • Jul 2005
            • 9865

            #6
            Originally posted by DarkJedi
            run a script to convert your .JPG to .jpg
            Definitely the best solution.

            Smarty is a gigantic POS!

            You could run some php to check if the file exists in an if else statement - however probably not going to do to well with big traffic numbers.

            EDIT :
            ie
            Code:
            {
            
            $file = "{$name_name2}/path/{$xxx1.xxx2}/to/01.jpg";
            
            if(!$file_exists($file)) { $file = '{$name_name2}/path/{$xxx1.xxx2}/to/01.JPG'; }
            
            }
            Last edited by georgeyw; 10-09-2011, 02:06 AM.
            TripleXPrint on Megan Fox
            "I would STILL suck her pussy until her face caved in. And then blow her up and do it again!"

            Comment

            • VladS
              Available for Coding Work
              • Jun 2008
              • 1459

              #7
              There's really no "perfect thing" in this case as far as i can tell, you could do a check if file exists, but that'll slow down the script. I would approach the problem in a way so that you have all images end in the same extension.
              <developer> MechBunny / KVS / PHP / MySQL / HTML5 / CSS3 / jQuery
              Email: vlad [at] dangerouscoding.com
              Telegram: @dangerouscoding

              Comment

              Working...