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: Eigene .php Files in Startseite einbinden??  (Read 4290 times)

0 Members and 1 Guest are viewing this topic.

DeMoehn

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Eigene .php Files in Startseite einbinden??
« on: April 26, 2007, 06:03:34 pm »

Hey Leute.

Coppermine ist immer noch so ein Rätsel für mich ;)
Bin nun etwas eingestiegen. Design etwas angepasst.

Die Seite ist hier: http://www.luxus-body.de/cpg1410/index.php

Ich möchte nun links noch eine Spalte einfügen mit Produkten aus dem Shop.
Kann mir einer sagen wie ich eigene Scripte einfügen kann?

Greetz, DeMoehn
« Last Edit: April 27, 2007, 08:17:48 am by GauGau »
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Eigene .php Files in Startseite einbinden??
« Reply #1 on: April 26, 2007, 06:53:44 pm »

Als Schlagworte zur Suche werfe ich mal

anycontent.php
custom header
custom footer

in den Raum

DeMoehn

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Eigene .php Files in Startseite einbinden??
« Reply #2 on: April 26, 2007, 07:30:16 pm »

Vielen Dank.
Das hilft mir doch schon weiter.

Greetz, DeMoehn
Logged

DeMoehn

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Eigene .php Files in Startseite einbinden??
« Reply #3 on: April 26, 2007, 08:26:43 pm »

Vielen Dank, wurde fündig...

Hiermit habe ich das ganze eingebunden.

Code: [Select]
function pageheader($section, $meta = '')
{
    global $CONFIG, $THEME_DIR;
    global $template_header, $lang_charset, $lang_text_dir;

    $custom_header = cpg_get_custom_include($CONFIG['custom_header_path']);

        $charset = ($CONFIG['charset'] == 'language file') ? $lang_charset : $CONFIG['charset'];

    header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
        header("Content-Type: text/html; charset=$charset");
    user_save_profile();

    $template_vars = array('{LANG_DIR}' => $lang_text_dir,
        '{TITLE}' => $CONFIG['gallery_name'] . ' - ' . strip_tags(bb_decode($section)),
        '{CHARSET}' => $charset,
        '{META}' => $meta,
        '{GAL_NAME}' => $CONFIG['gallery_name'],
        '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
        '{SYS_MENU}' => theme_main_menu('sys_menu'),
        '{SUB_MENU}' => theme_main_menu('sub_menu'),
        '{ADMIN_MENU}' => theme_admin_mode_menu(),
        '{CUSTOM_HEADER}' => $custom_header,
        '{SHOP_MOD}' => cpg_get_custom_include_2(),
        );

    echo template_eval($template_header, $template_vars);
}
/**
 * cpg_get_custom_include_2()
 *
 * @param string $path
 * @return
 **/
function cpg_get_custom_include_2()
{
    global $CONFIG;
    $path2 = 'shop/shop.php'; // path to file from root
    $return = '';

    // check if the include file exists
    if (!file_exists($path2))
    {
        return $return;
    }
    ob_start();
    include($path2);
    $return = ob_get_contents();
    ob_end_clean();
    // crude sub-routine to remove the most basic "no-no" stuff from possible includes
    // could need improvement
    $return = str_replace('<html>', '', $return);
    $return = str_replace('<head>', '', $return);
    $return = str_replace('<body>', '', $return);
    $return = str_replace('</html>', '', $return);
    $return = str_replace('</head>', '', $return);
    $return = str_replace('</body>', '', $return);
    return $return;
}

Thanks, DeMoehn
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Eigene .php Files in Startseite einbinden??
« Reply #4 on: April 28, 2007, 12:44:22 pm »

einfacher wäre trotzdem gewesen, die anycontent.php oder den custom header/ footer zu verwenden.

Trotzdem Danke für den code
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 15 queries.