forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: farremixtkof_2007 on December 13, 2007, 01:53:32 pm

Title: Please help me!!! How i can hide Parent category in gallery main page ?
Post by: farremixtkof_2007 on December 13, 2007, 01:53:32 pm
plz help me friends

How i can hide Parent category in gallery main page ? ???
Title: Re: Please help me!!! How i can hide Parent category in gallery main page ?
Post by: farremixtkof_2007 on December 15, 2007, 09:24:02 am
plz friends anybody know how i can disappear Parent category in gallery main page  ???
Title: Re: Please help me!!! How i can hide Parent category in gallery main page ?
Post by: Joachim Müller on December 15, 2007, 12:38:45 pm
Obviously nobody knows. That's why nobody answers. Bottom line: can't be accomplished easily unless you code it yourself.
Title: Re: Please help me!!! How i can hide Parent category in gallery main page ?
Post by: jacefarm on July 12, 2009, 07:17:58 pm
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.
Title: Re: Please help me!!! How i can hide Parent category in gallery main page ?
Post by: Nibbler on July 12, 2009, 07:28:33 pm
You should read the manual before editing the code. Those are all easily controlled by configuration options.
Title: Re: Please help me!!! How i can hide Parent category in gallery main page ?
Post by: jacefarm on July 12, 2009, 07:43:09 pm
Ah yes - well spoken my good man.  In the Config tab - Album List View / Content of the main page.
Title: Re: Please help me!!! How i can hide Parent category in gallery main page ?
Post by: Joachim Müller on July 12, 2009, 10:54:09 pm
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.
Title: Re: Please help me!!! How i can hide Parent category in gallery main page ?
Post by: jacefarm on July 12, 2009, 11:22:33 pm
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.
Title: Re: Please help me!!! How i can hide Parent category in gallery main page ?
Post by: Joachim Müller on July 13, 2009, 07:42:53 am
At 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.

and 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.

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.
Title: Re: Please help me!!! How i can hide Parent category in gallery main page ?
Post by: jacefarm on July 13, 2009, 08:13:49 am
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:

Code: [Select]
          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:

Those are all easily controlled by configuration options.
Title: Re: Please help me!!! How i can hide Parent category in gallery main page ?
Post by: Joachim Müller on July 13, 2009, 08:25:09 am
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.
Title: Re: Please help me!!! How i can hide Parent category in gallery main page ?
Post by: jacefarm on July 13, 2009, 08:41:39 am
Yes - good point.  Thanks for the advice.