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

Author Topic: a quick HOWTO for getting more infoblocks on the front page  (Read 8308 times)

0 Members and 1 Guest are viewing this topic.

azrael

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
a quick HOWTO for getting more infoblocks on the front page
« 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.
Logged

cangssithra

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
a quick HOWTO for getting more infoblocks on the front page
« Reply #1 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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
a quick HOWTO for getting more infoblocks on the front page
« Reply #2 on: January 07, 2004, 09:21:29 am »

you did what to accomplish what?

GauGau
Logged

Jaero

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
    • http://me.warcry.com
a quick HOWTO for getting more infoblocks on the front page
« Reply #3 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
Logged
Jaero - jaero@warcry.com
Site Manager - ME Warcry
http://me.warcry.com
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 18 queries.