From: Roland Häder <roland@mxchange.org>
Date: Mon, 21 Jun 2010 01:39:47 +0000 (+0000)
Subject: More rewrites/templates swapped out:
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=76fd13e5938a334f08e43893eb9a4ff49f72bf07;p=mailer.git

More rewrites/templates swapped out:
- Two more templates created (swapped out from PHP code)
- More rewrites to EL
- More double quotes converted to single quotes
- Some internal TODOs solved/new created
- TODOs.txt updated
---

diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt
index bf006599b1..1bcd6a72b6 100644
--- a/DOCS/TODOs.txt
+++ b/DOCS/TODOs.txt
@@ -32,6 +32,7 @@
 ./inc/extensions/ext-network.php:38: * @TODO Yoo!Media: What is LayerAd compared to Layer click?            *
 ./inc/extensions/ext-network.php:92:		// @TODO network_type_handle is an internal name and needs documentation
 ./inc/extensions/ext-newsletter.php:220:		// @TODO Move these into configuration
+./inc/extensions/ext-order.php:344:		// @TODO This should be moved out to inc/reset/
 ./inc/extensions/ext-rallye.php:331:		// @TODO Move this code into rallye_functions.php
 ./inc/extensions/ext-rallye.php:94:		// @TODO Fix config_rallye_prices to list_rallye_prices
 ./inc/extensions/ext-sql_patches.php:755:			// @TODO Rewrite this to a filter
@@ -40,27 +41,27 @@
 ./inc/extensions-functions.php:143:	// @TODO Do we still need this? setExtensionUpdateNotes('');
 ./inc/extensions-functions.php:423:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) )
 ./inc/extensions-functions.php:539:		// @TODO Extension is loaded, what next?
-./inc/functions.php:1052:// @TODO $simple is deprecated
-./inc/functions.php:1087:	// @TODO Do only use $content and deprecate $GLOBALS and $DATA in templates
-./inc/functions.php:2420:	// @TODO This can be easily moved out after the merge from EL branch to this is complete
-./inc/functions.php:2569:		// @TODO Add a little more infos here
-./inc/functions.php:2652:			// @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
+./inc/functions.php:1055:// @TODO $simple/$constants are deprecated
+./inc/functions.php:1082:	// @TODO Do only use $content and deprecate $GLOBALS and $DATA in templates
+./inc/functions.php:2415:	// @TODO This can be easily moved out after the merge from EL branch to this is complete
+./inc/functions.php:2564:		// @TODO Add a little more infos here
+./inc/functions.php:2647:			// @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
 ./inc/functions.php:266:	// @TODO Remove this sanity-check if all is fine
-./inc/functions.php:2675:			// @TODO Rewrite this old lost code to a template
+./inc/functions.php:2670:			// @TODO Rewrite this old lost code to a template
 ./inc/functions.php:269:	// @TODO Try to rewrite all $DATA to $content
-./inc/functions.php:2765:			// @TODO Are these convertions still required?
-./inc/functions.php:2783:// @TODO Rewrite this function to use readFromFile() and writeToFile()
-./inc/functions.php:3659:// @TODO Lame description for this function
-./inc/functions.php:3681:			// @TODO Move this in a filter
-./inc/functions.php:3805:	// @TODO This is still very static, rewrite it somehow
+./inc/functions.php:2760:			// @TODO Are these convertions still required?
+./inc/functions.php:2778:// @TODO Rewrite this function to use readFromFile() and writeToFile()
+./inc/functions.php:3654:// @TODO Lame description for this function
+./inc/functions.php:3676:			// @TODO Move this in a filter
+./inc/functions.php:3800:	// @TODO This is still very static, rewrite it somehow
 ./inc/functions.php:481:	// @TODO Do only use $content, not $DATA or raw variables
 ./inc/functions.php:551:		// @TODO Extension 'msg' does not exist
 ./inc/functions.php:614:// @TODO Rewrite this to an extension 'smtp'
 ./inc/install-functions.php:63:	// @TODO DEACTIVATED: changeDataInFile(getConfig('CACHE_PATH') . 'config-local.php', 'OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestParameter('omode'), 0);
-./inc/language/de.php:1146:// @TODO Rewrite these two constants
-./inc/language/de.php:1161:// @TODO Rewrite these three constants
+./inc/language/de.php:1143:// @TODO Rewrite these two constants
+./inc/language/de.php:1158:// @TODO Rewrite these three constants
 ./inc/language/de.php:309:	// @TODO Following two are unused?
-./inc/language/de.php:841:// @TODO Are these constants longer used?
+./inc/language/de.php:838:// @TODO Are these constants longer used?
 ./inc/language-functions.php:234:	// @TODO These are all valid languages, again hard-coded
 ./inc/language-functions.php:46:// @TODO Rewrite all language constants to this function.
 ./inc/language/rallye_de.php:13: * @TODO Naming convention not applied for language strings             *
@@ -68,9 +69,11 @@
 ./inc/language/sponsor_de.php:119:// @TODO Rewrite these four constants to one and use sprintf()
 ./inc/libs/admins_functions.php:440:		// @TODO This can be, somehow, rewritten
 ./inc/libs/beg_functions.php:58:		// @TODO Try to rewrite the following unset()
-./inc/libs/bonus_functions.php:213:			// @TODO Try to find a way for rewriting this constant
-./inc/libs/bonus_functions.php:301:		// @TODO This query isn't right, it will only update if the user was for a longer time away!
+./inc/libs/bonus_functions.php:213:		// @TODO Move this HTML to a template
+./inc/libs/bonus_functions.php:297:		// @TODO This query isn't right, it will only update if the user was for a longer time away!
 ./inc/libs/doubler_functions.php:46:// @TODO Lame description
+./inc/libs/doubler_functions.php:94:			// @TODO Can't this be moved into EL?
+./inc/libs/mailid_functions.php:49:		// @TODO Rewrite this to a dynamic include or so
 ./inc/libs/rallye_functions.php:724:	$EXPIRE = 3; // @TODO The hard-coded value...
 ./inc/libs/rallye_functions.php:806:// @TODO Please document this function
 ./inc/libs/rallye_functions.php:864:		// Load count @TODO Can't we rewrite this to our API?
@@ -79,16 +82,17 @@
 ./inc/libs/register_functions.php:375:	// @TODO Rewrite this to a filter
 ./inc/libs/register_functions.php:382:	// @TODO Rewrite this whole if() block to addPointsThroughReferalSystem(). This will also make following if() block obsolete
 ./inc/libs/register_functions.php:383:	// @TODO Wether the registration bonus should only be added to user directly or through referal system should be configurable
-./inc/libs/surfbar_functions.php:1549:		// @TODO This can be somehow rewritten
-./inc/libs/surfbar_functions.php:721:// @TODO Can't we use our new expression language instead of this ugly code?
-./inc/libs/surfbar_functions.php:965:	// @TODO Invalid salt should be refused
+./inc/libs/surfbar_functions.php:1547:		// @TODO This can be somehow rewritten
+./inc/libs/surfbar_functions.php:719:// @TODO Can't we use our new expression language instead of this ugly code?
+./inc/libs/surfbar_functions.php:963:	// @TODO Invalid salt should be refused
 ./inc/libs/task_functions.php:245:		// @TODO These can be rewritten to filter
 ./inc/libs/task_functions.php:53:// @TODO Move all extension-dependent queries into filters
-./inc/libs/user_functions.php:138:	// @TODO These two constants are no longer used, maybe we reactivate this code?
-./inc/libs/user_functions.php:225:// @TODO Double-check configuration entry here
-./inc/libs/user_functions.php:317:			// @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content);
-./inc/libs/user_functions.php:337:			// @TODO Make this filter working: $url = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON));
-./inc/libs/user_functions.php:413:	// @TODO We should try to rewrite this to fetchUserData() somehow
+./inc/libs/theme_functions.php:95:	// @TODO Can't this be rewritten to an API function?
+./inc/libs/user_functions.php:146:	// @TODO These two constants are no longer used, maybe we reactivate this code?
+./inc/libs/user_functions.php:233:// @TODO Double-check configuration entry here
+./inc/libs/user_functions.php:325:			// @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content);
+./inc/libs/user_functions.php:345:			// @TODO Make this filter working: $url = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON));
+./inc/libs/user_functions.php:421:	// @TODO We should try to rewrite this to fetchUserData() somehow
 ./inc/libs/yoomedia_functions.php:116:	$response = YOOMEDIA_QUERY_API('out_textmail.php', true); // @TODO Ask Yoo!Media for test script
 ./inc/load_config.php:77:	// @TODO Rewrite them to avoid this else block
 ./inc/loader/load_cache-extension.php:13: * @TODO Rewrite this whole file to load_cache-extensions.php           *
@@ -109,10 +113,9 @@
 ./inc/modules/admin/what-admin_add.php:61:		// @TODO Cant this be rewritten?
 ./inc/modules/admin/what-admin_add.php:77:		// @TODO This can be somehow rewritten to a function
 ./inc/modules/admin/what-adminedit.php:58:	// @TODO Kill all constants in this file
-./inc/modules/admin/what-admins_mails.php:61:				// @TODO Can this be rewritten???
+./inc/modules/admin/what-admins_mails.php:61:				// @TODO Can this be rewritten to an API function?
 ./inc/modules/admin/what-bonus.php:48:// @TODO Unused at the moment
 ./inc/modules/admin/what-config_admins.php:146:	// @TODO Rewrite this to filter 'run_sqls'
-./inc/modules/admin/what-config_mods.php:141:		// @TODO Rewritings: mod->module in template
 ./inc/modules/admin/what-config_mods.php:57:			// @TODO This can be moved into mysql-function.php, see checkModulePermissions() function
 ./inc/modules/admin/what-config_points.php:113:			// @TODO Rewrite this to a filter
 ./inc/modules/admin/what-config_rallye_prices.php:209:				// @TODO Rewritings: level->price_level, infos->info in template
@@ -125,14 +128,16 @@
 ./inc/modules/admin/what-guest_add.php:69:		// @TODO Cant this be rewritten?
 ./inc/modules/admin/what-guest_add.php:85:		// @TODO This can be somehow rewritten to a function
 ./inc/modules/admin/what-holiday_list.php:48:// @TODO Unused at the moment
-./inc/modules/admin/what-list_autopurge.php:55:// @TODO Rewrite those lines to filter
+./inc/modules/admin/what-list_autopurge.php:49:// @TODO Rewrite those lines to filter
 ./inc/modules/admin/what-list_autopurge.php:85:		// @TODO Rewritings: surname->surname,family->family in templates
 ./inc/modules/admin/what-list_bonus.php:131:		// @TODO Can't this be moved into our expression language?
 ./inc/modules/admin/what-list_cats.php:56:		// @TODO No longer needed? define('__CATS_BASE'   , '<a href="{%url=modules.php?module=admin&amp;userid=');
+./inc/modules/admin/what-list_cats.php:72:				// @TODO Rewrite this to countSum.....() function
 ./inc/modules/admin/what-list_links.php:57:		// @TODO Try to rewrite this to a filter
 ./inc/modules/admin/what-list_links.php:89:				// @TODO Find a way to rewrite this. See some lines above for different queries
 ./inc/modules/admin/what-list_links.php:98:					// @TODO Rewrite this to includes/filter
 ./inc/modules/admin/what-list_rallyes.php:258:			// @TODO Rewritings: opoints->curr_points,old->refs in template
+./inc/modules/admin/what-list_refs.php:110:								// @TODO Try to rewrite some to EL
 ./inc/modules/admin/what-list_task.php:146:		// @TODO Rewrite these templates to one and add $OUT
 ./inc/modules/admin/what-list_task.php:180:			// @TODO Rewritings: admin->assigned_admin,userid->userid,type->task_type_msg in template
 ./inc/modules/admin/what-list_task.php:192:				// @TODO Rewrite this to $OUT .= ..., true, ...
@@ -141,8 +146,8 @@
 ./inc/modules/admin/what-list_unconfirmed.php:77:	// @TODO This constant might be unused? define('__LIST_UNCON_TITLE', getMessage('LIST_UNCONFIRMED_BONUS_LINKS'));
 ./inc/modules/admin/what-list_unconfirmed.php:88:	// @TODO "Please do not call me directly." Should be rewritten to a nice selection depending on ext-bonus
 ./inc/modules/admin/what-list_user.php:157:		// @TODO Rewrite these to filters
-./inc/modules/admin/what-list_user.php:280:		// @TODO Rewrite this into a  filter
-./inc/modules/admin/what-list_user.php:334:			// @TODO Rewrite this into a filter
+./inc/modules/admin/what-list_user.php:275:		// @TODO Rewrite this into a filter
+./inc/modules/admin/what-list_user.php:330:			// @TODO Rewrite this into a filter
 ./inc/modules/admin/what-list_user.php:59:// @TODO Rewrite these if-blocks in a filter
 ./inc/modules/admin/what-logs.php:69:			// @TODO Fix content-type here
 ./inc/modules/admin/what-logs.php:72:			// @TODO Fix content-type here
@@ -156,28 +161,27 @@
 ./inc/modules/admin/what-usage.php:88:	// @TODO This code is double, see loadTemplate() and loadEmailTemplate() in functions.php
 ./inc/modules/admin/what-usr_online.php:51:	// @TODO Add a filter for sponsor
 ./inc/modules/guest/what-beg.php:60:// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getConfig('beg_userid_timeout')));
-./inc/modules/guest/what-confirm.php:113:					// @TODO Try to rewrite the following unset()
-./inc/modules/guest/what-login.php:108:	// @TODO Move this HTML code into a template
+./inc/modules/guest/what-confirm.php:120:					// @TODO Try to rewrite the following unset()
+./inc/modules/guest/what-login.php:114:	// @TODO Move this HTML code into a template
 ./inc/modules/guest/what-mediadata.php:183:// @TODO Rewrite all these if-blocks to filters
 ./inc/modules/guest/what-mediadata.php:70:	// @TODO Find a better formular than this one
 ./inc/modules/guest/what-rallyes.php:91:	// @TODO Reactivate this: $content['admin'] = '<a href="{%url=modules.php?module=index&amp;what=impressum&amp;admin=' . $adminId . '%}">' . $login . '</a>';
 ./inc/modules/guest/what-sponsor_infos.php:70:		// @TODO Rewritings: conv->conv_rate,name->conv_name in template
-./inc/modules/guest/what-sponsor_infos.php:90:			// @TODO Rewritings: name->pay_name,min->pay_min_count,min->pay_min_count,curr->pay_currency
-./inc/modules/guest/what-sponsor_reg.php:287:		// @TODO Swap this HTML code to templates
+./inc/modules/guest/what-sponsor_reg.php:290:		// @TODO Swap this HTML code to templates
 ./inc/modules/guest/what-stats.php:116:		// @TODO This can be somehow rewritten
 ./inc/modules/guest/what-stats.php:76:// @TODO This can be rewritten in a dynamic include
-./inc/modules/member/what-beg.php:64:// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getConfig('beg_userid_timeout')));
+./inc/modules/member/what-beg.php:56:// @TODO Can't this be moved into EL?
+./inc/modules/member/what-beg.php:65:// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getConfig('beg_userid_timeout')));
 ./inc/modules/member/what-bonus.php:57:	// @TODO Rewrite this to a filter
 ./inc/modules/member/what-categories.php:129:		// @TODO Rewrite this to use $OUT .= ...
 ./inc/modules/member/what-doubler.php:56:// @TODO The '*100' is in the way to get moved into the template
-./inc/modules/member/what-order.php:456:			// @TODO Rewrite this to a filter
+./inc/modules/member/what-order.php:458:			// @TODO Rewrite this to a filter
 ./inc/modules/member/what-order.php:65:// @TODO Rewrite this to a filter
-./inc/modules/member/what-payout.php:221:					// @TODO Rewrite this to a filter
+./inc/modules/member/what-payout.php:222:					// @TODO Rewrite this to a filter
 ./inc/modules/member/what-points.php:55:// @TODO Should we rewrite this to a filter?
 ./inc/modules/member/what-rallyes.php:91:	// @TODO Reactivate this: $content['admin'] = '<a href="{%url=modules.php?module=index&amp;what=impressum&amp;admin=' . $content['admin_id'] . '%}">' . $content['login'] . '</a>';
 ./inc/modules/member/what-refback.php:131:			// @TODO UNUSED: $refRow['status']      = translateUserStatus($refRow['status']);
 ./inc/modules/member/what-reflinks.php:54:// @TODO Move this into a filter
-./inc/modules/member/what-stats.php:119:		// @TODO Rewrite in template: clix->clicks
 ./inc/modules/member/what-transfer.php:132:				// @TODO Rewrite this to a filter
 ./inc/modules/member/what-transfer.php:222:				// @TODO Try to rewrite his to $content = SQL_FETCHARRAY(), see some lines above for two different queries
 ./inc/modules/member/what-transfer.php:304:			// @TODO This should be somehow rewritten to $row = SQL_FETCHARRAY(), see switch() block above for SQL queries
@@ -187,9 +191,9 @@
 ./inc/modules/order.php:76:		// @TODO Unused: 2,4
 ./inc/monthly/monthly_bonus.php:69:	// @TODO Rewrite this to a filter
 ./inc/mysql-manager.php:1590:			// @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
-./inc/mysql-manager.php:1688:	// @TODO Rewrite this to a filter
-./inc/mysql-manager.php:2068:			// @TODO Rewrite this to a filter
-./inc/mysql-manager.php:2109:// @TODO Fix inconsistency between last_module and getWhat()
+./inc/mysql-manager.php:1690:	// @TODO Rewrite this to a filter
+./inc/mysql-manager.php:2070:			// @TODO Rewrite this to a filter
+./inc/mysql-manager.php:2111:// @TODO Fix inconsistency between last_module and getWhat()
 ./inc/mysql-manager.php:229:			// @TODO Nothing helped???
 ./inc/mysql-manager.php:264:			// @TODO Rewrite this to a filter
 ./inc/mysql-manager.php:563:	// @TODO Try to rewrite this to one or more functions
@@ -202,14 +206,13 @@
 ./inc/wrapper-functions.php:455:// @TODO Do some more sanity check here
 ./inc/wrapper-functions.php:793:	 * @TODO Do we really need this check? If yes, try to fix this:
 ./mailid.php:135:					// @TODO Rewrite this to a filter
-./mailid.php:215:	// @TODO Rewrite this to a dynamic include or so
 ./mailid.php:95:		// @TODO Rewrite this to a filter
-./mailid_top.php:100:		// @TODO Rewrite this to a filter
-./mailid_top.php:136:					// @TODO Rewrite this to a filter
-./mailid_top.php:183:							// @TODO Rewrite this to a filter
-./mailid_top.php:190:									// @TODO Rewrite this to a filter
-./mailid_top.php:226:									// @TODO Rewrite these blocks to filter
-./mailid_top.php:261:										// @TODO Try to rewrite the following unset()
+./mailid_top.php:132:					// @TODO Rewrite this to a filter
+./mailid_top.php:179:							// @TODO Rewrite this to a filter
+./mailid_top.php:186:									// @TODO Rewrite this to a filter
+./mailid_top.php:222:									// @TODO Rewrite these blocks to filter
+./mailid_top.php:257:										// @TODO Try to rewrite the following unset()
+./mailid_top.php:99:		// @TODO Rewrite this to a filter
 ./view.php:70:		// @TODO No banner found, output some default banner
 ./templates/de/html/admin/admin_add_country.tpl:23:			<!-- @TODO Rewrite this selection box to our generic functions //-->
 ./templates/de/html/admin/admin_admins_contct_form.tpl:4:	<!-- @TODO Shouldn't we add a title here? //-->
@@ -220,16 +223,18 @@
 ./templates/de/html/admin/admin_list_bonus.tpl:3:	<!-- @TODO No title here? //-->
 ./templates/de/html/admin/admin_list_mods.tpl:4:	<!-- @TODO Shouldn't we add a title here? //-->
 ./templates/de/html/admin/admin_list_primera_main.tpl:3:<!-- @TODO No title here? //-->
+./templates/de/html/admin/admin_list_refs_level.tpl:21:		<!-- @TODO Nothing to say here? //-->
 ./templates/de/html/admin/admin_list_unconfirmed_list.tpl:3:<!-- @TODO Shouldn't we add a title here? //-->
 ./templates/de/html/admin/admin_list_wernis_main.tpl:2:<!-- @TODO No title here? //-->
-./templates/de/html/admin/admin_login_form.tpl:35:	@TODO Doesn't work with sessions
-./templates/de/html/admin/admin_login_form.tpl:38:		@TODO Try to move the select box to our generic functions
+./templates/de/html/admin/admin_login_form.tpl:34:	@TODO Doesn't work with sessions
+./templates/de/html/admin/admin_login_form.tpl:37:		@TODO Try to move the select box to our generic functions
 ./templates/de/html/admin/admin_mods_edit.tpl:3:	<!-- @TODO Shouldn't we add a title here? //-->
 ./templates/de/html/admin/admin_optimize.tpl:3:	<!-- @TODO Shouldn't we add a title here? //-->
 ./templates/de/html/admin/admin_send_bonus_form.tpl:4:	<!-- @TODO Maybe add some title? //-->
 ./templates/de/html/guest/guest_login.tpl:21:	@TODO Deactivated feature, try to implement it or remove it.
 ./templates/de/html/guest/guest_nickname_login.tpl:21:	@TODO Deactivated feature, try to find a solution for this or remove it.
 ./templates/de/html/guest/guest_stats_member.tpl:21:	@TODO We have to fix these counters.
+./templates/de/html/member/member_unconfirmed_table_nopoints.tpl:11:		<!-- @TODO Nothing to say here? //-->
 ./templates/de/html/surfbar/surfbar_frame_textlinks.tpl:5:		<!-- @TODO These are static lines and should be replaced by a filter (see ext-sponsor) //-->
 ./templates/de/html/surfbar/surfbar_frame_top.tpl:32:// @TODO Try to rewrite this JavaScript to js.php?js=surfbar_frame_top (wouldn't be easy)
 ### ### DEPRECATION FOLLOWS: ### ###
diff --git a/debug.php b/debug.php
index 44af72c545..5e8a6b82ed 100644
--- a/debug.php
+++ b/debug.php
@@ -54,7 +54,7 @@ if ((isExtensionActive('debug')) && (!ifFatalErrorsDetected())) {
 		// Handle the request
 		if (DEBUG_HANDLE_REQUEST(postRequestParameter('request'))) {
 			// Construct FQFN for the module
-			$inc = sprintf("inc/debug/%s/request_%s",
+			$inc = sprintf("inc/debug/%s/request_%s.php",
 				getConfig('debug_mode'),
 				SQL_ESCAPE(postRequestParameter('request'))
 			);
diff --git a/inc/autopurge/purge-inact.php b/inc/autopurge/purge-inact.php
index 1e725110c5..3f98e7023a 100644
--- a/inc/autopurge/purge-inact.php
+++ b/inc/autopurge/purge-inact.php
@@ -127,23 +127,18 @@ ORDER BY
 
 	// Now let's have a look for inactive accounts we want to delete we newly use the same exclude list
 	// here for e.g. excluding holiday users
-	$result_inactive = SQL_QUERY_ESC("SELECT
+	$result_inactive = SQL_QUERY("SELECT
 	d.userid, d.email, d.last_online
 FROM
 	`{?_MYSQL_PREFIX?}_user_data` AS d
 WHERE
 	`status`='CONFIRMED' AND
-	`joined` < (UNIX_TIMESTAMP() - %s) AND
-	`last_online` < (UNIX_TIMESTAMP() - %s) AND
-	`ap_notified` < (UNIX_TIMESTAMP() - %s)
+	`joined` < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND
+	`last_online` < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND
+	`ap_notified` < (UNIX_TIMESTAMP() - {?ap_inactive_time?})
 ".$EXCLUDE_LIST."
 ORDER BY
-	`userid` ASC",
-		array(
-			getConfig('ap_inactive_since'),
-			getConfig('ap_inactive_since'),
-			getConfig('ap_inactive_time')
-		), __FILE__, __LINE__);
+	`userid` ASC", __FILE__, __LINE__);
 
 	if (SQL_NUMROWS($result_inactive) > 0) {
 		// Prepare variable...
diff --git a/inc/config-functions.php b/inc/config-functions.php
index b58db19ee5..b32fcf713f 100644
--- a/inc/config-functions.php
+++ b/inc/config-functions.php
@@ -224,7 +224,7 @@ function updateOldConfigFile () {
 
 				/// ... and write it to the new config
 				//* DEBUG: */ outputHtml('function=' . $function . ',new=' . $new . ',comment=' . $comment . "<br />");
-				changeDataInFile(getConfig('CACHE_PATH') . 'config-local.php', $comment, $function . "('" . $oldNew . "', \"", "\");", constant($new), 0);
+				changeDataInFile(getConfig('CACHE_PATH') . 'config-local.php', $comment, $function . "('" . $oldNew . "', \"", '");', constant($new), 0);
 				//* DEBUG: */ outputHtml("CHANGED!<br />");
 
 				// Mark it as done
@@ -263,7 +263,7 @@ function updateOldConfigFile () {
 			$key = substr(trim($parts[0]), 1, -1); $value = substr(trim($parts[1]), 1, -2);
 
 			// We can now save the right part in new config file
-			changeDataInFile(getConfig('CACHE_PATH') . 'config-local.php', $comments[$key], "	'".$key."'     => \"", "\",", $value, 0);
+			changeDataInFile(getConfig('CACHE_PATH') . 'config-local.php', $comments[$key], "	'".$key."'     => \"", '",', $value, 0);
 		}
 	} // END - foreach
 
diff --git a/inc/fix_menu.php b/inc/fix_menu.php
index 31d3f96ff7..1fb3d21da5 100644
--- a/inc/fix_menu.php
+++ b/inc/fix_menu.php
@@ -74,11 +74,20 @@ foreach (array('guest','member','admin') as $menu) {
 				if (is_null($entry['what'])) {
 					// Main menu is double
 					SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `action`='%s' AND `what` IS NULL LIMIT %s",
-						array($menu, $entry['action'], ($entries - 1)), __FILE__, __LINE__);
+						array(
+							$menu,
+							$entry['action'],
+							($entries - 1)
+						), __FILE__, __LINE__);
 				} else {
 					// Sub menu is double
 					SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `action`='%s' AND `what`='%s' LIMIT %s",
-						array($menu, $entry['action'], $entry['what'], ($entries - 1)), __FILE__, __LINE__);
+						array(
+							$menu,
+							$entry['action'],
+							$entry['what'],
+							($entries - 1)
+						), __FILE__, __LINE__);
 				}
 			} // END - if
 		}
diff --git a/inc/functions.php b/inc/functions.php
index 5e7d2962d2..f010daf758 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -2502,7 +2502,7 @@ function generateErrorCodeFromUserStatus ($status='') {
 // Back-ported from the new ship-simu engine. :-)
 function debug_get_printable_backtrace () {
 	// Init variable
-	$backtrace = "<ol>\n";
+	$backtrace = '<ol>';
 
 	// Get and prepare backtrace for output
 	$backtraceArray = debug_backtrace();
@@ -2510,11 +2510,11 @@ function debug_get_printable_backtrace () {
 		if (!isset($trace['file'])) $trace['file'] = __FUNCTION__;
 		if (!isset($trace['line'])) $trace['line'] = __LINE__;
 		if (!isset($trace['args'])) $trace['args'] = array();
-		$backtrace .= "<li class=\"debug_list\"><span class=\"backtrace_file\">".basename($trace['file'])."</span>:" . $trace['line'].", <span class=\"backtrace_function\">" . $trace['function'].'('.count($trace['args']).")</span></li>\n";
+		$backtrace .= '<li class="debug_list"><span class="backtrace_file">' . basename($trace['file']) . '</span>:' . $trace['line'].", <span class=\"backtrace_function\">" . $trace['function'] . '(' . count($trace['args']) . ')</span></li>';
 	} // END - foreach
 
 	// Close it
-	$backtrace .= "</ol>\n";
+	$backtrace .= '</ol>';
 
 	// Return the backtrace
 	return $backtrace;
@@ -2566,17 +2566,17 @@ function debug_report_bug ($F, $L, $message = '', $sendEmail = true) {
 	} // END - if
 
 	// Add output
-	$debug .= "Please report this bug at <a title=\"Direct link to the bug-tracker\" href=\"http://bugs.mxchange.org\" rel=\"external\" target=\"_blank\">http://bugs.mxchange.org</a> and include the logfile from <strong>" . str_replace(getConfig('PATH'), '', getConfig('CACHE_PATH')) . "debug.log</strong> in your report (you can now attach files):<pre>";
+	$debug .= 'Please report this bug at <a title="Direct link to the bug-tracker" href="http://bugs.mxchange.org" rel="external" target="_blank">http://bugs.mxchange.org</a> and include the logfile from <strong>' . str_replace(getConfig('PATH'), '', getConfig('CACHE_PATH')) . 'debug.log</strong> in your report (you can now attach files):<pre>';
 	$debug .= debug_get_printable_backtrace();
-	$debug .= "</pre>\nRequest-URI: " . getRequestUri()."<br />\n";
-	$debug .= "Thank you for finding bugs.";
+	$debug .= '</pre>Request-URI: ' . getRequestUri() . '<br />';
+	$debug .= 'Thank you for finding bugs.';
 
 	// Send an email? (e.g. not wanted for evaluation errors)
 	if (($sendEmail === true) && (!isInstallationPhase())) {
 		// Prepare content
 		$content = array(
-			'message'     => trim($message),
-			'backtrace'   => trim(debug_get_mailable_backtrace())
+			'message'   => trim($message),
+			'backtrace' => trim(debug_get_mailable_backtrace())
 		);
 
 		// Send email to webmaster
diff --git a/inc/install-inc.php b/inc/install-inc.php
index 1f70d3aa55..4f62415814 100644
--- a/inc/install-inc.php
+++ b/inc/install-inc.php
@@ -179,7 +179,7 @@ if ((!isInstalled()) || (!isAdminRegistered())) {
 			// MySQL data
 			$OUT = '';
 			foreach ($GLOBALS['install_mysql'] as $key => $value) {
-				$OUT .= "    <input type=\"hidden\" name=\"mysql[" . $key . "]\" value=\"" . $value . "\" />\n";
+				$OUT .= '    <input type="hidden" name="mysql[' . $key . ']" value="' . $value . '" />';
 			} // END - foreach
 			$content['mysql_hidden'] = $OUT;
 
diff --git a/inc/libs/bonus_functions.php b/inc/libs/bonus_functions.php
index 5c99bb2e47..ed24b4b0b3 100644
--- a/inc/libs/bonus_functions.php
+++ b/inc/libs/bonus_functions.php
@@ -149,7 +149,7 @@ function addBonusRanks ($data, $type, $userid) {
 	} // END - if
 
 	// Load rankings
-	$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_bonus_turbo` WHERE %s=%s ORDER BY `level` ASC LIMIT {?bonus_lines?}",
+	$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_bonus_turbo` WHERE `%s`=%s ORDER BY `level` ASC LIMIT {?bonus_lines?}",
 		array($type, $data), __FUNCTION__, __LINE__);
 	if (SQL_NUMROWS($result) > 0) {
 		// Start generating the ranking list
@@ -197,12 +197,8 @@ LIMIT 1",
 			$rows['rank'] = $rank;
 			$rows['sw']   = $SW;
 
-			// Output row
-			$OUT .= "<tr>
-  <td class=\"bonus_rank_".$rows['rank']." bottom switch_sw".$rows['sw']."\">".$rows['rank'].".</td>
-  <td class=\"bonus_rank_".$rows['rank']." bottom switch_sw".$rows['sw']."\" align=\"center\">".$rows['userid']."</td>
-  <td class=\"bonus_rank_".$rows['rank']." bottom switch_sw".$rows['sw']."\" align=\"center\">{%pipe,translateComma=".$rows['points']."%}</td>
-</tr>\n";
+			// Load row template
+			$OUT .= loadTemplate('member_bonus_turbo_row', true, $rows);
 
 			// Switch color
 			$SW = 3 - $SW;
@@ -210,16 +206,16 @@ LIMIT 1",
 
 		if ($self === false) {
 			// If current user was not found set constant
-			// @TODO Try to find a way for rewriting this constant
 			$GLOBALS['ranking_content']['rankings'] = getMessage('BONUS_RANK_YOU_ARE_404');
 		} // END - if
 	} else {
 		// No entries found!
-		$OUT = "<tr>
-  <td colspan=\"3\" align=\"center\" height=\"30\" class=\"bottom\">
-    <div class=\"guest_failed\">".getMaskedMessage('BONUS_NO_RANKS', $data)."</div>
+		// @TODO Move this HTML to a template
+		$OUT = '<tr>
+  <td colspan="3" align="center" height="30" class="bottom">
+    <div class="guest_failed">' . getMaskedMessage('BONUS_NO_RANKS', $data) . '</div>
   </td>
-</tr>\n";
+</tr>';
 	}
 
 	// Retutn content
@@ -299,14 +295,14 @@ function FILTER_ADD_LOGIN_BONUS () {
 	if ((isExtensionInstalledAndNewer('sql_patches', '0.2.8')) && (getConfig('bonus_active') == 'Y') && (getConfig('bonus_login_yn') == 'Y')) {
 		// Update last login if far enougth away
 		// @TODO This query isn't right, it will only update if the user was for a longer time away!
-		SQL_QUERY_ESC("UPDATE
+		SQL_QUERY_ESC('UPDATE
 	`{?_MYSQL_PREFIX?}_user_data`
 SET
 	`last_login`=UNIX_TIMESTAMP()
 WHERE
 	`userid`=%s AND
 	`last_login` < (UNIX_TIMESTAMP() - {?login_timeout?})
-LIMIT 1",
+LIMIT 1',
 			array(
 				getMemberId()
 			), __FUNCTION__, __LINE__
diff --git a/inc/libs/rallye_functions.php b/inc/libs/rallye_functions.php
index 4e03f7ecba..c8662e6dc7 100644
--- a/inc/libs/rallye_functions.php
+++ b/inc/libs/rallye_functions.php
@@ -55,7 +55,7 @@ function autostartReferalRallyes ($result) {
 		array(bigintval($id)), __FUNCTION__, __LINE__);
 
 	// Transfer all neccessary data to the $content array
-	$content['userid_cnt'] = countSumTotalData('CONFIRMED','user_data','userid','status',true);
+	$content['userid_cnt'] = getTotalConfirmedUser();
 	$content['start']      = generateDateTime($start, 2);
 	$content['end']        = generateDateTime($end  , 2);
 	$content['now_t']      = generateDateTime(time(), 2);
diff --git a/inc/libs/refback_functions.php b/inc/libs/refback_functions.php
index 5dc539c2e7..dcd553bf17 100644
--- a/inc/libs/refback_functions.php
+++ b/inc/libs/refback_functions.php
@@ -52,7 +52,7 @@ function addRefbackPoints ($userid, $ref, $points, $ref_points) {
 	$return = $points;
 
 	// Get all ref levels
-	$result_refs = SQL_QUERY("SELECT `level`, `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` WHERE `level` > 0 ORDER BY `level` ASC",
+	$result_refs = SQL_QUERY('SELECT `level`, `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` WHERE `level` > 0 ORDER BY `level` ASC',
 		__FUNCTION__, __LINE__);
 
 	// "Walk" through all level
@@ -114,30 +114,33 @@ function getRefbackPercents ($userid, $ref) {
 	// Skip identical ids
 	if ($userid == $ref) return 0;
 
-	// Default is zero
-	$percents = '0';
-
-	// Get percents from database
-	$result = SQL_QUERY_ESC("SELECT refback FROM `{?_MYSQL_PREFIX?}_user_refs` WHERE `userid`=%s AND `refid`=%s LIMIT 1",
-	array($ref, $userid), __FUNCTION__, __LINE__);
-
-	// Entry found? (Should be!)
-	if (SQL_NUMROWS($result) == 1) {
-		// Fetch percents
-		list($percents) = SQL_FETCHROW($result);
-		//* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):percents={$percents}<br />");
-	} else {
-		// Debug log
-		//* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>): NO ENTRY FOUND! :-(<br />");
-		logDebugMessage(__FUNCTION__, __LINE__, "userid={$userid},ref={$ref} - No entry found! :-(");
-	}
-
-	// Free result
-	SQL_FREERESULT($result);
+	// Is it cached?
+	if (!isset($GLOBALS['refback_percents'][$userid][$ref])) {
+		// Default is zero
+		$GLOBALS['refback_percents'][$userid][$ref] = '0';
+
+		// Get percents from database
+		$result = SQL_QUERY_ESC("SELECT `refback` FROM `{?_MYSQL_PREFIX?}_user_refs` WHERE `userid`=%s AND `refid`=%s LIMIT 1",
+			array($ref, $userid), __FUNCTION__, __LINE__);
+
+		// Entry found? (Should be!)
+		if (SQL_NUMROWS($result) == 1) {
+			// Fetch percents
+			list($GLOBALS['refback_percents'][$userid][$ref]) = SQL_FETCHROW($result);
+			//* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):percents=".$GLOBALS['refback_percents'][$userid][$ref]."<br />");
+		} else {
+			// Debug log
+			//* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>): NO ENTRY FOUND! :-(<br />");
+			logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . $ref . ' - No entry found! :-(');
+		}
+
+		// Free result
+		SQL_FREERESULT($result);
+	} // END - if
 
 	// Return percents
 	//* DEBUG: */ print("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
-	return $percents;
+	return $GLOBALS['refback_percents'][$userid][$ref];
 }
 
 // "Getter" for userid array which will return only one entry
diff --git a/inc/libs/theme_functions.php b/inc/libs/theme_functions.php
index 2279e5741f..ef2d07b3aa 100644
--- a/inc/libs/theme_functions.php
+++ b/inc/libs/theme_functions.php
@@ -92,11 +92,12 @@ ORDER BY
 	SQL_FREERESULT($result);
 
 	// Construct selection form for the box template
+	// @TODO Can't this be rewritten to an API function?
 	$OUT = '';
 	foreach ($themesArray['theme_unix'] as $key => $theme) {
-		$OUT .= "  <option value=\"".$theme."\"";
+		$OUT .= '  <option value="' . $theme . '"';
 		if ($theme == getCurrentTheme()) $OUT .= ' selected="selected"';
-		$OUT .= ">".$themesArray['theme_name'][$key]."</option>\n";
+		$OUT .= '>' . $themesArray['theme_name'][$key] . '</option>';
 	} // END - foreach
 
 	// Remember content
diff --git a/inc/libs/transfer_functions.php b/inc/libs/transfer_functions.php
index 1104d6bf5a..6c509f4d8d 100644
--- a/inc/libs/transfer_functions.php
+++ b/inc/libs/transfer_functions.php
@@ -51,7 +51,7 @@ function autoPurgeTransfers ($max, $age) {
 		$remove = SQL_NUMROWS($result) - $max;
 
 		// This will make it really old, so the final removal query will find it
-		$result = SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_transfers_in` SET `time_trans`=0 ORDER BY `id` LIMIT %s",
+		$result = SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_transfers_in` SET `time_trans`=0 ORDER BY `id` ASC LIMIT %s",
 			array($remove), __FUNCTION__, __LINE__);
 	} // END - if
 
@@ -62,7 +62,7 @@ function autoPurgeTransfers ($max, $age) {
 		$remove = SQL_NUMROWS($result) - $max;
 
 		// This will make it really old, so the final removal query will find it
-		$result = SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_transfers_out` SET `time_trans`=0 ORDER BY `id` LIMIT %s",
+		$result = SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_transfers_out` SET `time_trans`=0 ORDER BY `id` ASC LIMIT %s",
 			array($remove), __FUNCTION__, __LINE__);
 	} // END - if
 
diff --git a/inc/libs/user_functions.php b/inc/libs/user_functions.php
index 549340dd24..012ff2c6b4 100644
--- a/inc/libs/user_functions.php
+++ b/inc/libs/user_functions.php
@@ -70,8 +70,14 @@ function alpha ($sortby, $colspan, $return=false) {
 		}
 	} // END - while
 
+	// Prepare content
+	$content = array (
+		'colspan2'        => $colspan,
+		'alpha_selection' => $OUT
+	);
+
 	// Load template
-	$OUT = loadTemplate('admin_list_user_alpha', true, $OUT);
+	$OUT = loadTemplate('admin_list_user_alpha', true, $content);
 	if ($return === true) {
 		// Return generated code
 		return $OUT;
@@ -118,7 +124,9 @@ function addSortLinks ($letter, $sortby, $colspan, $return=false) {
 		}
 	} // END - foreach
 
+	// Add list and colspan
 	$content['list'] = substr($OUT, 0, -13);
+	$content['colspan2'] = $colspan;
 
 	// Load template
 	$OUT = loadTemplate('admin_list_user_sort', true, $content);
diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php
index b4b8d03dcd..402b3ed7d7 100644
--- a/inc/modules/admin/admin-inc.php
+++ b/inc/modules/admin/admin-inc.php
@@ -1353,5 +1353,20 @@ function doVerifyExpertSettings () {
 	return $return;
 }
 
+// Generate link to unconfirmed mails for admin
+function generateUnconfirmedAdminLink ($id, $unconfirmed, $type = 'bid') {
+	// Init output
+	$OUT = $unconfirmed;
+
+	// Do we have unconfirmed mails?
+	if ($unconfirmed > 0) {
+		// Add link to list_unconfirmed what-file
+		$OUT = '<a href="{%url=modules.php?module=admin&amp;what=list_unconfirmed&amp;' . $type . '=' . $id . '%}">' . translateComma($unconfirmed) . '</a>';
+	} // END - if
+
+	// Return it
+	return $OUT;
+}
+
 // [EOF]
 ?>
diff --git a/inc/modules/admin/overview-inc.php b/inc/modules/admin/overview-inc.php
index 9685c51acd..b9f2da4b28 100644
--- a/inc/modules/admin/overview-inc.php
+++ b/inc/modules/admin/overview-inc.php
@@ -168,7 +168,7 @@ LIMIT 1",
 				if ($taskData['task_type'] == 'SUPPORT_MEMBER') {
 					$mode = substr($taskData['text'], 0, strpos($taskData['text'], ':'));
 					$taskData['text'] = substr($taskData['text'], strpos($taskData['text'], ':') + 1);
-					$add = "<li>{--ADMIN_TASK_SUPPORT_MODE--}: <strong>" . $mode . "</strong></li>";
+					$add = '<li>{--ADMIN_TASK_SUPPORT_MODE--}: <strong>' . $mode . '</strong></li>';
 				} // END - if
 
 				// Is a userid assign?
@@ -179,7 +179,7 @@ LIMIT 1",
 						$content = getUserDataArray();
 
 						// Generate HTML list entry
-						$add = "<li>{--ADMIN_MEMBER_UID--}: <strong>".generateUserProfileLink($taskData['userid'], 'user_data')." (<a href=\"".generateEmailLink($content['email'], 'user_data')."\">".translateGender($content['gender']) . ' ' . $content['surname'] . ' ' . $content['family']."</a>)</strong></li>";
+						$add = '<li>{--ADMIN_MEMBER_UID--}: <strong>' . generateUserProfileLink($taskData['userid'], 'user_data') . ' (<a href="' . generateEmailLink($content['email'], 'user_data') . '">' . translateGender($content['gender']) . ' ' . $content['surname'] . ' ' . $content['family'] . '</a>)</strong></li>';
 					} else {
 						// Invalid userid, so log and zero it
 						logDebugMessage(__FUNCTION__, __LINE__, 'Invalid userid=' . $taskData['userid'] . ' -> not found!');
diff --git a/inc/modules/admin/what-admin_add.php b/inc/modules/admin/what-admin_add.php
index 2ce5fe9133..f4155ec8c9 100644
--- a/inc/modules/admin/what-admin_add.php
+++ b/inc/modules/admin/what-admin_add.php
@@ -134,24 +134,25 @@ if (!isFormSent()) {
 			}
 		}
 	}
-	$OUT = "    <select class=\"admin_select\" name=\"sort\" size=\"1\">
-      <option value=\"0\">{--IS_FIRST_MENU--}</option>\n";
+
+	$OUT = '    <select class="admin_select" name="sort" size="1">
+      <option value="0">{--IS_FIRST_MENU--}</option>';
 	foreach ($below as $key => $m) {
 		if (is_array($m)) {
 			foreach ($m as $key2 => $m2) {
-				$OUT .= "      <option value=\"".$m2."\">".$titles[$key][$key2];
+				$OUT .= '      <option value="' . $m2 . '">' . $titles[$key][$key2];
 				foreach ($menus as $k => $v) {
 					if (($v == $key) && (!is_array($v))) {
-						$OUT .= " (" . $titles[$k] . ')';
-					}
-				}
-				$OUT .= "</option>\n";
+						$OUT .= ' (' . $titles[$k] . ')';
+					} // END - if
+				} // END - foreach
+				$OUT .= '</option>';
 			}
 		} else {
-			$OUT .= "      <option value=\"".$m."\">".$titles[$key]."</option>\n";
+			$OUT .= '      <option value="' . $m . '">' . $titles[$key] . '</option>';
 		}
 	}
-	$OUT .= "</select>";
+	$OUT .= '</select>';
 
 	// Prepare selections for template
 	$content['below_selection']  = $OUT;
diff --git a/inc/modules/admin/what-admins_mails.php b/inc/modules/admin/what-admins_mails.php
index 8afbb9aef9..ec939a6d1e 100644
--- a/inc/modules/admin/what-admins_mails.php
+++ b/inc/modules/admin/what-admins_mails.php
@@ -58,18 +58,18 @@ if (isFormSent('edit')) {
 			$OUT = '';
 			$adminId2 = '0'; $id = '0';
 			while ($content = SQL_FETCHARRAY($result)) {
-				// @TODO Can this be rewritten???
-				$OUT .= "<select name=\"admin_id[".$content['id']."]\" size=\"1\" class=\"admin_select\">
-<option value=\"0\"";
+				// @TODO Can this be rewritten to an API function?
+				$OUT .= '<select name="admin_id[' . $content['id'] . ']" size="1" class="admin_select">
+<option value="0"';
 				if ($content['admin_id'] == '0') $OUT .= ' selected="selected"';
-				$OUT .=">{--ADMINS_ALL_ADMINS--}</option>\n";
+				$OUT .= '>{--ADMINS_ALL_ADMINS--}</option>';
 				if (isExtensionActive('events')) {
-					$OUT .= "<option value=\"-1\"";
+					$OUT .= '<option value="-1"';
 					if ($content['admin_id'] == '-1') $OUT .= ' selected="selected"';
-					$OUT .= ">{--ADMINS_TO_USER_EVENTS--}</option>\n";
+					$OUT .= '>{--ADMINS_TO_USER_EVENTS--}</option>';
 				}
 				$OUT .= generateOptionList('admins', 'id', 'login', $content['admin_id'], 'email');
-				$OUT .= "</select>\n<br />\n";
+				$OUT .= '</select>';
 
 				// Transfer ids
 				$adminId2 = $content['admin_id'];
diff --git a/inc/modules/admin/what-config_bonus.php b/inc/modules/admin/what-config_bonus.php
index c623e19b98..fc320e7d81 100644
--- a/inc/modules/admin/what-config_bonus.php
+++ b/inc/modules/admin/what-config_bonus.php
@@ -59,7 +59,7 @@ if (isFormSent()) {
 	foreach (postRequestParameter('rate') as $rate) {
 		$rate = trim(convertCommaToDot($rate));
 		if (!empty($rate)) $RATES[] = $rate;
-	}
+	} // END - foreach
 	setPostRequestParameter('turbo_rates', trim(implode(';', $RATES)));
 	unsetPostRequestParameter('rate');
 
@@ -92,12 +92,12 @@ if (isFormSent()) {
 	if (getConfig('turbo_rates') == '') $RANKS = array(round(getConfig('turbo_bonus') / 2), round(getConfig('turbo_bonus') / 4));
 
 	// Generate list
-	$OUT = "<ol start=\"2\">\n";
+	$OUT = '<ol start="2">';
 	$cnt = '0';
 	foreach ($RANKS as $k => $rate) {
-		if (!empty($rate)) 	{
+		if (!empty($rate)) {
 			// Print only when something is in
-			$OUT .= "  <li><input type=\"text\" name=\"rate[".($k + 2)."]\" class=\"admin_normal\" size=\"4\" maxlength=\"7\" value=\"".$rate."\" /> <div class=\"admin_note\">({?POINTS?})</div></li>\n";
+			$OUT .= '<li><input type="text" name="rate[' . ($k + 2) . ']" class="admin_normal" size="4" maxlength="7" value="' . $rate . '" /> <div class="admin_note">({?POINTS?})</div></li>';
 		} // END - if
 		$cnt++;
 	} // END - foreach
@@ -108,9 +108,9 @@ if (isFormSent()) {
 
 	// Add more empty fields
 	for ($i = $cnt; $i < $max; $i++) {
-		$OUT .= "  <li><input type=\"text\" name=\"rate[".($i+2)."]\" class=\"admin_normal\" size=\"4\" maxlength=\"7\" /> <div class=\"admin_note\">({?POINTS?})</div></li>\n";
+		$OUT .= '  <li><input type="text" name="rate[' . ($i+2) . ']" class="admin_normal" size="4" maxlength="7" /> <div class="admin_note">({?POINTS?})</div></li>';
 	} // END - for
-	$OUT .= "</ol>\n";
+	$OUT .= '</ol>';
 	$content['trates_list'] = $OUT;
 
 	// Selection boxes
diff --git a/inc/modules/admin/what-config_mods.php b/inc/modules/admin/what-config_mods.php
index a24778f086..dee6e47d26 100644
--- a/inc/modules/admin/what-config_mods.php
+++ b/inc/modules/admin/what-config_mods.php
@@ -125,44 +125,38 @@ if (isFormSent('edit')) {
 
 if (countPostSelection() == 0) {
 	// Load module data (We do not need to check if there's at least one...)
-	$result = SQL_QUERY('SELECT id, module, locked, hidden, admin_only, title, mem_only
-FROM `{?_MYSQL_PREFIX?}_mod_reg`
-ORDER BY module', __FILE__, __LINE__);
+	$result = SQL_QUERY('SELECT
+	`id`, `module`, `locked`, `hidden`, `admin_only`, `title`, `mem_only`
+FROM
+	`{?_MYSQL_PREFIX?}_mod_reg`
+ORDER BY
+	`module` ASC', __FILE__, __LINE__);
+
 	$OUT = ''; $SW = 2;
 	while ($content = SQL_FETCHARRAY($result)) {
 		// Reset title to --- if it is NULL
 		if (empty($content['title'])) $content['title'] = '---';
 		if (($content['module'] == 'index') || ($content['module'] == 'login')) {
 			// Add link to detail statistics
-			$content['module'] = "<strong><a href=\"{%url=modules.php?module=admin&amp;what=stats_mods&amp;mod=" . $content['module'] . "%}\">" . $content['module'] . "</a></strong>";
+			$content['module'] = '<strong><a href="{%url=modules.php?module=admin&amp;what=stats_mods&amp;mod=' . $content['module'] . '%}">' . $content['module'] . '</a></strong>';
 		} // END - if
 
 		// Prepare array for the template
-		// @TODO Rewritings: mod->module in template
-		$content = array(
-			'sw'     => $SW,
-			'id'     => $content['id'],
-			'mod'    => $content['module'],
-			'title'  => $content['title'],
-			'locked' => translateYesNo($content['locked']),
-			'hidden' => translateYesNo($content['hidden']),
-			'admin'  => translateYesNo($content['admin_only']),
-			'mem'    => translateYesNo($content['mem_only']),
-		);
+		$content['sw'] = $SW;
 
 		// Load row template
 		$OUT .= loadTemplate('admin_list_mods_row', true, $content);
 
 		// Switch colors
 		$SW = 3 - $SW;
-	}
+	} // END - while
 
 	// Free memory
 	SQL_FREERESULT($result);
 
 	// Load main template
 	loadTemplate('admin_list_mods', false, $OUT);
-}
+} // END - if
 
 // [EOF]
 ?>
diff --git a/inc/modules/admin/what-config_register.php b/inc/modules/admin/what-config_register.php
index 4cba9e31e0..0744101ffc 100644
--- a/inc/modules/admin/what-config_register.php
+++ b/inc/modules/admin/what-config_register.php
@@ -73,16 +73,10 @@ while ($content = SQL_FETCHARRAY($result)) {
 
 	// Add more data
 	$content['sw']        = $SW;
-	$content['selection'] = addSelectionBox('yn', $content['field_required'], "sel[".$content['id']."]");
+	$content['selection'] = addSelectionBox('yn', $content['field_required'], 'sel[' . $content['id'] . ']');
 
 	// @TODO Move this HTML code into a template
-	$OUT .= "<tr>
-	<td align=\"center\" class=\"switch_sw".$content['sw']." bottom right\">".$content['id']."</td>
-	<td class=\"switch_sw".$content['sw']." bottom right\">".$content['field_name']."</td>
-	<td align=\"center\" class=\"switch_sw".$content['sw']." bottom right\">
-		".$content['selection']."
-	</td>
-</tr>\n";
+	$OUT .= loadTemplate('admin_config_register_row', true, $content);
 
 	// Switch color
 	$SW = 3 - $SW;
diff --git a/inc/modules/admin/what-del_transfer.php b/inc/modules/admin/what-del_transfer.php
index e6d63adc43..b4fc851c70 100644
--- a/inc/modules/admin/what-del_transfer.php
+++ b/inc/modules/admin/what-del_transfer.php
@@ -53,9 +53,9 @@ if (isFormSent('del')) {
 
 		// Delete entries...
 		foreach (postRequestParameter('sel') as $id => $sel) {
-			addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_transfers_in` WHERE `trans_id`=%s LIMIT 1",
+			addSql(SQL_QUERY_ESC('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_transfers_in` WHERE `trans_id`=%s LIMIT 1',
 				array(bigintval($id)), __FILE__, __LINE__, false));
-			addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_transfers_out` WHERE `trans_id`=%s LIMIT 1",
+			addSql(SQL_QUERY_ESC('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_transfers_out` WHERE `trans_id`=%s LIMIT 1',
 				array(bigintval($id)), __FILE__, __LINE__, false));
 		} // END - foreach
 
@@ -65,39 +65,39 @@ if (isFormSent('del')) {
 } // END - if
 
 // We only need outgoing transfers
-$result = SQL_QUERY("SELECT `userid`, `to_userid`, `trans_id`, `points`, `reason`, `time_trans` FROM `{?_MYSQL_PREFIX?}_user_transfers_out` ORDER BY `trans_id` ASC", __FILE__, __LINE__);
+$result = SQL_QUERY('SELECT
+	`userid` AS `from_userid`, `to_userid`, `trans_id`, `points`, `reason`, `time_trans`
+FROM
+	`{?_MYSQL_PREFIX?}_user_transfers_out`
+ORDER BY
+	`trans_id` ASC', __FILE__, __LINE__);
+
 $total = '0';
 if (SQL_NUMROWS($result) > 0) {
 	// Output rows
 	$OUT = ''; $SW = 2;
 	while ($content = SQL_FETCHARRAY($result)) {
 		// Prepare data for the row template
-		$content = array(
-			'sw'          => $SW,
-			'trans_id'    => $content['trans_id'],
-			'time_trans'  => generateDateTime($content['time_trans'], 3),
-			'userid_from' => generateUserProfileLink($content['userid']),
-			'userid_to'   => generateUserProfileLink($content['to_userid']),
-			'reason'      => $content['reason'],
-			'points'      => translateComma($content['points']),
-		);
+		$content['sw']         = $SW;
+		$content['time_trans'] = generateDateTime($content['time_trans'], 3);
 
 		// Load row template
 		$OUT .= loadTemplate('admin_del_transfer_row', true, $content);
 
 		// Sum points and switch colors
-		$total += $content['points']; $SW = 3 - $SW;
+		$total += $content['points'];
+		$SW = 3 - $SW;
 	} // END - while
 
 	// Free memory
 	SQL_FREERESULT($result);
 } else {
 	// Nothing for in and out
-	$OUT = "<tr>
-  <td colspan=\"6\" align=\"center\" class=\"bottom\">
-    ".loadTemplate('admin_settings_saved', true, getMessage('TRANSFER_NO_INOUT_TRANSFERS'))."
+	$OUT = '<tr>
+  <td colspan="6" align="center" class="bottom">
+    ' . loadTemplate('admin_settings_saved', true, getMessage('TRANSFER_NO_INOUT_TRANSFERS')) . '
   </td>
-</tr>";
+</tr>';
 }
 
 // ... and add them to a constant for the template
diff --git a/inc/modules/admin/what-email_archiv.php b/inc/modules/admin/what-email_archiv.php
index 369cf7f321..d840755cd5 100644
--- a/inc/modules/admin/what-email_archiv.php
+++ b/inc/modules/admin/what-email_archiv.php
@@ -66,7 +66,7 @@ if (!isGetRequestParameterSet('page'))   setGetRequestParameter('page'  , 1);
 if (!isGetRequestParameterSet('offset')) setGetRequestParameter('offset', getConfig('mails_page'));
 
 // Add limitation to SQL string
-$sql .= " LIMIT ".(getRequestParameter('offset') * getRequestParameter('page') - getRequestParameter('offset')) . ', ' . getRequestParameter('offset');
+$sql .= ' LIMIT ' . (getRequestParameter('offset') * getRequestParameter('page') - getRequestParameter('offset')) . ', ' . getRequestParameter('offset');
 
 // Run SQL query for normal mails
 $result = SQL_QUERY($sql, __FILE__, __LINE__);
@@ -109,23 +109,11 @@ if (SQL_NUMROWS($result) > 0) {
 		} // END - if
 
 		// Prepare data for the row template
-		$content = merge_array($content, array(
-			'sw'          => $SW,
-			'u_link'      => generateUserProfileLink($pool['sender']),
-			'subject'     => $pool['subject'],
-			'text'        => $pool['text'],
-			'pay'         => getPaymentTitlePrice($pool['payment_id']),
-			'cat'         => getCategory($pool['cat_id']),
-			'sent'        => $pool['max_rec'],
-			'ruserids'    => convertReceivers($pool['receivers']),
-			'unconfirmed' => $pool['unconfirmed'],
-			'type'        => translatePoolType($pool['data_type']),
-			'target_send' => $pool['target_send'],
-			'frametester' => generateFrametesterUrl($pool['url']),
-			'url'         => $pool['url'],
-			'timestamp'   => generateDateTime($pool['timestamp'], 0),
-			'mid'         => $pool['id'],
-		));
+		$content['sw'] = $SW;
+		$content['timestamp'] = generateDateTime($pool['timestamp'], 0);
+
+		// Merge pool data with content
+		$content = merge_array($content, $pool);
 
 		// Load row template and switch colors
 		$OUT .= loadTemplate('admin_email_archiv_row', true, $content);
diff --git a/inc/modules/admin/what-email_details.php b/inc/modules/admin/what-email_details.php
index e66c6bb224..22ca7fb20a 100644
--- a/inc/modules/admin/what-email_details.php
+++ b/inc/modules/admin/what-email_details.php
@@ -56,43 +56,52 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 addMenuDescription('admin', __FILE__);
 
 // Normal mails ordered by your members
-//              0     1       2       3       4           5          6          7       8        9          10
-$sql = "SELECT id, sender, subject, text, receivers, payment_id, data_type, timestamp, url, target_send, cat_id
-FROM `{?_MYSQL_PREFIX?}_pool`
-WHERE data_type IN('ADMIN','TEMP','NEW','ACTIVE')
-ORDER BY timestamp DESC";
+$sql = "SELECT
+	`id`, `sender`, `subject`, `text`, `receivers`, `payment_id`, `data_type`, `timestamp`, `url`, `target_send`, `cat_id`
+FROM
+	`{?_MYSQL_PREFIX?}_pool`
+WHERE
+	`data_type` IN('ADMIN','TEMP','NEW','ACTIVE')
+ORDER BY
+	`timestamp` DESC";
 
 $WHO = getMessage('_ALL');
 $SQL2 = '';
 
 if (isGetRequestParameterSet(('mid'))) {
 	// Only a specific mail shall be displayed
-	//              0     1       2       3       4           5          6          7       8        9          10
-	$sql = "SELECT id, sender, subject, text, receivers, payment_id, data_type, timestamp, url, target_send, cat_id
-	 FROM `{?_MYSQL_PREFIX?}_pool`
-	 WHERE `id`='".bigintval(getRequestParameter('mid'))."'
-	 LIMIT 1";
-	$WHO = getMessage('MAIL_ID').": ".getRequestParameter('mid');
+	$sql = "SELECT
+	`id`, `sender`, `subject`, `text`, `receivers`, `payment_id`, `data_type`, `timestamp`, `url`, `target_send`, `cat_id`
+FROM
+	`{?_MYSQL_PREFIX?}_pool`
+WHERE
+	`id`='".bigintval(getRequestParameter('mid'))."'
+LIMIT 1";
+	$WHO = getMessage('MAIL_ID') . ': ' . getRequestParameter('mid');
 } elseif (isGetRequestParameterSet('userid')) {
 	// All mails by a specific member shall be displayed
-	//              0     1       2       3       4           5          6          7       8        9          10
-	$sql = "SELECT id, sender, subject, text, receivers, payment_id, data_type, timestamp, url, target_send, cat_id
-FROM `{?_MYSQL_PREFIX?}_pool`
-WHERE sender='".bigintval(getRequestParameter('userid'))."'
-ORDER by timestamp DESC";
-	$WHO = getMessage('USER_ID').": ".getRequestParameter('userid');
+	$sql = "SELECT
+	`id`, `sender`, `subject`, `text`, `receivers`, `payment_id`, `data_type`, `timestamp`, `url`, `target_send`, `cat_id`
+FROM
+	`{?_MYSQL_PREFIX?}_pool`
+WHERE
+	`sender`='".bigintval(getRequestParameter('userid'))."'
+ORDER BY
+	`timestamp` DESC";
+	$WHO = getMessage('USER_ID') . ': ' . getRequestParameter('userid');
 }
 
 if ((isExtensionActive('bonus')) && ($WHO == getMessage('_ALL'))) {
-	// Bonus mails sent by you
-	//               0     1       2        3        4      5       6          7       8      9         10          11        12
-	$SQL2 = "SELECT id, subject, text, receivers, points, time, data_type, timestamp, url, cat_id, target_send, mails_sent, clicks
-FROM `{?_MYSQL_PREFIX?}_bonus`
-WHERE is_notify='N'
-ORDER BY timestamp DESC";
-
 	// Check for maximum pages
-	$result_bonus = SQL_QUERY($SQL2, __FILE__, __LINE__);
+	$result_bonus = SQL_QUERY("SELECT
+	`id`, `subject`, `text`, `receivers`, `points`, `time`, `data_type`, `timestamp`, `url`, `cat_id`, `target_send`, `mails_sent`, `clicks`
+	(`mails_sent` - `clicks`) AS `unconfirmed`
+FROM
+	`{?_MYSQL_PREFIX?}_bonus`
+WHERE
+	`is_notify`='N'
+ORDER BY
+	`timestamp` DESC", __FILE__, __LINE__);
 }
 
 // Check for maximum pages
@@ -114,7 +123,7 @@ if (!isGetRequestParameterSet('offset')) {
 // Add limitation to SQL string
 if (!isGetRequestParameterSet(('mid'))) {
 	// Create limitation line
-	$add = " LIMIT ".(bigintval(getRequestParameter('offset')) * bigintval(getRequestParameter('page')) - bigintval(getRequestParameter('offset'))).", ".bigintval(getRequestParameter('offset'));
+	$add = ' LIMIT ' . (bigintval(getRequestParameter('offset')) * bigintval(getRequestParameter('page')) - bigintval(getRequestParameter('offset'))) . ', ' . bigintval(getRequestParameter('offset'));
 
 	// For normal mails
 	$sql .= $add;
@@ -139,35 +148,25 @@ SQL_FREERESULT($result_normal);
 $MAIL = false;
 if (SQL_NUMROWS($result_list) > 0) {
 	// Init rows
-	$OUT = ''; $content = array();
+	$OUT = '';
 
 	// Walk through all entries
-	while ($pool = SQL_FETCHARRAY($result_list)) {
+	while ($content = SQL_FETCHARRAY($result_list)) {
 		// Unconfirmed mails and sent mails
-		$result_uncon = SQL_QUERY_ESC("SELECT max_rec, clicks FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `pool_id`=%s LIMIT 1",
-		array(bigintval($pool['id'])), __FILE__, __LINE__);
-		list($pool['sent_email'], $pool['clicks']) = SQL_FETCHROW($result_uncon);
+		$result_uncon = SQL_QUERY_ESC("SELECT (`max_rec` - `clicks`) AS `unconfirmed` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `pool_id`=%s LIMIT 1",
+			array(bigintval($content['id'])), __FILE__, __LINE__);
+
+		// Load and merge data
+		$content = merge_array($content, SQL_FETCHARRAY($result_uncon));
+
+		// Free result
 		SQL_FREERESULT($result_uncon);
 
 		// Unconfirmed mails
-		$pool['unconfirmed'] = $pool['sent_email'] - $pool['clicks'];
-		if ($pool['unconfirmed'] > 0) {
-			// Add link to list_unconfirmed what-file
-			$pool['unconfirmed'] = "<strong><a href=\"{%url=modules.php?module=admin&amp;what=list_unconfirmed&amp;mid=" . $pool['id'] . "%}\">" . $pool['unconfirmed'] . "</a></strong>";
-		} elseif ($pool['unconfirmed'] < 0) {
-			// Sometimes rarely displayed minus values will be "fixed" to zero
-			$pool['unconfirmed'] = '0';
-		}
+		$content['unconfirmed'] = generateUnconfirmedAdminLink($content['id'], ($content['unconfirmed']), 'mid');
 
 		// Prepare content
-		$content = $pool;
-		$content['sender_link'] = generateUserProfileLink($pool['sender']);
-		$content['payment']     = getPaymentTitlePrice($pool['payment_id']);
-		$content['category']    = getCategory($pool['cat_id']);
-		$content['receivers']   = convertReceivers($pool['receivers']);
-		$content['type']        = translatePoolType($pool['data_type']);
-		$content['frametester'] = generateFrametesterUrl($pool['url']);
-		$content['timestamp']   = generateDateTime($pool['timestamp'], 0);
+		$content['timestamp']   = generateDateTime($content['timestamp'], 0);
 
 		// Load row template
 		$OUT .= loadTemplate('admin_list_emails_row', true, $content);
@@ -201,24 +200,12 @@ if ((isExtensionActive('bonus')) && ($WHO == getMessage('_ALL'))) {
 		$PAGES = round(SQL_NUMROWS($result_bonus) / getConfig('mails_page') + 0.5);
 
 		// List emails
-		$OUT = ''; $content = array();
-		while ($bonus = SQL_FETCHARRAY($result_bonus)) {
-			// Calculate unconfirmed emails
-			$bonus['unconfirmed'] = $bonus['mails_sent'] - $bonus['clicks'];
-
-			// Add link?
-			if ($bonus['unconfirmed'] > 0) {
-				// Add link to list_unconfirmed what-file
-				$bonus['unconfirmed'] = "<strong><a href=\"{%url=modules.php?module=admin&amp;what=list_unconfirmed&amp;bid=" . $bonus['id'] . "%}\">" . $bonus['unconfirmed'] . "</a></strong>";
-			} // END - if
+		$OUT = '';
+		while ($content = SQL_FETCHARRAY($result_bonus)) {
+			// Add link to list_unconfirmed what-file
+			$content['unconfirmed'] = generateUnconfirmedAdminLink($content['id'], $content['unconfirmed']);
 
 			// Prepare content
-			$content = $bonus;
-			$content['time']        = createFancyTime($content['time']);
-			$content['category']    = getCategory($content['cat_id']);
-			$content['receivers']   = convertReceivers($content['receivers']);
-			$content['type']        = translatePoolType($content['data_type']);
-			$content['frametester'] = generateFrametesterUrl($content['url']);
 			$content['timestamp']   = generateDateTime($content['timestamp'], 0);
 
 			// Load row template
@@ -243,5 +230,5 @@ if ($MAIL === false) {
 	loadTemplate('admin_settings_saved', false, getMessage('ADMIN_NO_MAILS_IN_POOL'));
 } // END - if
 
-//
+// [EOF]
 ?>
diff --git a/inc/modules/admin/what-list_beg.php b/inc/modules/admin/what-list_beg.php
index ebe814aa93..7bf2f906c7 100644
--- a/inc/modules/admin/what-list_beg.php
+++ b/inc/modules/admin/what-list_beg.php
@@ -56,19 +56,22 @@ if (getConfig('beg_rallye') == 'Y') {
 	} // END - if
 
 	// Autopurge installed?
-	$lastOnline = "%s"; $ONLINE = '';
+	$lastOnline = '';
 	if (isExtensionActive('autopurge')) {
 		// Use last online timestamp to keep inactive members away from here
-		$lastOnline   = " AND `last_online` >= (UNIX_TIMESTAMP() - %s)";
-		$ONLINE = getConfig('ap_inactive_since');
+		$lastOnline   = " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})";
 	} // END - if
 
 	// Check if at least one is in the active rallye
-	$result = SQL_QUERY_ESC("SELECT userid, email, gender, surname, family, beg_points, last_online
-FROM `{?_MYSQL_PREFIX?}_user_data`
-WHERE `status`='CONFIRMED' AND beg_points > 0".$lastOnline."
-ORDER BY beg_points DESC, last_online DESC, userid",
-	array($ONLINE), __FILE__, __LINE__);
+	$result = SQL_QUERY("SELECT `userid`, `gender`, `surname`, `family`, `email`, `beg_points`, `last_online`
+FROM
+	`{?_MYSQL_PREFIX?}_user_data`
+WHERE
+	`status`='CONFIRMED' AND beg_points > 0".$lastOnline."
+ORDER BY
+	`beg_points` DESC,
+	`last_online` DESC,
+	`userid` ASC", __FILE__, __LINE__);
 
 	if (SQL_NUMROWS($result) > 0) {
 		// List users
@@ -88,10 +91,8 @@ ORDER BY beg_points DESC, last_online DESC, userid",
 			$content = array(
 				'userid'      => $content['userid'],
 				'email'       => generateEmailLink($content['email'], 'user_data'),
-				'gender'      => translateGender($content['gender']),
-				'surname'     => $content['surname'],
-				'family'      => $content['family'],
-				'turbo'       => translateComma($content['beg_points']),
+				'gender'      => $content['gender'],
+				'turbo'       => $content['beg_points'],
 				'last_online' => generateDateTime($content['last_online'], 2),
 				'sw'          => $SW,
 				'win1'        => $WIN1,
@@ -102,7 +103,7 @@ ORDER BY beg_points DESC, last_online DESC, userid",
 			// Load template and add it
 			$OUT .= loadTemplate('admin_list_beg_rows', true, $content);
 			$SW = 3 - $SW; $cnt++; $total += $content['beg_points'];
-		}
+		} // END - while
 
 		$content['rows']  = $OUT;
 		$content['total'] = translateComma($total);
diff --git a/inc/modules/admin/what-list_cats.php b/inc/modules/admin/what-list_cats.php
index 96f23cf486..75b3895a0b 100644
--- a/inc/modules/admin/what-list_cats.php
+++ b/inc/modules/admin/what-list_cats.php
@@ -69,12 +69,13 @@ if (isGetRequestParameterSet('userid')) {
 				$content = merge_array($content, $row);
 
 				// Check user's selection
+				// @TODO Rewrite this to countSum.....() function
 				$result_user = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_cats` WHERE `userid`=%s AND `cat_id`=%s LIMIT 1",
 					array(bigintval(getRequestParameter('userid')), bigintval($content['id'])), __FILE__, __LINE__);
 
 				// Set selection
-				$selection = "<font color=\"#ee0000\">{--NO--}</div>";
-				if (SQL_NUMROWS($result_user) == 1) $selection = "<font color=\"#00ee00\">{--YES--}</div>";
+				$selection = '<font color="#ee0000">{--NO--}</div>';
+				if (SQL_NUMROWS($result_user) == 1) $selection = '<font color="#00ee00">{--YES--}</div>';
 
 				// Add more elements
 				$content['sw']  = $SW;
diff --git a/inc/modules/admin/what-list_notifications.php b/inc/modules/admin/what-list_notifications.php
index c337999dbb..625df8f4d9 100644
--- a/inc/modules/admin/what-list_notifications.php
+++ b/inc/modules/admin/what-list_notifications.php
@@ -55,11 +55,15 @@ if (!isGetRequestParameterSet('offset')) setGetRequestParameter('offset', getCon
 
 if (isExtensionActive('bonus')) {
 	// Bonus mails sent by you
-	//               0     1       2        3        4      5       6          7       8      9         10          11        12
-	$SQL2 = "SELECT id, subject, text, receivers, points, time, data_type, timestamp, url, cat_id, target_send, mails_sent, clicks
-FROM `{?_MYSQL_PREFIX?}_bonus`
-WHERE is_notify='Y'
-ORDER BY timestamp DESC";
+	$SQL2 = "SELECT
+	`id`, `subject`, `text`, `receivers`, `points`, `time`, `data_type`, `timestamp`, `url`, `cat_id`, `target_send`,
+	`mails_sent`, `clicks`, (`mails_sent` - `clicks) AS `unconfirmed`
+FROM
+	`{?_MYSQL_PREFIX?}_bonus`
+WHERE
+	`is_notify`='Y'
+ORDER BY
+	`timestamp` DESC";
 
 	// Check for maximum pages
 	$result_max = SQL_QUERY($SQL2, __FILE__, __LINE__);
@@ -69,7 +73,7 @@ ORDER BY timestamp DESC";
 }
 
 // Create limitation line
-$add = " LIMIT ".(bigintval(getRequestParameter('offset')) * bigintval(getRequestParameter('page')) - bigintval(getRequestParameter('offset'))).", ".bigintval(getRequestParameter('offset'));
+$add = ' LIMIT ' . (bigintval(getRequestParameter('offset')) * bigintval(getRequestParameter('page')) - bigintval(getRequestParameter('offset'))) . ', ' . bigintval(getRequestParameter('offset'));
 
 // Add limitation
 if (!empty($SQL2)) $SQL2 .= $add;
@@ -85,28 +89,16 @@ if ((isExtensionActive('bonus')) && (SQL_NUMROWS($result_max) > 0) && (!empty($S
 
 		// List emails
 		$OUT = ''; $content = array();
-		while ($bonus = SQL_FETCHARRAY($result_bonus)) {
-			// Calculate unconfirmed emails
-			$bonus['unconfirmed'] = $bonus['mails_sent'] - $bonus['clicks'];
-
-			// Add link?
-			if ($bonus['unconfirmed'] > 0) {
-				// Add link to list_unconfirmed what-file
-				$bonus['unconfirmed'] = "<strong><a href=\"{%url=modules.php?module=admin&amp;what=list_unconfirmed&amp;bid=" . $bonus['id'] . "%}\">" . $bonus['unconfirmed'] . "</a></strong>";
-			} // END - if
+		while ($content = SQL_FETCHARRAY($result_bonus)) {
+			// Add "unconfirmed-link"
+			$content['unconfirmed_content'] = generateUnconfirmedAdminLink($content['id'], $content['unconfirmed']);
 
 			// Prepare content
-			$content = $bonus;
-			$content['time']        = createFancyTime($content['time']);
-			$content['category']    = getCategory($content['cat_id']);
-			$content['receivers']   = convertReceivers($content['receivers']);
-			$content['type']        = translatePoolType($content['data_type']);
-			$content['frametester'] = generateFrametesterUrl($content['url']);
 			$content['timestamp']   = generateDateTime($content['timestamp'], 0);
 
 			// Load row template
 			$OUT .= loadTemplate('admin_list_notify_emails_row', true, $content);
-		}
+		} // END - if
 
 		// Add navigation (without change box but with colspan=3)
 		$content['nav'] = '';
diff --git a/inc/modules/admin/what-list_refs.php b/inc/modules/admin/what-list_refs.php
index 59b6081579..5cbf29c67b 100644
--- a/inc/modules/admin/what-list_refs.php
+++ b/inc/modules/admin/what-list_refs.php
@@ -107,6 +107,7 @@ ORDER BY
 								$refs_cnt = countSumTotalData(getUserData('userid'), 'user_refs', 'id', 'userid', true);
 
 								// Prepare data for the template
+								// @TODO Try to rewrite some to EL
 								$content = array(
 									'sw'         => $SW,
 									'u_link'     => generateUserProfileLink(getUserData('userid')),
@@ -114,13 +115,13 @@ ORDER BY
 									'refs_link'  => 0,
 									'surname'    => getUserData('surname'),
 									'family'     => getUserData('family'),
-									'email'      => "[<a href=\"".generateEmailLink(getUserData('email'), 'user_data')."\">".getUserData('email')."</a>]",
+									'email'      => '[<a href="' . generateEmailLink(getUserData('email'), 'user_data') . '">' . getUserData('email') . '</a>]',
 									'status'     => translateUserStatus(getUserData('status')),
 									'registered' => generateDateTime(getUserData('joined'), 3),
 								);
 
 								// Check if referal count is larger 0 and update link
-								if ($refs_cnt > 0) $content['refs_link'] = generateUserProfileLink(getUserData('userid'), $refs_cnt, "list_refs");
+								if ($refs_cnt > 0) $content['refs_link'] = generateUserProfileLink(getUserData('userid'), $refs_cnt, 'list_refs');
 
 								// Load template for level one
 								$OUT_REFS .= loadTemplate('admin_list_refs_row', true, $content);
@@ -160,7 +161,7 @@ ORDER BY
 						'refs_link'  => 0,
 						'surname'    => $levels['surname'],
 						'family'     => $levels['family'],
-						'email'      => "[<a href=\"".generateEmailLink($levels['email'], 'user_data')."\">".$levels['email']."</a>]",
+						'email'      => '[<a href="' . generateEmailLink($levels['email'], 'user_data') . '">' . $levels['email'] . '</a>]',
 						'status'     => translateUserStatus($levels['status']),
 						'registered' => generateDateTime($levels['joined'], 3),
 					);
diff --git a/inc/modules/admin/what-list_transfer.php b/inc/modules/admin/what-list_transfer.php
index 96a8c72526..799d9ab25f 100644
--- a/inc/modules/admin/what-list_transfer.php
+++ b/inc/modules/admin/what-list_transfer.php
@@ -46,37 +46,37 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 addMenuDescription('admin', __FILE__);
 
 // We only need outgoing transfers
-$result = SQL_QUERY("SELECT userid, to_userid, trans_id, points, reason, time_trans FROM `{?_MYSQL_PREFIX?}_user_transfers_out` ORDER BY trans_id", __FILE__, __LINE__);
+$result = SQL_QUERY('SELECT
+	`userid` AS `from_userid`, `to_userid`, `trans_id`, `points`, `reason`, `time_trans`
+FROM
+	`{?_MYSQL_PREFIX?}_user_transfers_out`
+ORDER BY
+	`trans_id` ASC', __FILE__, __LINE__);
+
 $total = '0';
 if (SQL_NUMROWS($result) > 0) {
 	// Output rows
 	$OUT = ''; $SW = 2;
 	while ($content = SQL_FETCHARRAY($result)) {
 		// Prepare data for the row template
-		$content = array(
-			'sw'         => $SW,
-			'trans_id'   => $content['trans_id'],
-			'time_trans' => generateDateTime($content['time_trans'], 3),
-			'from_link'  => generateUserProfileLink($content['userid']),
-			'to_link'    => generateUserProfileLink($content['to_userid']),
-			'reason'     => wordwrap($content['reason'], 15),
-			'points'     => translateComma($content['points']),
-		);
+		$content['sw']          = $SW;
+		$content['time_trans']  = generateDateTime($content['time_trans'], 3);
+		$content['reason']      = wordwrap($content['reason'], 15);
 
 		// Load row template add points and switch color
 		$OUT .= loadTemplate('admin_list_transfer_row', true, $content);
 		$total += $content['points']; $SW = 3 - $SW;
-	}
+	} // END - while
 
 	// Free memory
 	SQL_FREERESULT($result);
 } else {
 	// Nothing for in and out
-	$OUT = "<tr>
-  <td colspan=\"6\" align=\"center\" class=\"bottom\">
-    ".loadTemplate('admin_settings_saved', true, getMessage('TRANSFER_NO_INOUT_TRANSFERS'))."
+	$OUT = '<tr>
+  <td colspan="6" align="center" class="bottom">
+    ' . loadTemplate('admin_settings_saved', true, getMessage('TRANSFER_NO_INOUT_TRANSFERS')) . '
   </td>
-</tr>";
+</tr>';
 }
 
 // ... and add them to a constant for the template
diff --git a/inc/modules/admin/what-list_user.php b/inc/modules/admin/what-list_user.php
index ea74ef7da4..c10ec781d7 100644
--- a/inc/modules/admin/what-list_user.php
+++ b/inc/modules/admin/what-list_user.php
@@ -253,42 +253,38 @@ LIMIT 1",
 	if (!isGetRequestParameterSet('offset')) setGetRequestParameter('offset', getConfig('user_limit'));
 
 	// Add limitation to SQL string and run him again
-	$sql .= " LIMIT ".(getRequestParameter('offset') * getRequestParameter('page') - getRequestParameter('offset')).", ".getRequestParameter('offset');
+	$sql .= ' LIMIT ' . (getRequestParameter('offset') * getRequestParameter('page') - getRequestParameter('offset')) . ', ' . getRequestParameter('offset');
 	$result = SQL_QUERY($sql, __FILE__, __LINE__);
 
-	// Count all confirmed users
-	$user_count = countSumTotalData('CONFIRMED','user_data','userid','status',true);
-
 	// Are there some entries?
 	if (SQL_NUMROWS($result_master) > 0) {
 		// We have some (new?) registrations!
-		define('__COLSPAN2'  , ($colspan + 2));
-		define('__USER_CNT'  , $user_count);
+		$templateContent['colspan2']   = ($colspan + 2);
+		$templateContent['user_count'] = getTotalConfirmedUser();
 
 		// Sorting links
-		define('__ALPHA_SORT', alpha(getRequestParameter('sortby'), $colspan, true));
-		define('__SORT_LINKS', addSortLinks(getRequestParameter('letter'), getRequestParameter('sortby'), $colspan, true));
+		$templateContent['alpha_sort'] = alpha(getRequestParameter('sortby'), ($colspan + 1), true);
+		$templateContent['sort_links'] = addSortLinks(getRequestParameter('letter'), getRequestParameter('sortby'), ($colspan + 1), true);
+		$templateContent['page_nav']   = '';
 
 		if ($PAGES > 1) {
-			define('__PAGE_NAV', addPageNavigation($PAGES, getConfig('user_limit'), true, $colspan, true));
-		} else {
-			// No page navigation is required
-			define('__PAGE_NAV', '');
-		}
+			$templateContent['page_nav'] = addPageNavigation($PAGES, getConfig('user_limit'), true, $colspan, true);
+		} // END - if
 
 		// Column with nickname when nickname extension is present
-		// @TODO Rewrite this into a  filter
+		// @TODO Rewrite this into a filter
+		$templateContent['nickname_th'] = '';
 		if (isExtensionActive('nickname')) {
 			// Nickname extension found
-			define('__NICKNAME_TH', "  <td class=\"header_column bottom\" align=\"center\">{--NICKNAME--}</td>");
-		} else {
-			// Not found
-			define('__NICKNAME_TH', '');
-		}
+			$templateContent['nickname_th'] = '<td class="header_column bottom" align="center">{--NICKNAME--}</td>';
+		} // END - if
 
 		// Load all users
 		$OUT = ''; $SW = 2;
 		while ($content = SQL_FETCHARRAY($result)) {
+			// Merge more data in
+			$content = merge_array($content, $templateContent);
+
 			// Set refid link
 			if ($content['refid'] > 0) $content['refid'] = generateUserProfileLink($content['refid']);
 
@@ -364,6 +360,9 @@ LIMIT 1",
 			$content['title'] = getMessage(sprintf("ADMIN_LIST_MODE_%s_ACCOUNTS", strtoupper(getRequestParameter('mode'))));
 		}
 
+		// Merge more data again
+		$content = merge_array($content, $templateContent);
+
 		// Load main template
 		loadTemplate('admin_list_user', false, $content);
 	} else {
diff --git a/inc/modules/admin/what-stats_mods.php b/inc/modules/admin/what-stats_mods.php
index 415f0c6177..3520e30163 100644
--- a/inc/modules/admin/what-stats_mods.php
+++ b/inc/modules/admin/what-stats_mods.php
@@ -79,7 +79,7 @@ if ((getRequestParameter('mod') == 'index') || (getRequestParameter('mod') == 'l
 
 		if (($content['module'] == 'index') || ($content['module'] == 'login')) {
 			// Add link to detail statistics
-			$content['module'] = "<strong><a href=\"{%url=modules.php?module=admin&amp;what=stats_mods&amp;mod=" . $content['module'] . "%}\">" . $content['module'] . "</a></strong>";
+			$content['module'] = '<a href="{%url=modules.php?module=admin&amp;what=stats_mods&amp;mod=' . $content['module'] . '%}">' . $content['module'] . '</a>';
 		} // END - if
 
 		// Add color switch
diff --git a/inc/modules/admin/what-theme_edit.php b/inc/modules/admin/what-theme_edit.php
index 04b637aa35..88c6bea489 100644
--- a/inc/modules/admin/what-theme_edit.php
+++ b/inc/modules/admin/what-theme_edit.php
@@ -59,21 +59,21 @@ if (countPostSelection() > 0) {
 		if (isPostRequestParameterSet(('status'))) {
 			// Change status
 			if (postRequestParameter('active', $id) == 'Y') {
-				$sql = "UPDATE `{?_MYSQL_PREFIX?}_themes` SET theme_active='N' WHERE `id`=" . bigintval($id) . " LIMIT 1";
+				$sql = "UPDATE `{?_MYSQL_PREFIX?}_themes` SET `theme_active`='N' WHERE `id`=%s LIMIT 1";
 			} else {
-				$sql = "UPDATE `{?_MYSQL_PREFIX?}_themes` SET theme_active='Y' WHERE `id`=" . bigintval($id) . " LIMIT 1";
+				$sql = "UPDATE `{?_MYSQL_PREFIX?}_themes` SET `theme_active`='Y' WHERE `id`=%s LIMIT 1";
 			}
 			$OUT = getMessage('ADMIN_THEMES_UPDATED');
 		} elseif (isFormSent('del')) {
 			// Delete themes
-			$sql = "DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_themes` WHERE `id`=" . bigintval($id) . " LIMIT 1";
+			$sql = "DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_themes` WHERE `id`=%s LIMIT 1";
 			$OUT = getMessage('ADMIN_THEMES_DELETED');
 		}
 
 		// Run SQL command?
 		if (!empty($sql)) {
 			// Run it
-			$result = SQL_QUERY($sql, __FILE__, __LINE__);
+			$result = SQL_QUERY_ESC($sql, array(bigintval($id)), __FILE__, __LINE__);
 
 			// Rebuild cache
 			rebuildCache('themes', 'them');
@@ -129,16 +129,15 @@ if (SQL_NUMROWS($result) > 0) {
 
 		// Prepare data for the row template
 		$content = array(
-			'sw'        => $SW,
-			'id'        => $content['id'],
-			'active'    => $content['theme_active'],
-			'link'      => $LINK,
-			'name'      => $content['theme_name'],
-			'is_act'    => translateYesNo($content['theme_active']),
-			'email'     => '<a href="mailto:' . $GLOBALS['theme_data']['email'] . '?Subject=[Theme:] ' . $GLOBALS['theme_data']['name'] . ' (' . $content['theme_path'] . ')\>' . $GLOBALS['theme_data']['author'] . '</a>',
-			'url_link'  => generateDerefererUrl($GLOBALS['theme_data']['url']),
-			'url_title' => $GLOBALS['theme_data']['url'],
-			'ver'       => $content['theme_ver'],
+			'sw'           => $SW,
+			'id'           => $content['id'],
+			'link'         => $LINK,
+			'theme_name'   => $content['theme_name'],
+			'theme_active' => $content['theme_active'],
+			'email'        => '<a href="mailto:' . $GLOBALS['theme_data']['email'] . '?Subject=[Theme:] ' . $GLOBALS['theme_data']['name'] . ' (' . $content['theme_path'] . ')\>' . $GLOBALS['theme_data']['author'] . '</a>',
+			'url_link'     => generateDerefererUrl($GLOBALS['theme_data']['url']),
+			'url_title'    => $GLOBALS['theme_data']['url'],
+			'theme_ver'    => $content['theme_ver'],
 		);
 
 		// Load row template and switch color
@@ -150,11 +149,11 @@ if (SQL_NUMROWS($result) > 0) {
 	SQL_FREERESULT($result);
 } else {
 	// No themes found???
-	$OUT .= "<tr>
-  <td colspan=\"7\" class=\"bottom\" height=\"60\">
-    ".loadTemplate('admin_settings_saved', true, getMessage('ADMIN_NO_THEMES_FOUND'))."
+	$OUT .= '<tr>
+  <td colspan="7" class="bottom" height="60">
+    ' . loadTemplate('admin_settings_saved', true, getMessage('ADMIN_NO_THEMES_FOUND')) . '
   </td>
-</tr>\n";
+</tr>';
 }
 
 // Load template
diff --git a/inc/modules/admin/what-unlock_emails.php b/inc/modules/admin/what-unlock_emails.php
index 5fb789f51c..75bddbb453 100644
--- a/inc/modules/admin/what-unlock_emails.php
+++ b/inc/modules/admin/what-unlock_emails.php
@@ -204,9 +204,9 @@ LIMIT 1",
 				'subject'     => $content['subject'],
 				'tester'      => generateFrametesterUrl($content['url']),
 				'url'         => $content['url'],
-				'cat_title'   => str_replace("\"", '&quot;', getCategory($content['category'])),
+				'cat_title'   => str_replace('"', '&quot;', getCategory($content['category'])),
 				'cat_link'    => $content['category'],
-				'pay_title'   => str_replace("\"", '&quot;', getPaymentTitlePrice($content['payment'], true)),
+				'pay_title'   => str_replace('"', '&quot;', getPaymentTitlePrice($content['payment'], true)),
 				'pay_link'    => $content['payment'],
 				'timestamp'   => generateDateTime($content['timestamp'], 2),
 				'target_send' => $content['target_send'],
diff --git a/inc/modules/admin/what-user_contct.php b/inc/modules/admin/what-user_contct.php
index c2dfa2a4fb..74551c3f80 100644
--- a/inc/modules/admin/what-user_contct.php
+++ b/inc/modules/admin/what-user_contct.php
@@ -60,9 +60,13 @@ if ((isGetRequestParameterSet('userid')) && (bigintval(getRequestParameter('user
 			// Insert text
 			$content['text'] = trim(secureString(postRequestParameter('text')));
 
+			// Load email template
+			$message = loadEmailTemplate('member_contct', $content, getRequestParameter('userid'));
+
 			// Send contact form out
-			$message = loadEmailTemplate('member_contct', $content);
 			sendEmail($content['email'], getMessage('ADMIN_CONTACT_USER_SUBJECT'), $message);
+
+			// Display message
 			loadTemplate('admin_settings_saved', false, getMessage('ADMIN_USER_CONTACTED'));
 		} else {
 			// Load contact form template
diff --git a/inc/modules/guest/what-login.php b/inc/modules/guest/what-login.php
index b3e272c6c5..e888b2cbbb 100644
--- a/inc/modules/guest/what-login.php
+++ b/inc/modules/guest/what-login.php
@@ -105,25 +105,18 @@ $content['message'] = '';
 
 // Login problems?
 if (!empty($errorCode)) {
-	// @TODO Move this HTML code into a template
-	$message = "<tr>
-  <td colspan=\"4\" align=\"center\">
-    <span class=\"guest_failed\">";
-
 	// Do we have a userid set?
 	if (isSessionVariableSet('current_userid')) {
 		// Then prefetch data for this account
 		fetchUserData(getSession('current_userid'));
 	} // END - if
 
-	// Convert the code to message
-	$message .= getMessageFromErrorCode($errorCode);
-
-	// Continue with HTML
-	$message .= "</span>
+	// @TODO Move this HTML code into a template
+	$content['message'] = '<tr>
+  <td colspan="4" align="center">
+    <span class="guest_failed">' . getMessageFromErrorCode($errorCode) . '</span>
   </td>
-</tr>\n";
-	$content['message'] = $message;
+</tr>';
 } // END - if
 
 // Display login form with resend-password form
diff --git a/inc/modules/guest/what-sponsor_reg.php b/inc/modules/guest/what-sponsor_reg.php
index d0d9fff8bb..3556a9447b 100644
--- a/inc/modules/guest/what-sponsor_reg.php
+++ b/inc/modules/guest/what-sponsor_reg.php
@@ -279,9 +279,12 @@ WHERE `id`='%s' LIMIT 1",
 	loadTemplate('admin_settings_saved', false, $message);
 } else {
 	// Check for payment types
-	$result = SQL_QUERY("SELECT `id`, `pay_name`, `pay_rate`, `pay_currency`, `pay_min_count`
-FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes`
-ORDER BY `pay_name`", __FILE__, __LINE__);
+	$result = SQL_QUERY('SELECT
+	`id`, `pay_name`, `pay_rate`, `pay_currency`, `pay_min_count`
+FROM
+	`{?_MYSQL_PREFIX?}_sponsor_paytypes`
+ORDER BY 
+	pay_name` ASC', __FILE__, __LINE__);
 	if (SQL_NUMROWS($result) > 0) {
 		// Load all types...
 		// @TODO Swap this HTML code to templates
diff --git a/inc/modules/member/what-surfbar_list.php b/inc/modules/member/what-surfbar_list.php
index da9bfd2551..562ea10b33 100644
--- a/inc/modules/member/what-surfbar_list.php
+++ b/inc/modules/member/what-surfbar_list.php
@@ -74,15 +74,13 @@ if ((isFormSent()) && (isPostRequestParameterSet(('action'))) && (isPostRequestP
 	foreach ($urlArray as $id => $content) {
 		// "Translate"/insert data
 		$content['sw'] = $SW;
-		$content['url'] = generateDerefererUrl($content['url']);
 		if ($content['views_total'] > 0) {
 			// Include link to stats
-			$content['views_total'] = "[<a href=\"{%url=modules.php?module=login&amp;what=surfbar_list%}\">".translateComma($content['views_total'])."</a>]";
+			$content['views_total'] = '[<a href="{%url=modules.php?module=login&amp;what=surfbar_list%}">' . translateComma($content['views_total']) . '</a>]';
 		} // END - if
 		$content['url_registered']  = generateDateTime($content['url_registered'], 2);
 		$content['url_last_locked'] = generateDateTime($content['url_last_locked'], 2);
 		$content['actions']         = SURFBAR_MEMBER_ACTIONS($content['id'], $content['url_status']);
-		$content['url_status']      = translateSurfbarUrlStatus($content['url_status']);
 		if (empty($content['url_lock_reason'])) {
 			// Fixes some HTML problems with empty cells
 			$content['url_lock_reason'] = '---';
@@ -102,5 +100,5 @@ if ((isFormSent()) && (isPostRequestParameterSet(('action'))) && (isPostRequestP
 	loadTemplate('admin_settings_saved', false, getMessage('MEMBER_SURFBAR_NO_URLS_FOUND'));
 }
 
-//
+// [EOF]
 ?>
diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php
index afd2f1caab..362fa1f780 100644
--- a/inc/mysql-manager.php
+++ b/inc/mysql-manager.php
@@ -1656,7 +1656,8 @@ LEFT JOIN
 ON
 	p.userid=d.userid
 WHERE
-	p.userid=%s",
+	p.userid=%s
+LIMIT 1",
 		array(bigintval($userid)), __FUNCTION__, __LINE__);
 
 	// Do we have an entry?
@@ -1665,7 +1666,8 @@ WHERE
 		$data = SQL_FETCHARRAY($result);
 
 		// Delete points entries as well
-		SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid`=%s", array(bigintval($userid)), __FUNCTION__, __LINE__);
+		SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid`=%s",
+			array(bigintval($userid)), __FUNCTION__, __LINE__);
 
 		// Update mediadata as well
 		if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {
diff --git a/inc/reset/reset_birthday.php b/inc/reset/reset_birthday.php
index ea3f2a4905..5dbbb34dc5 100644
--- a/inc/reset/reset_birthday.php
+++ b/inc/reset/reset_birthday.php
@@ -68,7 +68,7 @@ WHERE
 	`status`='CONFIRMED' AND
 	`birth_day`=%s AND
 	`birth_month`=%s AND
-	`birthday_sent` < (UNIX_TIMESTAMP() - ".(getConfig('ONE_DAY') * 364).")
+	`birthday_sent` < (UNIX_TIMESTAMP() - ({?ONE_DAY?} * 364))
 	".$add."
 ORDER BY
 	`userid` ASC",
diff --git a/templates/de/emails/admin/admin_autopurge_inactive.tpl b/templates/de/emails/admin/admin_autopurge_inactive.tpl
index c6812dc7ee..d3e5991b6d 100644
--- a/templates/de/emails/admin/admin_autopurge_inactive.tpl
+++ b/templates/de/emails/admin/admin_autopurge_inactive.tpl
@@ -1,6 +1,6 @@
 Hallo Administrator,
 
-In Ihrem {?mt_word?} wurden Mitglieder gefunden, die seit $content[since] Tagen nicht mehr aktiv waren! Sollten diese Mitglieder weitere {!__INACTIVE_TIME!} Tage inaktiv bleiben, werden sie automatisch gel&ouml;scht!
+In Ihrem {?mt_word?} wurden Mitglieder gefunden, die seit $content[since] Tagen nicht mehr aktiv waren! Sollten diese Mitglieder weitere {%config,createFancyTime=ap_inactive_time%} inaktiv bleiben, werden sie automatisch gel&ouml;scht!
 
 Hier alle inaktiven Mitglieder:
 --------------------------------
diff --git a/templates/de/html/admin/admin_config_register_row.tpl b/templates/de/html/admin/admin_config_register_row.tpl
new file mode 100644
index 0000000000..0451c4ef50
--- /dev/null
+++ b/templates/de/html/admin/admin_config_register_row.tpl
@@ -0,0 +1,7 @@
+<tr>
+	<td align="center" class="switch_sw$content[sw] bottom right">$content[id]</td>
+	<td class="switch_sw$content[sw] bottom right">$content[field_name]</td>
+	<td align="center" class="switch_sw$content[sw] bottom right">
+		$content[selection]
+	</td>
+</tr>
diff --git a/templates/de/html/admin/admin_del_transfer_row.tpl b/templates/de/html/admin/admin_del_transfer_row.tpl
index d389a5bf11..90d342036a 100644
--- a/templates/de/html/admin/admin_del_transfer_row.tpl
+++ b/templates/de/html/admin/admin_del_transfer_row.tpl
@@ -6,15 +6,15 @@
 		$content[time_trans]
 	</td>
 	<td class="switch_sw$content[sw] bottom right">
-		$content[userid_from]
+		{%pipe,generateUserProfileLink=$content[from_userid]%}
 	</td>
 	<td class="switch_sw$content[sw] bottom right">
-		$content[userid_to]
+		{%pipe,generateUserProfileLink=$content[to_userid]%}
 	</td>
 	<td class="switch_sw$content[sw] bottom right">
 		$content[reason]
 	</td>
 	<td class="switch_sw$content[sw] bottom">
-		$content[points]
+		{%pipe,translateComma=$content[points]%}
 	</td>
 </tr>
diff --git a/templates/de/html/admin/admin_email_archiv_row.tpl b/templates/de/html/admin/admin_email_archiv_row.tpl
index ad04d22f2f..2bd5b2e67d 100644
--- a/templates/de/html/admin/admin_email_archiv_row.tpl
+++ b/templates/de/html/admin/admin_email_archiv_row.tpl
@@ -1,7 +1,7 @@
 <tr>
 	<td class="switch_sw$content[sw] bottom right" width="23%" align="center">
 		{--EMAIL_SENDER--}:<br />
-		<strong class="admin_misc">$content[u_link]</strong>
+		<strong class="admin_misc">{%pipe,generateUserProfileLink=$content[sender]%}</strong>
 	</td>
 	<td class="switch_sw$content[sw] bottom right" width="23%" align="center">
 		{--EMAIL_SUBJECT--}:<br />
@@ -15,18 +15,18 @@
 <tr>
 	<td colspan="2" align="center" class="switch_sw$content[sw] bottom right">
 		{--EMAIL_PAYMENT--}:<br />
-		<strong class="admin_misc">{%pipe,translateComma=$content[pay]%}</strong>
+		<strong class="admin_misc">{%pipe,getPaymentTitlePrice,translateComma=$content[payment_id]%}</strong>
 	</td>
 	<td align="center" class="switch_sw$content[sw] bottom">
 		{--EMAIL_CATEGORY--}:<br />
-		<strong class="admin_misc">$content[cat]</strong>
+		<strong class="admin_misc">{%pipe,getCategory=$content[cat_id]%}</strong>
 	</td>
 </tr>
 <tr>
 	<td align="center" class="switch_sw$content[sw] bottom right">
 		{--EMAIL_RECEIVERS--}:<br />
 		<strong class="admin_misc">$content[sent]</strong> ({--EMAIL_RUIDS--}:
-		<strong class="admin_misc">$content[ruserids]</strong>)
+		<strong class="admin_misc">{%pipe,convertReceivers=$content[receivers]%}</strong>)
 	</td>
 	<td align="center" class="switch_sw$content[sw] bottom right">
 		{--USERS_LINKS--}:<br />
@@ -34,7 +34,7 @@
 	</td>
 	<td align="center" class="switch_sw$content[sw] bottom">
 		{--EMAIL_POOL_TYPE--}:<br />
-		<strong class="admin_misc">$content[type]</strong>
+		<strong class="admin_misc">{%pipe,translatePoolType=$content[data_type]%}</strong>
 	</td>
 </tr>
 <tr>
@@ -44,7 +44,7 @@
 	</td>
 	<td align="center" class="switch_sw$content[sw] bottom right">
 		{--EMAIL_URL--}:<br />
-		<strong class="admin_misc"><a href="$content[frametester]"
+		<strong class="admin_misc"><a href="{%pipe,generateFrametesterUrl=$content[url]%}"
 			target="_blank">{--ADMIN_TEST_URL--}</a></strong>
 	</td>
 	<td align="center" class="switch_sw$content[sw] bottom">
@@ -64,6 +64,6 @@
 </tr>
 <tr>
 	<td align="center" class="switch_sw$content[sw] bottom admin_del_link" colspan="3">
-		<a href="{%url=modules.php?module=admin&amp;what=del_email&amp;mid=$content[mid]%}">{--ADMIN_DELETE_NORMAL_MAIL--}</a>
+		<a href="{%url=modules.php?module=admin&amp;what=del_email&amp;mid=$content[id]%}">{--ADMIN_DELETE_NORMAL_MAIL--}</a>
 	</td>
 </tr>
diff --git a/templates/de/html/admin/admin_list_beg_rows.tpl b/templates/de/html/admin/admin_list_beg_rows.tpl
index 7c9b99c4fa..d680eb2bec 100644
--- a/templates/de/html/admin/admin_list_beg_rows.tpl
+++ b/templates/de/html/admin/admin_list_beg_rows.tpl
@@ -1,7 +1,7 @@
 <tr>
 	<td class="switch_sw$content[sw] bottom right" align="center">$content[win1]$content[cnt]$content[win2]</td>
 	<td class="switch_sw$content[sw] bottom right" align="center">$content[win1]<a href="{%url=modules.php?module=admin&amp;what=list_user&amp;userid=$content[userid]%}">$content[userid]</a>$content[win2]</td>
-	<td class="switch_sw$content[sw] bottom right">$content[win1]<a href="$content[email]">$content[gender] $content[surname] $content[family]</a>$content[win2]</td>
-	<td class="switch_sw$content[sw] bottom right">$content[turbo] {?POINTS?}</td>
+	<td class="switch_sw$content[sw] bottom right">$content[win1]<a href="$content[email]">{%pipe,translateGender=$content[gender]%} $content[surname] $content[family]</a>$content[win2]</td>
+	<td class="switch_sw$content[sw] bottom right">{%pipe,translateComma=$content[beg_points]%} {?POINTS?}</td>
 	<td class="switch_sw$content[sw] bottom">$content[last_online]</td>
 </tr>
diff --git a/templates/de/html/admin/admin_list_bonus_emails_row.tpl b/templates/de/html/admin/admin_list_bonus_emails_row.tpl
index bdc73d3c89..7b283b95e4 100644
--- a/templates/de/html/admin/admin_list_bonus_emails_row.tpl
+++ b/templates/de/html/admin/admin_list_bonus_emails_row.tpl
@@ -11,22 +11,22 @@
 <tr>
   <td align="center" class="top bottom right" width="23%">
     <div>{--EMAIL_POINTS--}:</div>
-    <div><strong class="admin_misc">$content[points] {?POINTS?}</strong></div>
+    <div><strong class="admin_misc">{%pipe,translateComma=$content[points]%} {?POINTS?}</strong></div>
   </td>
   <td align="center" class="top bottom right" width="23%">
     <div>{--EMAIL_SECONDS--}:</div>
-    <div><strong class="admin_misc">$content[time]</strong></div>
+    <div><strong class="admin_misc">{%pipe,createFancyTime=$content[time]%}</strong></div>
   </td>
   <td align="center" class="top bottom">
     <div>{--EMAIL_CATEGORY--}:</div>
-    <div><strong class="admin_misc">$content[category]</strong></div>
+    <div><strong class="admin_misc">{%pipe,getCategory=$content[cat_id]%}</strong></div>
   </td>
 </tr>
 <tr>
   <td align="center" class="top bottom right">
     <div>{--EMAIL_RECEIVERS--}:</div>
-    <div><strong class="admin_misc">$content[mails_sent]</strong>
-    ({--EMAIL_RUIDS--}: <strong class="admin_misc">$content[receivers]</strong>)</div>
+    <div><strong class="admin_misc">{%pipe,translateComma=$content[mails_sent]%}</strong>
+    ({--EMAIL_RUIDS--}: <strong class="admin_misc">{%pipe,convertReceivers=$content[receivers]%}</strong>)</div>
   </td>
   <td align="center" class="top bottom right">
     <div>{--USERS_LINKS--}:</div>
@@ -34,7 +34,7 @@
   </td>
   <td align="center" class="top bottom">
     <div>{--EMAIL_POOL_TYPE--}:</div>
-    <div><strong class="admin_misc">$content[type]</strong></div>
+    <div><strong class="admin_misc">{%pipe,translatePoolType=$content[data_type]%}</strong></div>
   </td>
 </tr>
 <tr>
@@ -44,7 +44,7 @@
   </td>
   <td align="center" class="top bottom right">
     <div>{--EMAIL_URL--}:</div>
-    <div><strong class="admin_misc"><a href="$content[frametester]" target="_blank">{--ADMIN_TEST_URL--}</a></strong></div>
+    <div><strong class="admin_misc"><a href="{%pipe,generateFrametesterUrl=$content[url]%}" target="_blank">{--ADMIN_TEST_URL--}</a></strong></div>
   </td>
   <td align="center" class="top bottom">
     <div>{--EMAIL_TIMESTAMP--}:</div>
diff --git a/templates/de/html/admin/admin_list_emails_row.tpl b/templates/de/html/admin/admin_list_emails_row.tpl
index 7f1720fd1f..cc7fb364bb 100644
--- a/templates/de/html/admin/admin_list_emails_row.tpl
+++ b/templates/de/html/admin/admin_list_emails_row.tpl
@@ -1,7 +1,7 @@
 <tr>
   <td class="bottom top right" width="23%" align="center">
     {--EMAIL_SENDER--}:<br />
-    <div class="admin_misc">$content[sender_link]</div>
+    <div class="admin_misc">{%pipe,generateUserProfileLink=$content[sender]%}</div>
   </td>
   <td class="bottom top right" width="23%" align="center">
     {--EMAIL_SUBJECT--}:<br />
@@ -12,23 +12,21 @@
     <div class="admin_misc">$content[text]</div>
   </td>
 </tr>
-<tr><td height="5" colspan="3"></td></tr>
 <tr>
   <td colspan="2" align="center" class="top bottom right">
     {--EMAIL_PAYMENT--}:<br />
-    <div class="admin_misc">$content[payment]
+    <div class="admin_misc">{%pipe,getPaymentTitlePrice=$content[payment_id]%}</div>
   </td>
   <td align="center" class="top bottom">
     {--EMAIL_CATEGORY--}:<br />
-    <div class="admin_misc">$content[category]
+    <div class="admin_misc">{%pipe,getCategory=$content[cat_id]%}</div>
   </td>
 </tr>
-<tr><td height="5" colspan="3"></td></tr>
 <tr>
   <td align="center" class="top bottom right">
     {--EMAIL_RECEIVERS--}:<br />
-    <div class="admin_misc">$content[sent_email]</div>
-    ({--EMAIL_RUIDS--}: <div class="admin_misc">$content[receivers]</div>)
+    <div class="admin_misc">{%pipe,translateComma=$content[sent_email]%}</div>
+    ({--EMAIL_RUIDS--}: <div class="admin_misc">{%pipe,convertReceivers=$content[receivers]%}</div>)
   </td>
   <td align="center" class="top bottom right">
     {--USERS_LINKS--}:<br />
@@ -36,18 +34,17 @@
   </td>
   <td align="center" class="top bottom">
     {--EMAIL_POOL_TYPE--}:<br />
-    <div class="admin_misc">$content[type]</div>
+    <div class="admin_misc">{%pipe,translatePoolType=$content[data_type]%}</div>
   </td>
 </tr>
-<tr><td height="5" colspan="3"></td></tr>
 <tr>
   <td align="center" class="top right">
     {--EMAIL_TSEND--}:<br />
-    <div class="admin_misc">$content[target_send]</div>
+    <div class="admin_misc">{%pipe,translateComma=$content[target_send]%}</div>
   </td>
   <td align="center" class="top right">
     {--EMAIL_URL--}:<br />
-    <div class="admin_misc"><a href="$content[frametester]" target="_blank">{--ADMIN_TEST_URL--}</a></div>
+    <div class="admin_misc"><a href="{%pipe,generateFrametesterUrl=$content[url]%}" target="_blank">{--ADMIN_TEST_URL--}</a></div>
   </td>
   <td align="center" class="top">
     {--EMAIL_TIMESTAMP--}:<br />
diff --git a/templates/de/html/admin/admin_list_mods_row.tpl b/templates/de/html/admin/admin_list_mods_row.tpl
index 6162158d4f..1b6f952cee 100644
--- a/templates/de/html/admin/admin_list_mods_row.tpl
+++ b/templates/de/html/admin/admin_list_mods_row.tpl
@@ -3,21 +3,21 @@
 		<input type="checkbox" title="{--ID_SELECT--} $content[id]" class="admin_normal" name="sel[$content[id]]" value="1" />
 	</td>
 	<td class="switch_sw$content[sw] bottom right">
-		&nbsp;$content[mod]
+		$content[module]
 	</td>
 	<td class="switch_sw$content[sw] bottom right">
-		&nbsp;$content[title]
+		$content[title]
 	</td>
 	<td class="switch_sw$content[sw] bottom right" align="center">
-		$content[locked]
+		{%pipe,translateYesNo=$content[locked]%}
 	</td>
 	<td class="switch_sw$content[sw] bottom right" align="center">
-		$content[hidden]
+		{%pipe,translateYesNo=$content[hidden]%}
 	</td>
 	<td class="switch_sw$content[sw] bottom right" align="center">
-		$content[admin]
+		{%pipe,translateYesNo=$content[admin_only]%}
 	</td>
 	<td class="switch_sw$content[sw] bottom" align="center">
-		$content[mem]
+		{%pipe,translateYesNo=$content[mem_only]%}
 	</td>
 </tr>
diff --git a/templates/de/html/admin/admin_list_notify_emails_row.tpl b/templates/de/html/admin/admin_list_notify_emails_row.tpl
index 7acc8d6368..23f3902d7f 100644
--- a/templates/de/html/admin/admin_list_notify_emails_row.tpl
+++ b/templates/de/html/admin/admin_list_notify_emails_row.tpl
@@ -11,40 +11,40 @@
 <tr>
   <td align="center" class="top bottom right" width="23%">
     {--EMAIL_POINTS--}:<br />
-    <strong class="admin_misc">$content[points] {?POINTS?}</strong>
+    <strong class="admin_misc">{%pipe,translateComma=$content[points]%} {?POINTS?}</strong>
   </td>
   <td align="center" class="top bottom right" width="23%">
     {--EMAIL_SECONDS--}:<br />
-    <strong class="admin_misc">$content[time]</strong>
+    <strong class="admin_misc">{%pipe,createFancyTime=$content[time]%}</strong>
   </td>
   <td align="center" class="top bottom">
     {--EMAIL_CATEGORY--}:<br />
-    <strong class="admin_misc">$content[category]</strong>
+    <strong class="admin_misc">{%pipe,getCategory=$content[cat_id]%}</strong>
   </td>
 </tr>
 <tr>
   <td align="center" class="top bottom right">
     {--EMAIL_RECEIVERS--}:<br />
-    <strong class="admin_misc">$content[mails_sent]</strong>
-    ({--EMAIL_RUIDS--}: <strong class="admin_misc">$content[receivers]</strong>)
+    <strong class="admin_misc">{%pipe,translateComma=$content[mails_sent]%}</strong>
+    ({--EMAIL_RUIDS--}: <strong class="admin_misc">{%pipe,convertReceivers=$content[receivers]%}</strong>)
   </td>
   <td align="center" class="top bottom right">
     {--USERS_LINKS--}:<br />
-    <strong class="admin_misc">$content[unconfirmed]</strong>
+    <strong class="admin_misc">$content[unconfirmed_content]</strong>
   </td>
   <td align="center" class="top bottom">
     {--EMAIL_POOL_TYPE--}:<br />
-    <strong class="admin_misc">$content[type]</strong>
+    <strong class="admin_misc">{%pipe,translatePoolType=$content[data_type]%}</strong>
   </td>
 </tr>
 <tr>
   <td align="center" class="top bottom right">
     {--EMAIL_TSEND--}:<br />
-    <strong class="admin_misc">$content[target_send]</strong>
+    <strong class="admin_misc">{%pipe,translateComma=$content[target_send]%}</strong>
   </td>
   <td align="center" class="top bottom right">
     {--EMAIL_URL--}:<br />
-    <strong class="admin_misc"><a href="$content[frametester]" target="_blank">{--ADMIN_TEST_URL--}</a></strong>
+    <strong class="admin_misc"><a href="{%pipe,generateFrametesterUrl=$content[url]%}" target="_blank">{--ADMIN_TEST_URL--}</a></strong>
   </td>
   <td align="center" class="top bottom">
     {--EMAIL_TIMESTAMP--}:<br />
diff --git a/templates/de/html/admin/admin_list_transfer_row.tpl b/templates/de/html/admin/admin_list_transfer_row.tpl
index eff3d910b0..4de9fd5ad6 100644
--- a/templates/de/html/admin/admin_list_transfer_row.tpl
+++ b/templates/de/html/admin/admin_list_transfer_row.tpl
@@ -1,8 +1,20 @@
 <tr>
-	<td class="switch_sw$content[sw] bottom right" align="center"><strong>$content[trans_id]</strong></td>
-	<td class="switch_sw$content[sw] bottom right" align="center">$content[time_trans]</td>
-	<td class="switch_sw$content[sw] bottom right" align="center">$content[from_link]</td>
-	<td class="switch_sw$content[sw] bottom right" align="center">$content[to_link]</td>
-	<td class="switch_sw$content[sw] bottom right">$content[reason]</td>
-	<td class="switch_sw$content[sw] bottom" align="center">$content[points]</td>
+	<td class="switch_sw$content[sw] bottom right" align="center">
+		<strong>$content[trans_id]</strong>
+	</td>
+	<td class="switch_sw$content[sw] bottom right" align="center">
+		$content[time_trans]
+	</td>
+	<td class="switch_sw$content[sw] bottom right" align="center">
+		{%pipe,generateUserProfileLink=$content[from_userid]%}
+	</td>
+	<td class="switch_sw$content[sw] bottom right" align="center">
+		{%pipe,generateUserProfileLink=$content[to_userid]%}
+	</td>
+	<td class="switch_sw$content[sw] bottom right">
+		$content[reason]
+	</td>
+	<td class="switch_sw$content[sw] bottom" align="center">
+		{%pipe,translateComma=$content[points]%}
+	</td>
 </tr>
diff --git a/templates/de/html/admin/admin_list_user.tpl b/templates/de/html/admin/admin_list_user.tpl
index 5eb3f45c28..d44e5acbb0 100644
--- a/templates/de/html/admin/admin_list_user.tpl
+++ b/templates/de/html/admin/admin_list_user.tpl
@@ -1,14 +1,14 @@
 <div align="center">
 <table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
 	<tr>
-		<td class="admin_title bottom" colspan="{!__COLSPAN2!}" align="center">
+		<td class="admin_title bottom" colspan="$content[colspan2]" align="center">
 			<strong>$content[title]:</strong>
 		</td>
 	</tr>
-	{!__ALPHA_SORT!}
-	{!__SORT_LINKS!}
-	{!__PAGE_NAV!}
+	$content[alpha_sort]
+	$content[sort_links]
+	$content[page_nav]
 	$content[rows]
-	{!__PAGE_NAV!}
+	$content[page_nav]
 </table>
 </div>
diff --git a/templates/de/html/admin/admin_list_user_alpha.tpl b/templates/de/html/admin/admin_list_user_alpha.tpl
index de20a34be8..89082addca 100644
--- a/templates/de/html/admin/admin_list_user_alpha.tpl
+++ b/templates/de/html/admin/admin_list_user_alpha.tpl
@@ -1,9 +1,9 @@
 <tr>
-	<td colspan="{!__COLSPAN2!}" align="center">
+	<td colspan="$content[colspan2]" align="center">
 	<table border="0" cellspacing="0" cellpadding="0" width="510">
 		<tr>
 			<td class="admin_alpha">
-			{--ADMIN_ALPHA_SELCTION--}&nbsp;[&nbsp;$content&nbsp;]</td>
+			{--ADMIN_ALPHA_SELCTION--}&nbsp;[&nbsp;$content[alpha_selection]&nbsp;]</td>
 		</tr>
 	</table>
 	</td>
diff --git a/templates/de/html/admin/admin_list_user_pagenav.tpl b/templates/de/html/admin/admin_list_user_pagenav.tpl
index 59ca0fb01b..ef00578efe 100644
--- a/templates/de/html/admin/admin_list_user_pagenav.tpl
+++ b/templates/de/html/admin/admin_list_user_pagenav.tpl
@@ -1,5 +1,5 @@
 <tr>
-	<td class="admin_title" colspan="{!__COLSPAN2!}" align="center">
+	<td class="admin_title" colspan="$content[colspan2]" align="center">
 		<table border="0" cellspacing="0" cellpadding="0">
 		<tr>
 			<td class="admin_pagenav">
diff --git a/templates/de/html/admin/admin_list_user_sort.tpl b/templates/de/html/admin/admin_list_user_sort.tpl
index d2a89e19df..b67e1b5a20 100644
--- a/templates/de/html/admin/admin_list_user_sort.tpl
+++ b/templates/de/html/admin/admin_list_user_sort.tpl
@@ -1,5 +1,5 @@
 <tr>
-	<td class="bottom" colspan="{!__COLSPAN2!}" align="center">
+	<td class="bottom" colspan="$content[colspan2]" align="center">
 	<table border="0" cellspacing="0" cellpadding="0">
 		<tr>
 			<td class="admin_sortlinks">
diff --git a/templates/de/html/admin/admin_list_user_sort_form.tpl b/templates/de/html/admin/admin_list_user_sort_form.tpl
index 62c682b1cd..58adcbb32c 100644
--- a/templates/de/html/admin/admin_list_user_sort_form.tpl
+++ b/templates/de/html/admin/admin_list_user_sort_form.tpl
@@ -1,5 +1,5 @@
 <tr>
-	<td colspan="{!__COLSPAN2!}" align="center">
+	<td colspan="$content[colspan2]" align="center">
 	<table border="0" cellspacing="0" cellpadding="0">
 		<tr>
 			<td align="center">
diff --git a/templates/de/html/admin/admin_mods_stats_row.tpl b/templates/de/html/admin/admin_mods_stats_row.tpl
index 214a2a7c8f..23b68467c4 100644
--- a/templates/de/html/admin/admin_mods_stats_row.tpl
+++ b/templates/de/html/admin/admin_mods_stats_row.tpl
@@ -1,6 +1,6 @@
 <tr>
 	<td class="switch_sw$content[sw] bottom right">
-		&nbsp;$content[title] ($content[module])
+		&nbsp;$content[title] (<span class="admin_misc">$content[module]</span>)
 	</td>
 	<td class="switch_sw$content[sw] bottom" align="center">
 		$content[clicks]
diff --git a/templates/de/html/admin/admin_theme_edit_row.tpl b/templates/de/html/admin/admin_theme_edit_row.tpl
index 22dce6d40f..a6d7ae2048 100644
--- a/templates/de/html/admin/admin_theme_edit_row.tpl
+++ b/templates/de/html/admin/admin_theme_edit_row.tpl
@@ -1,16 +1,16 @@
 <tr>
 	<td class="switch_sw$content[sw] bottom right" align="center">
 		<input type="checkbox" name="sel[$content[id]]" title="{--ID_SELECT--} $content[id]" class="admin_normal" value="1" />
-		<input type="hidden" name="active[$content[id]]" value="$content[active]" />
+		<input type="hidden" name="active[$content[id]]" value="$content[theme_active]" />
 	</td>
 	<td class="switch_sw$content[sw] bottom right" align="center">
 		$content[link]
 	</td>
 	<td class="switch_sw$content[sw] bottom right" align="center">
-		$content[name]
+		$content[theme_name]
 	</td>
 	<td class="switch_sw$content[sw] bottom right" align="center">
-		$content[is_act]
+		{%pipe,translateYesNo=$content[theme_active]%}
 	</td>
 	<td class="switch_sw$content[sw] bottom right" align="center">
 		$content[email]
@@ -19,6 +19,6 @@
 		<a href="$content[url_link]" target="_blank">$content[url_title]</a>
 	</td>
 	<td class="switch_sw$content[sw] bottom" align="center">
-		v$content[ver]
+		v$content[theme_ver]
 	</td>
 </tr>
diff --git a/templates/de/html/member/member_bonus_turbo_row.tpl b/templates/de/html/member/member_bonus_turbo_row.tpl
new file mode 100644
index 0000000000..9089642221
--- /dev/null
+++ b/templates/de/html/member/member_bonus_turbo_row.tpl
@@ -0,0 +1,5 @@
+<tr>
+  <td class="bonus_rank_$rows[rank] bottom switch_sw$rows[sw]">{%pipe,translateComma=$rows[rank]%}.</td>
+  <td class="bonus_rank_$rows[rank] bottom switch_sw$rows[sw]" align="center">$rows[userid]</td>
+  <td class="bonus_rank_$rows[rank] bottom switch_sw$rows[sw]" align="center">{%pipe,translateComma=$rows[points]%}</td>
+</tr>
diff --git a/templates/de/html/member/member_surfbar_list_row.tpl b/templates/de/html/member/member_surfbar_list_row.tpl
index 189ae3227c..387766923e 100644
--- a/templates/de/html/member/member_surfbar_list_row.tpl
+++ b/templates/de/html/member/member_surfbar_list_row.tpl
@@ -1,6 +1,6 @@
 <tr>
 	<td align="center" class="switch_sw$content[sw] bottom right">
-		<a href="$content[url]" target="_blank" title="{--MEMBER_TEST_URL--}">{--MEMBER_SURFBAR_TEST_URL--}</a>
+		<a href="{%pipe,generateDerefererUrl=$content[url]%}" target="_blank" title="{--MEMBER_TEST_URL--}">{--MEMBER_SURFBAR_TEST_URL--}</a>
 	</td>
 	<td align="center" class="switch_sw$content[sw] bottom right">
 		{%pipe,translateSurfbarUrlStatus=$content[url_status]%}