PDA


View Full Version : foreach error on line 992


underESTIMATED
07-22-2005, 06:03 PM
I'm not sure what I did, but when I click on "Edit pages" I get this error and it does not list and pages.

Warning: Invalid argument supplied for foreach() in /admin/vba_cmps_admin.php on line 992

I am also have a permissions problem with the portal, but I think it might be related.

Here is the code on line 992


foreach ($pages AS $pageid => $page)
{
$cells = array();
$cells[] = '<b>' . str_repeat('- - ', ($page['level'] - 1)) . '<a href="vba_cmps_admin.php?do=editpage&amp;pageid=' . $page['pageid'] . '">' . $page['title'] . '</a></b>' . iif(!$page['active'], ' <span style="color:red;font-size:9px;font-weight:normal;">(' . $vbphrase['inactive'] . ')</span></div>');
$cells[] = '<select name="p' . $page['pageid'] . '" onchange="js_page_jump(' . $page['pageid'] . ');" class="bginput">' . construct_select_options($diroptions) . '</select><input type="button" class="button" value="' . $vbphrase['go'] . '" onclick="js_page_jump(' . $page['pageid'] . ');" />';
$cells[] = '<input type="text" class="bginput" name="order[' . $page['pageid'] . ']" size="3" title="' . $vbphrase['edit_display_order'] . '" value="' . $page['displayorder'] . '" />';
$cells[] = $page['name'];
$cells[] = $vbphrase["$page[type]"];

print_cells_row($cells);
}

Brian
07-22-2005, 08:50 PM
Did you by chance remove all of your pages? I don't see how you would be getting that error otherwise...

underESTIMATED
07-22-2005, 10:00 PM
No pages are being listed. The database shows that there is still one page, "Default / Homepage"

underESTIMATED
07-22-2005, 10:09 PM
Ok I fixed it. I have no idea what the error was about. I created a 2nd module. The "Edit pages" page would only list the 2nd one. I deleted the 1st one and set the default to the 2nd.

Here is the backup query for the 1st one

INSERT INTO `adv_pages` VALUES (1, 'Default / Homepage', 'home', 'module', '', '1', 1, '9,15,1,8,13,12,4,5,3,6,14,10,7,16', 'a:3:{s:15:"adv_portal_news";a:1:{s:16:"portal_threadids";s:43:"a:2:{i:815;s:5:"11054";i:1726;s:5:"21891";}";}s:15:"adv_portal_main";a:1:{s:14:"portal_homeurl";s:36:"http://ohioscions.com/cmps_index.php";}s:15:"adv_portal_poll";a:1:{s:24:"portal_poll_allowsmilies";s:1:"1";}}', '', 0, 0, 0, '', 0, 0, '', '', 0);

Was there somethign wrong with the data? I have no idea how it got that way if there is...

Thanks anyway for help :)

mydogatemyballs
08-03-2005, 08:15 AM
thanks for putting me the right direction, i got this error after i changed Parent Page to itself lol so with your help i just changed parentid from 1 to 0 in the database.

thanks