Fix checkRpItemsPosition
[ryzomcore.git] / web / public_php / app / app_test / index.php
blobad5408e220784c88360380a8138625c55b9dc9da
1 <?php
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;
16 // Debug log
17 p($user);
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']));
24 if ($num_access)
25 $db->update('test', array('num_access' => ++$num_access['num_access']), array('id' => $user['id']));
26 else
27 $db->insert('test', array('num_access' => $num_access['num_access']=1, 'id' => $user['id']));
29 // Content
30 $c = _t('access', $num_access['num_access']).'<br/>';
32 echo ryzom_app_render(APP_NAME, $c, $user['ig']);