Header.inc Header.inc
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Header.inc

Started by angeldevil, August 14, 2006, 08:02:14 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

angeldevil

Hi,

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

TNX
a

Nibbler

Try using anycontent.php instead.

angeldevil

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?
a

Stramm

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

angeldevil

#4
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?
a

Nibbler

Yes, just add the code into your header. Use ($_GET['cat'] == 0) to determine whether to output anything.

angeldevil

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
a

Joachim Müller

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.

angeldevil

Ok Gaugau, no problems! thank you for the suggestion

best regards
a