Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Wrapp content in a diffrent div after each 10...  (Read 8847 times)

0 Members and 1 Guest are viewing this topic.

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Wrapp content in a diffrent div after each 10...
« on: February 28, 2014, 02:13:35 pm »

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
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Wrapp content in a diffrent div after each 10...
« Reply #1 on: February 28, 2014, 02:16:51 pm »

and for the album list too.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Wrapp content in a diffrent div after each 10...
« Reply #2 on: February 28, 2014, 03:48:32 pm »

I don't get what you ask for.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Wrapp content in a diffrent div after each 10...
« Reply #3 on: February 28, 2014, 04:23:25 pm »

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>
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4886
    • Windsurf.me
Re: Wrapp content in a diffrent div after each 10...
« Reply #4 on: February 28, 2014, 04:50:41 pm »

Why every 10?
Logged
It is a mistake to think you can solve any major problems just with potatoes.

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Wrapp content in a diffrent div after each 10...
« Reply #5 on: February 28, 2014, 05:08:50 pm »

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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Wrapp content in a diffrent div after each 10...
« Reply #6 on: March 05, 2014, 02:17:06 pm »

I'm sure this can be done near
Code: [Select]
        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
Code: [Select]
echo $header;and below, add
Code: [Select]
echo '<div class="albThDiv1">';
find
Code: [Select]
        if ((($i % $thumbcols) == 0) && ($i < count($thumb_list))) {
            echo $row_separator;
        }
and below, add
Code: [Select]
        if ((($i % 10) == 0) && ($i < count($thumb_list))) {
            echo '<div class="albThDiv'.($i / 10 + 1).'">';
        }

find
Code: [Select]
echo $footer;and above, add
Code: [Select]
echo '</div>';
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Wrapp content in a diffrent div after each 10...
« Reply #7 on: March 05, 2014, 09:45:39 pm »

Empty div1,div2,div3 before each maintable that contains the thumbnails.
I used a clean curve theme.
« Last Edit: March 05, 2014, 10:13:24 pm by allvip »
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Wrapp content in a diffrent div after each 10...
« Reply #8 on: March 05, 2014, 11:35:44 pm »

Please post the actual HTML output.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Wrapp content in a diffrent div after each 10...
« Reply #9 on: March 06, 2014, 02:07:27 pm »

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

Code: [Select]
<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>
« Last Edit: March 06, 2014, 02:16:35 pm by allvip »
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Wrapp content in a diffrent div after each 10...
« Reply #10 on: March 06, 2014, 02:15:27 pm »

album thumbnails:

Code: [Select]
<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>
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Wrapp content in a diffrent div after each 10...
« Reply #11 on: March 06, 2014, 02:17:43 pm »

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.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Wrapp content in a diffrent div after each 10...
« Reply #12 on: March 06, 2014, 02:57:45 pm »

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

« Last Edit: March 19, 2014, 05:26:55 pm by allvip »
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Wrapp content in a diffrent div after each 10...
« Reply #13 on: March 14, 2014, 11:33:44 am »

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

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Wrapp content in a diffrent div after each 10...
« Reply #14 on: March 19, 2014, 05:17:54 pm »

Thanks a lot for your help.it worked for the divs no tables version.

how to replace tables with divs:

http://forum.coppermine-gallery.net/index.php/topic,76836.msg371239.html#msg371239
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Wrapp content in a diffrent div after each 10...
« Reply #15 on: January 30, 2015, 09:24:56 pm »

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.
Logged
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 20 queries.