![]() |
|
Replace Broken link Images with Default Image - Possible? - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Replace Broken link Images with Default Image - Possible? (/thread-12168.html) |
Replace Broken link Images with Default Image - Possible? - darkufo - 2015-03-22 Hi, We've successfully completed our migration of 120,000 images (it took a while lol) and for the most part it's working very well. We do have some instances where we have some broken images that we have linked to in articles. This was expected as those are actually no longer there However, whilst doing this, I wondered if the following was possible. eg on this page You will see some broken image links. Each of these img src values look like this Now that is fine and as I said expected. Would it be possible somehow, I suspect through htaccess, that when it comes across a broken link that it instead displays a standard image. (Our image will say something like "The Thumbnail is currently missing, however clicking on me will load the correct page") eg something like what tinypic do ( Screenshot http://tinypic.com/images/404.gif ) I'm not sure if there is a simple htaccess rule that could be written. Any help, much appreciated. Replace Broken link Images with Default Image - Possible? - darkufo - 2015-03-22 I think I've got it fixed for broken images RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f You can see it working here However it seems that the other broken ones are not being detected as images but a php? Not sure if there is anything that can be done. Replace Broken link Images with Default Image - Possible? - acrylian - 2015-03-22 http://www.spoilertv.co.uk/images/zp-core/i.php?a=Chicago%20PD/Season%202/Promotional%20Episode%20Photos/Episode%202.18%20-%20Get%20Back%20to%20Even&i=NUP_167772_0075.JPG&s=100&c=1&cw=100&ch=100&q=100&t=1&wmk=! Not sure that is possible with htaccess as that of course cannot know about zp internal image processing. Replace Broken link Images with Default Image - Possible? - darkufo - 2015-03-22 Thanks acrylian, that's what I suspected Do you think it's possible, that I could somehow edit the i.php file so that if an image is not there, that the i.php file returns a default image? Replace Broken link Images with Default Image - Possible? - acrylian - 2015-03-22 You could but you shouldn't at all cost hack any core files :-) Actually the processor should return a 404 and a default image if it doesn't find the image: Replace Broken link Images with Default Image - Possible? - darkufo - 2015-03-22 Ah I see thanks. Why does my link here Not return an image but rather an error ? See Screenshot Replace Broken link Images with Default Image - Possible? - acrylian - 2015-03-22 I admit I have no idea right now. Does that album actually still exist? Since you Zenphoto version still seems to be 1.4.3.1 I cannot tell if that is related to that maybe. Replace Broken link Images with Default Image - Possible? - darkufo - 2015-03-22 Yes, that actual link is one for the old server. It will redirect here Here is the redirected link that does not throw the default image. Replace Broken link Images with Default Image - Possible? - sbillard - 2015-03-22 This is the same issue as your other thread. The base URL needs to be changed to the new site. Same solution should work. Replace Broken link Images with Default Image - Possible? - darkufo - 2015-03-22 Hi SBillard, Could you explain please a little more about the Base URL? Is that a setting in the config? Replace Broken link Images with Default Image - Possible? - sbillard - 2015-03-23 The current versions of zenphoto use the strings So if you have links in your database that are the wrong site you can find them and replace the site part with the appropriate token. You would do this with your MySQL GUI--see your hoster for how to access it. Simple SQL statements can make the replacements. You just need to know what tables and columns to examin. In your case that is most likely the Once those tokens are in place zenphoto will replace them with the correct site link before they are placed on any content pages. Replace Broken link Images with Default Image - Possible? - darkufo - 2015-03-24 Thanks SBillard. We're on an older version 1.4.3.1 which I believe does not have those values/tokens |