<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
define('SHOW_ONLINE', true);
$page_title = $lang['Index'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$user_id = intval($userdata['user_id']);
echo "$user_id ";
$result = 0;
$query = "SELECT user_operation FROM phpbb_users WHERE user_id = $user_id";
$result = $db->sql_query($query) or die(print_r($db->sql_error(),true));
echo "$result";
if ($result == 1)
{
$template->set_filenames(array(
'body' => 'operations.tpl')
);
$template->pparse('body');
}
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
I'm trying to modify phpBB code, but I'm running into a few problems. Specifically with the query.
$user_id takes the current id of the person who is logged in with no problem. I'm trying to get the value of the user_operation field for the user who is currently logged in. It should be either 0 or 1.
For some reason, $result is neither 0 or 1. Somehow, the echo prints out "Resource id #21"
Does anybody have any clue what this means, or even where it got that from?