Several fixes/cleanups
authorRoland Häder <roland@mxchange.org>
Tue, 26 Jan 2010 13:20:13 +0000 (13:20 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 26 Jan 2010 13:20:13 +0000 (13:20 +0000)
14 files changed:
inc/databases.php
inc/functions.php
inc/language/order_de.php
inc/libs/holiday_functions.php
inc/modules/member/what-order.php
inc/reset/reset_birthday.php
templates/de/html/member/member_header.tpl
templates/de/html/member/member_order-zip1.tpl
templates/de/html/member/member_order_page1.tpl
templates/de/html/member/member_order_page2.tpl
templates/de/html/member/member_order_points.tpl
theme/business/css/general.css
theme/default/css/general.css
theme/desert/css/general.css

index c70b12d..35a8696 100644 (file)
@@ -48,6 +48,7 @@ addCode('WRONG_ID'           , 0x002);
 addCode('ACCOUNT_LOCKED'     , 0x003);
 addCode('ACCOUNT_UNCONFIRMED', 0x004);
 addCode('UNKNOWN_STATUS'     , 0x005);
+addCode('NO_MAIL_TYPE'       , 0x006);
 addCode('CNTR_FAILED'        , 0x008);
 addCode('LOGOUT_DONE'        , 0x008);
 addCode('LOGOUT_FAILED'      , 0x009);
index c129368..2da1f61 100644 (file)
@@ -2548,6 +2548,7 @@ function getMessageFromErrorCode ($code) {
                case getCode('MORE_RECEIVERS2')    : $message = getMessage('MEMBER_NO_MORE_RECEIVERS_FOUND'); break;
                case getCode('MORE_RECEIVERS3')    : $message = getMessage('MEMBER_ENTER_MORE_MIN_RECEIVERS'); break;
                case getCode('INVALID_URL')        : $message = getMessage('MEMBER_ENTER_INVALID_URL'); break;
+               case getCode('NO_MAIL_TYPE')       : $message = getMessage('MEMBER_NO_MAIL_TYPE_SELECTED'); break;
                case getCode('UNKNOWN_ERROR')      : $message = getMessage('LOGIN_UNKNOWN_ERROR'); break;
                case getCode('UNKNOWN_STATUS')     : $message = getMessage('LOGIN_UNKNOWN_STATUS'); break;
 
index 9ccb461..a257194 100644 (file)
@@ -65,16 +65,17 @@ addMessages(array(
        'MEMBER_ORDER_MAX_ALLOWED' => "Maximale Mailbuchungen",
        'MEMBER_ORDER_ALLOWED_EXHAUSTED' => "Sie k&ouml;nnen keine weiteren Mails mehr versenden, oder stellen Sie bitte den Empfang h&ouml;her ein.",
        'MEMBER_ENTER_INVALID_URL' => "Ung&uuml;tige URL eingegeben.",
+       'MEMBER_NO_MAIL_TYPE_SELECTED' => "Bitte w&auml;hlen Sie eine Mailart aus.",
 
-       'ORDER_SELECT_COLUMN_USERID' => "Mitgliedsnummer",
-       'ORDER_SELECT_COLUMN_ZIP' => "Postleitzahl",
-       'ORDER_SELECT_COLUMN_COUNTRY' => "Land",
-       'ORDER_SELECT_COLUMN_EMAIL' => "EMail-Adresse",
-       'ORDER_SELECT_COLUMN_BIRTH_YEAR' => "Geburtsjahr",
-       'ORDER_SELECT_COLUMN_LAST_ONLINE' => "Als letztes Online",
-       'ORDER_SELECT_COLUMN_REF_CLICKS' => "Klicks auf Ref-Link",
+       'ORDER_SELECT_COLUMN_USERID'       => "Mitgliedsnummer",
+       'ORDER_SELECT_COLUMN_ZIP'          => "Postleitzahl",
+       'ORDER_SELECT_COLUMN_COUNTRY'      => "Land",
+       'ORDER_SELECT_COLUMN_EMAIL'        => "EMail-Adresse",
+       'ORDER_SELECT_COLUMN_BIRTH_YEAR'   => "Geburtsjahr",
+       'ORDER_SELECT_COLUMN_LAST_ONLINE'  => "Als letztes Online",
+       'ORDER_SELECT_COLUMN_REF_CLICKS'   => "Klicks auf Ref-Link",
        'ORDER_SELECT_COLUMN_TOTAL_LOGINS' => "Gesamtlogins",
-       'ORDER_SELECT_COLUMN_MAIL_ORDERS' => "Heutige Mailbuchungen",
+       'ORDER_SELECT_COLUMN_MAIL_ORDERS'  => "Heutige Mailbuchungen",
 
        'ORDER_DEFAULT_SUBJECT' => "Betreffzeile in allen Mails",
        'ORDER_DEFAULT_TEXT'    => "Geben Sie hier Ihren Werbetext ein.",
index 014d4f7..0b07bf1 100644 (file)
@@ -56,6 +56,7 @@ ORDER BY
        if (SQL_NUMROWS($result_stop) > 0) {
                // We foud at least one
                $admin = '';
+
                // Init SQLs
                initSqls();
 
@@ -76,11 +77,11 @@ LIMIT 1",
                                array(bigintval($content['userid'])), __FUNCTION__, __LINE__, false));
 
                        // Prepare array
-                       $content = array(
+                       $content = merge_array($content, array(
                                'holiday_end'      => generateDateTime($content['holiday_end']  , 3),
                                'holiday_start'    => generateDateTime($content['holiday_start'], 3),
                                'holiday_comments' => $content['comments']
-                       );
+                       ));
 
                        // Send mail to user
                        $message = loadEmailTemplate('member_holiday_unlock', $content, $content['userid']);
@@ -101,5 +102,5 @@ LIMIT 1",
        SQL_FREERESULT($result_stop);
 }
 
-//
+// [EOF]
 ?>
index a950b09..dd09108 100644 (file)
@@ -198,7 +198,13 @@ LIMIT 1",
                                // Remove any HTML code
                                setPostRequestParameter('text', str_replace('<', '{OPEN_HTML}', str_replace('>', '{CLOSE_HTML}', postRequestParameter('text'))));
                        }
-               }
+               } // END - if
+
+               // Is mail type set?
+               if ((!isPostRequestParameterSet('mail_type')) || (postRequestParameter('mail_type') < 1)) {
+                       // Not correctly set
+                       $URL = 'modules.php?module=login&amp;what=order&amp;code=' . getCode('NO_MAIL_TYPE');
+               } // END - if
        } elseif (!isAdmin()) {
                // He has already sent a mail within a specific time
                $URL = 'modules.php?module=login&amp;what=order&amp;code=' . getCode('URL_TLOCK') . '&amp;id=' . $id;
@@ -223,7 +229,11 @@ LEFT JOIN
 ON
        c.userid=d.userid
 WHERE
-       c.cat_id=%s AND c.userid != '%s' AND d.`status`='CONFIRMED' AND d.receive_mails > 0".$add."
+       c.cat_id=%s AND
+       c.userid != '%s' AND
+       d.`status`='CONFIRMED' AND
+       d.receive_mails > 0
+       ".$add."
 ORDER BY
        d.%s %s",
                        array(
@@ -278,7 +288,7 @@ LIMIT 1",
                        if ($content['target_send'] > postRequestParameter('receiver')) $content['target_send'] = bigintval(postRequestParameter('receiver'));
 
                        // Calculate used points
-                       $USED = $content['target_send'] * getPaymentPoints(bigintval(postRequestParameter('type')));
+                       $USED = $content['target_send'] * getPaymentPoints(bigintval(postRequestParameter('mail_type')));
 
                        // Fix empty zip code
                        if (!isPostRequestParameterSet('zip')) setPostRequestParameter('zip', 0);
@@ -292,13 +302,13 @@ LIMIT 1",
                                        if (isExtensionActive('html_mail')) {
                                                // HTML extension is active
                                                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_pool` (`sender`, `subject`, `text`, `receivers`, `payment_id`, `data_type`, `timestamp`, `url`, `cat_id`, `target_send`, `zip`, `html_msg`)
- VALUES ('%s','%s','%s','%s','%s','TEMP',UNIX_TIMESTAMP(),'%s','%s','%s','%s','%s')",
+VALUES (%s,'%s','%s','%s','%s','TEMP',UNIX_TIMESTAMP(),'%s',%s,%s,%s,'%s')",
                                                        array(
                                                                getMemberId(),
                                                                postRequestParameter('subject'),
                                                                postRequestParameter('text'),
                                                                $receiver,
-                                                               bigintval(postRequestParameter('type')),
+                                                               bigintval(postRequestParameter('mail_type')),
                                                                postRequestParameter('url'),
                                                                bigintval(postRequestParameter('cat')),
                                                                $content['target_send'],
@@ -308,13 +318,13 @@ LIMIT 1",
                                        } else {
                                                // No HTML extension is active
                                                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_pool` (`sender`, `subject`, `text`, `receivers`, `payment_id`, `data_type`, `timestamp`, `url`, `cat_id`, `target_send`, `zip`)
- VALUES ('%s','%s','%s','%s','%s','TEMP',UNIX_TIMESTAMP(),'%s','%s','%s','%s')",
+VALUES (%s,'%s','%s','%s','%s','TEMP',UNIX_TIMESTAMP(),'%s',%s,%s,%s)",
                                                        array(
                                                                getMemberId(),
                                                                postRequestParameter('subject'),
                                                                postRequestParameter('text'),
                                                                $receiver,
-                                                               bigintval(postRequestParameter('type')),
+                                                               bigintval(postRequestParameter('mail_type')),
                                                                postRequestParameter('url'),
                                                                bigintval(postRequestParameter('cat')),
                                                                $content['target_send'],
@@ -345,7 +355,7 @@ LIMIT 1",
                                                                postRequestParameter('subject'),
                                                                postRequestParameter('text'),
                                                                $receiver,
-                                                               bigintval(postRequestParameter('type')),
+                                                               bigintval(postRequestParameter('mail_type')),
                                                                postRequestParameter('url'),
                                                                bigintval(postRequestParameter('cat')),
                                                                $content['target_send'],
@@ -374,7 +384,7 @@ LIMIT 1",
                                                                postRequestParameter('subject'),
                                                                postRequestParameter('text'),
                                                                $receiver,
-                                                               bigintval(postRequestParameter('type')),
+                                                               bigintval(postRequestParameter('mail_type')),
                                                                postRequestParameter('url'),
                                                                bigintval(postRequestParameter('cat')),
                                                                $content['target_send'],
@@ -391,7 +401,7 @@ LIMIT 1",
                                                array(
                                                        getMemberId(),
                                                        postRequestParameter('subject'),
-                                                       bigintval(postRequestParameter('type'))
+                                                       bigintval(postRequestParameter('mail_type'))
                                                ), __FILE__, __LINE__);
 
                                        // Get pool id
@@ -443,7 +453,7 @@ ORDER BY
                        // @TODO Rewrite this to a filter
                        $HTML = ''; $HOL_STRING = '';
                        if ((isExtensionActive('html_mail')) && (postRequestParameter('html') == 'Y')) $HTML = " AND `html`='Y'";
-                       if (getExtensionVersion('holiday') >= '0.1.3') {
+                       if (isExtensionInstalledAndNewer('holiday', '0.1.3')) {
                                // Extension's version is fine
                                $HOL_STRING = " AND `holiday_active`='N'";
                        } // END - if
index 5b6ccb8..e793ee1 100644 (file)
@@ -117,7 +117,7 @@ if (SQL_NUMROWS($result_birthday) > 0) {
        } // END - while
 
        // Free memory
-       SQL_FREERESULT($result);
+       SQL_FREERESULT($result_birthday);
 }
 
 // [EOF]
index 666381e..9b0ba9e 100644 (file)
@@ -1,7 +1,7 @@
 <a name="TOP"></a>
 <table border="0" cellspacing="0" cellpadding="0" width="100%" class="member_main">
 <tr>
-       <td colspan="3" align="center" valign="top" class="member_title">
+       <td colspan="3" align="center" valign="top" class="member_header">
                <table border="0" cellspacing="0" cellpadding="0" width="100%" class="guest">
                <tr>
                        <td colspan="3" align="center">
index b4a87a6..44966aa 100644 (file)
@@ -25,8 +25,8 @@
        </td>
 </tr>
 <tr>
-       <td class="bottom" align="right">{--MEMBER_ENTER_ZIP_CODE--}:</td>
-       <td class="bottom">
+       <td align="right">{--MEMBER_ENTER_ZIP_CODE--}:</td>
+       <td>
                <input type="text" name="zip" class="member_normal" size="5" maxlength="6" value="$content[zip]" />
        </td>
 </tr>
index a693eaa..3ecb186 100644 (file)
@@ -4,7 +4,7 @@
        $content[zip_content]
        $content[html_extension]
        <tr>
-               <td colspan="2" align="center" class="member_footer">
+               <td colspan="2" align="center" class="member_footer top">
                        <input type="reset" class="member_reset" value="{--CLEAR_FORM--}" />
                        <input type="submit" name="data" class="member_submit" value="{--ORDER_PAGE_2--}" />
                </td>
index 30713e0..fdbf2e2 100644 (file)
@@ -4,7 +4,7 @@
        $content[zip_content]
        <tr>
                <td align="right">{--SELECT_MAIL_TYPE--}:</td>
-               <td><select name="type" size="1" class="member_select">
+               <td><select name="mail_type" size="1" class="member_select">
                        <option value="X" disabled="disabled">{--PLEASE_SELECT--}</option>
                        $content[type_selection]
                </select></td>
index 93178dc..8972f35 100644 (file)
@@ -1,5 +1,6 @@
 <div class="para">
-<div align="center" class="member_table dashed">
+<div align="center">
+<div class="member_table dashed">
        <div align="center">
                {--MEMBER_POINTS_LEFT--}:
                <strong>$content[total] {?POINTS?}</strong>
index 34f868c..1d84ce3 100644 (file)
@@ -200,8 +200,10 @@ a.admin_logout {
 
 .member_header {
        text-align: center;
-       height: 28px;
+       color: #000000;
+       vertical-align: middle;
        background-color: #eeeeff;
+       height: 60px;
 }
 
 .admin_failed, .guest_failed, .member_failed, .member_note {
@@ -267,7 +269,7 @@ a.admin_logout {
        color: #000000;
        vertical-align: middle;
        background-color: #eeeeff;
-       height: 60px;
+       height: 28px;
 }
 
 .guest_login_header {
index 6220473..0fe7b0f 100644 (file)
@@ -245,8 +245,10 @@ a.admin_logout {
 
 .member_header {
        text-align: center;
-       height: 28px;
+       color: #009900;
+       vertical-align: middle;
        background-color: #ddeedd;
+       height: 60px;
 }
 
 .admin_failed, .guest_failed, .member_failed, .member_note {
@@ -299,7 +301,7 @@ a.admin_logout {
        color: #009900;
        vertical-align: middle;
        background-color: #ddeedd;
-       height: 60px;
+       height: 28px;
 }
 
 .guest_login_header {
index 9f64ed8..c80abff 100644 (file)
@@ -200,8 +200,10 @@ a.admin_logout {
 
 .member_header {
        text-align: center;
-       height: 28px;
+       color: #880000;
+       vertical-align: middle;
        background-color: #ddddaa;
+       height: 60px;
 }
 
 .admin_failed, .guest_failed, .member_failed, .member_note {
@@ -255,7 +257,7 @@ a.admin_logout {
        color: #880000;
        vertical-align: middle;
        background-color: #ddddaa;
-       height: 60px;
+       height: 28px;
 }
 
 .guest_login_header {
@@ -278,8 +280,7 @@ a.admin_logout {
        border: 1px solid #880000;
 }
 
-.guest_menu_row, .guest_menu_bottom, .member_menu_row, .member_menu_bottom
-       {
+.guest_menu_row, .guest_menu_bottom, .member_menu_row, .member_menu_bottom {
        border: 1px solid #880000;
        border-top: 0px;
        background-color: #ffffcc;