- $result = SQL_QUERY_ESC("SELECT admin_id, id FROM "._MYSQL_PREFIX."_admins_mails WHERE mail_template='%s' ORDER BY id",
- array($template), __FILE__, __LINE__);
- $OUT = ""; $aid = 0; $aid2 = 0;
- while (list($aid, $id) = SQL_FETCHROW($result))
- {
- $OUT .= "<SELECT name=\"admin_id[".$id."]\" size=\"1\" class=\"admin_select\">
-<OPTION value=\"0\"";
- if ($aid == "0") $OUT .= " selected default";
- $OUT .=">".ADMINS_ALL_ADMINS."</OPTION>\n";
- if (EXT_IS_ACTIVE("userlog"))
- {
- $OUT .= "<OPTION value=\"-1\"";
- if ($aid == "-1") $OUT .= " selected default";
- $OUT .= ">".ADMINS_TO_USERLOG."</OPTION>\n";
+ $result = SQL_QUERY_ESC("SELECT `admin_id`, `id` FROM `{?_MYSQL_PREFIX?}_admins_mails` WHERE `mail_template`='%s' ORDER BY `id` ASC",
+ array($template), __FILE__, __LINE__);
+ $OUT = ''; $adminId2 = 0;
+ while ($content = SQL_FETCHARRAY($result)) {
+ // @TODO Can this be rewritten???
+ $OUT .= "<select name=\"admin_id[".$content['id']."]\" size=\"1\" class=\"admin_select\">
+<option value=\"0\"";
+ if ($content['admin_id'] == '0') $OUT .= ' selected="selected"';
+ $OUT .=">{--ADMINS_ALL_ADMINS--}</option>\n";
+ if (isExtensionActive('events')) {
+ $OUT .= "<option value=\"-1\"";
+ if ($content['admin_id'] == '-1') $OUT .= ' selected="selected"';
+ $OUT .= ">{--ADMINS_TO_USER_EVENTS--}</option>\n";