Advanced search  

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]

Pages: [1]   Go Down

Author Topic: [MOD] Displaying last additions for particular category  (Read 21663 times)

0 Members and 1 Guest are viewing this topic.

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - (Windows)
    • Makc's home page
[MOD] Displaying last additions for particular category
« 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.

  • 'lastup': last uploads
  • 'random': random files (setting this one to random files for huge categories with more than 10,000 pics might result in performance problems; change to something else in this case)
  • 'lastcom': last comments
  • 'topn': most viewed
  • 'toprated': top rated
  • 'lasthits': last viewed
  • 'lastalb': last albums to which uploads
  • 'favpics': particular user's favourite pictures sorted by last uploads

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
« Last Edit: January 19, 2008, 04:20:58 pm by Joachim Mller »
Logged

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - (Windows)
    • Makc's home page
Re: [MOD] Displaying last additions for particular category
« Reply #1 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.
Logged

miamimees

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: [MOD] Displaying last additions for particular category
« Reply #2 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!
Logged

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - (Windows)
    • Makc's home page
Re: [MOD] Displaying last additions for particular category
« Reply #3 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 asked me for this one).
  • 'lastup': last uploads
  • 'random': random files (setting this one to random files for huge categories with more than 10,000 pics might result in performance problems; change to something else in this case)
  • 'lastcom': last comments
  • 'topn': most viewed
  • 'toprated': top rated
  • 'lasthits': last viewed
  • 'lastalb': last albums to which uploads
  • 'favpics': particular user's favourite pictures sorted by last uploads
Logged

chrisjd

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: [MOD] Displaying last additions for particular category
« Reply #4 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!
Logged

dke

  • Guest
Re: [MOD] Displaying last additions for particular category
« Reply #5 on: January 10, 2008, 08:41:50 pm »

thank you, worked perfectly.
Logged

elphie

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: [MOD] Displaying last additions for particular category
« Reply #6 on: April 11, 2008, 04:10:18 am »

can you upload the "anycontent2.zip" to download?
Logged

Joachim Mller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: [MOD] Displaying last additions for particular category
« Reply #7 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.
Logged

elphie

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: [MOD] Displaying last additions for particular category
« Reply #8 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.
Logged

elphie

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: [MOD] Displaying last additions for particular category
« Reply #9 on: April 12, 2008, 03:05:10 am »

OK, nevermind, I just found it. My eyes have been deceiving me lately. Sorry.
Logged

pixelroom

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: [MOD] Displaying last additions for particular category
« Reply #10 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!
Logged

Joachim Mller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: [MOD] Displaying last additions for particular category
« Reply #11 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 in the future.
Logged
Pages: [1]   Go Up
 

Page created in 0.061 seconds with 20 queries.