forum.coppermine-gallery.net

Support => cpg1.4 plugins => cpg1.4.x Support => Older/other versions => cpg1.4 plugin contributions => Topic started by: mil1616 on June 15, 2009, 04:52:07 pm

Title: Hide categories independantly for unregistered users
Post by: mil1616 on June 15, 2009, 04:52:07 pm
Hello

This plugin allows you to hide categories from unregistered users in the index page.
You can specify in the category manager which categories you want to hide and which not. There is a new field in the category editor.


Unzip it in the plugins folder and install it through the plugin manager.

There are two language file: english and french.


Bug fixed: Database name
Title: Re: Hide categories independantly for unregistered users
Post by: barjo07 on June 28, 2009, 03:07:24 pm
I run 1.4.24. I installed the plug-in, activated it and then called catmgr.php (the new version) but got an error message "There was an error while processing a database query".
I had a look in the database, the new field is there. When I set visibility to 1 in the db the category is indeed hidden.
But catmgr.php does not work anymore. Any clue?
Title: Re: Hide categories independantly for unregistered users
Post by: Nibbler on June 28, 2009, 03:11:17 pm
Enable debug mode in config and post the actual mysql error you get.
Title: Re: Hide categories independantly for unregistered users
Post by: barjo07 on June 28, 2009, 06:46:57 pm
While executing query "SELECT `visibility` FROM `cpg14x_categories` where cid = 0" on 0

mySQL error: Table '*****.cpg14x_categories' doesn't exist
---------------------------------------------------------------------------------------

Note: the prefix of the table was hidden by me because it would give too much detail about the database.
Title: Re: Hide categories independantly for unregistered users
Post by: barjo07 on June 28, 2009, 07:03:23 pm
The table is called cpg1410_categories.
Title: Re: Hide categories independantly for unregistered users
Post by: Nibbler on June 28, 2009, 07:25:42 pm
Find

Code: [Select]
$sql = "SELECT `visibility` FROM `cpg14x_categories` where cid = $cid";

change to

Code: [Select]
$sql = "SELECT `visibility` FROM {$CONFIG['TABLE_CATEGORIES']} where cid = $cid";
Title: Re: Hide categories independantly for unregistered users
Post by: barjo07 on June 28, 2009, 11:46:09 pm
Works like a charm. ;D Thank you!
Title: Re: Hide categories independantly for unregistered users
Post by: Nibbler on August 08, 2009, 03:52:30 pm
Split support request to http://forum.coppermine-gallery.net/index.php/topic,61096.0.html
Title: Re: Hide categories independantly for unregistered users
Post by: Joachim Müller on January 10, 2010, 12:43:07 pm
Added German language file and some minor header adjustments to the plugin and added the package to our download section at sourceforge.net: https://sourceforge.net/projects/coppermine/files/Plugins/1.4.x/cpg1.4.x_plugin_smart-catlist_v1.1.zip/download
I'm not very fond though about what the plugin does - the database modifications appear tricky to me. Thanks for the contribution, but I can not recommend this plugin.