X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fmember%2Fwhat-points.php;h=6b64c1a8436614d77b9eb822feb9498a187f962d;hp=563eab9f39e225bf86089a8da62c64400a19c0d2;hb=63f159414369b5ea19a8ca75d8cd8033c45d8341;hpb=a454def0bfba8288ffc839d034c710f034cf4728 diff --git a/inc/modules/member/what-points.php b/inc/modules/member/what-points.php index 563eab9f39..6b64c1a843 100644 --- a/inc/modules/member/what-points.php +++ b/inc/modules/member/what-points.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2011 by Mailer Developer Team * + * Copyright (c) 2009 - 2012 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -37,7 +37,7 @@ // Some security stuff... if (!defined('__SECURITY')) { - die(); + exit(); } elseif (!isMember()) { redirectToIndexMemberOnlyModule(); } @@ -45,6 +45,12 @@ if (!defined('__SECURITY')) { // Add description as navigation point addYouAreHereLink('member', __FILE__); +// Extension ext-user is highly required +if ((!isExtensionActive('user')) && (!isAdmin())) { + displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=user%}'); + return; +} // END - if + // Query for referral levels and percents $result_depths = SQL_QUERY('SELECT `level`,`percents` FROM `{?_MYSQL_PREFIX?}_refdepths` ORDER BY `level` ASC', __FILE__, __LINE__); @@ -53,9 +59,14 @@ $numDepths = SQL_NUMROWS($result_depths); // Add many more rows for the login/turbo/ref/order bonus // @TODO Should we rewrite this to a filter? -if (!isExtensionActive('bonus')) $numDepths += 1; -if (isExtensionInstalledAndNewer('bonus', '0.2.2')) $numDepths += 6; -if (isExtensionInstalledAndNewer('bonus', '0.4.4')) $numDepths += 4; +if (isExtensionActive('bonus')) { + // Extension ext-bonus is there, okay + if (isExtensionInstalledAndNewer('bonus', '0.2.2')) $numDepths += 6; + if (isExtensionInstalledAndNewer('bonus', '0.4.4')) $numDepths += 4; +} else { + // Not installed ext-bonus + $numDepths += 1; +} // Remember row count in constant $content['rowspan'] = ($numDepths * 2 + 15); @@ -89,11 +100,8 @@ while ($data = SQL_FETCHARRAY($result_depths)) { } // END - if // Load referral points - $result_points = SQL_QUERY_ESC("SELECT - p.`points`, - p.`order_points`, - p.`locked_points`, - p.`locked_order_points`, + $result_points = SQL_QUERY_ESC('SELECT + ' . getAllPointColumns('p.', ',') . ' r.`counter` FROM `{?_MYSQL_PREFIX?}_user_points` AS p @@ -104,8 +112,8 @@ ON p.`ref_depth`=r.`level` WHERE p.`userid`=%s AND - ".$depth." -LIMIT 1", + ' . $depth . ' +LIMIT 1', array( getMemberId(), convertZeroToNull($content['level']) @@ -116,11 +124,17 @@ LIMIT 1", // Load data $content = merge_array($content, SQL_FETCHARRAY($result_points)); - // Add all entries + // Add locked-/points $content['part_points'] += $content['points']; - $content['part_order'] += $content['order_points']; $content['part_locked'] += $content['locked_points']; - $content['part_locked_order'] += $content['locked_order_points']; + + // For these columns, ext-order must be installed as well + if (isExtensionInstalled('order')) { + $content['part_order'] += $content['order_points']; + $content['part_locked_order'] += $content['locked_order_points']; + } // END - if + + // Add referral counter $content['part_referrals'] += $content['counter']; } // END - if