Where is it? Can't see it on the first post. What's new in the update?dmzx wrote:Update version 1.1.2
Code update.
Rhino.Freak wrote:Where is it? Can't see it on the first post. What's new in the update?dmzx wrote:Update version 1.1.2
Code update.
Code: Select all
<?php
/* First, get userpoints passed in URL from JavaScript section of main custom page 'bjack_new_session.php' */
$points=$_GET['newPoints'];
/* Begin Second Custom Page set up */
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
/* Start session management */
$user->session_begin();
$auth->acl($user->data);
$user->setup();
$userid = $user->data['user_id'];
$username = $user->data['username'];
$userpoints = $user->data['user_points'];
/* Update DB userpoints for the current user only*/
$sql_arr = array(
'user_points' => $points,
);
$sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_arr) . '
WHERE user_id = ' . (int) $userid;
$db->sql_query($sql);
/* Close the DB connection after every update */
mysql_close();
?>