SimplePortal
Support => English Support => Topic started by: iobit on May 04, 2011, 01:43:36 AM
-
Hello,
I update smf at the last version the rc5 and this code dont work! :'( For category
global $cat_tree, $boards, $boardList, $scripturl, $sourcedir, $user_info, $db_prefix;
$block_parameters = array(
'num_children' => 'int',
);
if ($return_parameters)
return $block_parameters;
$child_depth = !empty($parameters['num_children']) ? (int) $parameters['num_children'] - 1 : -1;
require_once($sourcedir . '/Subs-Boards.php');
getBoardTree();
// Remobe any boards this user can't actually see.
$temp_boards = $boards;
$request = db_query("
SELECT b.ID_BOARD
FROM {$db_prefix}boards AS b
WHERE !($user_info[query_see_board])", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
unset($temp_boards[$row['ID_BOARD']]);
mysql_free_result($request);
echo '
<div style="padding-left:2px;">';
foreach ($cat_tree as $catid => $tree)
{
foreach ($boardList[$catid] as $boardid)
{
$prefix = '';
for ($i=0; $i<=$boards[$boardid]['level']; $i++)
$prefix .= '-';
echo '
', $prefix, '<span class="sp_navigation_block_board"><a href="', $scripturl, '?board=', $boards[$boardid]['id'], '">', $boards[$boardid]['name'], '</a> (', $boards[$boardid]['posts'], ')</span><br />';
}
}
echo '
</div>';
Fatal error: Call to undefined function db_query() in /home/sitename/public_html/Sources/PortalBlocks.php(3351) : eval()'d code on line 17
thanks.
-
Following the update, your custom code will require a little updating, too.
I am suggesting a few changes, but I have not tested them. Please test them, one step at a time. I got information on which changes to make by searching through Subs-DB-mysql.php, and also by looking at typical calls to 'smf_db_query' in SSI.php to see how it is used. You can look in these same places. Then you will know everything I know.
global $cat_tree, $boards, $boardList, $scripturl, $sourcedir, $user_info, $db_prefix;
global $cat_tree, $boards, $boardList, $scripturl, $sourcedir, $user_info, $smcFunc;
and
$request = db_query("
$request = $smcFunc['db_query']('',"
Your query itself can be changed, as well.
"
SELECT b.ID_BOARD
FROM {$db_prefix}boards AS b
WHERE !($user_info[query_see_board])"
'
SELECT b.ID_BOARD
FROM {db_prefix}boards AS b
WHERE !({query_see_board})'