Please help me!!! How i can hide Parent category in gallery main page ? Please help me!!! How i can hide Parent category in gallery main page ?
 

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]

Main Menu

Please help me!!! How i can hide Parent category in gallery main page ?

Started by farremixtkof_2007, December 13, 2007, 01:53:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

farremixtkof_2007

plz help me friends

How i can hide Parent category in gallery main page ? ???

farremixtkof_2007

plz friends anybody know how i can disappear Parent category in gallery main page  ???

Joachim Müller

Obviously nobody knows. That's why nobody answers. Bottom line: can't be accomplished easily unless you code it yourself.

jacefarm

Responding long after the original post, but I was able to hide a lot of the areas by commenting out the "case" options that I didn't want inside the "switch" at line 777 of the main index.php file.

Nibbler

You should read the manual before editing the code. Those are all easily controlled by configuration options.

jacefarm

Ah yes - well spoken my good man.  In the Config tab - Album List View / Content of the main page.

Joachim Müller

Additionally, the thread starter didn't ask how to hide meta albums. He asked for something completely different. You shouldn't have tried to hijack this thread.

jacefarm

Hijacking was not my intent.

My intent was to leave behind some potential solutions as a matter of leaving this thread with an answer that was more helpful than your vague post which said, "Bottom line: can't be accomplished easily unless you code it yourself."  At least Nibbler's response revealed that an answer was to be found in the manual, and he's not even an administrator.  Oh well.

Joachim Müller

Quote from: jacefarm on July 12, 2009, 11:22:33 PMAt least Nibbler's response revealed that an answer was to be found in the manual
No, you got this wrong: the answer to your question (how to disable certain meta albums) is to be found in the docs - that's what Nibbler said. The answer to the question posted by the thread starter can not be found in the docs.

Quote from: jacefarm on July 12, 2009, 11:22:33 PMand he's not even an administrator.
You can't conclude from the fact that a person has admin privileges on this forum or not how his coding skills are or what level of understanding on coppermine a person has. Nibbler is one of the most skilled coders around. My coding skills don't rival his skills. That's why I have to take care of this forum (performing backups and other boring tasks), while he gets all the money, women and fame that come naturally when you're a genius coder. ;D
Being an admin on this forum means that you have extra work to do that the other dev team members don't have to perform. Being an admin is just a job description and no indicator for a person's rank within a hierarchy. It's something the forum application does (sticking that silly title next to my user name) and there (sadly) is no option to disable this.

Quote from: jacefarm on July 12, 2009, 11:22:33 PM
My intent was to leave behind some potential solutions as a matter of leaving this thread with an answer that was more helpful than your vague post which said, "Bottom line: can't be accomplished easily unless you code it yourself."
Well, if you have accomplished something code wise, why not reply with something less vague and posting your actual code proposals? Instead of just saying that you commented out some code - that's not helpfull for newbies at all.

jacefarm

I had a request from a client to remove a lot of the default features from the gallery main page, and to leave behind just the albums (remove categories, latest additions, etc.).  Searching your forum, I found this thread, and alas, presumed it was a similar issue.  But I'll take your word on the original post.

Anyway, if it's of some help, to address hiding certain elements on the main page, I changed the code in the index.php file, by commenting out (using /* ... */) most of the case situations I didn't need.  Beginning at line 777:

          switch ($matches[1]) {
                   case 'breadcrumb':
                       // Added breadcrumb as a separate listable block from config
                       if (($breadcrumb != '' || count($cat_data) > 0) && $cat != 0) theme_display_breadcrumb($breadcrumb, $cat_data);
                       break;

                   /* case 'catlist':
                       if ($breadcrumb != '' || count($cat_data) > 0) theme_display_cat_list($breadcrumb, $cat_data, $statistics);
                       if (isset($cat) && $cat == USER_GAL_CAT) {
                           list_users();
                       }
                       flush();
                       break; */

                   case 'alblist':
                       list_albums();
                       flush();
                       break;

                   /* case 'random':
                       display_thumbnails('random', $cat, 1, $CONFIG['thumbcols'], max(1, $matches[2]), false);
                       flush();
                       break;

                   case 'lastup':
                       display_thumbnails('lastup', $cat, 1, $CONFIG['thumbcols'], max(1, $matches[2]), false);
                       flush();
                       break;

                   case 'lastalb':
                       display_thumbnails('lastalb', $cat, 1, $CONFIG['thumbcols'], max(1, $matches[2]), false);
                       break;

                   case 'topn':
                       display_thumbnails('topn', $cat, 1, $CONFIG['thumbcols'], max(1, $matches[2]), false);
                       flush();
                       break;

                   case 'toprated':
                       display_thumbnails('toprated', $cat, 1, $CONFIG['thumbcols'], max(1, $matches[2]), false);
                       flush();
                       break;

                   case 'lastcom':
                       display_thumbnails('lastcom', $cat, 1, $CONFIG['thumbcols'], max(1, $matches[2]), false);
                       flush();
                       break;

                   case 'lasthits':
                       display_thumbnails('lasthits', $cat, 1, $CONFIG['thumbcols'], max(1, $matches[2]), false);
                       flush();
                       break; */

                   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;
               }


That worked great for my needs, but I hear what Nibbler is saying regarding the config settings, which would have been simpler:

Quote from: Nibbler on July 12, 2009, 07:28:33 PM
Those are all easily controlled by configuration options.

Joachim Müller

OK, thanks for being ready to share. As you said, it's much easier to use the corresponding options in coppermine's config, so the above mentioned code should not be actually used (this is a recommendation for others reviewing this thread). Please use bbcode to post code in the future - I edited your posting accordingly.
The main reason why you should only fiddle with the code if there's no other option: upgrading get's so much harder, as you need to re-apply your code changes every time you perform an update/upgrade.

jacefarm