public static function getInstance() { if (self::$_instance === NULL) { self::$_instance = new ryLogger(); } return self::$_instance; }
<?php define('APP_NAME', 'app_test'); include_once '../config.php'; include_once '../lang.php'; include_once 'lang.php'; // Ask to authenticate user (using ingame or session method) and fill $user with all information ryzom_app_authenticate($user, true); // Enable debug logs only for DEVS if (in_array('DEV', $user['groups'])) { ryLogger::getInstance()->enable = true; } // Debug log p($user); // Update user acces on Db $db = ryDB::getInstance(APP_NAME); $db->setDbDefs('test', array('id' => SQL_DEF_INT, 'num_access' => SQL_DEF_INT)); $num_access = $db->querySingleAssoc('test', array('id' => $user['id'])); if ($num_access) { $db->update('test', array('num_access' => ++$num_access['num_access']), array('id' => $user['id'])); } else { $db->insert('test', array('num_access' => $num_access['num_access'] = 1, 'id' => $user['id'])); } // Content $c = _t('access', $num_access['num_access']) . '<br/>'; echo ryzom_app_render(APP_NAME, $c, $user['ig']);
static function getEnd($ig) { ryLogger::getInstance()->addPrint(implode("\n", self::$luaend), '#FF55FF'); $ret = $ig ? "<lua>\n" . implode("\n", self::$luaend) . "\n</lua>" : ''; self::$luaend = array(); return $ret; }
function ryzom_render_window_end() { global $user; return '</div> <div>P_' . (isset($user['id']) ? $user['id'] : 'GUEST') . ':' . (isset($user['groups']) ? implode(':', $user['groups']) : '') . '</div> <div style="background-color: #000000">' . ryLogger::getInstance()->getLogs() . '</div></div></div></div> <div class="ryzom-ui-bl"><div class="ryzom-ui-br"><div class="ryzom-ui-b"></div></div></div><p class="ryzom-ui-notice">powered by <a class="ryzom-ui-notice" href="http://dev.ryzom.com/projects/ryzom-api/wiki">ryzom-api</a></p> </div> '; }