coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: angeldevil on August 14, 2006, 08:02:14 PM

Title: Header.inc
Post by: angeldevil on August 14, 2006, 08:02:14 PM
Hi,

how do I display the header section in a first page only?

TNX
Title: Re: Header.inc
Post by: Nibbler on August 14, 2006, 08:06:09 PM
Try using anycontent.php instead.
Title: Re: Header.inc
Post by: angeldevil on August 15, 2006, 12:49:14 AM
Quote from: Nibbler on August 14, 2006, 08:06:09 PM
Try using anycontent.php instead.

TNX Nibbler, but I use anycontent.php for a flash slideshow, below a breadcrumb.

no other solution?
Title: Re: Header.inc
Post by: Stramm on August 15, 2006, 07:50:42 AM
open index.php
find
                    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;

below add

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



this'll include anycontent2.php
use it like you did with anycontent
Title: Re: Header.inc
Post by: angeldevil on August 15, 2006, 03:13:04 PM
thanks Stramm, but anycontent doesn't appears above the page like header.inc

My problem is to show "header.inc" in the first page only, for a fast view of other page

How do I resolve it?

A solutions like:

if ($cat == 0) { include('header.inc');

}


is it possible?
Title: Re: Header.inc
Post by: Nibbler on August 15, 2006, 03:32:20 PM
Yes, just add the code into your header. Use ($_GET['cat'] == 0) to determine whether to output anything.
Title: Re: Header.inc
Post by: angeldevil on August 15, 2006, 04:31:11 PM
Quote from: Nibbler on August 15, 2006, 03:32:20 PM
Yes, just add the code into your header. Use ($_GET['cat'] == 0) to determine whether to output anything.

Ok, I've used:
if (!isset($_GET['cat'])) {

in header.inc and all work fine!  :D

Problem solved! 

Many tnx
Title: Re: Header.inc
Post by: Joachim Müller on August 15, 2006, 07:44:34 PM
Side note: include files shouldn't be named foobar.inc, but foobar.inc.php or similar. If they are just named foobar.inc, malevolent users who manage to find out the name of the include could browse your source code and possibly be able to find out sensitive details.
I'm aware that the use of just foobar.inc can be seen frequently, even on well-known script resources. However, you shouldn't adopt this bad practise.
Title: Re: Header.inc
Post by: angeldevil on August 15, 2006, 07:56:17 PM
Ok Gaugau, no problems! thank you for the suggestion

best regards