Od razu pisze że nie mam zielonego pojęcia nt. programowania w PHP problem polega na tym że wgrałem templatkę do zainstalowanego CMSa i w poglądzie wywala mi błąd na stronie a mianowicie:
Warning: Invalid argument supplied for foreach() in /homepages/.........../Base.class.php on line 152
Poniżej kod PHP pliku Base.class.php
<?php /*. .Tu jest tekst ale zastapiłem go . .Liczba kropek zgadza się z ilością linijek . . . . . .*/ class JA_Base{ var $_params = null; var $children = null; var $open = null; var $items = null; var $Itemid = 0; var $_db = null; var $showSeparatedSub = false; function JA_Base( &$params ){ $this->_params = $params; $this->Itemid = $Itemid; $this->loadMenu(); } function loadMenu(){ $this->loadMenu_15(); } function createParameterObject($param, $path='', $type='menu') { return new JParameter($param, $path); } function loadMenu_10x(){ if ($mosConfig_shownoauth) { $sql = "SELECT m.* FROM #__menu AS m" . "\nWHERE menutype='". $this->getParam( 'menutype' ) ."' AND published='1'" . "\nORDER BY parent,ordering"; } else { $sql = "SELECT m.* FROM #__menu AS m" . "\nWHERE menutype='". $this->getParam( 'menutype' ) ."' AND published='1' AND access <= '$my->gid'" . "\nORDER BY parent,ordering"; } $database->setQuery( $sql ); $rows = $database->loadObjectList( 'id' ); // first pass - collect children foreach ($rows as $index => $row) { if ($row->access <= $my->gid) { $pt = $row->parent; switch ($row->type) { case 'separator': case 'component_item_link': break; case 'url': $row->link .= '&Itemid='. $row->id; } } break; case 'content_item_link': case 'content_typed': // load menu params $menuparams = $this->createParameterObject( $row->params, $mainframe->getPath( 'menu_xml', $row->type ), 'menu' ); $unique_itemid = $menuparams->get( 'unique_itemid', 1 ); if ( $unique_itemid ) { $row->link .= '&Itemid='. $row->id; } else { if ( $row->type == 'content_typed' ) { $row->link .= '&Itemid='. $mainframe->getItemid($temp[1], 1, 0); } else { $row->link .= '&Itemid='. $mainframe->getItemid($temp[1], 0, 1); } } break; default: $row->link .= '&Itemid='. $row->id; break; } $row->link = sefRelToAbs( $row->link ); } $row->url = $row->url = ampReplace( $row->link ); $children[$pt] = $list; } $cacheIndex[$row->id] = $index; $this->items[$row->id] = $row; } $this->children = $children; // second pass - collect 'open' menus $count = 20; // maximum levels - to prevent runaway loop $id = $this->Itemid; while (-- $count) { $index = $cacheIndex[$id]; $id = $rows[$index]->parent; $open[] = $id; } else { break; } } } $this->open = $open; // $this->items = $rows; } function loadMenu_15(){ $menu = @JMenu :: getInstance(); $menu = @JMenu :: getInstance('site'); } $user =& JFactory::getUser(); // Get Menu Items $items = &JSite::getMenu(); $rows = $items->getItems('menutype', $this->getParam('menutype')); // first pass - collect children $aid = $user->get('aid', 0); foreach ($rows as $index => $v) { if ($v->access <= $aid) { $pt = $v->parent; switch ($v->type) { case 'url' : $v->url = $v->link.'&Itemid='.$v->id; } else { $v->url = $v->link; } break; default : coś tam dalej ale za dużo znaków
Proszę o pomoc bo kompletnie się nie znam na tym

