forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Visuals => Topic started by: Makc666 on June 07, 2007, 06:24:49 pm

Title: [MOD] Displaying last additions for particular category
Post by: Makc666 on June 07, 2007, 06:24:49 pm
This one is for:
Modifications/Add-Ons/Hacks
Mods: Visuals
http://forum.coppermine-gallery.net/index.php?board=82.0
CPG 1.4.x
Tested with 1.4.10

Description:
If you want to display last additions for particular category this modification is for you.

1.
Open file:
index.php

2.
Find code:
Code: [Select]
                    case 'anycontent':
                        if ($cat == 0) {
                            ob_start();
                            /**
                             * Any php code or HTML can be put in this file and will be displayed
                             */
                            include('anycontent.php');
                            $anycontent = CPGPluginAPI::filter('anycontent',ob_get_contents());
                            ob_end_clean();
                            echo ($anycontent);
                        }
                        flush();
                        break;

3.
After add code:
Code: [Select]
                    case 'anycontent2':
                        if ($cat == 0) {
                            ob_start();
                            /**
                             * Any php code or HTML can be put in this file and will be displayed
                             */
                            include('anycontent2.php');
                            $anycontent2 = CPGPluginAPI::filter('anycontent2',ob_get_contents());
                            ob_end_clean();
                            echo ($anycontent2);
                        }
                        flush();
                        break;

4.
Go to:
"Config" -> "Album list view" -> "The content of the main page"

5.
Add in the beginnig of the line:
anycontent2,3/

So, for example, you will have line:
anycontent2,3/lastup,3/random,1/breadcrumb/catlist/alblist

6.
Download file:
anycontent2.zip

7.
Unpack from archive and open it in any text editor the file:
anycontent2.php

8.
Find block of code:
Code: [Select]
////////////////////////
//Category number
$cat2 = 2;
////////////////////////

9.
Set $cat2 (line 39) to the category number you need and save the file.

10.
Find block of code:
Code: [Select]
////////////////////////
//Case type (look below for avaliable types)
$case2 = 'lastup';
////////////////////////

11.
Set $case2 (line 42) to the case type you need and save the file.


12.
Upload to the gallery root that file:
anycontent2.php

P.S. There is also a line in anycontent2.php:
Code: [Select]
starttable("100%", "Powered by Coppermine Photo Gallery Forum and Makc666");You can comment it out (add double slashes // at the beginning of the line)
or
change to any text you like :P
Title: Re: [MOD] Displaying last additions for particular category
Post by: Makc666 on June 08, 2007, 08:12:35 am
I fixed one thing, so you can reupload the archive or change manually
$cat to $cat2 in line:
Code: [Select]
display_thumbnails2('lastup', $cat2, 1, $CONFIG['thumbcols'], max(1, $matches[2]), true);
Also you have to know what true means in line:
Code: [Select]
display_thumbnails2('lastup', $cat2, 1, $CONFIG['thumbcols'], max(1, $matches[2]), true);
If you set it to true and you have more pictures in choosen category than you will have information bar at the bottom of that block.
Look at attached picture: anycontent2-true.png

If you set it to false than you will not have information bar at the bottom of that block.
Title: Re: [MOD] Displaying last additions for particular category
Post by: miamimees on June 14, 2007, 10:21:23 am
Was exactly, what I was looking for!
I wanted it so that lastup on the main page doesn't show anything from user albums.

Thanks a lot to the author!
Title: Re: [MOD] Displaying last additions for particular category
Post by: Makc666 on September 10, 2007, 03:41:43 pm
I updated the mod. You can redownload the file from the first post if you want.

Now you can select which case type you want to see in that block (chrisjd (http://forum.coppermine-gallery.net/index.php?action=profile;u=48364) asked me for this one).
Title: Re: [MOD] Displaying last additions for particular category
Post by: chrisjd on September 10, 2007, 06:43:06 pm
It works great and makes CPG more and more worthy to me! Many thanks from Germany to Moscow!
Title: Re: [MOD] Displaying last additions for particular category
Post by: dke on January 10, 2008, 08:41:50 pm
thank you, worked perfectly.
Title: Re: [MOD] Displaying last additions for particular category
Post by: elphie on April 11, 2008, 04:10:18 am
can you upload the "anycontent2.zip" to download?
Title: Re: [MOD] Displaying last additions for particular category
Post by: Joachim Müller on April 11, 2008, 09:01:19 am
It is attached to the very first posting in this thread. Please read the thread before replying.
Title: Re: [MOD] Displaying last additions for particular category
Post by: elphie on April 12, 2008, 03:03:22 am
It is attached to the very first posting in this thread. Please read the thread before replying.

I did read the thread. I read the whole thread actually, and I haven't found a download link for the zip file.
Title: Re: [MOD] Displaying last additions for particular category
Post by: elphie on April 12, 2008, 03:05:10 am
OK, nevermind, I just found it. My eyes have been deceiving me lately. Sorry.
Title: Re: [MOD] Displaying last additions for particular category
Post by: pixelroom on September 09, 2009, 04:41:03 pm
Sorry to dig up an old thread, but i was just wondering how to: instead of linking directly to the image I wanna link to the album view, because Im using this one a couple of times on the frontpage!
Title: Re: [MOD] Displaying last additions for particular category
Post by: Joachim Müller on September 14, 2009, 02:32:58 pm
Your question is not related at all to the thread you're on. Start your own thread and respect board rules (http://forum.coppermine-gallery.net/index.php/topic,55415.0.html) in the future.