Resource icon

MetaMirror 1.6.1

No permission to download
This is brilliant, just a couple of things:

- Possibly move the new column on xf_post to installation code rather than doing the describe table every run
- For the option ids you should use a prefix to avoid conflicts on common words like 'Ignore' and 'enabled'
- Maybe make the cron run less often and with a larger batch by default
- If possible add some detection of dynamic images (especially when the new signature code is added), by server cache headers or url (by presence of query string and/or '.php') or something. It's quite common on gaming forums that you will get people putting dynamic statistics images in their signatures
 
The problem with this add-on is that to do this correctly the converted image links should be made into attachments. That way when a thread or post is deleted the attachments are deleted also. With this add-on you will end up with thousands of orphaned images wasting hard disk space.
 
This is brilliant, just a couple of things:

- Possibly move the new column on xf_post to installation code rather than doing the describe table every run
- For the option ids you should use a prefix to avoid conflicts on common words like 'Ignore' and 'enabled'
Oops, I thought the scope the options was restricted to an add-on, will to.


- Maybe make the cron run less often and with a larger batch by default
- If possible add some detection of dynamic images (especially when the new signature code is added), by server cache headers or url (by presence of query string and/or '.php') or something. It's quite common on gaming forums that you will get people putting dynamic statistics images in their signatures

You can add .php or ? to the (soon to be renamed) ignore option.
 
The problem with this add-on is that to do this correctly the converted image links should be made into attachments. That way when a thread or post is deleted the attachments are deleted also. With this add-on you will end up with thousands of orphaned images wasting hard disk space.

That never occurred to me, as I rarely delete posts and threads. If it becomes a problem then a "delete orphaned images" option could theoretically be added.
 
Where you're checking isset($url_info['host']) should probably do ['path'] too as I've had a few posts giving undefined index: path
 
Where you're checking isset($url_info['host']) should probably do ['path'] too as I've had a few posts giving undefined index: path

So you mean like:
PHP:
                if($ignore || !isset($url_info['host']) || !isset($url_info['path']))
?

Can you give me an exmaple URL that fails? Something like
?

I'll add that to 1.1, coming soon
 
So you mean like:
PHP:
                if($ignore || !isset($url_info['host']) || !isset($url_info['path']))
?

Can you give me an exmaple URL that fails? Something like
?

I'll add that to 1.1, coming soon

Didn't catch which url it was, but yeah it was probably just malformed

And another thing, probably need to consider the query string for situations such as people hotlinking google images thumbnails (typical :P)

Code:
         if(!empty($url_info['query']))
           $url = $url_info['host'].$url_info['query'].$url_info['path'];
         else
           $url = $url_info['host'].$url_info['path'];
 
Mick West updated MetaMirror with a new update entry:

Added rehosting of images in sig, renamed options (require reinstall)

Images in signatures are now (optionally) rehosted the same as images in posts.

A change to the naming of options (I did not use a prefix) requires that you uninstall and re-install MetaMirror in order to delete the badly named options. Sorry about that.

This means you will need to re-enter your ignore strings, and then re-enable the add-on.

Read the rest of this update entry...
 
Wow! Great Addon! I might take your code and modify it someway to fit my needs!

For anyone expecting to use this on signature images, take into account dynamic signatures. My users love to use that kind of signature and this addon would break them.
 
Didn't catch which url it was, but yeah it was probably just malformed

And another thing, probably need to consider the query string for situations such as people hotlinking google images thumbnails (typical :p)

Code:
         if(!empty($url_info['query']))
           $url = $url_info['host'].$url_info['query'].$url_info['path'];
         else
           $url = $url_info['host'].$url_info['path'];

Shouldn't that be:
Code:
         if(!empty($url_info['query']))
           $url = $url_info['host'].$url_info['path'].$url_info['query'];
         else
           $url = $url_info['host'].$url_info['path'];
 
Hmm, yes, I see it rehosts the google cached images fine, but strips off the query for the filename, so they will overwrite each other depending on what Google server hosts the. I shall fix this, as it also applies to any image generated with queries.
 
Wow! Great Addon! I might take your code and modify it someway to fit my needs!

For anyone expecting to use this on signature images, take into account dynamic signatures. My users love to use that kind of signature and this addon would break them.

Depending on the variety of dynamic signatures, that could be handled with ignore strings. Or just switch of the signature re-hostingin the options.
 
Shouldn't that be:
Code:
         if(!empty($url_info['query']))
           $url = $url_info['host'].$url_info['path'].$url_info['query'];
         else
           $url = $url_info['host'].$url_info['path'];

Swapping them round is a nice lazy way to keep extensions intact :)
 
Last edited:
Is there a way to run the job and just tally up what the total storage needed would be? I could see this getting rather expensive if you pay for storage ala carte.
 
  • Like
Reactions: DRE
Top Bottom