forum.coppermine-gallery.net

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: azrael on October 23, 2003, 05:49:57 pm

Title: a quick HOWTO for getting more infoblocks on the front page
Post by: azrael on October 23, 2003, 05:49:57 pm
Saw someone earlier ask how they would get more blocks on the
mainpage of CM. I spent a little time poking into some of the files and
discovered how, and thus want to share that little trick with others who
might wonder how to do the same.

In the manual at http://yourcmsite/docs theres a little section that
exlains how to change which regions on the front page.
As an example is used the sample anycontent who points to
anycontent.php in the root dir of your CM site. The name anycontent
is a variable that is declared in the index.php file and looks like this:

            case 'anycontent':
                if ($cat == 0) {
                    include('anycontent.php');
                }
                flush();
                break;

Lets say you wanted to use two sections, one at to and one at bottom as
your own custom header and footer, simply remove or name the
anycontent label and replace it with what you want to name it, for
instance like this:

                case 'headerblock':
                if ($cat == 0) {
                    include('headerblock.php');
                }
                flush();
                break;
            case 'footerblock':
                if ($cat == 0) {
                    include('footerblock.php');
                }
                flush();
                break;

This will make two variables name headerblock and footerblock which
points to their respective files as an include statement.

Now to get things shown properly we need to get the CM to actually use
them, this is done through the regular confugre section in CM.
Under album list view, theres a section named "The content of the
mainpage". Here you place the variables you made in the index.php file.

In my case it looks like this:
headerblock/catlist/alblist/random,2/topn,2/toprated/footerblock.

This will display first the contents of headerblock.php, then the catergory
list, the albumlist,2 rows of random images, 2 rows of most viewed
pictures, 1 row of the most top rated pictures and finally the contents of
the footerblock.php

Hope this is useful for someone :)

--
Az.
Title: a quick HOWTO for getting more infoblocks on the front page
Post by: cangssithra on January 07, 2004, 08:33:50 am
i got problem putting the search block on the main page. I replace the anycontent.php to search.php but it won't work.
Title: a quick HOWTO for getting more infoblocks on the front page
Post by: Joachim Müller on January 07, 2004, 09:21:29 am
you did what to accomplish what?

GauGau
Title: a quick HOWTO for getting more infoblocks on the front page
Post by: Jaero on March 04, 2004, 11:12:10 pm
When I try this (exactly what is said) - I get
Quote
Parse error: parse error, expecting `']'' in /home/web/me/content/fanart/index.php on line 92