Wrapp content in a diffrent div after each 10... Wrapp content in a diffrent div after each 10...
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Wrapp content in a diffrent div after each 10...

Started by allvip, February 28, 2014, 02:13:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

allvip

I want to wrapp thumbnails on meta albums,actual meta albums,albums thumbnails and category div (catrow)

all pages with diffrent class:meta albums (for all meta albums - metaAlbumsDiv1,metaAlbumsDiv2 etc),actual meta (for all actual meta-actualMeta Div1,actualMeta Div2 etc),albums thumbnails(albThDiv1,albThDiv2 etc),category(CatrowWrappDiv1,Catrow WrappDiv2 etc)

Like this:
view attachment

allvip


Αndré


allvip

example: Album1 has 30 images that means on the album thumbnails page will show 30 thumbnails.
I want to divide them in divs after every 10 thumbnails:

<div class="cpg_main_block_inner">
  <div class="maintable">
  <div class="albThDiv1"><div class="thumbnails">thumb_image_1.jpg</div> <div class="thumbnails">thumb_image_2.jpg</div> <div class="thumbnails">thumb_image_3.jpg</div> <div class="thumbnails">thumb_image_4.jpg</div> <div class="thumbnails">thumb_image_5.jpg</div> <div class="thumbnails">thumb_image_6.jpg</div> <div class="thumbnails">thumb_image_7.jpg</div> <div class="thumbnails">thumb_image_8.jpg</div> <div class="thumbnails">thumb_image_9.jpg</div> <div class="thumbnails">thumb_image_10.jpg</div></div>
<div class="albThDiv2"><div class="thumbnails">thumb_image_11.jpg</div> <div class="thumbnails">thumb_image_12.jpg</div> <div class="thumbnails">thumb_image_13.jpg</div> <div class="thumbnails">thumb_image_14.jpg</div> <div class="thumbnails">thumb_image_15.jpg</div> <div class="thumbnails">thumb_image_16.jpg</div> <div class="thumbnails">thumb_image_17.jpg</div> <div class="thumbnails">thumb_image_18.jpg</div> <div class="thumbnails">thumb_image_19.jpg</div> <div class="thumbnails">thumb_image_20.jpg</div></div>
<div class="albThDiv3"><div class="thumbnails">thumb_image_21.jpg</div> <div class="thumbnails">thumb_image_22.jpg</div> <div class="thumbnails">thumb_image_23.jpg</div> <div class="thumbnails">thumb_image_24.jpg</div> <div class="thumbnails">thumb_image_25.jpg</div> <div class="thumbnails">thumb_image_26.jpg</div> <div class="thumbnails">thumb_image_27.jpg</div> <div class="thumbnails">thumb_image_28.jpg</div> <div class="thumbnails">thumb_image_29.jpg</div> <div class="thumbnails">thumb_image_30.jpg</div></div>

  </div>
</div>

phill104

It is a mistake to think you can solve any major problems just with potatoes.

allvip

every 5,every 15 or 5 in div1,10 in div2. it does not mater.I just want to group thumbnails and have diffrent style for every group for a crazy looking page.

Αndré

I'm sure this can be done near
        if ((($i % $thumbcols) == 0) && ($i < count($thumb_list))) {
            echo $row_separator;
        }

in the function theme_display_thumbnails. As Coppermine uses a table layout out of the box, this will probably produce invalid HTML code.


I haven't tested the following modification, but it should work.

Find
echo $header;
and below, add
echo '<div class="albThDiv1">';

find
        if ((($i % $thumbcols) == 0) && ($i < count($thumb_list))) {
            echo $row_separator;
        }

and below, add
        if ((($i % 10) == 0) && ($i < count($thumb_list))) {
            echo '<div class="albThDiv'.($i / 10 + 1).'">';
        }


find
echo $footer;
and above, add
echo '</div>';

allvip

#7
Empty div1,div2,div3 before each maintable that contains the thumbnails.
I used a clean curve theme.

Αndré


allvip

#9
with firebug - index.php with lastup,random etc thumbnails:


<div id="cpg_main_block_outer">
<div class="cpg_main_block_inner">
<table class="maintable " width="100%" cellspacing="1" cellpadding="0" align="center">
<img width="1" border="" height="7" alt="" src="images/spacer.gif">
<br>
<table class="maintable " width="100%" cellspacing="1" cellpadding="0" align="center">
<img width="1" border="" height="7" alt="" src="images/spacer.gif">
<br>
<div class="albThDiv1"> </div>
<div class="albThDiv2"> </div>
<div class="albThDiv3"> </div>
<table class="maintable " width="100%" cellspacing="1" cellpadding="0" align="center">
<tbody>
<tr>
<tr>
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
</tr>
<tr>
<tr>
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
</tr>
<tr>
<tr>
</tbody>
</table>
<img width="1" border="" height="7" alt="" src="images/spacer.gif">
<br>
<div class="albThDiv1"> </div>
<div class="albThDiv2"> </div>
<div class="albThDiv3"> </div>
<div class="albThDiv4"> </div>
<div class="albThDiv5"> </div>
<div class="albThDiv6"> </div>
<table class="maintable " width="100%" cellspacing="1" cellpadding="0" align="center">
<tbody>
<tr>
<tr>
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
</tr>
<tr>
<tr>
<tr>
<tr>
<tr>
<tr>
<tr>
<tr>
<tr>
<tr>
</tbody>
</table>
<img width="1" border="" height="7" alt="" src="images/spacer.gif">
<br>
<div class="albThDiv1"> </div>
<div class="albThDiv2"> </div>
<div class="albThDiv3"> </div>
<div class="albThDiv4"> </div>
<div class="albThDiv5"> </div>
<div class="albThDiv6"> </div>
<table class="maintable " width="100%" cellspacing="1" cellpadding="0" align="center">
<tbody>
<tr>
<tr>
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
</tr>
<tr>
<tr>
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
</tr>
<tr>
<tr>
<tr>
<tr>
<tr>
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
</tr>
<tr>
<tr>
<tr>
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
</tr>
<tr>
</tbody>
</table>
<img width="1" border="" height="7" alt="" src="images/spacer.gif">
<br>
<br>
</div>
</div>

allvip

album thumbnails:


<div id="cpg_main_block_outer">
<div class="cpg_main_block_inner">
<table class="maintable " width="100%" cellspacing="1" cellpadding="0" align="center">
<img width="1" border="" height="7" alt="" src="images/spacer.gif">
<br>
<div class="albThDiv1"> </div>
<div class="albThDiv2"> </div>
<div class="albThDiv3"> </div>
<div class="albThDiv4"> </div>
<div class="albThDiv5"> </div>
<div class="albThDiv6"> </div>
<div class="albThDiv7"> </div>
<div class="albThDiv8"> </div>
<div class="albThDiv9"> </div>
<div class="albThDiv10"> </div>
<table class="maintable " width="100%" cellspacing="1" cellpadding="0" align="center">
<tbody>
<tr>
<tr>
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
</tr>
<tr>
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
<td class="thumbnails" width="20%" valign="top" align="center">
</tr>
<tr>
<tr>
<tr>
<tr>
<tr>
<tr>
<tr>
<tr>
<tr>
<tr>
<tr>
<tr>
<tr>
<tr>
<tr>
<tr>
<tr>
<tr>
<tr>
</tbody>
</table>
<img width="1" border="" height="7" alt="" src="images/spacer.gif">
<br>
<br>
</div>
</div>

Αndré

As Firebug re-arranges the HTML source code, please don't use it to get the actual HTML source code. Instead, please use your browser's built-in feature or post a link to your gallery where we can check it ourselves.

allvip

#12
I removed the links because I deleted the curve themes from the server.


Αndré

Please try to replace
        if ((($i % 10) == 0) && ($i < count($thumb_list))) {
            echo '<div class="albThDiv'.($i / 10 + 1).'">';
        }

with
        if ((($i % 10) == 0) && ($i < count($thumb_list))) {
            echo '</div><div class="albThDiv'.($i / 10 + 1).'">';
        }

allvip


allvip

for Andre

I know I asked support for many custom php and I give up using it, but is because I had to.
I wanted to make a really awesome theme and with big thumbnails but is not possible.
My gallery is always near or over my CPU and MySql time.
In a few months I have to decide to move to a VPN or cancell the gallery.

That to explain why I asked so many questions and I am not using most of them.
Thanks a lot.