Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

Remotely hosted pictures
https://www.tinywebgallery.com/forum/viewtopic.php?f=1&t=407
Page 1 of 1

Author:  Tominator [ 22. Jul 2006, 01:44 ]
Post subject:  Remotely hosted pictures

Hi,

I just installed the software, and I played a bit with it uploading local images and stuff. Now I want to use imageshack.us for hosting the pictures, and then show them with the script. The how-to for this is very sketchy, with a broken sentence, and 2 bullets. Only one of the bullets is explained. If I put the imageshack url in the urls.txt file, I notice that TWG takes a bit longer to display the first time, but then shows the folder containing the urls.txt empty. I don't know what to do, and it's a bit late to read source. Can you update the how-to or write it in full here please?

Thanks in advance!

Author:  Tominator [ 22. Jul 2006, 01:50 ]
Post subject: 

I immediately have an update:

[~/www/twg] $ grep -r "url.txt" *
admin/.config/mimes.php: "urltxt" => array($GLOBALS["mimes"]["urltxt"],"txt.gif","\url.txt$"),
config.php:$url_file = "url.txt"; // new 1.3 - you can place your images on an extern http - on the local server are only some working images! This only works of fsocksopen is available. Please check the how-to!

Is there even code to use the url.txt file? I can see fsockcode with grep in inc/filefunctions.inc.php... but debugging at 2am is not fun :-)

Author:  Tominator [ 22. Jul 2006, 02:01 ]
Post subject: 

I'm sorry for this stream of messages, but I've found that the how-to is correct in this view: the url.txt file does need to link to a page that contains links to .jp(e)g files, which are then downloaded. The delay in my viewing of the index file was the downloading of the jpeg to parse it for the "real" jpegs, and none were found. So I guess what I need to do is make a dummy page somewhere on my host, linking to the imageshack images (with real <a href> links), and then it should work.
Is there an easy way? Like in the "upload" box of the admin panel, a checkbox "upload to imageshack/others instead" with a dropdown box? ;-)

Cheers!

Author:  TinyWebGallery [ 22. Jul 2006, 02:59 ]
Post subject: 

quite some text :).

What twg does with url.txt is to scan the url in the url.txt for link to jpg's.
I know that this is no the ultimate solution but i haven't found a bett er http solution yet (I had ftp in mind but not many people use this features and it would be a lot of work ...).

If there is a special treatment for imageshark (I have never used this) that makes sense plese let me know.

/Michael

Author:  Tominator [ 22. Jul 2006, 12:14 ]
Post subject: 

Hi again,

here's my situation now: I understand how url.txt works and how it is used. I put a url in to an html page, which links to an image on www.imageshack.us. When I view the gallery, I see a black preview image, and upon clicking, no large image.

In the error log I get that the script tries to getimagesize from the url "http://www.<mywebhosthere>.org/<twg folder>/<htmlfile_with_links>.htm<url of imageshack picture>"
An example: http://www.google.com/twg/Testing/links ... yimage.jpg
This seems wrong.

Are you really sure the feature still works? I don't know how to debug a thing as horrid as image.php, with all its duplications and everything :shock:

Author:  TinyWebGallery [ 23. Jul 2006, 15:02 ]
Post subject: 

Hi,

I'm pretty sure this features does work.

You can test it with the following url in url.txt:
http://twg.tw.funpic.de/pictures/Davos/

image.php is not quite easy but because it's only some big swiches not that hard either (And I have cleaned it up in my local build too ;).)
But the actual work is not done there!

TWG is scanning the html of the page where the remote images should be - normally this is only a files listing from a remote folder (paste the url above into your browser and you'll see).

What is the url you are using?
because the example below is of course wrong.
What TWG does is to scan for the images (*.jpg's there) and add these names to your url.txt url!! I your case this it totally nonsense because I think you have directly linked to the remote host images..

You would have to modify the function checkurl
in the inc/fielfunctions.inc.php that it would not return the url (that is added in from of the images) but an empty String !

/Michael

Author:  TinyWebGallery [ 24. Jul 2006, 14:00 ]
Post subject: 

did you get it to work?

I'm just thinking to enhance this feature by checking each image if it is already a http ... link and then don't attach the prefix of the domain.

/Michael

Author:  Tominator [ 24. Jul 2006, 15:44 ]
Post subject: 

Hello,

I've been looking at the code, it seems unwise to remove the "checkUrl" function by making it return an empty string. The code that needs tweaking I think would be in image.php, with the $remote_image variable. I won't touch it though, since you claim to have a more compact version of that code.
Your idea of checking if the links on the page of url.txt are full links or relative links is probably the best option. That way, people (like me) can store images everywhere on the internet and contain all links in just one html page.
You know the code better than I do, would it be an easy fix for you, or should I attempt a dirty patch just for myself? :)

Author:  TinyWebGallery [ 24. Jul 2006, 15:48 ]
Post subject: 

I think the code is bad enough :). And simply returning "" does not work for all cases ;).

but one thing you can provide: The page you created and you are linking to. This would then be my testpage. You can send me the link by email if you like.

I'll add this then to 1.5

/Michael

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/