forum.coppermine-gallery.net
No Support => Modifications/Add-Ons/Hacks => Mods: Visuals => Topic started 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:
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:
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:
////////////////////////
//Category number
$cat2 = 2;
////////////////////////
9.
Set $cat2 (line 39) to the category number you need and save the file.
10.
Find block of 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:
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
-
I fixed one thing, so you can reupload the archive or change manually
$cat to $cat2 in line:
display_thumbnails2('lastup', $cat2, 1, $CONFIG['thumbcols'], max(1, $matches[2]), true);
Also you have to know what true means in line:
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.
-
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!
-
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).
- '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
-
It works great and makes CPG more and more worthy to me! Many thanks from Germany to Moscow!
-
thank you, worked perfectly.
-
can you upload the "anycontent2.zip" to download?
-
It is attached to the very first posting in this thread. Please read the thread before replying.
-
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.
-
OK, nevermind, I just found it. My eyes have been deceiving me lately. Sorry.
-
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!
-
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.