Ads between rows of thumbnails

spankee

Joined: 2004-06-12
Posts: 51
Posted: Sat, 2006-07-29 15:06

I have been trying to put ads between the first and second rows of thumbnails when viewing an album. Any help would be much appreciated!
Patrick

 
spankee

Joined: 2004-06-12
Posts: 51
Posted: Tue, 2006-08-08 02:02

Is their code in gallery2 capable of placing items between rows? I know their is in version 1.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2006-08-08 04:03

If you are using matrix theme look for albums.tpl and you will find

{* Move to a new row *}
              {if ($childrenInColumnCount == $theme.params.columns)}
            </tr>

That code adds a </tr> when the loop counting the items equals the columns in the album settings.
I hope this helps.

Dave
____________________________________________________
Blog with G2 || Gallery Frames / Mods || G1 Test Gallery

 
spankee

Joined: 2004-06-12
Posts: 51
Posted: Wed, 2006-08-09 01:43

I was able to get ads between each and every row but it is beyond me how to place an ad only between the first and second row.
Any ideas?
Thanks

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2006-08-09 02:55

not tested but try somthing like:

{assign var="myAddvertWritten" value=0}
{* Move to a new row *}
              {if ($childrenInColumnCount == $theme.params.columns)}
{if ($myAddvertWritten < 1)}
<your JS here>
{assign var=myAddvertWritten value="`$myAddvertWritten+1`"}
            </tr>

I am a newbe whan it comes to loops in smarty.

Dave

 
spankee

Joined: 2004-06-12
Posts: 51
Posted: Wed, 2006-08-09 05:29
Quote:
I am a newbe whan it comes to loops in smarty.

And I am a little loopy.

I will give it a try real soon.
thanks for the help.

 
spankee

Joined: 2004-06-12
Posts: 51
Posted: Fri, 2006-08-11 03:05

I tried the code out but the thumbnails would not show up.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2006-08-11 04:04

This seems to work for me in the matrix theme:

              {* Move to a new row *}
              {if ($childrenInColumnCount == $theme.params.columns)}
              
            </tr>
            {if ($childrenInColumnCount == $theme.params.columns)}
            {if $advert == null}
            <tr><td>text</td></tr>
            {/if}
            {assign var="advert" value="true"}
            {/if}
            <tr valign="top">
              {assign var="childrenInColumnCount" value=0}
              {/if}

I included some code above and below for context.

Dave
____________________________________________________
Blog with G2 || Gallery Frames / Mods || G1 Test Gallery

 
spankee

Joined: 2004-06-12
Posts: 51
Posted: Fri, 2006-08-11 16:00

It is working for me as well!

Thanks for helping me out on this. I am sure many people will get some use out of this.
And with their increased revenue maybe they will think about donating back a percentage to Gallery

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2006-08-11 21:56

We would like all users to donate. If they don't have money thay can donate time.....as in this project time is very valuable.

Dave

____________________________________________________
Blog with G2 || Gallery Frames / Mods || G1 Test Gallery

 
spankee

Joined: 2004-06-12
Posts: 51
Posted: Sat, 2006-08-12 02:27

Oh no, I did not do a thorough enough job testing this out.
When using a wide advertisement it widens the first column--It acts as if it is in a cell.

Patrick

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2006-08-12 04:12

Something like:

              {* Move to a new row *}
              {if ($childrenInColumnCount == $theme.params.columns)}
              
            </tr>
            {if ($childrenInColumnCount == $theme.params.columns)}
            {if $advert == null}
            <tr><td colspan="{$theme.params.columns}">text</td></tr>
            {/if}
            {assign var="advert" value="true"}
            {/if}
            <tr valign="top">
              {assign var="childrenInColumnCount" value=0}
              {/if}

Does that work?

____________________________________________________
Blog with G2 || Gallery Frames / Mods || G1 Test Gallery

 
spankee

Joined: 2004-06-12
Posts: 51
Posted: Sat, 2006-08-12 04:47

Thank you Dave, It works great!

 
rotpar

Joined: 2007-02-26
Posts: 47
Posted: Fri, 2007-03-02 20:19

Do you have any idea how I can place the ads between say row 3 and 4? I can't figure that out. Thanks!

 
blacksburgpoker

Joined: 2005-11-26
Posts: 108
Posted: Wed, 2007-10-10 20:54

Hey,

I added my code (Google Adsense)... but it is only showing my ads between the first and second line and blank in the rest... Any idea why?

-------------------------
Nima | Limit Poker | Best of Internet

 
blacksburgpoker

Joined: 2005-11-26
Posts: 108
Posted: Tue, 2007-10-16 03:25

Can anyone help me out here?

Thanks
Nima

-------------------------
Nima | Limit Poker | Best of Internet

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2007-10-16 03:42

I don't think you can have more than 3 adverts per page.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Astor

Joined: 2005-12-15
Posts: 154
Posted: Mon, 2007-11-26 13:26

Can i used this code in a specific album and its subalbums (example testalbum).
How a make it?
I have used this script but not work

              {* Move to a new row *}

             {if $theme.item.title == 'testalbum'}
              {if ($childrenInColumnCount == $theme.params.columns)}
              
            </tr>
            {if ($childrenInColumnCount == $theme.params.columns)}
            {if $advert == null}
            <tr><td colspan="{$theme.params.columns}">text</td></tr>
            {/if}
            {assign var="advert" value="true"}
            {/if}
            <tr valign="top">
              {assign var="childrenInColumnCount" value=0}
              {/if}
             {/if}

Any solutions?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2007-11-27 05:05

perhaps your {if} statements don't match as

{if $theme.item.title == 'testalbum'}
test
{/if}

seems to work for me.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Astor

Joined: 2005-12-15
Posts: 154
Posted: Tue, 2007-11-27 10:11
floridave wrote:
{if $theme.item.title == 'testalbum'}
test
{/if}

But, I have been trying to put ads between the first and second rows only in album and sub-album 'testalbum' and not in all gallery.
I have replaced the word 'test' with the code in the post over, but he does not work.
Other solutions?

Excuse bad english
_____________________________________________

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2007-11-27 14:44

Try with the word test first. Then make simple steps first don't add all the {if} statments at once to see where the typo or error come up.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Astor

Joined: 2005-12-15
Posts: 154
Posted: Wed, 2007-11-28 13:32

Ok . This code work, but only for the single album.I have eliminated the first
{if ($childrenInColumnCount == $theme.params.columns)}

{if $theme.item.title == 'testalbum'}
</tr>
            {if ($childrenInColumnCount == $theme.params.columns)}
            {if $advert == null}
            <tr><td colspan="{$theme.params.columns}">text</td></tr>
            {/if}
            {assign var="advert" value="true"}
            {/if}
            <tr valign="top">
              {assign var="childrenInColumnCount" value=0}
{/if}

If I modify with:

{if $theme.parent.title == 'testalbum'}
...
...

work for the subalbums and not in 'testalbum'.

Any solutions for 'testalbum' and his sub albums?
The code is good?

 
Slayergirl
Slayergirl's picture

Joined: 2007-09-12
Posts: 180
Posted: Wed, 2007-11-28 15:25

{if $theme.parent.title == 'testalbum' || $theme.item.title == 'testalbum'}

$theme.parent.title == 'testalbum' here you only look for the Parent so the item "testalbum" had another parent(root?)

|| = or
So you check if parent is testalbum or item title is test album

 
Astor

Joined: 2005-12-15
Posts: 154
Posted: Wed, 2007-11-28 16:33

Slayergirl : tnx work

If I want this case:
testalbum - text
testalbum2 - text2
...

I must use this code?

{if $theme.parent.title == 'testalbum' || $theme.item.title == 'testalbum'}
</tr>
            {if ($childrenInColumnCount == $theme.params.columns)}
            {if $advert == null}
            <tr><td colspan="{$theme.params.columns}">text</td></tr>
            {/if}
            {assign var="advert" value="true"}
            {/if}
            <tr valign="top">
              {assign var="childrenInColumnCount" value=0}
{/if}
{if $theme.parent.title == 'testalbum2' || $theme.item.title == 'testalbum2'}
</tr>
            {if ($childrenInColumnCount == $theme.params.columns)}
            {if $advert == null}
            <tr><td colspan="{$theme.params.columns}">text2</td></tr>
            {/if}
            {assign var="advert" value="true"}
            {/if}
            <tr valign="top">
              {assign var="childrenInColumnCount" value=0}
{/if}

...

Or this code can be become simpler?

 
bigu_c
bigu_c's picture

Joined: 2007-10-28
Posts: 421
Posted: Thu, 2008-01-03 16:13

@floridave: You're great!!!!

Thanks!

Exotic Car Wallpaper - Celebrity Wallpaper

 
DeathMarine

Joined: 2008-02-11
Posts: 9
Posted: Mon, 2008-02-11 08:36
      {if ($childrenInColumnCount == $theme.params.columns)}
            {if $advert == null}
            <tr><td colspan="{$theme.params.columns}">text</td></tr>
            {/if}
            {assign var="advert" value="true"}
            {/if}

this code works great but im having slight trouble with it. it only puts an ad in the first row. if i change the null to "true" i can get ads in every row EXCEPT between the first and second. can you tell me what to change so i can get an ad in between every row??

thank you very much!

EDIT: sorry, after hours of fiddling i finally figured it out. I just had to delete the second line and the first "{/if}" and it works the way i want! :D

sorry to bother you all.

 
kelawa

Joined: 2008-01-16
Posts: 23
Posted: Sun, 2008-03-23 17:52

mr dave .. how to add ads near thumbnails and near image block?

kameesh...

 
objected

Joined: 2008-04-13
Posts: 3
Posted: Mon, 2008-04-14 07:09

Is this possible in the siriux theme?

I've been poking around for awhile now can't seem to get it.

 
skunker

Joined: 2005-02-04
Posts: 344
Posted: Wed, 2008-04-16 13:59

Did anyone ever get this figured out for the Siriux theme?

 
Carvehicle.net

Joined: 2008-12-27
Posts: 28
Posted: Tue, 2008-12-30 17:25

I'm using ICE theme. I want to put Ads at the first row, but I was trying gang.can you help me

Thanks ^^

 
Carvehicle.net

Joined: 2008-12-27
Posts: 28
Posted: Wed, 2008-12-31 02:31

hi dave.I'm using ICE theme.
I want to place ads like the picture below, it must do.
I think the file itself in photo.tpl

Thanks

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2008-12-31 02:39

Yes that looks like photo.tpl to me. What have you tried?
Just add some letters to the file and you will see where they show up. Then you will find where to add your code.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Carvehicle.net

Joined: 2008-12-27
Posts: 28
Posted: Wed, 2008-12-31 05:24

I want to insert ads (160x600) such as this. http://gallery.menalto.com/files/car.JPG
I tried. But it still failed

I'm Vietnamese to write English very bad. Sorry ^^!

you will help me

Thanks You

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2008-12-31 05:40
Quote:
I tried. But it still failed

What did you try? What file did you edit?
I am not going to do the work for you but will help if you get stuck.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Carvehicle.net

Joined: 2008-12-27
Posts: 28
Posted: Wed, 2008-12-31 06:07

I own and then edit it thank you very much ^ ^!

I want to ask some one.

is my site http://carvehicle.net.

i want the link http://carvehicle.net but not this http://carvehicle.net/main.php
i want the link http://www.carvehicle.net but not this http://carvehicle.net

totalize one link I want to complete the following http://www.carvehicle.net

I have to do

thanks Dave ^^!

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2008-12-31 14:41
Quote:
i want the link http://carvehicle.net but not this http://carvehicle.net/main.php
i want the link http://www.carvehicle.net but not this http://carvehicle.net

I don't see how that is related to this topic.
but try:
FAQ: Can I rename main.php?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Carvehicle.net

Joined: 2008-12-27
Posts: 28
Posted: Wed, 2008-12-31 17:55

Thanks Floridave ^^!