addMenuDescription('member', __FILE__);
// Load current referal clicks
-$result = SQL_QUERY_ESC("SELECT `ref_clicks` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s LIMIT 1",
- array(getUserId()), __FILE__, __LINE__);
-
-// Load it
-$content = SQL_FETCHARRAY($result);
-
-// Free result
-SQL_FREERESULT($result);
+if (!fetchUserData(getUserId())) {
+ // Something really bad happened
+ debug_report_bug('No user account ' . getUserId() . ' found.');
+} // END - if
// Prepare some data
-$content['userid'] = getUserId();
+$content['ref_clicks'] = getUserData('ref_clicks');
+$content['userid'] = getUserId();
// @TODO Move this into a filter
if (isExtensionActive('nickname')) {