MyBB Community Forums

Full Version: Admin CP cant browse users.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
when I try to browse/search users. I get this error:

Warning [2] Invalid argument supplied for foreach() - Line: 1904 - File: admin/modules/user/users.php PHP 5.2.10 (Linux)
File 	Line 	Function
/admin/modules/user/users.php 	1904 	errorHandler->error
/admin/modules/user/users.php 	1801 	build_users_view
/admin/index.php 	380 	require

and:

Warning [2] Invalid argument supplied for foreach() - Line: 2422 - File: admin/modules/user/users.php PHP 5.2.10 (Linux)
File 	Line 	Function
/admin/modules/user/users.php 	2422 	errorHandler->error
/admin/modules/user/users.php 	2220 	build_user_view_table
/admin/modules/user/users.php 	1801 	build_users_view
/admin/index.php 	380 	require
Have you added a custom view?? Seems to be something wrong with it.
No it just did it randomly, i havent edited any files. We moved servers a few days ago and this is the first time i've use dthe function.
OK, can you go into phpMyAdmin, choose your database from the list on the left, and browse your adminviews table... there should be (at least) one record in there, the default one has a vid of 1... is this the case for you?? If by any chance this table is empty, run this query:

INSERT INTO `mybb_adminviews` (`vid`, `uid`, `title`, `type`, `visibility`, `fields`, `conditions`, `sortby`, `sortorder`, `perpage`, `view_type`) VALUES
(1, 0, 'All Users', 'user', 2, 'a:7:{i:0;s:6:"avatar";i:1;s:8:"username";i:2;s:5:"email";i:3;s:7:"regdate";i:4;s:10:"lastactive";i:5;s:7:"postnum";i:6;s:8:"controls";}', 'a:0:{}', 'username', 'asc', 20, 'card');
It was empty so I did the SQL and its fixed. Thanks Matt Big Grin