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: Header.inc  (Read 5070 times)

0 Members and 1 Guest are viewing this topic.

angeldevil

  • Translator
  • Coppermine frequent poster
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 107
Header.inc
« on: August 14, 2006, 08:02:14 pm »

Hi,

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

TNX
« Last Edit: August 15, 2006, 04:33:16 pm by Nibbler »
Logged
a

Nibbler

  • Guest
Re: Header.inc
« Reply #1 on: August 14, 2006, 08:06:09 pm »

Try using anycontent.php instead.
Logged

angeldevil

  • Translator
  • Coppermine frequent poster
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 107
Re: Header.inc
« Reply #2 on: August 15, 2006, 12:49:14 am »

Try using anycontent.php instead.

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

no other solution?
Logged
a

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Header.inc
« Reply #3 on: August 15, 2006, 07:50:42 am »

open index.php
find
Code: [Select]
                    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
Code: [Select]
            case 'anycontent2':
                if ($cat == 0) {
                    include('anycontent2.php');
                }
                flush();
                break;


this'll include anycontent2.php
use it like you did with anycontent

angeldevil

  • Translator
  • Coppermine frequent poster
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 107
Re: Header.inc
« Reply #4 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:

Code: [Select]
if ($cat == 0) { include('header.inc');

}


is it possible?
« Last Edit: August 15, 2006, 03:20:56 pm by angeldevil »
Logged
a

Nibbler

  • Guest
Re: Header.inc
« Reply #5 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.
Logged

angeldevil

  • Translator
  • Coppermine frequent poster
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 107
Re: Header.inc
« Reply #6 on: August 15, 2006, 04:31:11 pm »

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

Ok, I've used:
Code: [Select]
if (!isset($_GET['cat'])) {
in header.inc and all work fine!  :D

Problem solved! 

Many tnx
Logged
a

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Header.inc
« Reply #7 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.
Logged

angeldevil

  • Translator
  • Coppermine frequent poster
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 107
Re: Header.inc
« Reply #8 on: August 15, 2006, 07:56:17 pm »

Ok Gaugau, no problems! thank you for the suggestion

best regards
Logged
a
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 19 queries.