Make a wrapper function eg. get_url() that attempts fopen, fsockopen and curl. Maybe even FTP. I would think at least one of them will work in 90-95% of cases.
Great idea - I'll look into it.
If all that fails, how about falling back on iframes or some rss feed reader?
Iframes is being used in cpg1.5.x as fail-safe method to display the news from coppermine-gallery.net. However, you can't use the content in the iframe easily on the server the coppermine install is on and look stuff up. As RSS feeds are not built into the PHP core, you have to use a library that reads the feeds at basic PHP level - which is again fopen, fsockopen or whatever, so you're back to step one. Your suggestion works to
display information from somewhere else, but you can not use that content logically, i.e. use it to determine version differences.
I'm not a code wizard, as most of you know so i am just thinking simple here.
Would it be possible to have a page or piece of code on a page check the content or name of a file placed at the location where you can also download cpg ?
If you name the file cpg1413.chk for example can a piece of php code recognize the name and report back to the user that the correct or outdated version is in use by the user ?
That's basically how versioncheck works right now. Will not help though with webhosts blocking access to external content by turning off all means of external communication (fopen e.a.).
I don't know if it's any help but PHPBB shows what version you are using and whether a new version is available whenever you are logged in to the admin page.
They also have an advanced version check mod which not only checks the latest version of the main app but any other mod/plugin in it's list. Here is a link to the mods thread. Much of the code in the download is for the plugin system (easymod) so that can be ignored.
http://www.phpbb.com/community/viewtopic.php?t=277654
Might be worth a look to see how they achieve it.
The new versioncheck that currently exists in cpg1.5.x will check wether files have been modified (using an MD5-hash for the original file), however it will not check if this has been done deliberately (by applying a mod) or by accident (e.g. by using an improper FTP mode when uploading the files).
I'm aware that software like phpBB or SMF use an advanced package manager. However I don't think that we should focus on this: versioncheck has basically been designed to help users who upgraded to check if the upgrade went OK. What we're doing right now is to find a method to alert users that a new version exists without making them check the coppermine homepage regularly. Coming up with an even more advanced version check tool that takes into account mods is currently beyond the scope of development. This being said, I would like to point out why I don't think that we should focus on developing a package manager: in my opinion, the approach of coppermine is different to the approach of a forum application - you can change the visual approach (design) by overriding core functionality using your custom theme/template. You can add functionality using coppermine's plugin API. This way, the number of core hacks should be reduced to an absolute minimum. As a result, coppermine users should always have unmodified core files at all times. We just have to make sure that users apply fixes as soon as they are released.
Joachim