Support Forum Project Downloads FAQ Documentation About Demo Tutorials Blog Plugins
November 21, 2009, 01:38:28 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Maintenance release cpg1.4.25 - upgrade recommended
The Coppermine development team is releasing an update for Coppermine in order to fix an issue with http uploads that could occur in particular versions of PHP.The fix is not security-critical, so if your gallery is running fine with cpg1.4.23 or cpg1.4.24 you don't need to upgrade. If you are running an older version than cpg1.4.23, you must update to this latest version as soon as possible because of the security impact (the past few maintenance releases before cpg1.4.24 all were security-related).
[more]
   Home   Help Search Board rules Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: [MOD] Displaying last additions for particular category  (Read 7825 times)
0 Members and 1 Guest are viewing this topic.
Makc666 Topic starter
Translator
**
Gender: Male
Russian Federation Russian Federation

Posts: 1105


Русский (ISO-8859-1) - Russian - Ðóññêèé (Windows)


WWW
« on: June 07, 2007, 05: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:
                    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:
                    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:
////////////////////////
//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:
////////////////////////
//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:
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 Tongue
« Last Edit: January 19, 2008, 03:20:58 pm by Joachim Müller » Logged

(http://makc666.com/wedont.gif) "А стукачков мы не любим!"

Официальный Русский Перевод - 1.4.x

[MOD] Restriction of email domains
Makc666 Topic starter
Translator
**
Gender: Male
Russian Federation Russian Federation

Posts: 1105


Русский (ISO-8859-1) - Russian - Ðóññêèé (Windows)


WWW
« Reply #1 on: June 08, 2007, 07:12:35 am »

I fixed one thing, so you can reupload the archive or change manually
$cat to $cat2 in line:
Code:
display_thumbnails2('lastup', $cat2, 1, $CONFIG['thumbcols'], max(1, $matches[2]), true);

Also you have to know what true means in line:
Code:
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

(http://makc666.com/wedont.gif) "А стукачков мы не любим!"

Официальный Русский Перевод - 1.4.x

[MOD] Restriction of email domains
miamimees
Coppermine newbie

Posts: 2


« Reply #2 on: June 14, 2007, 09: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 Topic starter
Translator
**
Gender: Male
Russian Federation Russian Federation

Posts: 1105


Русский (ISO-8859-1) - Russian - Ðóññêèé (Windows)


WWW
« Reply #3 on: September 10, 2007, 02: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

(http://makc666.com/wedont.gif) "А стукачков мы не любим!"

Официальный Русский Перевод - 1.4.x

[MOD] Restriction of email domains
chrisjd
Coppermine newbie

Posts: 1


« Reply #4 on: September 10, 2007, 05:43:06 pm »

It works great and makes CPG more and more worthy to me! Many thanks from Germany to Moscow!
Logged
je001
Coppermine frequent poster
***
Posts: 231


« Reply #5 on: January 10, 2008, 07:41:50 pm »

thank you, worked perfectly.
Logged
elphie
Coppermine newbie

Posts: 10


« Reply #6 on: April 11, 2008, 03:10:18 am »

can you upload the "anycontent2.zip" to download?
Logged
Joachim Müller
Administrator
*****
Gender: Male
Germany Germany

Posts: 45051


aka "GauGau"


WWW
« Reply #7 on: April 11, 2008, 08:01:19 am »

It is attached to the very first posting in this thread. Please read the thread before replying.
Logged
elphie
Coppermine newbie

Posts: 10


« Reply #8 on: April 12, 2008, 02: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

Posts: 10


« Reply #9 on: April 12, 2008, 02:05:10 am »

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

Sweden Sweden

Posts: 1


« Reply #10 on: September 09, 2009, 03: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 Müller
Administrator
*****
Gender: Male
Germany Germany

Posts: 45051


aka "GauGau"


WWW
« Reply #11 on: September 14, 2009, 01: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
  Print  
 
Jump to:  

Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC
Page created in 0.048 seconds with 17 queries.