Problem with includes

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
Post Reply
Voro
Posts: 7
Joined: Tue 25. Apr 2006, 22:05

Problem with includes

Post by Voro »

Hope this is the correct place to post my problem.

Running this code

Code: Select all

<?php

        $rootdir = $_SERVER['DOCUMENT_ROOT']; 

        // includes for nav menu 
        include ($rootdir.'/phpwcms/config/phpwcms/conf.template_default.inc.php'); 
        require ($rootdir.'/phpwcms/include/inc_front/front.func.inc.php'); 
        require ($rootdir.'/phpwcms/config/phpwcms/conf.inc.php'); 
        require ($rootdir.'/phpwcms/include/inc_lib/default.inc.php'); 

        // create menu 
        $dstruct = get_struct_data ($db, '', ''); 
        $navmenu = nav_table_struct($dstruct,"",$template_default["nav_table_struct"], "/phpwcms/index.php"); 

?>
in test.php produces the following errors:

Code: Select all

Notice: Undefined index: indexpage in /www/htdocs/v123456/phpwcms/include/inc_front/front.func.inc.php on line 719

Notice: Undefined index: indexpage in /www/htdocs/v123456/phpwcms/include/inc_front/front.func.inc.php on line 720

Notice: Undefined index: indexpage in /www/htdocs/v123456/phpwcms/include/inc_front/front.func.inc.php on line 723

Notice: Undefined index: indexpage in /www/htdocs/v123456/phpwcms/include/inc_front/front.func.inc.php on line 724

Notice: Undefined index: indexpage in /www/htdocs/v123456/phpwcms/include/inc_front/front.func.inc.php on line 725

Notice: Undefined index: indexpage in /www/htdocs/v123456/phpwcms/include/inc_front/front.func.inc.php on line 726

Notice: Undefined index: indexpage in /www/htdocs/v123456/phpwcms/include/inc_front/front.func.inc.php on line 727

Notice: Undefined index: indexpage in /www/htdocs/v123456/phpwcms/include/inc_front/front.func.inc.php on line 728

Notice: Undefined index: indexpage in /www/htdocs/v123456/phpwcms/include/inc_front/front.func.inc.php on line 729

Notice: Undefined index: indexpage in /www/htdocs/v123456/phpwcms/include/inc_front/front.func.inc.php on line 730

Notice: Undefined index: indexpage in /www/htdocs/v123456/phpwcms/include/inc_front/front.func.inc.php on line 731

Notice: Undefined index: indexpage in /www/htdocs/v123456/phpwcms/include/inc_front/front.func.inc.php on line 732

Notice: Use of undefined constant VISIBLE_MODE - assumed 'VISIBLE_MODE' in /www/htdocs/v123456/phpwcms/include/inc_front/front.func.inc.php on line 736
What I'm doing wrong?

*****

Ich hoffe, dieses ist der richtige Platz um mein Problem zu schildern.

Bei Aufruf der obigen php-Datei zeigt der Browser mir die beschriebenen Fehlermeldungen. Was mache ich falsch?

Wer hat einen Tipp für mich?

Voro
phalancs
Posts: 793
Joined: Thu 19. Feb 2004, 05:09
Location: Germany

Post by phalancs »

versuche mal auf diese rootdir definition zu verzichten. einfach relative pfade beginnend beim phpwcms root nehmen, so funzt es bei mir immer.

Bsp:

Code: Select all

include_once ('include/file.inc.php');
or

Code: Select all

require_once ('include/file.inc.php');
2008
Voro
Posts: 7
Joined: Tue 25. Apr 2006, 22:05

Post by Voro »

phalancs wrote:versuche mal auf diese rootdir definition zu verzichten. einfach relative pfade beginnend beim phpwcms root nehmen, so funzt es bei mir immer.

Bsp:

Code: Select all

include_once ('include/file.inc.php');
or

Code: Select all

require_once ('include/file.inc.php');
Diese Änderung hat leider nichts gebracht. :(
Es kommen exakt die gleichen Fehlermeldungen.

Muss ich evtl. hier in Zeile 713 in der front.func.inc.php etwas anpassen?

Code: Select all

	function get_struct_data ($dbcon, $root_name="Home", $root_info="") {
wegen

Code: Select all

//if(!$root_name) $root_name = 'Home';

Voro
Voro
Posts: 7
Joined: Tue 25. Apr 2006, 22:05

Post by Voro »

Hat denn wirklich niemand eine Idee :?:

So sehen die beanstandeten Codezeilen 718-732 in der front.func.inc.php aus:

Code: Select all

$data[0] = array(	"acat_id"		=> 0,
						"acat_name"		=> $GLOBALS['indexpage']['acat_name'],
						"acat_info"		=> $GLOBALS['indexpage']['acat_info'],
						"acat_struct"	=> 0,
						"acat_sort"		=> 0,
						"acat_hidden"	=> intval($GLOBALS['indexpage']['acat_hidden']),
						"acat_regonly"	=> intval($GLOBALS['indexpage']['acat_regonly']),
						"acat_ssl"		=> intval($GLOBALS['indexpage']['acat_ssl']),
						"acat_template"	=> intval($GLOBALS['indexpage']['acat_template']),
						"acat_alias"	=> $GLOBALS['indexpage']['acat_alias'],
						"acat_topcount"	=> intval($GLOBALS['indexpage']['acat_topcount']),
						"acat_redirect"	=> $GLOBALS['indexpage']['acat_redirect'],
						"acat_order"	=> intval($GLOBALS['indexpage']['acat_order']),
						"acat_timeout"	=> $GLOBALS['indexpage']['acat_timeout'],
						"acat_nosearch"	=> $GLOBALS['indexpage']['acat_nosearch']
Post Reply