forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Uploading => Topic started by: flux on October 10, 2005, 01:32:46 am

Title: External Images Links / Use "remote" storage servers
Post by: flux on October 10, 2005, 01:32:46 am
okay as it seems we can't post in the admin functions forum i'll post my hack here, hopping it'll get noticed, rated and maybe posted where it belongs :)

so this hack is of course about the topic i investigated in this thread.

I made several versions of my hack to be able to store picture on remote servers and finally decided to only keep the very simplest one and post it here..

For the moment i'd say it's still in beta as it's only been tested by myself.. And you could call it "Pseudo Remote Gallery" hack as i'll explain how it works below :

Basically this hack will let the gallery use pictures that are located on a different server than the local server and still behave just as if the pictures where stored locally..

## Requirements ##
Php with "http" fopen support

CPG 1.4.x (tested on cpg 141 beta), my admin tool "files.php" should also work on cpg 1.3 with the proper "db_query" function modifications. The modifications to themes.inc.php could probably be ported to 1.3 too.

a properly formated remote file list.


## Installation ##
In the Config section "Custom fields for image description", set "Field 4 name" to "Remote URL". Be carefull no typo will be tolerated..

then put the file "files.php" into the root of your cpg gallery and put the file "themes.inc.php" in the include directory.
You can rename "files.php" to anything the script should still work.

## How does it work / What does it do ? ##

"files.php" is a batch add tool, to add remote pictures to your gallery. It's built on the "timer.php" script i found in this forum's admin tools scripts..
You can find details about that batch add script here : http://forum.coppermine-gallery.net/index.php?topic=13949.msg102336#msg102336

basicaly it creates categories/albums based on paths provided in the remote pictures list you'll provide.

So the important thing is to provide my script with a properly formated list of remote files and locations to store the local pictures to.

The list should always have the following format :

/relative/album/path/
http://www.domain.com/direct/path/to/the/picture.jpg
..
..
..
/relative/otheralbum/path/
http://www.domain.com/direct/path/to/the/picture.jpg*
..
..

and so on
"/relative/album/path/" is the path that will be used to both create the category/album structure in your gallery AND download/store the pictures under your albums/ directory..

so in my above example list, the first picture would be downloaded to albums/relative/album/path/, the categories "relative" > "album" would be created if not existing and the album "path" would be created inside the "album" category..
okay my choice of words for the path was really poor but anyways it's quite simple, right ?

Once the download of the remote picture is completed successfully the "thumb" and "normal" pictures will be created according to your gallery configuration, meaning the normal picture does not have to be created/stored locally if you don't use normal pictures or if it's not required according to the source picture size and your max sizes configuration..
Last but not least the source picture we've just downloaded will be removed and replaced by an empty file of the very same name. This empty file is necessary for later dupe checks to make sure the picture is already present in the gallery and use another filename to perform the download and storage of thumbs/normal pics..

Well that's about it.. Oh yeah of course the source URL is stored inside the "Field 4 name" field of the picture so it can be used to display the fullsize picture inside your gallery.

now when you browse your gallery, thumbs and normal pics are used locally but the fullsize picture is fetched from the source url..

That works both when using the fullsize popup from a normal picture display but also when not using any normal picture at all..

And of course local pictures can still be used !
The gallery behaviour towards local pics in unchanged, so you can potentially mix local and remote pictures as you wish..


## A few further explanations on the batch add script and the list format ##

any line starting with "/" will be considered a path and treated as such.
A path will be created prior to adding any pictures to it so even though no pictures follow the path it would still be created !

any line starting with "http" will be considered a source url, case sensitivity is not a matter (HttP would be recognized as well).

any other line will be ignored !

so if you screw up your paths some pictures could end up inside the previous path. Coz if the new path is faulty it will be ignored and the latest recognized path would still be used for the next pictures..

Pictures following a "/" path will be skipped. That would mean adding pictures with an album ID of 0 and those pics cannot be sorted with the current admin tools of CPG so i decided to skip those "unsorted" pictures..


## IMPORTANT LIMITATIONS ##

the main cpg hack is located in the include/themes.inc.php script which stores functions to display the pictures in the gallery.
As i see it those functions can be localized inside a CPG theme, meaning that with such a theme my modifications in the original include script would be overriden and the hack would no longer work !
If your theme is using its own display functions you have to manualy apply my hack to them. Search for "user4" in the include/themes.inc.php and patch you theme functions.


You can "see" a demo of the hack here : http://capsnscans.free.fr/cpg/
all the source pics are remote, thumbs and normals are local as explained above.


I still consider this hack beta because there must be some things i've missed or skipped being focused on my own way of using cpg..


Let me know if this hack works fine for you and if you have suggestions/questions, i'll be glad to take a look at them.

.flux


## Make sure you check my posts below they will have the latest versions of this hack ! ##
Title: Re: External Images Links / Use "remote" storage servers
Post by: Joachim Müller on October 10, 2005, 07:50:50 am
split the above post from the thread "[feat. req.] External Images Links / Use "remote" storage servers (http://forum.coppermine-gallery.net/index.php?topic=21935.0)" on the "Feature requests" board that got turned down as the dev team doesn't want coppermine to be used for stealing other's bandwidth. However, we welcome the contribution. We strongly suggest that all who want to use this mod make up their minds on bandwidth theft and only use this mod to share pics from another webspace that they own or pay the bills for.

Joachim
Title: Re: External Images Links / Use "remote" storage servers
Post by: flux on October 10, 2005, 01:57:32 pm
sorry i don't quite understand what you want me to do with my post.. should i (re)post it in another of your forums with a different topic ?


concerning bandwidth problems, here's my point of view and possible customization of this hack / remote system :

first yeah you can steal bandwidth when using remote urls, but recently the huge growth of free picture hosting pushes almost everyone to use thoses "remote" hostings anyway..

Now in order to give the credit to the host actually hosting the remote picture i could modify my hack to clearly reference / link the hosting company on top of every remote picture displayed in the gallery.

Moreover i could introduce a config parameter limiting the remote urls to some of the biggest and well known free picture hosts, so at least it shows a gesture to prove our good intentions..

of course it would be quite simple to go around that limitation but "burying" that data in the database would probably prevent newbies to do whatever they want with it..

Title: Re: External Images Links / Use "remote" storage servers
Post by: Joachim Müller on October 10, 2005, 08:20:26 pm
sorry i don't quite understand what you want me to do with my post.. should i (re)post it in another of your forums with a different topic ?
Everything is fine, you don't need to do anything. I was justing pointing out that the dev team disagrees with storing pics remotely. So if people come here and ask for the mod, we'll tell them that it is there, but we will not recommend using it. Having nearly unlimited webspace only will make newbie users waste resources imo - they'll upload incredibly large pics.

Cheers

Joachim
Title: Re: External Images Links / Use "remote" storage servers
Post by: Aktiv on October 11, 2005, 03:07:19 am
Sounds great - just the right hack to use my university webspace  ;)

But unfortunately it doesn't work. I've copied the files.php and themes.inc.php into the particular folders and I've got the following file uploadpictures.txt:
Code: [Select]
/Test/test/
http://www.informatik.uni-oldenburg.de/~jb007/derrest/000_0043.jpg
/Test/test/
http://www.informatik.uni-oldenburg.de/~jb007/derrest/000_0045.jpg
/Test/test/
http://www.informatik.uni-oldenburg.de/~jb007/derrest/000_0047.jpg
When pressing the button [Begin], I get the following:
Code: [Select]
File Uploaded : /tmp/phpCmhJuE
File Size : 236

Back to the main form : Back
It seems as if nothing happens - there are no new pictures in my album "test" or somewhere else.
Category Test and Album test are already existing and I use the theme "rainy day" and Coppermine 1.3.3 - maybe I should upgrade to 1.4.X or did I just miss something?
Title: Re: External Images Links / Use "remote" storage servers
Post by: Nibbler on October 11, 2005, 03:37:03 am
This mod is made for 1.4, it won't work on 1.3
Title: Re: External Images Links / Use "remote" storage servers
Post by: flux on October 11, 2005, 01:46:06 pm
hi,

yeah the above files are only for 1.4.x, the script should work with 1.3.x if you replace the cpg_db_query function calls by db_query..

but you'd still have to hack your 1.3 themes.inc.php in order to get this to work..

I'll try to make a 1.3 version when i have time, shouldn't be too much of a problem.. I'll try to figure out how to determine what version of cpg is currently running my batch add tool, so you don't have to worry about thoses db_query functions.
Title: Re: External Images Links / Use "remote" storage servers
Post by: flux on October 11, 2005, 03:56:55 pm
okay i just had a couple of minutes to update my batch script so it works with CPG 1.3 : TESTED ON 1.3.2 ONLY !

the files are in the "remote_cpg13_b2.zip"
both files.php and displayimage.php go into your cpg root

CPG Configuration for 1.3 is the same as for 1.4 :
In the Config section "Custom fields for image description", set "Field 4 name" to "Remote URL". Be carefull no typo will be tolerated..




And I've also updated the 1.4 version of the batch script and cpg hack : TESTED ON CPG 1.4.1 ONLY !
the files are in the "remote_cpg14_b2.zip".
files.php goes in the root and themes.inc.php goes into "include" directory.


The display now shows a remote host link above the picture, both in fullsize and intermediate versions.

the demo is still available here : http://capsnscans.free.fr/cpg/

Know Bug :
After analyzing a bit longer my hack for the 1.3 version i noticed the host address was not displayed in slide show mode.. Meaning that if you don't use intermediate pictures, it's most probable that your slideshow won't work with remote pictures..
I haven't found exactly how the slideshow display works and why my image display modifications are skipped in slideshow mode.
Title: Re: External Images Links / Use "remote" storage servers
Post by: Stramm on October 11, 2005, 04:09:27 pm
have a look at include/slideshow.inc.php
to get the pic urls it's using function get_pic_url (in functions.inc.php). If you don't have the correct URLs here it won't work (all URLs in a javascript array that gets cycled)
Title: Re: External Images Links / Use "remote" storage servers
Post by: flux on October 11, 2005, 05:49:58 pm
thx stram

okay i've modified slideshow.inc.php, but had to make a small modification to the get_picture_data function too in functions.inc.php..

i guess i'll have to give all the modification details so anyone can add them manually and not overwrite the whole file..
i'll try to do that when i have some spare time.

the good thing is that it works for slideshows too now when you don't use intermediate pics and the fullzise is remote one..

i'll try to make the slideshow hack for CPG 1.3 too.. gee i hope CPG 1.5 won't get released next week =)
Title: Re: External Images Links / Use "remote" storage servers
Post by: Aktiv on October 13, 2005, 02:52:21 am
Thank you!
Title: Re: External Images Links / Use "remote" storage servers
Post by: flux on October 14, 2005, 09:06:28 am
you're welcome ;)


So I have updated my hack with the slideshow thing, so it'll work with slideshows too now :

## Current Version is Beta 3 ##

You'll find the files for "CPG 1.4.1 Beta" AND "CPG 1.3.5" below

Installation requires manual modifications so make sure you read the INSTALL.txt File !
for 1.4 and 1.3 : 1 modification of include/functions.inc.php for the slideshow to work
for 1.3 only : 1 modification of include/iptc.inc.php to trap an error if you're using iptc

If everything works fine for all the user out there i'm not sure there'll be any further modifications / additions to this hack, maybe some to the batch add script although it's quite functionnal already, imho..

.flux

Title: Re: External Images Links / Use "remote" storage servers
Post by: flux on October 19, 2005, 02:10:07 pm
could an admin reset the cpg compatibility version info on this thread, i won't edit the original message anymore as it seems to remove it.

so it's compatible with 1.3 and 1.4 now

thx

.flux
Title: Re: External Images Links / Use "remote" storage servers
Post by: digimic on November 25, 2005, 12:57:45 am
hello
if i understand with "remote_cpg141b_b3"
i can manage pictures on another server. Can i do exactly the same actions as the local server? like host all pictures format, upload picture on the remote server...?
Title: Re: External Images Links / Use "remote" storage servers
Post by: flux on November 25, 2005, 01:05:21 pm
pictures have to be located on a remote server before adding them to cpg gallery thru my hack.

my cpg hack only makes cpg gallery use those remote pictures and produce thumbnails and intermediates versions of those remote pictures on the local server. It won't managed remote pictures in any ways, or store anything on those remote servers thru your cpg tools..

You can still use cpg as a local gallery just as you'd use a unhacked version..
Title: Re: External Images Links / Use "remote" storage servers
Post by: digimic on December 02, 2005, 11:47:37 pm
Hello Flux!
DO you have a new release of your hack for the version 1.4.2 ?
Title: Re: External Images Links / Use "remote" storage servers
Post by: Nibbler on December 03, 2005, 12:00:29 am
Read the thread.
Title: Re: External Images Links / Use "remote" storage servers
Post by: Joachim Müller on December 03, 2005, 09:42:53 am
..and http://forum.coppermine-gallery.net/index.php?topic=24540.0 as well... ::)
Title: Re: External Images Links / Use "remote" storage servers
Post by: flux on December 03, 2005, 03:22:09 pm
humm, haven't tested my hack over version 1.4.2

i'll do that shortly and report problems and possibly new version of the hack for cpg142 soon..

i've also been trying to implement a better handling of the downloads in my batch add tool coz i've had some problems with some downloads never getting any timeouts and so making the batch process hang forever, unfortunately beeing no php geek i haven't managed to make something thru fopen although i did come accross a few examples making loops and counting the time but i couldn't get it to work.. so i anyone reads this and can help me out, please drop me a mail or pm ont this forum..
Title: Re: External Images Links / Use "remote" storage servers
Post by: flux on December 27, 2005, 03:06:33 pm
New 1.4.x Version : Beta4

having finally some spare time to test the hack on 1.4.2 sources, i couldn't resist to add/improve some features, so here they are :

##########################
* Beta4 CHANGES
- hack code locations are clearly marked with "#REMOTE HACK START/END" blocks (not a feature but usefull :).
# batch add tool
- support for user1 to user4 extra info.
- added pictures log in the database.
# web display
- iframes & remote pages urls instead of only remote pictures urls, kinda anti-anti-hotlinking.
- width management of remote files when not using intermediate pictures.
- added links to popup fullsize remote pictures or iframes.
- alternate, nicer way to hack into your cpg themes.
##########################


basically the big new feature is support for iframes.
Remote pictures URLs can now be added along with their true web page URL and that web page URL can be used to display iframes in your gallery.
Displaying the page url, instead of the remote picture directly avoids almost any anti-hotlinking the hosts can use.
And is some way also gives the proper credits to the picture host as the entire web page is displayed, including possible advertisement and so on..
With mosts free picture hosting iframe doesn't make a difference and won't polute your gallery in any way..

here's the doc concerning the new features that is present in the INSTALL.txt file in the zip


##########################
* Using IFRAMES, "Remote Page URL" data and other user data:
In order to use the iframes you will have to provide my batch add too with a second data for your remote pictures which is the remote page url from where that remote picture can be seen.
Indeed as you probably already know many free pictures hosts give access to hosted pictures thru a web page of their own, so the following picture "http://www.freepichost.com/random/path/to/picture_name.jpg" can be accessed thru the following URL "http://www.freepic.host/page.php?picture=picture_name.jpg", or something like that.
It can happen that accessing the picture using its direct URL will return an "access denied" page or a different picture mentioning the fact that you can't access the picture directly. Then the only way to access that picture is done by accessing the web page with the second link.
So if you set your CPG user data 3 aka "Field 3 name" with the following name "Remote Page URL" and provide my batch add tool with the page URL then it'll be stored and used to display that picture thru it's webpage inside the gallery using an iframe.
You will also have to set the default "define('REMOTE_PIC_IFRAME',0);" to "define('REMOTE_PIC_IFRAME',1);" to enable iframes.

Then you can build your remote picture list as follows :
/path/to/album
http://www.freepichost.com/random/path/to/picture_name.jpg \ http://www.freepic.host/page.php?picture=picture_name.jpg
...

the page URL is placed on the very same line as the picture url and separated by a "\".

You can also place two more data on every line that will be stored insode the "Field 2 name" and "Field 1 name" of each of your added pictures.
So in a matter of speaking you could see each picture line with the following description :

Picture URL \ Page URL \ user data 2 \ user data 1

or if you're not using Page URL and iframes you can even see it like that :
Picture URL \ user data 3 \ user data 2 \ user data 1

You can of course put anything you want on each data, expected you won't use the "\" char in yout text strings..
Beware the "\" char cannot be escaped link in some programming language, the strings will be interpreted asis.


* Using the width management with remote pictures :
When the intermediate picture is disabled you can enforce the remote picture width, displayed on your pages with an additional define() as follows :
define('REMOTE_PIC_MAXW',1);

the width of the displayed remote picture will then be according to your Max Intermediate Width Setting in CPG config.
Of course i've made sure to add a link above the iframe or on the picture in order to display the fullsize one with the CPG popup you already know.


* Using the Added Pictures Log :
That log is simply an additional table you can create/purge/remove within my batch add tool, that will log every picture you add to your gallery.
You can very well leave that alone and never use it, it will not make any difference in the way my Remote hack works online..

The only idea behind that log was to avoid inserting the same remote picture more than once.
So if you insert a remote picture in your database and for some reason decide to delete it from you database manually then when the log is active the batch add tool won't add that very same picture ever again when it finds it in your lists.
The reason for that log is that i'm using some automated scripts that go over remote pictures lists that can have the same source from times to times and i don't want the pictures i've removed manually to be added ever again, so i keep a log of every picture i've added to the gallery and decide not to add them in the future.
Of course as nobody's perfect you can always make mistakes and remove pictures you shouldn't have, so you can override the log whenever you want during a single batch add session. The log will then be ignored.

##########################



enjoy and report bugs here.
The trickiest part was the slideshow so i expect some thing to look weird there especially with iframes.. The modified javascript should be clean enough for recent browsers and display is okay for Mozilla Browsers which was the only thing i had in mind when coding that thing.

.flux
Title: Re: External Images Links / Use "remote" storage servers
Post by: digimic on December 27, 2005, 03:20:49 pm
the pictures are still retrivied on the server?or is it like Phpwebgallery?
can we let all the pictures on the remote server ( thumbnail,normal,big) ?
Title: Re: External Images Links / Use "remote" storage servers
Post by: flux on December 27, 2005, 03:21:19 pm
woops, seems like i've left my additional defines to 1

define('REMOTE_PIC_IFRAME',1);
define('REMOTE_PIC_MAXW',1);

it shouldn't make any difference anyway if you're using intermediate pictures or if you haven't added some remote pictures with my beta4 batch add tool (with pages URL data of course)..

iframes are only visible on popups when you use intermediate pictures AND when the remote picture has a page URL (see doc above)
in any other case the system will continue to use the remote picture URL directly and/or intermediate pictures..


And i forgot to mention that the beta4 version was of course backward compatible with beta3 and of course with regular CPG use, ie "local" pictures..

.flux
Title: Re: External Images Links / Use "remote" storage servers
Post by: flux on December 27, 2005, 03:28:08 pm
@digimic

don't know about Phpwebgallery but my CPG hack still works the same way as it was designed in the beginning

thumbs & intermediate pics are stored locally (you can disable intermediate pics if you want)

the fullsize picture is stored on the remote server, fetched by the batch add tool to create thumbs/intermediate ones and then removed locally.. then whenever the fullsize pic has to be displayed in the gallery the remote picture URL will be used instead of the non existing local fullsize picture..


Making a 100% remote gallery wouldn't be so much trouble as far as displaying picture in CPG can be but the management would definitely be something harder to do something i'm not planning on doing..

.flux


Title: Re: External Images Links / Use "remote" storage servers
Post by: Rc2000 on January 02, 2006, 04:40:32 pm
I haven't tried this yet (new to Coppermine), but it sounds like just the thing for one of my galleries. I have several domains I can store files on, so I'll be using my own bandwidth.
Now to find time to do this. ;)

Rc
Title: Re: External Images Links / Use "remote" storage servers
Post by: flux on January 03, 2006, 03:01:00 pm
i haven't mentionned it in my latest 1.4.x version but it works with the current 1.4.3 sources
Title: Re: External Images Links / Use "remote" storage servers
Post by: srijit on January 04, 2006, 03:16:52 pm
flux... thanks for this mod. This is the one that convinced me to try coppermine.... coppermine + joomla integration will come later.
but i am a bit confused. i want to use the remote URL and not the image link. also i already have the thumbnail files which i can rename to the proper convention.
Quote from: flux's instructions
You will also have to set the default "define('REMOTE_PIC_IFRAME',0);" to "define('REMOTE_PIC_IFRAME',1);" to enable iframes.

Then you can build your remote picture list as follows :
/path/to/album
http://www.freepichost.com/random/path/to/picture_name.jpg \ http://www.freepic.host/page.php?picture=picture_name.jpg

where ( in which file? ) do i have to set define('REMOTE_PIC_IFRAME',0); to 1 ?? is this necessary if i dont plan on using intermediate images?

also can u tell me which database table is being modified by your hack, when i add remote files? this is because then i can directly add the values to the database.... and then upload the thumbnails with the proper names using FTP, to the proper directories. I then wont have to download the remote linked files ( more than 6000 and abt 2 Gb+ ) to my server and waste my and the file hostings bandwidth. i already have abt 50mb's worth of thumbnails that i can rename. i also have the remote URL.

can u please help me with it? thanks in advance :D
Title: Re: External Images Links / Use "remote" storage servers
Post by: srijit on January 04, 2006, 03:36:37 pm
also when i tried to change the settings in config i get this error
Code: [Select]
Template error
Failed to find block 'log_ecards'(#(<!-- BEGIN log_ecards -->)(.*?)(<!-- END log_ecards -->)#s) in :

                <div align="center">
                <table cellpadding="0" cellspacing="1">
                        <tr>
<!-- BEGIN admin_approval -->
                                <td class="admin_menu" id="admin_menu_anim"><a href="editpics.php?mode=upload_approval" title="{UPL_APP_TITLE}">{UPL_APP_LNK}</a></td>
<!-- END admin_approval -->
                                <td class="admin_menu"><a href="admin.php" title="{ADMIN_TITLE}">{ADMIN_LNK}</a></td>
                                <td class="admin_menu"><a href="catmgr.php" title="{CATEGORIES_TITLE}">{CATEGORIES_LNK}</a></td>
                                <td class="admin_menu"><a href="albmgr.php{CATL}" title="{ALBUMS_TITLE}">{ALBUMS_LNK}</a></td>
                                <td class="admin_menu"><a href="groupmgr.php" title="{GROUPS_TITLE}">{GROUPS_LNK}</a></td>
                                <td class="admin_menu"><a href="usermgr.php" title="{USERS_TITLE}">{USERS_LNK}</a></td>
                                <td class="admin_menu"><a href="banning.php" title="{BAN_TITLE}">{BAN_LNK}</a></td>
                                <td class="admin_menu"><a href="reviewcom.php" title="{COMMENTS_TITLE}">{COMMENTS_LNK}</a></td>

                                <td class="admin_menu"><a href="picmgr.php" title="{PICTURES_TITLE}">{PICTURES_LNK}</a></td>
                                <td class="admin_menu"><a href="searchnew.php" title="{SEARCHNEW_TITLE}">{SEARCHNEW_LNK}</a></td>
                                <td class="admin_menu"><a href="util.php" title="{UTIL_TITLE}">{UTIL_LNK}</a></td>
                                <td class="admin_menu"><a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}">{MY_PROF_LNK}</a></td>
<!-- BEGIN documentation -->
                                <td class="admin_menu"><a href="{DOCUMENTATION_HREF}" title="{DOCUMENTATION_TITLE}" target="cpg_documentation">{DOCUMENTATION_LNK}</a></td>
<!-- END documentation -->
                        </tr>
                </table>
                </div>

i just replaced the include/themes.inc.php with the one in your pack.... is this what is causing the error?

TEST site is http://cutewalls.com/joomla/gallery

thanks again
Title: Re: External Images Links / Use "remote" storage servers
Post by: srijit on January 04, 2006, 04:29:13 pm
i uploaded my includes and all themes.. then CPG told me that it had to reinstall.... it seems that some database fields were missing.....
now i tried again but using 2nd method.... ie: i added the code in the theme_functions.txt to the classic >> theme.php
i tried again to upload files with the files.php, but here too i am getting an error
Quote from: CPG Message
Critical error
There was an error while processing a database query
Nothing else.... and my gallery is like it this http://cutewalls.com/joomla/gallery
only ONE file is being added although the albums are added OK.
i thought at first problem is with the folder permissions... so i tried again ( with permissions as 777 ), but still only one file is being added, but that too the thumbnail is not being displayed....
am attaching the file that i use to upload

any help is appreciated :D
Title: Re: External Images Links / Use "remote" storage servers
Post by: flux on January 04, 2006, 10:08:53 pm
flux... thanks for this mod. This is the one that convinced me to try coppermine.... coppermine + joomla integration will come later.
but i am a bit confused. i want to use the remote URL and not the image link. also i already have the thumbnail files which i can rename to the proper convention.

well, i probably don't use very specific words but the thing works as follows :

in my first version i was using a single Remote URL which was the direct url to the remote picture and i called that "Remote URL" and it  is stored in the user data field 4, that remote URL is necessary for my hack to work but not to display the picture if you use "Remote Page URLs" thru iframes.
The direct remote picture url aka "Remote URL" is required because it is the very data used to make sure a remote picture is not inserted twice.. And it is also required when you need to access the picture directly of course..

where ( in which file? ) do i have to set define('REMOTE_PIC_IFRAME',0); to 1 ?? is this necessary if i dont plan on using intermediate images?

My two additional Defines() are located where you hack your theme, meaning thru ONE of the two ways i have described to hack your theme, that's where you should modify them but i think i left them both enabled (1) in my release so it should already be set to 1..

also can u tell me which database table is being modified by your hack, when i add remote files? this is because then i can directly add the values to the database.... and then upload the thumbnails with the proper names using FTP, to the proper directories. I then wont have to download the remote linked files ( more than 6000 and abt 2 Gb+ ) to my server and waste my and the file hostings bandwidth. i already have abt 50mb's worth of thumbnails that i can rename. i also have the remote URL.

well my hack does not modify any original CPG tables, it only uses the available data fields (user1 thru user4) in the cpg_pictures table

user4 = Remote URL = direct remote link to the picture (http://www.example.com/path/image.jpg)
user3 = Remote page URL = remote link to the picture page (http://www.example.com/display.php?image=/path/image.jpg)

user2 and user1 can be used to insert any data you'd like thru my batch add tool and using my list file convention
Remote URL \ Remote Page URL \ user2 data \ user1 data


Concerning your errors, are you using CPG version 1.4.3 ?

Overwritting include/thems.inc.php shouldn't make any problems if it does then put back the original file and try to hack the theme file of the theme you'll use in themes/xxx/theme.php
you can't overwrite that one you must do copy paste


Concerning your remaining setup i can't really tell if my hack has any thing to do with your errors, if you follow my install documentation it should be okay..

Remember that you should add remote pictures only with my batch add tool, if you insert them manually in the database and forget some required data (obviously user4 and user3 data) then it won't work..

Title: Re: External Images Links / Use "remote" storage servers
Post by: srijit on January 05, 2006, 06:30:48 am
hey thanks..... i am now testing the hack with Remote URL ( direct Link to the file ) in this case should the filed3 value "Remote Page URL" be filled? if it is filled and i dont give it in the text file ( attached in the previous post ) will it cause an error?
also why is the thumbnail not being generated? and why is there an error after adding the first new file in the list?
i am using CPG 1.4.3 which i downloaded yesterday

URL is http://cutewalls.com/joomla/gallery

thanks for your help :)
Title: Re: External Images Links / Use "remote" storage servers
Post by: srijit on January 05, 2006, 06:39:09 am
hmmm.... so if i add everything correctly in the cpg_pictures table ( including remote URL and remote page URL ) then if i upload the thumb files and the dummy files via FTP to the correct locations, it should work right?

also what happens if i dont have the direct URL but only the remote page URL? will that work alone? can the user4 field be left blank?

server is being moved now... so i cant test it out :(
Title: Re: External Images Links / Use "remote" storage servers
Post by: flux on January 05, 2006, 04:07:21 pm
humm so

user4 config name = "Remote URL"
user4 data = Direct Pirture URL = http://www.esample.com/path/picture.jpg

Must be given whichever display mode you use..

Now user3 config name and data (remote page url) are optional because it is only used for iframes mode.

user2 & user1 data and config names are completely optional and are NOT requiered for anything to work..

If you want the thumbnails to be generated you MUST use my batch add tool, and to use my batch add tool you MUST build a list file according to my documentation.

I would strongly suggest you try to insert a single remote picture using my batch add tool and see how it works when you turn on and off the iframe define, only if you use remote page url of course, and it will also give you a proper example how a picture row has to be inserted if you want to manually insert files and place them on your server..

All of this is rather simple and i really believe i explained the most important things you need to take care of in order to get my hack to work but maybe trying to do too many new things at the same time gets you confused..
Title: Re: External Images Links / Use "remote" storage servers
Post by: srijit on January 05, 2006, 05:39:27 pm
oh dear.... it not workinf, even though i followed instructions.... well no matter. i will try later :D
Title: Re: External Images Links / Use "remote" storage servers
Post by: sectioni on March 18, 2006, 07:14:14 pm
Terrific mod - just what I was looking for.

One question.  It doesn't seem to respect the thumbnails for video files.  When doing a standard batch add of movies, I can have mymovie.wmv and thumb_mymovie.jpg and it will make that jpg the thumb for the video file.  Is it possible for the remote files upload to set the thumb like the standard upload?  Certainly not a big deal, but it would be nice.

Also, can't use the 'download to my computer' link when viewing the video remotely.  It just saves a 0kb file.

Thanks.

[Edited about a 1/2 hour later - oops]

Nevermind about the thumbnail.  I found that if you just put the thumb_.jpg files in the album directory, it works just fine.
Title: Re: External Images Links / Use "remote" storage servers
Post by: flux on March 21, 2006, 04:19:47 pm
yeah sorry i have absolutely never made any tests with video files on cpg and so never tested it with my remote files mod..

I'm not sure how cpg handles thumbnails for video files actually..

I made some tests on php5 with a codec modules to extract/create thumbnails out of video files works nice, i guess in some future cpg could have an feature like that to manage video thumbnails as it does with picture files..
Title: Re: External Images Links / Use "remote" storage servers
Post by: sectioni on March 23, 2006, 08:03:38 pm
Not sure if this is the correct way to do it, but I modified the download.php file to accomodate the remote file links.  In download.php, I had to make a few changes to download remote files:

Changed:

Quote
        $sql = 'select '.
                'p.filepath,'.
                'p.filesize,'.
                'p.filename,'.
                $CONFIG['TABLE_ALBUMS'].'.visibility, '.
                'p.aid as aid '.
                'from '.$CONFIG['TABLE_PICTURES'].' as p LEFT JOIN '.$CONFIG['TABLE_ALBUMS'].
                ' ON (p.aid = ' . $CONFIG['TABLE_ALBUMS'].'.aid ) '.
                ' where pid='.$pid.' and approved="YES"';

to

Quote
        $sql = 'select '.
                'p.filepath,'.
                'p.filesize,'.
                'p.filename,'.
                'p.user4,'.
                $CONFIG['TABLE_ALBUMS'].'.visibility, '.
                'p.aid as aid '.
                'from '.$CONFIG['TABLE_PICTURES'].' as p LEFT JOIN '.$CONFIG['TABLE_ALBUMS'].
                ' ON (p.aid = ' . $CONFIG['TABLE_ALBUMS'].'.aid ) '.
                ' where pid='.$pid.' and approved="YES"';

Then changed:

Quote
readfile($CONFIG['fullpath'].$file['filepath'].$file['filename']);

to

Quote
if ($CONFIG['user_field4_name'] == "Remote URL" && $file['user4'] != "" ) {
        readfile($file['user4']);
} else {
        readfile($CONFIG['fullpath'].$file['filepath'].$file['filename']);
}

and that now allows me to download files from this remote link mod.  I'm completely new to php, so please let me know if I did anything wrong.

Thanks again for this great mod!


Title: Re: External Images Links / Use "remote" storage servers
Post by: flux on March 25, 2006, 07:49:45 pm
it would have to be checked out but what you've done probably makes the gallery server download the remote file thru the readfile function call..

In my opinion this is a waste of bandwidth and could cause other nasty side effects..
The general idea would be to skip local processing of file downloads when you're accessing remote file, a simple link to the remote file on the remote server should be enough to give access to that file..

I'm just guessing here but i imagine that download.php script's purpose is to collect statistics of downloads and stuff like that and maybe manage some sort download security or access restrictions..

In my opinion that should only be applied to local files, files on the gallery server itself, not to remote files which should be left with a full free access to anyone..

If you want or need to keep a counter running for those downloads, another way to do that woud be to let download.php do its thing and then force it to redirect to the remote file location, triggering the download of that remote file on the client end..
I think that wouldbe more appropriate although it would probably require more script tweaking and debugging..

But you should seriously consider my explanation above concerning your modification and the bandwidth usage problem..
Title: Re: External Images Links / Use "remote" storage servers
Post by: donpeyote on May 05, 2006, 06:52:21 pm
i installed beta4 with, changed the Remote URL and replaced themes.inc.php e slideshow just like it shows in the Install...everything fine until i started to add files..

this is my file.txt i go get in files.php
"
/banhada2006/
http://pdam.no.sapo.pt/banhada2006/tomar-banhada-2006_001.jpg
"
after that , i hit continue and i get this page:
"
File Uploaded : file.txt
File Size : 78
Album Created:banhada2006
Adding to list: http://pdam.no.sapo.pt/banhada2006/tomar-banhada-2006_001.jpg
1 Remote Pictures Links Found
0 Remote Pictures in the database
After filtering 1 NEW Remote Pictures will be added.
structure created, 1 files to add.
"
everything ok, i hit Continue and i get an error:
"
Error ! The Remote File could not be accessed: http://pdam.no.sapo.pt/banhada2006/tomar-banhada-2006_001.jpg
Back to the main form : Back"

i can check the URL, here is working...maybe im missing something...i havent edit files.php

i also changed include/functions.inc.php - Line 905 ## as told
Title: Re: External Images Links / Use "remote" storage servers
Post by: flux on May 06, 2006, 02:43:27 pm
that error simply indicates that the function used to "open" the file failed to open it.
that function (fopen) is initially designed to open local files but recent php versions extended the scope of this file access function to URL under the only condition that the parameter "allow_url_fopen" is enabled in your php.ini

you should be able to make sure you can actually access http:// files by trying to add the picture to your gallery thru the regular admin tools and by using that same URL..
If you can't add files to your gallery using URLs then you won't be able to use my batch add tool..

Of course the problem could have other origins, like for example the server running your gallery has troubles accessing files from those urls (cf my test above)..

.flux
Title: Re: External Images Links / Use "remote" storage servers
Post by: donpeyote on May 07, 2006, 10:10:11 pm
when adding with admin tools i get this error :

URI/URL Uploads:
File Name/URL   Error Message
1. http://pdam.no.sapo.pt/banhada2006/tomar-banhada-2006_001.jpg   Could not open URI.


i even tried with a google.com image, one from microsoft, even frm home page of my hosting..so most probably theres no problem with that specific image/site but with 'fopen' right?

im running on a free webserver

Apache version     1.3.34 (Unix)
PHP version    4.4.1
MySQL version    4.1.19

is there anyway to enable allow_url_fopen or to check it status or i must contact my hosting?

but ill try to get help elsewhere since now this is a different problem, still if you can help ... :)

Title: Re: External Images Links / Use "remote" storage servers
Post by: flux on May 08, 2006, 11:32:27 am
allow_url_fopen is defined in the server config files, so only server administrators can change that and really doubt they will change it for you as it would be a global change for everyone on the server.

I would suggest you change your webhost and make sure fopen works with urls before you install cpg and the remote hack.

.flux
Title: Re: External Images Links / Use "remote" storage servers
Post by: ctcentralinfo on May 13, 2006, 03:21:53 pm
This is a great addition to coppermine. The fact is that it is NOT a good idea to allow mwmbers to upload images to your hosting site because of the potiential for uploading viruses.

My question though is that I plan on uploading some videos I produced myself and upload them to www.youtube.com and I was wondering if this hack will allow me to remote play my videos.


I also want to be able to screen photos to view the content before I give permission for members to upload them. This is already avialable with coppermine, but will it work with your hack?

Title: Ethical and other considerations
Post by: cgc0202 on May 13, 2006, 05:13:46 pm
Hi flux,

I do not have the capability yet but this is one feature similar to what Gallery2 that I liked, before I decided that there are so many features that Coppermine have that made it more attractive.  Having this mode therefore is a welcome addition.

Anyway, before I go any further, I agree with the point raised in the first response of Gaugau to your post -- stealing bandwidth even from free sites is not something that we should promote, even if it is technologically feasible.  I did not know about the implications when I first started awhile back, so I have been linking photos before also, until I realized the potential implications.  This is one of the reasons why I have decided to create my own photogallery websites. 

I will still rely on "Creative Commons" photos (and secure copyright permissions from others) aside from citing the ownership, but I decided to download those photos and create archives of them to be presented hopefully using mods like yours.  But, as pointed out by Gaugau, these must be accessed through sites that the webmaster owns, not "stealing bandwidth" even from free sites.  I believe there would be less need for people to deface their photos with ugly watermarks or copyright ownership markings, if we try hard enough to follow certain rules.

I should point out too that you expose yourself to potential legal complicity suit, if one of the users of your mod would be charged for copyright infringements.  You may want to think about this.

The flipside is that you might expose the visitors to sites that are stealing bandwidth (and photos) from other parties with potential viral attacks, and other more diabolical creations that invade the visitor's privacy or actual steal information from them (or worse take over their computer).  Not too many people, I should say developers of websites or programs think about this anymore.  In the process, we all contribute to our debasement as human beings, with the continued errosion of our privacy and at times outright more diabolical manipulations of everything that we considered safe before.

I think there would be complications also even if the above scenarios do not apply.  In allowing the use of third party sites, the "gallery owner" really does not have control of the contents of his/her virtual gallery as allowed in your mod.  As a result, when the third party decides to move or delete specific photos that the mod remotely linked, then ou would end up with many dead sites.

Thus, I would recommend highly that you will steer the development of your mod so that it will work mainly with something that the user of the mod has control of.

I commend you for developing this mod, and as important for your desire to share it, much like Coppermine is oding and all those involved in the "open source" movement.  I bookmarked this thread, and I hope when I finally would need your mod, it has been refined further.

cgc0202
Title: Re: External Images Links / Use "remote" storage servers
Post by: ctcentralinfo on May 14, 2006, 04:22:29 am
They are not stealing bandwidth if they are using programs like photobuck. Beside it should be up to the owner to decide if they will allow members photos to show up. Anyway, I am wording if this will work with youtube. I have an account and planning on uploading my OWN videos to my youtube account so that I can have them on my site.


If you want to prevent folks from hot linking to other site, just creat rules for linking to your site, if they don't comply just deny them access.
Title: Re: External Images Links / Use "remote" storage servers
Post by: Joachim Müller on May 14, 2006, 10:27:44 am
If you're low on valuable php-powered webspace and therefor use another server that is under your control to store your pics on (using this mod), that's fine. But don't allow your users to store files remotely. That's ethically wrong. Closing your eyes to what will definitely happen, denying your responsibility about the content on your page (that will get stolen from other's bandwidth without their approval) by just hiding behind a disclaimer ("I told my users that they mustn't hotlink pics they don't own") also has a legal impact in many countries. I am not a lawyer, but I'm sure that you can't get away that easily.
Look: I'm convinced that you (the people who posted on this thread so far) don't plan do use this mod for something that is ethically or legally wrong. But others will - that's a fact. That's why we (the dev team members) don't like remote storage hacks and we won't add such functionality to coppermine's core code.
The only option that is legally and ethically OK imo would be that the hack would check for existance of a token file on the remote server that must have been uploaded by the owner of that remote webspace deliberatly before allowing to add pics from that webspace to coppermine's database. But then, it's not easy to accomplish this in a re-usable way.
Title: Re: External Images Links / Use "remote" storage servers
Post by: ctcentralinfo on May 14, 2006, 04:07:22 pm
YOu are not getting what I am saying. A disclaimer will be put up. YOU the owner will check the link. If it is not from a site such as photobuck will get deleted.
Title: Hotlinking is stealing
Post by: cgc0202 on May 16, 2006, 06:47:05 pm
I got you the first time ctcentralinfo.  However,  I stated my point in the first response and I was planning not to elaborate further.  But, the issue has become an exchange, as you try to insist your point.  Instead of trying to understand our perspective,  you repeat yourself in your response to GauGau -- as if that will make the point right.  [You were presumptuous into thinking that we did not understand you.]  Is it possible that you might be the one who is not getting the point?

Gaugau elaborated further and I hope flux will incorporate the safeguard Gaugau suggested. 

I want this mod by flux.  I have to start rearranging the architecture of  my entire website this weekend and that will be a big job that will take a very long time.  The reason for this is that the CPMFetch that Vuud created worked if the mod is in the same domain (or subdomain) as the gallery and the website where the photos will be added outside of the gallery.  I made that work now thanks to Vuud's very kind replies to my inquiries when it was not working properly.  Unfortunately, the Fetch design (in my hands at the moment) will not work when Fetch and the other site are in different domain (or subdomain).  That was also stated in the FAQ section of CPMFetch. 

Maybe this issue with  CPMFetch will be resolved by Vuud or someone else who knows programming, at some point.  In the meantime, a way around it would be using this mod that flux is developing -- or at least I think I can.

Now back to your point (in the first response to my post):

If you want to prevent folks from hot linking to other site, just creat rules for linking to your site, if they don't comply just deny them access.

You are placing the burden to the owner of the site -- who if (s)he did not want any of his/her creation stolen has already placed a copyright note.  If the photos are not copyrighted, i.e., released through "Creative Commons" (although some have restrictions), why not take the responsibility of dowloading those photos yourself and store them in your site?  Then you can use them however you want -- there is no need for you to hotlink, as already pointed by Gaugau.

The plain and simple truth is that you will not want to take the extra work to do the right thing.  Your own admission -- "hotlinking".  What a fast way to have a "photo gallery site" filled with photos, without the extra trouble.

Please put this in your head and try to think about it when you have time to reflect: Even those who would give away their website contents for free would not want their bandwidth stolen and that is especially true for photos (and other multimedia) because they use a lot of bandwidth.   

However you try to sugarcoat your words, technical jargon or hide yourself in any technology, it is outright stealing -- because you cause other people to pay  money for your "hotlinking". Have you ever looked at how much it costs when a site exceeds its bandwidth?

English is not my native tongue and that may be the reason why I was not able to express myself clearly enough to get through to you.  Please allow me then to repeat myself, if I have not made my points clear enough the first time. To quote you:

YOu are not getting what I am saying. A disclaimer will be put up. YOU the owner will check the link. If it is not from a site such as photobuck will get deleted.

Here is a better suggestion.  I am not familiar with the software or technology you keep suggesting.  So, why not ask the developer to place a script whereby if it does not see the statement: "Hotlink allowed!" it will not do any hotlinking.  If this cannot be automated yet, why not take the trouble of manually visiting sites that you like and see i they would explicitly allow "Hotlinking".

Hotlink only those sites that would say so.  In this alternative, place the responsibility in your hands -- do not pass the burden to others.

Maybe you have all the time in the world to be babysitting your website but most webmasters do not have your luxury. They only find out that some other websites are hotlining when they exceeded their normal bandwidth usage.  If you have a popular site worth hotlinking -- do you honestly believe you will have the time in the world to be sitting there wasting your time blacklisting sites, that can be from all over  the world?  The plain answer is no.

Because of the attitude that you espouse as a site developer, some webmasters have taken draconian measures instead.  There are ways to fool "hotlinking" bans of individual sites, or it will cause added inconvenience for webmasters will multiple websites.  To counter this, I have read of instances where the webmaster banned  an entire webhosting service because those IP addresses are "static".

As a result, because of attitudes like yours, you will cause problems to others sharing a webhosting service with you, as well as added work to your webhosting service itself -- to rectify the banning of their site -- simply because you would not want to follow rules.  These, aside from the points that I raised earlier already. 

Take the responsibility of following the rules (at least the ethical rules, for decent people) -- do not let your irresponsible attitude become a burden to others.

If you are a decent person, why not link the main site of the websites that you think are worth visiting?

However much you have persuaded yourself that what you are doing is legal and ethically right, it does not make your actions legal nor ethical, in the eyes of others.  At least two people here already think differently.  True, it is technically feasible and doable; but it is not legal.  And, even if it is legal (which I doubt) it is not ethically right to do so, because you are costing others money.

Unfortunately, no one can teach you anything about ethical responsibilities if you do not want to listen. 

cgc0202

N.B.

I must admit offhand that when I was new in developing my website  I never realized what "hotlinking" and related stuff meant nor understood their implications.   Gradually, I begun to understand them. 

One of the reasons why I am developing my own photogalleries is to rectify these mistakes.

And yes, as I suggested to you above, I am downloading those photos that I liked that have been released through "Creative Commons".  My website is not commercial, so that my use of the photos are within the restrictions indicated in the "Creative Commons" agreement.  And yes, the entire process takes a lot of work.  I have spent months so far poring through thousands and thousands of internet photos and sites, to select a few hundred so far. 

I have downloaded copyright photos too.  One of the reasons why I have not released my site URL yet for the photogalleries was because I want to get permission from other people who had copyright notices; and  at least to have the decency to inform even those who released their photos under  "Creative Commons" agreement that I wish to use their photos for my website.

Once I have created a credible site, I may then invite others if they are interested to share photos.  Here,  as the webmaster, I have to make sure that all individual copyrights are respected.  More important, as a webmaster, I take the responsibility of ensuring that I have the resources that I can indeed afford to finance such an undertaking.

Maybe you ought to consider the same option -- if you wish to do the right thing.
Title: Powerful additions to the mod
Post by: cgc0202 on May 16, 2006, 08:01:08 pm
Hi!

Going back to a more important issue. It would be quite powerful if this mod was developed so that it is also able to extract the info (text and other embedded stuff) associated with each photo in a remote site and carryover the info to the other site where the photogallery is located.

cgc0202
Title: Re: External Images Links / Use "remote" storage servers
Post by: ctcentralinfo on May 18, 2006, 03:41:36 am
Now that we are back on track. Will I be able top play videos I have on youtube?
Title: Re: External Images Links / Use "remote" storage servers
Post by: Joachim Müller on May 18, 2006, 05:59:31 am
we can't tell for sure, there might be things interfering with it, but after all it's the purpose of this mod to allow you doing this. Why don't you try to find out?
Title: Re: External Images Links / Use "remote" storage servers
Post by: edgarg on May 30, 2006, 08:22:59 pm
hello, the youtube way it is a small embeded code that calls up a flash video player, so I think the implementation will be kind of easy
as long as it is factible to allow code to be embbeded in some way
this is an example of the code  of  a you tube video...


<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/dIzvcqoUB9I"></param><embed src="http://www.youtube.com/v/dIzvcqoUB9I" type="application/x-shockwave-flash" width="425" height="350"></embed></object>

BTW I do not know if we should open a tread of its own about this, I think is quite relevant.

Code: [Select]
<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/dIzvcqoUB9I"></param><embed src="http://www.youtube.com/v/dIzvcqoUB9I" type="application/x-shockwave-flash" width="425" height="350"></embed></object>
Title: Re: External Images Links / Use "remote" storage servers
Post by: donpeyote on June 01, 2006, 02:50:19 pm
hmm am i missing something here?
my files.txt are something like this all jpgs are ok..why 0 Files...

/IPT/Aulas/
http://alienbrothers.no.sapo.pt/fotosmaio2006/AulaElectronicaMaio2006_01.jpg
http://alienbrothers.no.sapo.pt/fotosmaio2006/AulaElectronicaMaio2006_02.jpg
http://alienbrothers.no.sapo.pt/fotosmaio2006/AulaElectronicaMaio2006_03.jpg

0 Remote Pictures Links Found

File Uploaded : files.txt
File Size : 2126
0 Remote Pictures Links Found
433 Remote Pictures in the database
After filtering 0 NEW Remote Pictures will be added.

Title: Re: External Images Links / Use "remote" storage servers
Post by: donpeyote on June 08, 2006, 09:34:29 pm
anyone can see something i might be doing wrong..those 3 pics i just uploaded thru URI/URL Uploads: with no problems so....
Title: Re: External Images Links / Use "remote" storage servers
Post by: donpeyote on June 14, 2006, 08:46:24 pm
i dont want to be a boring ass but can anyone help me ??
Title: Re: External Images Links / Use "remote" storage servers
Post by: krnboy on June 15, 2006, 11:14:03 pm
I've ended up with quite a dilema........ I installed the mod successfully, but i still have 2 small problems. 
1) after i upload a remote picture i get the message "The previous file was placed successfully." but i did not have the picture uploaded before.
2) My original problem was tat i used photobucket and i jux wanted the original picture pulled up from photobucket rather than being stored in my own webspace.  It now pulls up from photobucket, but i checked my FTP for my website and saw that the gallery still downloaded the file into my album.  Is there a way to keep it from doin tat?  Will it be ok to manually erase those big original pictures? They don't seem to be linked to anything anyways.
Title: Re: External Images Links / Use "remote" storage servers
Post by: krnboy on June 15, 2006, 11:14:49 pm
Oh and i used the CGP 1.4x hack and also installed the slideshow mod
Title: Re: External Images Links / Use "remote" storage servers
Post by: krnboy on June 15, 2006, 11:20:42 pm
Oh shoot! Sry for posting 3 times in a row, but i jux got an error

"Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 9216 bytes) in /home/krnboy/public_html/gallery2/include/picmgmt.inc.php on line 259"

The remote picture was below the configured max file size and max width and height.  Do i need to change something in micmgmt.inc.php?
Title: Re: External Images Links / Use "remote" storage servers
Post by: Joachim Müller on June 20, 2006, 08:13:09 am
1) This mod goes unsupported by the Coppermine devs
2) Search for your error message first - Fatal error: Allowed memory size of X bytes exhausted (http://forum.coppermine-gallery.net/index.php?topic=24088.msg110690#msg110690). The error message you got is not directly related to this mod, please stop cluttering this thread.
Title: Re: External Images Links / Use "remote" storage servers
Post by: viperpurple on July 04, 2006, 02:23:42 pm
Hey Peeps,

Firstly i'd like to congratulate Flux on producing this great Mod  ;D

I have just installed the beta4 mod onto my coppermine install version 1.4.8.  It all works correctly, i have uploaded several photos into the albums and the normal and thumb files have been created locally however they don't appear in the gallery.

see http://www.viperpurple.net/gallery/index.php (http://www.viperpurple.net/gallery/index.php) for the gallery i am refering to.

I hope someone can help and if you need more information then please just ask and i will post it promptly  :)

TTFN  :P

Adam
Title: Re: External Images Links / Use "remote" storage servers
Post by: flux on July 04, 2006, 03:25:03 pm
are you sure the pictures are actually located where they should be and can be accessed by the web server ? ownership/right problem maybe..

if you have access to the logs check the error log to see what's said there..

anyways what i wanted to say was that i upgraded my demo to 1.4.8 and everything works fine
Title: Re: External Images Links / Use "remote" storage servers
Post by: viperpurple on July 04, 2006, 04:37:53 pm
stupid file permissions! i'm sure i'd checked them, ahh well it works super now  ;D

cheers and sorry for the stupidly simple post
Title: Re: External Images Links / Use "remote" storage servers
Post by: viperpurple on July 07, 2006, 03:37:01 pm
Hey,

I have been uploading and adding over 1000 photos at a time using this mod on cpg1.4.8 and have found the following problems, i'm not sure whether its bugs in the mod but i have followed the instructions exactly and  seem to get the problems consistantly.


I hope i've explained the above problems enough, if not then please let me know and i'll answer any questions and try to expand on the details.

TTFN  :P

Adam
Title: Re: External Images Links / Use "remote" storage servers
Post by: viperpurple on July 07, 2006, 03:47:32 pm
hey,

i've just found another 2 problems,


I'd be interested to hear about other peoples experiences of adding files in cpg1.4.8 with the beta4 mod

TTFN  :P

Adam
Title: Re: External Images Links / Use "remote" storage servers
Post by: flux on July 07, 2006, 06:29:42 pm
most of the "problems" you've encountered are probably caused by the fact the script does not execute normaly with your server setup.

1. X_ name prefix is added when the exact image path/name already exists, the script is designed to check the db for an existing file not the ondisc file which could very well be missing in the db.
The fact it had to create "new" files with the same original name obviously follows a problem when executing the script. File was probably being added and the script failed for a reason. Reloading the script would try to add the very same file thus producing a 1_, then 2_ new files if several failures occur.. and that you want to force it by reloading..

2. The automated execution is not perfect, it's basically designed to try avoiding script timeouts but that doesn't work 100% and i even saw on some setups that it won't work at all.. i'd suggest you lower the number of pictures added in one pass, it won't matter if you add 5 pics or 10 at a time.. the only thing you want here is to avoid script failures..

3. look for "0750" values in the script and change them to whatever you want, "0755" in your case maybe.. i've also seen some setups that will not let mkdir change the default chmod value so it may not work..

4. failure to add pictures are probably cpg functions related, the script only makes sure the pics are not already in the database and then tries to add the new pictures using available cpg functions.. Once again it could fail if your remote picture takes too long to be fetched but then that's another timeout problem you'll have to deal with..

5. no idea where that come from, make sure you didn't see them in a gallery being updated. the relative index that cpg produces to access pictures in ablums is really relative and a single link would point to different pictures at different times if the gallery you browse is being updated..

6. Funny, i had the very same bug but only after i introcuded it myself while making modifications to my script..
So in your case it could also be related to your various script failures and so on..


My opinion is that it's absolutely not related in any ways to your cpg version, i've added like 5k pics to my demo gallery upgraded to 1.48 and had no problems whatsoever..

failure to add pictures can occur for various reasons since you rely on ip transfers which are themselves not reliable..
Title: Re: External Images Links / Use "remote" storage servers
Post by: viperpurple on July 07, 2006, 08:19:57 pm
thanks flux for such an indepth answer to my questions, you exceeded my expectations by miles

keep up the great work, i only hope that one day my web programming progresses to such a level  :)

Title: Re: External Images Links / Use "remote" storage servers
Post by: jko on July 29, 2006, 08:56:25 pm
1st post and a big thanks to flux for this addon.

I've just taken delivery of a new Linkstation NAS and set it up as a webserver with all my photos on it - lots more than I could ever put on my hosted webspace. I've been a long time user of a different image gallery but it doesn't have the facility to link to remote files.
I found this post after a bit of web searching and decided to try Coppermine - flawless install. Then had a quick play with this facility and it just worked.
OK, so I've got a bit of work to do arranging my photo albums and creating the file lists, but it's exactly what I'm looking for, so, once again a big thumbs up and thanks.

John
Title: Re: External Images Links / Use "remote" storage servers
Post by: igor666 on August 23, 2006, 04:42:17 pm
Just found this thread - installed the mod and, so far, it's working great - many, many thanks for a superb job!
Title: Re: External Images Links / Use "remote" storage servers
Post by: HinDu on August 30, 2006, 08:29:37 pm
hi flux,

first of all thank you for the great work - with your hack, Coppermine seems to be the exactly what I need.
I have a problem however with "uploading" the images, I made a few screens, so you can see what I mean.

ok, the database is working properly, I can upload (the normal way) pics and everythings fine. I have a category "Winterzeit" and the album "Weihnacht"

see here: http://img179.imageshack.us/img179/9400/databasefh4.jpg

Now I want to upload the following picture: http://foto.arcor-online.net/palb/alben/85/357385/3164386530316330.jpg (don't mind the size, I have everything set up correctly. If I upload it normally everything works great with the pic - it's just for testing purpose)
I have a pic.txt that says
Code: [Select]
/Winterzeit/Weihnacht/
http://foto.arcor-online.net/palb/alben/85/357385/3164386530316330.jpg
And I execute the files.php, point it to the txt file and let it begin. Then I get this error message:
http://img113.imageshack.us/img113/8383/errorox7.jpg
If I continue, it says "file has already been added"

Now, if I go to my album, I see this:
http://img106.imageshack.us/img106/1537/thumbgl5.jpg
If I click on the picture, I get this
http://img113.imageshack.us/img113/6534/normaljh0.jpg

And the strange part is, if I click on the picture, I get a (fullsized) picture, hosted by arcor. So it seems that only the thumbs and normal album view is not working. The fullsize picture itself is correctly linked in the database.

What could that be? Any help?
Title: Re: External Images Links / Use "remote" storage servers
Post by: HinDu on August 30, 2006, 08:33:43 pm
If I continue, it says "file has already been added"

It actually says

Code: [Select]
Picture already added: http://foto.arcor-online.net/palb/alben/85/357385/3164386530316330.jpg to path: /Winterzeit/Weihnacht

Back to the main form : Back
Title: Re: External Images Links / Use "remote" storage servers
Post by: HinDu on August 31, 2006, 12:47:26 pm
oh and here is the debug from the "database error":

===============================================
There was an error while processing a database query.

While executing query "Select rlogid FROM cpg149_remote_log WHERE picurl='http://foto.arcor-online.net/palb/alben/85/357385/3164386530316330.jpg'" on 0

mySQL error: Table 'db175712587.cpg149_remote_log' doesn't exist

File: /homepages/21/d13576347/htdocs/cpg149/include/functions.inc.php - Line: 249
===============================================
Title: Re: External Images Links / Use "remote" storage servers
Post by: karpate on September 30, 2006, 10:17:19 am
hi
I installed the hack. It worked so far on my cpg version 1.4.9. But when I checked the albums on my webspace, I got the thumb,normal and original picture of the remote file. I installed the hack according to the installation.txt. What went wrong?
Thanks for helping!
Title: Re: External Images Links / Use "remote" storage servers
Post by: gandhi51 on October 04, 2006, 07:30:48 pm
Hi all!

First, thanx you Flux for your contribution! I'm using your hack (beta4) since 2 weeks now. It works fine.

I want to add a little contribution too.
The hack is only usable by the administrator. If you want to let some (trusted) people to use it, see my solution for an Apache server (certainly not very good for security, but it works!):


First found the eight line of files.php
Quote
if (!GALLERY_ADMIN_MODE) die('Access denied');
and delete it (wooow, it is bad for the security... i know :-[).

Next, add a .htaccess file in the directory where you put files.php
Quote
<Files files.php>
PerlSetVar AuthFile /path/to/your/.htpasswd
AuthName "Restricted acces"
AuthType Basic
require valid-user
</Files>

Be carreful, my webhost is 'Free'. And i need to use special syntax in my htaccess file because Free is using a modified apache server.

I give this only as an exemple. I'm not a programmer and not a expert in security (as you can see  ;))

Lots of websites gives information about htaccess.

Thanx!
Title: Re: External Images Links / Use "remote" storage servers
Post by: sectioni on November 13, 2006, 04:16:00 am
My webhost (Powweb) switched to new servers and now will not allow fopen on remote urls.  I'm not very good with php and I know this is a loaded question, but is there an alternative to using fopen?  I've used this mod for over a year and I love it, but now my host won't let me use it with fopen.
Title: Re: External Images Links / Use "remote" storage servers
Post by: Joachim Müller on November 13, 2006, 07:56:48 am
No.
Title: Re: External Images Links / Use "remote" storage servers
Post by: cmatte on March 05, 2007, 07:02:08 pm
Hi,
I installed this mod with cpg1.4.10 .
Everything seems to work fine except the fact that nothing happens:
Code: [Select]
File Uploaded : monum.txt
File Size : 2728
Category already exists: Foto Parigi 2007
Album already exists: Monumenti e oggetti
Adding to list:[...]
39 Remote Pictures Links Found
0 Remote Pictures in the database
After filtering 39 NEW Remote Pictures will be added.
Then, nothing happens, the category is being created but no photos appear there...
What's wrong?
Title: Re: External Images Links / Use "remote" storage servers
Post by: ElEsteban on April 24, 2007, 03:34:33 pm
There are one free hosting that have "allow_url_fopen" set to on?

Post here please...

Thanks ;)
Title: Re: External Images Links / Use "remote" storage servers
Post by: Joachim Müller on April 24, 2007, 06:54:43 pm
Free webhosting is not being discussed here - there's a sticky thread on the General discussion board that discusses free webhosts, and it's the only thread where we allow this type of discussion. Reasons: (1) we don't want other threads to become cluttered with adverts (2) free webhosts frequently change their policy on what they allow and disallow. Any information would soon be outdated.

allow_url_fopen is a security hole, that's why free webhosts disable it - you will hardly find one that has it enabled.

This entire mod is silly in the first place - imo we should close it; either get decent webspace (which is cheap) or review the idea to host a web gallery if you can't afford it. Use one of the many free picture/multimedia hosting sites that are already available.
Title: Re: External Images Links / Use "remote" storage servers
Post by: sevy on August 20, 2007, 09:45:01 am
Stealing other sites bandwidth this? This is great idea, I hope you guys get it too work. You could can add a little check box host remote from this site when the user uploads the picture or video. I'm operating a couple of sites and saving space is the name of the game. There are hundreds of Image hosting sites out there. I know I'll switch to this gallery if I had an option like this one. Good luck!!
Title: Re: External Images Links / Use "remote" storage servers
Post by: zendiz on January 14, 2008, 12:31:12 pm
I don't get it.

It seems like great hack but when I have like 20000 pics sitting on server, and I need to manually make a txt file with each pic location..pff
 :( ....sounds a lot of work.

Why not write something that detects all images in remote folder(s), then stores that in local db with pointing to remote url.  Doesn't that sound cleaner?

server 1 (image/video data storage) <- modscript -> server 2 database coppermine website/database with remote urls.


Or am I missing something?
Title: Re: External Images Links / Use "remote" storage servers
Post by: eK3eKyToPa on January 18, 2008, 04:19:07 pm
I'm trying to put in the gallery , picture from remote server, but as I see there is error.
Picture is here http://webek.data.bg/cpg_2.JPG
and the Error is :
Code: [Select]
1. http://webek.data.bg/cpg_2.JPG HTTP/1.1 302 FoundIf not possible to import this URL please say how to trace the original url of the picture
Title: Re: External Images Links / Use "remote" storage servers
Post by: eK3eKyToPa on January 24, 2008, 09:35:04 am
Please, need some help about this mod
As I see the hosting server does not see the image files I want to add.
And when putting some image as a Remote URL it is downloaded by coppermine and after that is added as a remote picture, and the copy (downloaded by coppermine) stays in the album directory.
Say how to make so that nothing to be downloaded , and just image fail without any testing to be added to the gallery.

Thanks!
Title: Re: External Images Links / Use "remote" storage servers
Post by: Hinata Snape on November 15, 2008, 02:46:11 pm
Hi,
where is files.php ?
How to domnload it ?

Thanks !

(sorry for my english, i'm french)
Title: Re: External Images Links / Use "remote" storage servers
Post by: Hinata Snape on November 15, 2008, 02:50:32 pm
Oh i'm sorry, i have see it.  ;)
Title: Re: External Images Links / Use "remote" storage servers
Post by: kevinjd on December 13, 2008, 11:04:34 pm
the gallery says "remote picture added" but the images show as red X's in the gallery, what is going on?
Title: Re: External Images Links / Use "remote" storage servers
Post by: darkeagle on April 04, 2009, 03:01:52 am
I don't want to show Remote URL link at viewing intermediate pictures.

How can I do it?
Title: Re: External Images Links / Use "remote" storage servers
Post by: MarcM on June 09, 2009, 07:24:03 pm
Hello,
I'm really sorry but I can't find the files.php.
Is this still present in this topic ? :'(
Is there another solution that work .

Thanks
Title: Re: External Images Links / Use "remote" storage servers
Post by: Joachim Müller on June 13, 2009, 12:58:01 am
Attached to the initial posting in this thread.
This mod goes unsupported. Locking.