X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=inline;f=inc%2Fmodules%2Fadmin%2Fwhat-add_points.php;h=66d4d2aefc2c1fca382cd8f9a59996756e883202;hb=3c311675e341584ad25c561a5a65198f3717125f;hp=91a1c62d7ee6af47829e73202b0c6143824833e0;hpb=dbb6aa4eaeff7c3bab27f143d881781380d43d41;p=mailer.git diff --git a/inc/modules/admin/what-add_points.php b/inc/modules/admin/what-add_points.php index 91a1c62d7e..66d4d2aefc 100644 --- a/inc/modules/admin/what-add_points.php +++ b/inc/modules/admin/what-add_points.php @@ -1,7 +1,7 @@ SQL_ESCAPE(postRequestElement('reason')), + 'points' => bigintval(postRequestElement('points')), + 'userid' => $row['userid'], + 'subject' => 'admin_add_all', + ); // Load email template and send email away - $message = loadEmailTemplate('add-points', $content, bigintval($content['userid'])); - sendEmail(bigintval($content['userid']), getMessage('ADMIN_ADD_SUBJ'), $message); + $message = loadEmailTemplate('member_add_points', $content, bigintval($content['userid'])); + sendEmail(bigintval($content['userid']), '{--ADMIN_ADD_SUBJECT--}', $message); } // END - while // Free memory SQL_FREERESULT($result_main); // Output message - loadTemplate('admin_settings_saved', false, getMessage('ADMIN_ALL_POINTS_ADDED')); + displayMessage('{--ADMIN_ALL_POINTS_ADDED--}'); } else { // Display form add points loadTemplate('admin_add_points_all'); } } elseif (isGetRequestElementSet('userid')) { - // User ID found in URL so we use this give him some credits - $result = SQL_QUERY_ESC("SELECT `surname`, `family`, `email` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s AND `status`='CONFIRMED' LIMIT 1", - array(bigintval(getRequestElement('userid'))), __FILE__, __LINE__); - if (SQL_NUMROWS($result) == 1) { + // User id found in URL so we use this give him some credits + if (fetchUserData(getRequestElement('userid'))) { // Selected user does exist - $content = SQL_FETCHARRAY($result); + $content = getUserDataArray(); - if ((isFormSent()) && (isPostRequestElementSet(('points')))) { + if ((isFormSent()) && (isPostRequestElementSet('points'))) { // Add points and send an email to him... - addPointsDirectly('admin_single', bigintval(getRequestElement('userid')), bigintval(postRequestElement('points'))); + addPointsDirectly('admin_add_single', bigintval(getRequestElement('userid')), bigintval(postRequestElement('points'))); // Prepare content $content = array( - 'text' => SQL_ESCAPE(postRequestElement('reason')), - 'points' => bigintval(postRequestElement('points')) + 'reason' => SQL_ESCAPE(postRequestElement('reason')), + 'points' => bigintval(postRequestElement('points')), + 'subject' => 'admin_add_single', ); // Message laden - $message = loadEmailTemplate('add-points', $content, bigintval(getRequestElement('userid'))); + $message = loadEmailTemplate('member_add_points', $content, bigintval(getRequestElement('userid'))); - sendEmail(bigintval(getRequestElement('userid')), getMessage('ADMIN_ADD_SUBJ'), $message); - loadTemplate('admin_settings_saved', false, getMessage('ADMIN_POINTS_ADDED')); + sendEmail(bigintval(getRequestElement('userid')), '{--ADMIN_ADD_SUBJECT--}', $message); + displayMessage('{--ADMIN_POINTS_ADDED--}'); } else { // Prepare content - $content['user'] = "".$content['surname']." ".$content['family'].""; $content['userid'] = bigintval(getRequestElement('userid')); // Output template loadTemplate('admin_add_points', false, $content); } } else { - // User not found! - loadTemplate('admin_settings_saved', false, "