GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Simple Smarty Question - $15 Paxum/PayPal In Thread :D (https://gfy.com/showthread.php?t=1041085)

Inter-Sex 10-09-2011 02:24 AM

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,

:warning(Disclaimer : max 1 winner)

darksoul 10-09-2011 02:36 AM

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'

DarkJedi 10-09-2011 02:36 AM

run a script to convert your .JPG to .jpg

darksoul 10-09-2011 02:41 AM

Or do this if its an option: http://www.osguides.net/tips-a-trick...sensitive.html

Inter-Sex 10-09-2011 02:47 AM

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.

georgeyw 10-09-2011 02:54 AM

Quote:

Originally Posted by DarkJedi (Post 18478833)
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'; }

}


VladS 10-09-2011 03:09 AM

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.


All times are GMT -7. The time now is 12:05 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc