]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-edit_emails.php
New method generateExtensionInactiveMessage() introduced
[mailer.git] / inc / modules / admin / what-edit_emails.php
index c12004b4465c9ec76a9e6209d46ccd593a479bbe..c36da875352539a30b4bf41537f42e0cad4adeae 100644 (file)
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Werbebuchungen aendern (z.B. umleiten der URL)   *
  * -------------------------------------------------------------------- *
- * $Revision:: 856                                                    $ *
- * $Date:: 2009-03-06 20:24:32 +0100 (Fr, 06. March 2009)             $ *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
- * $Author:: stelzi                                                   $ *
+ * $Author::                                                          $ *
  * Needs to be in all Files and every File needs "svn propset           *
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
 
 // Some security stuff...
 if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 }
 
 // Add description as navigation point
-ADD_DESCR("admin", __FILE__);
+ADD_DESCR('admin', __FILE__);
 
-if ((IS_FORM_SENT()) && (!REQUEST_ISSET_POST(('id')))) {
+if ((isFormSent()) && (!REQUEST_ISSET_POST('id'))) {
        REQUEST_UNSET_POST('ok');
 }
 
 $result = SQL_QUERY("SELECT id, sender, subject, payment_id, cat_id FROM `{!_MYSQL_PREFIX!}_pool` ORDER BY timestamp", __FILE__, __LINE__);
 if (SQL_NUMROWS($result) > 0) {
-       if (IS_FORM_SENT()) {
+       if (isFormSent()) {
                // Make mail editable...
-               $result = SQL_QUERY_ESC("SELECT subject, text, url FROM `{!_MYSQL_PREFIX!}_pool` WHERE id=%s LIMIT 1",
-                array(bigintval(REQUEST_POST('id'))), __FILE__, __LINE__);
+               $result = SQL_QUERY_ESC("SELECT subject, text, url FROM `{!_MYSQL_PREFIX!}_pool` WHERE `id`=%s LIMIT 1",
+               array(bigintval(REQUEST_POST('id'))), __FILE__, __LINE__);
                list($subj, $text, $url) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
                // @TODO More constants to rewrite
@@ -65,19 +65,19 @@ if (SQL_NUMROWS($result) > 0) {
 
                // Load template
                LOAD_TEMPLATE("admin_edit_email");
-       } elseif (REQUEST_ISSET_POST(('save'))) {
+       } elseif (REQUEST_ISSET_POST('save')) {
                // Save changes
                SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET
 subject='%s',
 text='%s',
 url='%s'
-WHERE id=%s LIMIT 1",
- array(
-       REQUEST_POST('subj'),
-       REQUEST_POST('text'),
-       REQUEST_POST('url'),
-       bigintval(REQUEST_POST('id')),
-), __FILE__, __LINE__);
+WHERE `id`=%s LIMIT 1",
              array(
+               REQUEST_POST('subj'),
+               REQUEST_POST('text'),
+               REQUEST_POST('url'),
+               bigintval(REQUEST_POST('id')),
+               ), __FILE__, __LINE__);
 
                if (SQL_AFFECTEDROWS() == 1) {
                        $content = getMessage('SETTINGS_SAVED');
@@ -86,10 +86,10 @@ WHERE id=%s LIMIT 1",
                }
 
                // Display message
-               LOAD_TEMPLATE("admin_settings_saved", false, $content);
+               LOAD_TEMPLATE('admin_settings_saved', false, $content);
        } else {
                // There are mail orders available
-               $OUT = ""; $SW = 2;
+               $OUT = ''; $SW = 2;
                while ($content = SQL_FETCHARRAY($result)) {
                        // Prepare data for the row template
                        // @TODO Rewritings: subj->subject in template
@@ -97,9 +97,9 @@ WHERE id=%s LIMIT 1",
                                'sw'   => $SW,
                                'id'   => $content['id'],
                                'subj' => $content['subject'],
-                               'uid'  => ADMIN_USER_PROFILE_LINK($content['sender']),
-                               'pay'  => GET_PAYMENT($content['payment_id']),
-                               'cat'  => GET_CATEGORY($content['cat_id']),
+                               'uid'  => generateUserProfileLink($content['sender']),
+                               'pay'  => getPaymentTitlePrice($content['payment_id']),
+                               'cat'  => getCategory($content['cat_id']),
                        );
 
                        // Load row template and switch colors
@@ -118,7 +118,7 @@ WHERE id=%s LIMIT 1",
        }
 } else {
        // No mail orders left in pool
-       LOAD_TEMPLATE("admin_settings_saved", false, "<span class=\"admin_failed\">{--ADMIN_NO_MAILS_IN_POOL--}</span>");
+       LOAD_TEMPLATE('admin_settings_saved', false, "<span class=\"admin_failed\">{--ADMIN_NO_MAILS_IN_POOL--}</span>");
 }
 
 //