siriux theme modification

tetonedge

Joined: 2005-09-17
Posts: 9
Posted: Sun, 2005-09-18 01:51

I am trying to add image frame support to the siriux theme. I was wondering if anybody has done that or had any luck. Also if anybody could suggest a theme like it that is simple. Let me know. Thanks

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-09-18 02:05

hybrid, classic and matrix have frames. the other themes don't have them. you need to change theme.inc
see:
$this->setStandardSettings(

and in album.tpl
you have to replace the normal code with

                {if $child.canContainChildren}
                {assign var=frameType value="albumFrame"}
                {else}
                {assign var=frameType value="itemFrame"}
                {/if}
                <div>
                  {if isset($theme.params.$frameType) && isset($child.thumbnail)}
		    {g->container type="imageframe.ImageFrame" frame=$theme.params.$frameType}
		      <a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}">
			{g->image id="%ID%" item=$child image=$child.thumbnail
			 class="%CLASS% giThumbnail"}
		      </a>
		    {/g->container}
                  {elseif isset($child.thumbnail)}
		    <a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}">
		      {g->image item=$child image=$child.thumbnail class="giThumbnail"}
		    </a>
                  {else}
		    <a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}"
                       class="giMissingThumbnail">
		      {g->text text="no thumbnail"}
		    </a>
                  {/if}
                </div>

to the right place (compare two themes)

but it would be better if someone who knew siriux did the changes, since you probably need to change the matrix code a little to work in siriux.

 
tetonedge

Joined: 2005-09-17
Posts: 9
Posted: Sun, 2005-09-18 02:14

i am doing that right now, but it seems from the code, most of his custimization comes from CSS as the tpl files are different from the matrix.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-09-18 02:28

first change theme.inc, then reinstall (not just activate/deactivate. do uninstall etc.) the theme.
then you should see image frame options in site admin -> themes -> siriux.

and the css will be included in your pages automatically once you did the two changes i mentioned above.

 
Jayh

Joined: 2006-02-21
Posts: 21
Posted: Fri, 2006-03-10 00:39

tetonedge: was that working?

valiant: I know very little PHP...what to do with that "$this->setStandardSettings("? Is it enough just to add "'albumFrame' => '', 'itemFrame' => '', 'photoFrame' => '',"? And where to insert all those "{if $child.canContainChildren}............" things? There are two {if $child.canContainChildren} in album.tpl

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2007-08-07 22:44

Here are diffs from current svn to change siriux to use imageframe...

Index: themes/siriux/theme.css
===================================================================
--- themes/siriux/theme.css     (revision 16841)
+++ themes/siriux/theme.css     (working copy)
@@ -84,7 +84,7 @@
        text-align: center;
 }

-.gallery-thumb img {
+.X-gallery-thumb img {
        background-color: #f3f3f3;
        border: 1px solid #ddd;
        padding: 7px;
@@ -92,11 +92,11 @@
        -moz-border-radius: 3px;
 }

-.gallery-thumb a img {
+.X-gallery-thumb a img {
        border-color: #ccc;
 }

-.gallery-thumb a:hover img {
+.X-gallery-thumb a:hover img {
        border-width: 2px;
        border-color: #38c;
        margin: 0;
Index: themes/siriux/theme.inc
===================================================================
--- themes/siriux/theme.inc     (revision 16841)
+++ themes/siriux/theme.inc     (working copy)
@@ -39,6 +39,7 @@
        $this->setStandardSettings(
            array('perPage' => 9,
                  'contentWidth' => 700,
+                 'albumFrame' => '', 'itemFrame' => '', 'photoFrame' => '',
                  'albumBlocks' => serialize(array(
                        array('comment.ViewComments', array()))),
                  'photoBlocks' => serialize(array(
Index: themes/siriux/templates/photo.tpl
===================================================================
--- themes/siriux/templates/photo.tpl   (revision 16841)
+++ themes/siriux/templates/photo.tpl   (working copy)
@@ -18,6 +18,14 @@

   {if ($image.viewInline)}
     <div class="gallery-photo">
+      {if isset($theme.params.photoFrame)}
+       {assign var="imageId" value="%ID%"}
+       {assign var="imageClass" value="%CLASS%"}
+      {else}
+       {assign var="imageId" value=""}
+       {assign var="imageClass" value="gallery-photo"}
+      {/if}
+      {capture assign="imageContent"}
       {if $theme.params.enableImageMap}{strip}
        {if isset($theme.navigator.back)}
          <a href="{g->url params=$theme.navigator.back.urlParams}"
@@ -26,7 +34,7 @@
             onmouseout="document.getElementById('prevArrow').style.visibility='hidden'"
          ><img src="{g->theme url="images/arrow-left.gif"}" alt="" width="20" height="17"
          /></a>{/if}
-       {g->image item=$theme.item image=$image class="gallery-photo"
+       {g->image item=$theme.item image=$image id=$imageId class=$imageClass
            fallback=$smarty.capture.fallback usemap=#prevnext}
        {if isset($theme.navigator.next)}
          <a href="{g->url params=$theme.navigator.next.urlParams}"
@@ -36,9 +44,17 @@
           ><img src="{g->theme url="images/arrow-right.gif"}" alt="" width="20" height="17"
           /></a>{/if}
       {/strip}{else}
-        {g->image item=$theme.item image=$image class="gallery-photo"
+        {g->image item=$theme.item image=$image id=$imageId class=$imageClass
         fallback=$smarty.capture.fallback}
       {/if}
+      {/capture}
+      {if isset($theme.params.photoFrame)}
+       {g->container type="imageframe.ImageFrame" frame=$theme.params.photoFrame}
+         {$imageContent}
+       {/g->container}
+      {else}
+       {$imageContent}
+      {/if}
     </div>
   {else}
     {$smarty.capture.fallback}
Index: themes/siriux/templates/album.tpl
===================================================================
--- themes/siriux/templates/album.tpl   (revision 16841)
+++ themes/siriux/templates/album.tpl   (working copy)
@@ -35,6 +35,13 @@

       <div class="gallery-album">
         <div class="gallery-thumb">
+       {if isset($theme.params.albumFrame) && isset($child.thumbnail)}
+         {g->container type="imageframe.ImageFrame" frame=$theme.params.albumFrame}
+            <a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}">
+              {g->image item=$child image=$child.thumbnail id="%ID%" class="%CLASS%"}
+            </a>
+         {/g->container}
+       {else}
           <a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}">
           {if isset($child.thumbnail)}
             {g->image item=$child image=$child.thumbnail}
@@ -42,6 +49,7 @@
             {g->text text="no thumbnail"}
           {/if}
           </a>
+       {/if}
         </div>

        <h4><a href="{g->url arg1="view=core.ShowItem"
@@ -74,6 +82,13 @@
         {assign var="firstItem" value=false}
       {/if}
       <div class="gallery-thumb">
+      {if isset($theme.params.itemFrame) && isset($child.thumbnail)}
+       {g->container type="imageframe.ImageFrame" frame=$theme.params.itemFrame}
+         <a href="{g->url params=$theme.pageUrl arg1="itemId=`$child.id`"}">
+           {g->image item=$child image=$child.thumbnail id="%ID%" class="%CLASS%"}
+         </a>
+       {/g->container}
+      {else}
        <a href="{g->url params=$theme.pageUrl arg1="itemId=`$child.id`"}">
          {if isset($child.thumbnail)}
            {g->image item=$child image=$child.thumbnail}
@@ -81,6 +96,7 @@
            {g->text text="no thumbnail"}
          {/if}
        </a>
+      {/if}
       </div>
     {/if}
   {/foreach}
 
dichev
dichev's picture

Joined: 2007-05-25
Posts: 15
Posted: Wed, 2007-08-08 09:17

Thanks, mindless! :)
In fact this change is for the gallery of the my girlfriend's website. She uses siriux and has asked me, why she can not change the image frames around the thumbnails and I began to modify the code. Hope this will work fine and she will be happy soon.
I will try this today and I will post the result and my comments later.
- - -
See my Gallery2 at: http://dichev.com/gallery/

 
dichev
dichev's picture

Joined: 2007-05-25
Posts: 15
Posted: Wed, 2007-08-08 14:43

Cheers, mindless!

Your great help rocks...
Perfect explained and works fine from the first attempt to modify the code! The only thing, that I had to make, was to deactivate and uninstall siriux theme and install it and activate it again.

Many thanks for the time you have spent!

The result is siriux theme with image frames configurable from the template admin:
http://velina.info/gallery/

Thanks again for the help and good luck everybody!

- - -
See my Gallery2 at: http://dichev.com/gallery/

 
dichev
dichev's picture

Joined: 2007-05-25
Posts: 15
Posted: Thu, 2007-08-09 12:29

I have a little problem now. I have lost the static URLs to the photos. Gallery shows static URLs only for the albums and dynamic URLs for all photo-pages even in the gallery root album.
What have to change to fix this?

Sorry, that I am asking so many questions. I think after few more answers I will be more advanced with gallery and will stop boring you so much. :)

Thanks for your support in advance!

Edit: I have forgotten to post the location of the gallery: http://velina.info/gallery/

- - -
See my Gallery2 at: http://dichev.com/gallery/

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2007-08-09 15:21

The code above is for G2.2.x.
For G2.1.x, change:
{g->url params=$theme.pageUrl arg1="itemId=`$child.id`"}
to
{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}

 
dichev
dichev's picture

Joined: 2007-05-25
Posts: 15
Posted: Mon, 2007-09-10 11:05

Sorry for the delay in my answer. Static URLs are working now.
It was my mistake, I have forgotten to tell you the Gallery version.
Big thanks, mindless!
- - -
See my Gallery2 at: http://dichev.com/gallery/

 
WebKat
WebKat's picture

Joined: 2002-11-22
Posts: 182
Posted: Mon, 2009-12-28 21:03

mindless: I feel dumb, but I can't figure out how to do anything with the code here. I tried and broke it. Heh. Is it asking too much to ask if someone can make the change (allow custom frame choice in Siriux theme) and send me the modified file(s)? Pretty please?

>^,,^<
http://opalcat.com

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2009-12-28 21:37

Hey opalcat, what version of G2 are you using or testing out?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
WebKat
WebKat's picture

Joined: 2002-11-22
Posts: 182
Posted: Mon, 2009-12-28 21:42

The most recent one. 2.3.1.

>^,,^<
http://opalcat.com