Member
Member
darkufo   2015-03-22, 11:51
#1

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
http://www.spoilertv.com/2015/03/chicago-pd-episode-218-get-back-to-even.html

You will see some broken image links.

Each of these img src values look like this

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=!

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.

Member
Member
darkufo   2015-03-22, 12:10
#2

I think I've got it fixed for broken images

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule .(gif|jpe?g|png|bmp) missing.png [NC,L]

You can see it working here
http://www.spoilertv.com/2015/03/chicago-pd-episode-218-get-back-to-even.html

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.

Administrator
Administrator
acrylian   2015-03-22, 12:45
#3

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=!
This is the link to the image processor so technically a php page until the image is cached which of course does not happen if it is not there anymore.

Not sure that is possible with htaccess as that of course cannot know about zp internal image processing.

Member
Member
darkufo   2015-03-22, 12:51
#4

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?

Administrator
Administrator
acrylian   2015-03-22, 13:04
#5

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: zp-core/images/err-imagenotfound.png. That's in the core but that you could replace more easily.

Member
Administrator
Administrator
acrylian   2015-03-22, 13:10
#7

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.

Member
Member
Member
sbillard   2015-03-22, 19:12
#9

This is the same issue as your other thread. The base URL needs to be changed to the new site. Same solution should work.

Member
Member
darkufo   2015-03-22, 22:37
#10

Hi SBillard,

Could you explain please a little more about the Base URL? Is that a setting in the config?

Member
Member
sbillard   2015-03-23, 17:17
#11

The current versions of zenphoto use the strings {*WEBPATH*} and {*FULLWEBPATH*} as tokens to represent your sites basu URL. The FULLWEBPATH token includes the http(s)//, the WEBPATH one does not.

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 news table and the content column.

Once those tokens are in place zenphoto will replace them with the correct site link before they are placed on any content pages.

Member
Member
darkufo   2015-03-24, 00:37
#12

Thanks SBillard. We're on an older version 1.4.3.1 which I believe does not have those values/tokens

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.