video download link help?
|
fberardi
![]()
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 |
|
| Login or register to post comments |


Posts: 13007
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
Posts: 68
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
.
Posts: 18728
http://codex.gallery2.org/Gallery2:Modules:downloadlink
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 13007
Perfect! Thanks Dave, forgot about that module.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 68
I installed it, and it is very cool, however, it doesn't create a download link for VIDEOS,just photos!!
Still hoping!!
Posts: 4162
{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
Posts: 68
OK, I'll bite...where should I insert that code suprsidr? Album.tpl? photo.tpl?
Thanks again for the replies.
Posts: 4162
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
Posts: 68
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}
Posts: 4162
sorry, typo should be entityType
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 68
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!!!
Posts: 68
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)
Posts: 4162
{math equation="`$theme.item.size`/1024/1024" format="%.2f"}Megs-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 68
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}