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 [2]   Go Down

Author Topic: Hide albums from latest and random  (Read 45360 times)

0 Members and 1 Guest are viewing this topic.

Nibbler

  • Guest
Re: Hide albums from latest and random
« Reply #20 on: February 04, 2006, 01:20:15 pm »

Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Hide albums from latest and random
« Reply #21 on: February 04, 2006, 04:08:47 pm »

I'm of the opinion that hooks should only change between major revisions like 1.4 and 1.5.

I also think that we need to rethink the placement of some of the existing plugin hooks, and we need more consistency in naming.  The place to make these changes are in the devel version, not stable.
Donnoman is absolutely right, that's something we agreed upon: no hooks (which would equal a new feature) will be added for an existing release to avoid confusion what version of a plugin will work with which version of coppermine. Only bug-fixes are permitted to be added to the cvs of a stable release. New features must only be added to the devel branch.
Logged

txspaderz

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Hide albums from latest and random
« Reply #22 on: April 26, 2006, 05:05:05 am »

I'm trying to do this:  I want to keep from displaying one whole category.  I have a NSFW Gallery, that I don't want to be shown on the main page only.  I have blocked all the albums, but now when I go to that particular category, where I have blocked all the albums, I get an error: 
Critical error
There was an error while processing a database query 

Any suggestions?
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Hide albums from latest and random
« Reply #23 on: September 18, 2006, 04:46:19 am »

I just noticed today that the plugin causes the items in excluded album not to show up even when viewing the album: http://takethu.com/thumbnails.php?album=73

If I uninstall the plugin, the thumbnails show up. I downloaded the plugin again and did a diff and the only difference to my code is the list of excluded album ids.
Logged

Stifler

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Hide albums from latest and random
« Reply #24 on: October 16, 2006, 09:31:58 pm »

Does this work?
Logged

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: Hide albums from latest and random
« Reply #25 on: October 17, 2006, 05:17:06 am »

Logged

Stifler

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Hide albums from latest and random
« Reply #26 on: October 19, 2006, 01:36:58 am »

Thank you donnoman.
Logged

Nibbler

  • Guest
Re: Hide albums from latest and random
« Reply #27 on: November 13, 2006, 11:37:19 pm »

Try this code as codebase.php. It suppresses the filters when viewing the albums directly and is coded more simply.

Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2005 Coppermine Dev Team
  v1.1 originaly written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  ********************************************
  Coppermine version: 1.4.2
**********************************************/

if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');

$thisplugin->add_filter('plugin_block','remove_meta_albs'); //index.php

if (!$_GET['cat']) {
$thisplugin->add_filter('post_breadcrumb','remove_meta_albs'); //thumbnails.php
if (!is_numeric($_GET['album'])) $thisplugin->add_filter('displayimage_init','remove_meta_albs'); //displayimage.php (MODDED PLUGIN HOOK)
}

function 
filter_meta_album() {

global $META_ALBUM_SET,$ALBUM_SET;
    
    
$unwanted_albs=array(45);
$META_ALBUM_SET.= ' AND aid NOT IN ('.implode(',',$unwanted_albs).')';
    if (
defined('DISPLAYIMAGE_PHP')) $ALBUM_SET $META_ALBUM_SET;
}

function 
remove_meta_albs($return) {
    
    static 
$run_once;
    if (!
$run_once) {
        
filter_meta_album();
        
$run_once=true;
    }
    return 
$return;
}
Logged

studeo

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 50
Re: Hide albums from latest and random
« Reply #28 on: November 14, 2006, 12:28:43 am »

Thanks, That works better except for one issue.

If the excluded album is the ONLY album of a given member, when you click on that gallery from the index the latest addition and random image block under that album report "No images to display" You can click the one main album thumbnail to get to the thumbnail page however.

Thank You.
Logged

Prowler9

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 29
Re: Hide albums from latest and random
« Reply #29 on: December 02, 2006, 05:11:07 am »

Ok well I installed and did everything it says to do and I only have one problem.  Well when I click pictures in the filtered album i get No image to display. Is there something else I need to edit?? If so let me know thanks again for your time reading this post
Logged

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: Hide albums from latest and random
« Reply #30 on: December 03, 2006, 01:35:58 am »

I just released Unwanted_Metas 2.0 that eliminates the need for  modding displayimage.php and has fixed all of the known issues, and includes a graphical interface to select the albums.

http://cpg-contrib.org/board/index.php?board=31.0
Logged

studeo

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 50
Re: Hide albums from latest and random
« Reply #31 on: December 03, 2006, 02:52:14 pm »

Thanks for a new plugin.  If I may comment: The selection list only lists my own albums and shared albums....Some of the excludes I would do are uselessly large member galleries...they are not listed in the drop-down list...where can I add their album ID to the code manually since I cannot select them automatically?

Thank You Donnoman
Logged

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: Hide albums from latest and random
« Reply #32 on: December 03, 2006, 06:33:18 pm »

unwanted_metas 2.1

12-03-2006 Added support for removing user albums
12-03-2006 Widened the configuration list box

http://sourceforge.net/project/showfiles.php?group_id=132063&package_id=213644

If you are looking for support on a cpg-contrib plugin the best place to get it (because I check there more often) is on the cpg-contrib forums

http://cpg-contrib.org/board/index.php?board=31.0
Logged

studeo

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 50
Re: Hide albums from latest and random
« Reply #33 on: December 03, 2006, 11:21:42 pm »

Very nice plugin! Extremely useful.

One point though: If I exclude a user album and its 'the only' album by that user, no images are displayed on their album page except for the main gallery image at the top table. It makes sense that the album is excluded from all meta albums (random, latest). Is there anyway to isolate the exclusion to take effect on the index page only so it is not global?

Thanks again for the nice plugin!

Studeo
Logged

Prowler9

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 29
Re: Hide albums from latest and random
« Reply #34 on: December 04, 2006, 02:18:19 am »

Thank you sir ;)
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Hide albums from latest and random
« Reply #35 on: December 04, 2006, 03:55:24 am »

One point though: If I exclude a user album and its 'the only' album by that user, no images are displayed on their album page except for the main gallery image at the top table. It makes sense that the album is excluded from all meta albums (random, latest). Is there anyway to isolate the exclusion to take effect on the index page only so it is not global?
Why do you reply here? Donnoman told you were to turn for support. ::)
Logged
Pages: 1 [2]   Go Up
 

Page created in 0.03 seconds with 20 queries.