forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: serg5777 on February 12, 2013, 06:04:40 pm

Title: Pagination CPG
Post by: serg5777 on February 12, 2013, 06:04:40 pm
I welcome you Αndré. There was one problem, please help to solve it.
I need to have the text describing the album (class = "albdesc") is only output on the first page of the album.
Here:
http://i51.fastpic.ru/big/2013/0212/f7/63afa4053e107645199fcdaed01a39f7.jpg

It is also necessary to class = "albdesc" was under the photo. Here:
http://i51.fastpic.ru/big/2013/0212/c6/3dd3c8999bfe1eb2588fff7327ebe0c6.jpg
Title: Re: Pagination CPG
Post by: Αndré on February 13, 2013, 09:09:27 am
I guess you're using this mod (http://forum.coppermine-gallery.net/index.php/topic,67900.0.html) to display the album description on the thumbnails page? If so, it works for me as expected.

Please also post a link to your gallery.
Title: Re: Pagination CPG
Post by: serg5777 on February 13, 2013, 09:51:59 am
Here is the link: http://www.krasivye-devushki.net/ :)
Title: Re: Pagination CPG
Post by: Αndré on February 13, 2013, 10:03:26 am
The album description is displayed for me on all three pages of that album: http://www.krasivye-devushki.net/thumbnails.php?album=2

Maybe I misunderstood your request. Do you want to display the album description additionally at the bottom of each thumbnail page?
Title: Re: Pagination CPG
Post by: serg5777 on February 13, 2013, 10:06:19 am
Yes, at the bottom :)

I also want to description of the album is not duplicated on other pages, because it is bad for SEO :)
Title: Re: Pagination CPG
Post by: serg5777 on February 13, 2013, 10:10:57 am
I would also like to description of the album was not a question of solid text, and was divided into paragraphs. And so you can use BB-code to identify the keys to the <strong> tag, well, the same as in the file anycontent.php
Title: Re: Pagination CPG
Post by: Αndré on February 13, 2013, 10:28:17 am
So you want to display the album description above and below the thumbnails, but just on the first thumbnail page of each album, correct?
Title: Re: Pagination CPG
Post by: serg5777 on February 13, 2013, 10:30:52 am
Yes, the thumbnails below, and only on the first page of each album :)
Title: Re: Pagination CPG
Post by: serg5777 on February 13, 2013, 10:44:56 am
Just below the thumbnails! Otherwise, why would two of the same type on a page!? :)
Title: Re: Pagination CPG
Post by: Αndré on February 13, 2013, 11:44:38 am
Undo your current mod to remove the album description above the thumbnails.

Copy function theme_display_thumbnails to your themes theme.php file if it doesn't exists. Then, find
Code: [Select]
    CPGPluginAPI::action('theme_thumbnails_wrapper_end', null);and replace with
Code: [Select]
    CPGPluginAPI::action('theme_thumbnails_wrapper_end', null);

    if ($page == 1) {
        echo $CURRENT_ALBUM_DATA['description'];
    }
Title: Re: Pagination CPG
Post by: serg5777 on February 13, 2013, 12:05:36 pm
Thank you very much Αndré, it works. And tell me how I can do to be able to use bb-code? And so you can share the text into paragraphs?
Here:
http://i51.fastpic.ru/big/2013/0213/0a/065eb799ffbba437c615ab240de5010a.jpg
Title: Re: Pagination CPG
Post by: Αndré on February 13, 2013, 12:47:32 pm
Use this code:
Code: [Select]
    CPGPluginAPI::action('theme_thumbnails_wrapper_end', null);

    if ($page == 1) {
        echo bb_decode($CURRENT_ALBUM_DATA['description']);
    }
Title: Re: Pagination CPG
Post by: serg5777 on February 13, 2013, 12:57:31 pm
Since paragraphs worked and tagged unfortunately not :(
Here:
http://i54.fastpic.ru/big/2013/0213/99/da019d6459c5c7fa6d182f7633634099.jpg
Title: Re: Pagination CPG
Post by: Αndré on February 13, 2013, 01:02:38 pm
Use [b] instead of [strong].
Title: Re: Pagination CPG
Post by: serg5777 on February 13, 2013, 01:07:32 pm
Thank you very much, I'll know now :)

I'll probably already tired at all, I only have one last question for.These pages are doubles:
http://www.krasivye-devushki.net/thumbnails.php?album=2
and
http://www.krasivye-devushki.net/thumbnails.php?album=2&page=1

Can I make the page to http://www.krasivye-devushki.net/thumbnails.php?album=2&page=1, always appear as http://www.krasivye-devushki.net/thumbnails.php?album=2 ?
Title: Re: Pagination CPG
Post by: Αndré on February 13, 2013, 01:11:15 pm
That should be possible with an appropriate rewrite rule on web server level. Alternatively you have to modify the Coppermine code at probably various places.
Title: Re: Pagination CPG
Post by: serg5777 on February 13, 2013, 01:16:44 pm
In .htaccess 301 redirect? :)
Title: Re: Pagination CPG
Post by: Αndré on February 13, 2013, 02:07:59 pm
Try something like
Code: [Select]
RewriteEngine  on
RewriteCond %{QUERY_STRING} ^(.*)&page=1$ [NC]
RewriteRule ^thumbnails\.php$  http://www.krasivye-devushki.net/thumbnails.php?%1
Title: Re: Pagination CPG
Post by: serg5777 on February 13, 2013, 02:26:04 pm
Αndré once again thank you very much for the points that helped me optimize the photo gallery!  ;)
Title: Re: Pagination CPG
Post by: serg5777 on March 01, 2013, 09:28:14 am
Good day Andre!
I can not set the style in anycontent.php, namely:
Code: [Select]
echo <<< EOT
    <tr>
        <td class="tableb">
text
</td>
    </tr>

EOT;

endtable();

When it is added before the line:
Code: [Select]
CPGPluginAPI::action('theme_thumbnails_wrapper_end', null);Gallery stops working.

Please tell me where I need to insert these tags, it does not look very nice :)
Here are screenshots:
anycontent.php: http://i52.fastpic.ru/big/2013/0301/a0/8814355716320d3a5207f3b0a31a17a0.jpg
thumbnails: http://i54.fastpic.ru/big/2013/0301/4d/cef8f388f4f304d646037a681621a64d.jpg
Title: Re: Pagination CPG
Post by: Αndré on March 01, 2013, 09:33:09 am
I don't know what you try to accomplish and how anycontent.php is related to whatever you want to add before/after the plugin hook. Please post more details.
Title: Re: Pagination CPG
Post by: serg5777 on March 01, 2013, 09:37:11 am
I wish that was the same table, and style of text in the description of each album in anycontent.php
Please come to my gallery and look :)
Title: Re: Pagination CPG
Post by: serg5777 on March 01, 2013, 09:54:48 am
Andre, It does not matter of course, but I would like to make it all aesthetically pleasing :)
Title: Re: Pagination CPG
Post by: serg5777 on March 01, 2013, 10:33:05 am
Here again, just so you know what I mean ;)
anycontent.php - tableb: http://i54.fastpic.ru/big/2013/0301/74/2bc1adddd71475aebad58d079a41a974.jpg
thumbnails - not tableb: http://i51.fastpic.ru/big/2013/0301/15/dd34431041b572bcdc76cdb5b4539b15.jpg
Title: Re: Pagination CPG
Post by: serg5777 on March 01, 2013, 10:34:53 am
In style.css
Code: [Select]
.tableb {
    background: #F2F5F7 ;
    padding-top: 3px;
    padding-right: 5px;
    padding-bottom: 3px;
    padding-left: 5px;
}
Title: Re: Pagination CPG
Post by: Αndré on March 01, 2013, 11:35:27 am
Undo your current mod. Then, find
Code: [Select]
    endtable();
    CPGPluginAPI::action('theme_thumbnails_wrapper_end', null);
and above, add
Code: [Select]
    if ($page == 1) {
        echo '<tr><td class="tableb" colspan="'.$thumbcols.'">'.bb_decode($CURRENT_ALBUM_DATA['description']).'</td></tr>';
    }
Title: Re: Pagination CPG
Post by: serg5777 on March 01, 2013, 11:50:35 am
Thank you very much Andre!  :)