- // Load data
- $result = SQL_QUERY_ESC("SELECT login_bonus, turbo_bonus".$ADD." FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
- array($GLOBALS['userid']), __FILE__, __LINE__);
-
- // We don't add this points now. This will be done after each month
- list($login, $turbo, $ref, $order, $stats) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
+// Display login bonus and turbo-click bonus
+if ((isExtensionInstalledAndNewer('bonus', '0.2.2')) && (isExtensionActive('bonus')) && (getConfig('bonus_active') == 'Y')) {
+ // Fetch some data and init others (to avoid a notice here)
+ $content['login'] = getUserData('login_bonus');
+ $content['turbo'] = getUserData('turbo_bonus');
+ $content['ref'] = '0.00000';
+ $content['order'] = '0.00000';
+ $content['stats'] = '0.00000';
+
+ // Get more data if ext-bonus is newer
+ if (getExtensionVersion('bonus') >= '0.4.4') {
+ $content['ref'] = getUserData('bonus_ref');
+ $content['order'] = getUserData('bonus_order');
+ $content['stats'] = getUserData('bonus_stats');
+ } // END - if