3 define('APP_NAME', 'app_test');
5 include_once('../config.php');
6 include_once('../lang.php');
7 include_once('lang.php');
9 // Ask to authenticate user (using ingame or session method) and fill $user with all information
10 ryzom_app_authenticate($user, true);
12 // Enable debug logs only for DEVS
13 if (in_array('DEV', $user['groups']))
14 ryLogger
::getInstance()->enable
= true;
19 // Update user acces on Db
20 $db = ryDB
::getInstance(APP_NAME
);
21 $db->setDbDefs('test', array('id' => SQL_DEF_INT
, 'num_access' => SQL_DEF_INT
));
23 $num_access = $db->querySingleAssoc('test', array('id' => $user['id']));
25 $db->update('test', array('num_access' => ++
$num_access['num_access']), array('id' => $user['id']));
27 $db->insert('test', array('num_access' => $num_access['num_access']=1, 'id' => $user['id']));
30 $c = _t('access', $num_access['num_access']).'<br/>';
32 echo ryzom_app_render(APP_NAME
, $c, $user['ig']);