video download link help?

fberardi
fberardi's picture

Joined: 2006-10-19
Posts: 68
Posted: Mon, 2009-03-30 21:03

I am trying to create a "download Item" link for videos in Gallery 2.3. After searching, the closest I can find is:

http://gallery.menalto.com/node/37456

and I made the changes in the local/album.tpl suggested by nivekiam (near the bottom of the post), but, it doesn't work for my 2.3 installation.

Can anyone help me implement a "download Item" link forthe videos (Flash, wmv, avi, etc.) items in my gallery???

THANKS for any replies!!

Last Run Details:

Gallery URL = http://photos.sew-g-it.com/family/main.php
Gallery version = 2.3 core 1.3.0
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.2.6 apache2handler
Webserver = Apache
Database = mysqli 4.1.22-standard, lock.system=flock
Toolkits = Exif, Gd, NetPBM, ImageMagick, Ffmpeg, Thumbnail
Acceleration = none, none
Operating system = Linux daisy.cirtexhosting.com 2.6.9-78.0.13.ELsmp #1 SMP Wed Jan 14 16:12:46 EST 2009 i686
Default theme = matrix
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5
Rows in GalleryAccessMap table = 21
Rows in GalleryAccessSubscriberMap table = 146
Rows in GalleryUser table = 5
Rows in GalleryItem table = 140
Rows in GalleryAlbumItem table = 18
Rows in GalleryCacheMap table = 0

Login or register to post comments
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 10642
Posted: Mon, 2009-03-30 21:31

Oh wow! That thread you dug up is ancient. I think it would be a safe bet that those changes won't work in 2.1 or newer. I believe that was well before the theme system under went some major modifications.

If someone else doesn't dig into it I'll try to take a look at it tonight and see. You may be able to dig up some information about variable names and get close to doing what you need. To see all the Smarty Debug info (variable names and all) you need to put Gallery into debug mode:
FAQ: How to set/use Gallery in debug mode?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

Login or register to post comments
fberardi
fberardi's picture

Joined: 2006-10-19
Posts: 68
Posted: Mon, 2009-03-30 21:41

Well, I didn't want to ask the question until I at least LOOKED to see if there had already been an answer. I was excited when I found the link and did at least TRY IT.... And, you are right, it didn't work!!
Thanks for the reply and I will look forward to any help you might offer.
FB
.

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 16960
Posted: Tue, 2009-03-31 01:26
Login or register to post comments
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 10642
Posted: Tue, 2009-03-31 02:50

Perfect! Thanks Dave, forgot about that module.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

Login or register to post comments
fberardi
fberardi's picture

Joined: 2006-10-19
Posts: 68
Posted: Tue, 2009-03-31 04:16
Quote:
Can anyone help me implement a "download Item" link for the videos (Flash, wmv, avi, etc.) items in my gallery???

I installed it, and it is very cool, however, it doesn't create a download link for VIDEOS,just photos!!
Still hoping!!

Login or register to post comments
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 2937
Posted: Tue, 2009-03-31 04:51
{if $user.isRegisteredUser && $theme.item.enitiyType=="GalleryMovieItem"}
  <a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.item.id`"}">
    {g->text text="Download %s" arg1=$theme.item.title}
  </a>
{/if}

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

Login or register to post comments
fberardi
fberardi's picture

Joined: 2006-10-19
Posts: 68
Posted: Tue, 2009-03-31 17:19

OK, I'll bite...where should I insert that code suprsidr? Album.tpl? photo.tpl?
Thanks again for the replies.

Login or register to post comments
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 2937
Posted: Tue, 2009-03-31 17:23

photo.tpl where you want the link to show.
you can remove the $user.isRegisteredUser && if you want anon users to see it too.
Remember to clear your template cache to see any changes.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

Login or register to post comments
fberardi
fberardi's picture

Joined: 2006-10-19
Posts: 68
Posted: Tue, 2009-03-31 17:42

Inserted code into matrix/templates/local/photo.tpl (around line # 110. Clear data base and template cache...no link shows:

{* Download link for item in original format *}
{if !empty($theme.sourceImage) && $theme.sourceImage.mimeType != $theme.item.mimeType}
<div class="gbBlock">
<a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.item.id`"}">
{g->text text="Download %s in original format" arg1=$theme.sourceImage.itemTypeName.1}
</a>
</div>
{/if}

{* Download link for movie item in original format *}
{if $user.isRegisteredUser && $theme.item.enitiyType=="GalleryMovieItem"}
<a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.item.id`"}">
{g->text text="Download %s" arg1=$theme.item.title}
</a>
{/if}

{* Show any other photo blocks (comments, exif etc) *}
{foreach from=$theme.params.photoBlocks item=block}
{g->block type=$block.0 params=$block.1}
{/foreach}

Login or register to post comments
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 2937
Posted: Tue, 2009-03-31 17:48
Login or register to post comments
fberardi
fberardi's picture

Joined: 2006-10-19
Posts: 68
Posted: Tue, 2009-03-31 17:59

oops..is that a typo in the user.isRegisteredUser?

{if $user.isRegisteredUser && $theme.item.enitiyType=="GalleryMovieItem"}
Should it be entityType??
UPDATE: Edited the entry name (second time, I got it right...)...delete cache...Link shows!!

Thanks for the help!!!

Login or register to post comments
fberardi
fberardi's picture

Joined: 2006-10-19
Posts: 68
Posted: Tue, 2009-03-31 18:04

OK, this was so successful that [i]I have another small add question. Can the link show the filesize next to the link?

Like "Download THISFILENAME (1.5 megs)" (no quotes needed)

Login or register to post comments
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 2937
Posted: Tue, 2009-03-31 18:36

{math equation="`$theme.item.size`/1024/1024" format="%.2f"}Megs

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

Login or register to post comments
fberardi
fberardi's picture

Joined: 2006-10-19
Posts: 68
Posted: Tue, 2009-03-31 19:03

Cool...appears to be the answer. Thanks again and I love it!!

I wanted to surround the filesize with brackets so I added some to the code. Might not be in the correct format but it appears correctly on the page. Is the following ok?? (See the bracket after $theme.item.title and after MEGS?). Is it ok for them to be "hanging out" there??

{* Download link for movie item in original format *}
{if $theme.item.entityType=="GalleryMovieItem"}
<div class="gbBlock">
<a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.item.id`"}">
{g->text text="Right-click here to Download and Save %s" arg1=$theme.item.title} (
{math equation="`$theme.item.size`/1024/1024" format="%.2f"} Megs )
</a>
</div>
{/if}

Login or register to post comments