Using link instead of Local file

Khrysller_

Joined: 2004-07-04
Posts: 20
Posted: Sun, 2004-07-04 07:07

Hi Duddes,

Today came in mind an idea to use another way to show video with gallery(usually know as: out of disk space ^_^), so I am thinkin in use a link to bring the file to the gallery instead of the local file.

So I have tried to change it manually in: photos.dat, photos.dat.0, and the same in .bak, and my gallery blows, hehehehe. Thanks i made a backup of the files. So this way don't work.

So, why this is usefull? Well, space limit. I have an account with a lot of MB, but I can't run the site there... so I was thinking in put only the videos.

Is this possible or am I trying to workaround the way of gallery works?

My Gallery: http://pumpers.homeip.net/pumpers/html/modules.php?set_albumName=album03&op=modload&name=gallery&file=index&include=view_album.php

sorry the english, and thanks in advance : )

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2004-07-06 00:50

You can have videos or other files (ie full images) on a different server if you like.
The method that I have came up with works well and is simple but have a few drawbacks.
I change the frame style around the item (movie, full image etc.). So the draw back is you have to maintain this as is it not mirrored or synconized.
Here is how I have done the modifications:
add a new "case" to /html_wrap/inline_imagewrap.inc

<?php
  break;
case "remote":
global $gallery;
$photo = $gallery->album->getPhoto($GLOBALS["index"]);
?>
  <TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR=#000000 ALIGN="CENTER">
    <tr>
      <td>
        <a target="new" href="http://remote_server.com/full/
		<?php 
		echo $gallery->session->albumName;
		echo "/";
		echo $photo->image->name;
		echo ".";
		echo $photo->image->type; ?>">
		<?php echo $tag ?>"></a>
      </td>
    </tr>
  </table>

then in util.php add this info to the function available_frames():

	$opts=array(
			'none' => _("None"), 
			'dots' => _("Dots"), 
			'remote' => _("Remote-site"),
			'torn' => _("Torn"), 
			'solid' => _("Solid"), 
			);

In this case I have added 2 new frame styles Torn and Remote-site.
These options will show up in the album properties when you select the different frame style.

So when you select the "remote" frame style, the item is server from your remote server. In this example I have hardcoded the remote server address and the directory (full). On the remote server you need to have a similar directory structure as the structure on the Gallery server. (albumName/imagename.type)

There is probably a better way; Mirroring comes to mind but this works for my application that a friend needed.

Dave

 
butcho

Joined: 2006-01-30
Posts: 3
Posted: Mon, 2006-01-30 20:40

This works great. Thanks! I removed the "> from the following line because it seemed to be extraneous:

<?php echo $tag ?>"></a>

I have a follow up question. Is it possible for the link to the full image to only be enabled if this has been enabled in the Album properties? For instance, I only allow LOGGEDIN users to view the full images. Can anyone suggest some code that I can add to enable this link only if the user is LOGGEDIN?

Thanks!

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2006-01-31 14:45

Sure,
where you edited a new "case" to /html_wrap/inline_imagewrap.inc you can add an is logged in check like:
if ($gallery->user->isLoggedIn()) { then at the bottom add a php tag and closing brace:
<?php } ?>

Dave
____________________________________________________
Gallery Frames / Mods || G1 Test Gallery

 
tomballpkr

Joined: 2007-05-26
Posts: 1
Posted: Sat, 2007-05-26 02:43

Will this work on Gallery 2? I can't figure out how this works. If I upload a movie and then decide to remove it because I ran out of space, how do I do that yet leave the thumbnail and such so that it can be clicked and go to the remove server? If the idea is to start with the movie on the remove server in the first place, Gallery has a way to use a link to the remote link and do all of this automagically. I am wondering if I am missing something or if this is a Gallery 1 issue only.

I would like to upload and serve movies off of my site but as it fills up relocate movies to another server in the easiest manner possible. This seemed cool because I thought I could somehow delete the original files off of the server, keep the thumbnails, and just change the frames.

Any feedback would be appreciated...

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2007-05-26 03:32

Only works in G1

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team