How randomly pictures in album

desz

Joined: 2012-03-09
Posts: 6
Posted: Fri, 2012-03-09 08:39

Hi all! At first im want to say a big THANKS for Gallery.
So in gallery2 a good thing to change a header picture in randomly. Is it possible to change pictures inside albums in random mode (mix'em) ?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2012-03-09 12:04
 
desz

Joined: 2012-03-09
Posts: 6
Posted: Fri, 2012-03-09 13:52

Thank you !!! All ok! And another questions^
Im need to put some ads to my gallery
There (this ia a big picture page)
[img]http://s018.radikal.ru/i526/1203/44/3a1cb5e84673.jpg[/img]
Im think that in my matrix theme a photo.tpl ?
Sorry for my English i'm studied badly =) but my php is more ugly - I'm like a pig in oranges =)))

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2012-03-09 15:08

try http://codex.gallery2.org/Gallery2:Modules:htmlblock
if that does not do what you want, you will have to edit photo.tpl by hand

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

 
desz

Joined: 2012-03-09
Posts: 6
Posted: Sat, 2012-03-10 14:10

suprsidr thx for you help! Please advice me in which place put code of my ads
{*
* $Revision: 16387 $
* Read this before changing templates! http://codex.gallery2.org/Gallery2:Editing_Templates
*}
{if !empty($theme.imageViews)}
{assign var="image" value=$theme.imageViews[$theme.imageViewsIndex]}
{/if}
<table width="100%" cellspacing="0" cellpadding="0">
<tr valign="top">
{if !empty($theme.params.sidebarBlocks)}
<td id="gsSidebarCol">
{g->theme include="sidebar.tpl"}
</td>
{/if}
<td>
<div id="gsContent">
<div class="gbBlock gcBackground1">
<table width="100%">
<tr>
<td>
{if !empty($theme.item.title)}
<h2> {$theme.item.title|markup} </h2>
{/if}
{if !empty($theme.item.description)}
<p class="giDescription">
{$theme.item.description|markup}
</p>
{/if}
</td>
<td style="width: 30%">
{g->block type="core.ItemInfo"
item=$theme.item
showDate=true
showOwner=$theme.params.showImageOwner
class="giInfo"}
{g->block type="core.PhotoSizes" class="giInfo"}
</td>
</tr>
</table>
</div>

{if !empty($theme.navigator)}
<div class="gbBlock gcBackground2 gbNavigator">
{g->block type="core.Navigator" navigator=$theme.navigator reverseOrder=true}
</div>
{/if}

<div id="gsImageView" class="gbBlock">
{if !empty($theme.imageViews)}
{capture name="fallback"}
<a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.item.id`"
forceFullUrl=true forceSessionId=true}">
{g->text text="Download %s" arg1=$theme.sourceImage.itemTypeName.1}
</a>
{/capture}

{if $image.viewInline}
{if count($theme.imageViews) > 1}
{capture assign="imageViewLink"}
{if $theme.imageViewsIndex==1 && count($theme.imageViews)==2}
<a href="{g->url params=$theme.pageUrl arg1="itemId=`$theme.item.id`"}">
{else}
{assign var="imageViewsLink" value=$theme.imageViewsIndex+1}
{if $imageViewsLink==count($theme.imageViews)}
{assign var="imageViewsLink" value=$theme.imageViewsIndex-1}
{/if}
<a href="{g->url params=$theme.pageUrl arg1="itemId=`$theme.item.id`"
arg2="imageViewsIndex=`$imageViewsLink`"}">
{/if}
{/capture}
{/if}
{if isset($theme.photoFrame)}
{g->container type="imageframe.ImageFrame" frame=$theme.photoFrame
width=$image.width height=$image.height}
{if isset($imageViewLink)}{$imageViewLink}{/if}
{g->image id="%ID%" item=$theme.item image=$image
fallback=$smarty.capture.fallback class="%CLASS%"}
{if isset($imageViewLink)}</a>{/if}
{/g->container}
{else}
{if isset($imageViewLink)}{$imageViewLink}{/if}
{g->image item=$theme.item image=$image fallback=$smarty.capture.fallback}
{if isset($imageViewLink)}</a>{/if}
{/if}
{else}
{$smarty.capture.fallback}
{/if}
{else}
{g->text text="There is nothing to view for this item."}
{/if}
</div>

{if $theme.pageUrl.view != 'core.ShowItem' && $theme.params.dynamicLinks == 'jumplink'}
<div class="gbBlock">
<a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$theme.item.id`"}">
{g->text text="View in original album"}
</a>
</div>
{/if}

{* 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}

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

{if !empty($theme.navigator)}
<div class="gbBlock gcBackground2 gbNavigator">
{g->block type="core.Navigator" navigator=$theme.navigator reverseOrder=true}
</div>
{/if}

{g->block type="core.GuestPreview" class="gbBlock"}

{* Our emergency edit link, if the user removes all blocks containing edit links *}
{g->block type="core.EmergencyEditItemLink" class="gbBlock" checkBlocks="sidebar,photo"}
</div>
</td>
</tr>
</table>

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2012-03-10 14:41

somewhere next to {g->image however you want to divide up that space

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

 
desz

Joined: 2012-03-09
Posts: 6
Posted: Sun, 2012-03-11 10:35

Hmm no understood you mean like this: after <div id="gsImageView" class="gbBlock"> incert {g-><div id="mybanner764"><a href="http://mybanner.ruu" target="_blank">News from mybanner.ruu</a></div>
<script src="http://mybanner.ruu/informer/java_inf.php?inf=764"></script>}

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2012-03-11 15:15

you'll have to play with the html placement yourself.
but you don't need to wrap your html in any smarty code.

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

 
desz

Joined: 2012-03-09
Posts: 6
Posted: Mon, 2012-03-12 09:01

THX great suprsidr! Im try. I'm don't wona to open another topic: How to make block with random pictures horizontal now it they only vertical ?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2012-03-12 13:37
Quote:
random pictures horizontal

http://codex.gallery2.org/Gallery2:Modules:imageblock#Examples

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
desz

Joined: 2012-03-09
Posts: 6
Posted: Fri, 2012-03-16 12:55

photo tpl is not working ((( Im paste code there but it nothing happens. This my site http://chastnoe-foto.ru/ sorry for erotic content, but lost hope to put banner there ( in to photo page)