This commit has been accessed 618 times via Git panel.
commit ac3dbc4644c2dc91cd5e6d0df909310068488b23
tree 6e3478617e9db58765a80229fa2dc9ed4f68302a
parent 2075572dcf81dcf2a0411300bc08c674c04450d7
author Engels Antonio <engels@majcms.org> 1298974917 +0800
committer Engels Antonio <engels@majcms.org> 1298974917 +0800
Add aliases selection in compose From:
diff --git a/post.php b/post.php
index e600cf3..2a45326 100644
--- a/post.php
+++ b/post.php
@@ -13,6 +13,8 @@ if (isset($_POST['new']) and !empty($_POST['new']) and is_numeric($_POST['new'])
$reply_from = "\"$usr_name\" <{$_SESSION['logged_uid']}>";
$reply_from = htmlentities($reply_from,ENT_QUOTES);
+ $post_alias_query = mysql_query("select id from aliases where alias='{$_SESSION['logged_uid']}' order by domain, id");
+
echo "<title>Kartero - Compose - {$_SESSION['logged_uid']}</title>";
echo "<table border=\"0\" cellspacing=\"0\" callpadding=\"0\" width=\"800\"><tr><td valign=\"top\">";
@@ -21,7 +23,25 @@ if (isset($_POST['new']) and !empty($_POST['new']) and is_numeric($_POST['new'])
echo "<form method=\"post\">";
- echo "<tr><td width=\"50\"><b>From:</b></td><td rowspan=\"7\" width=\"5\"></td><td><input class=\"input\" type=\"text\" name=\"reply_from\" value=\"$reply_from\" readonly></td></tr>";
+ echo "<tr><td width=\"50\"><b>From:</b></td><td rowspan=\"7\" width=\"5\"></td><td>";
+
+ if (mysql_num_rows($post_alias_query) > 0) {
+
+ echo "<select class=\"input\" name=\"reply_from\">";
+ echo "<option>$reply_from</option>";
+
+ while ($row = mysql_fetch_assoc($post_alias_query)) {
+ echo "<option>\"$usr_name\" <$row[id]></option>";
+ }
+
+ echo "</select>";
+ }
+ else {
+ echo "<input class=\"input\" type=\"text\" name=\"reply_from\" value=\"$reply_from\" readonly>";
+ }
+
+ echo "</td></tr>";
+
echo "<tr><td><b>To:</b></td><td><input class=\"input\" type=\"text\" name=\"reply_to\"></td></tr>";
echo "<tr><td><b>Cc:</b></td><td><input class=\"input\" type=\"text\" name=\"reply_cc\"></td></tr>";
echo "<tr><td><b>Bcc:</b></td><td><input class=\"input\" type=\"text\" name=\"reply_bcc\"></td></tr>";
tree 6e3478617e9db58765a80229fa2dc9ed4f68302a
parent 2075572dcf81dcf2a0411300bc08c674c04450d7
author Engels Antonio <engels@majcms.org> 1298974917 +0800
committer Engels Antonio <engels@majcms.org> 1298974917 +0800
Add aliases selection in compose From:
diff --git a/post.php b/post.php
index e600cf3..2a45326 100644
--- a/post.php
+++ b/post.php
@@ -13,6 +13,8 @@ if (isset($_POST['new']) and !empty($_POST['new']) and is_numeric($_POST['new'])
$reply_from = "\"$usr_name\" <{$_SESSION['logged_uid']}>";
$reply_from = htmlentities($reply_from,ENT_QUOTES);
+ $post_alias_query = mysql_query("select id from aliases where alias='{$_SESSION['logged_uid']}' order by domain, id");
+
echo "<title>Kartero - Compose - {$_SESSION['logged_uid']}</title>";
echo "<table border=\"0\" cellspacing=\"0\" callpadding=\"0\" width=\"800\"><tr><td valign=\"top\">";
@@ -21,7 +23,25 @@ if (isset($_POST['new']) and !empty($_POST['new']) and is_numeric($_POST['new'])
echo "<form method=\"post\">";
- echo "<tr><td width=\"50\"><b>From:</b></td><td rowspan=\"7\" width=\"5\"></td><td><input class=\"input\" type=\"text\" name=\"reply_from\" value=\"$reply_from\" readonly></td></tr>";
+ echo "<tr><td width=\"50\"><b>From:</b></td><td rowspan=\"7\" width=\"5\"></td><td>";
+
+ if (mysql_num_rows($post_alias_query) > 0) {
+
+ echo "<select class=\"input\" name=\"reply_from\">";
+ echo "<option>$reply_from</option>";
+
+ while ($row = mysql_fetch_assoc($post_alias_query)) {
+ echo "<option>\"$usr_name\" <$row[id]></option>";
+ }
+
+ echo "</select>";
+ }
+ else {
+ echo "<input class=\"input\" type=\"text\" name=\"reply_from\" value=\"$reply_from\" readonly>";
+ }
+
+ echo "</td></tr>";
+
echo "<tr><td><b>To:</b></td><td><input class=\"input\" type=\"text\" name=\"reply_to\"></td></tr>";
echo "<tr><td><b>Cc:</b></td><td><input class=\"input\" type=\"text\" name=\"reply_cc\"></td></tr>";
echo "<tr><td><b>Bcc:</b></td><td><input class=\"input\" type=\"text\" name=\"reply_bcc\"></td></tr>";