$subselect = ''; break; case 'none': default: $subselect = ' where id = 0'; break; } } $result = Sql_query('SELECT id,name FROM ' . $tables['list'] . "{$subselect} ORDER BY listorder"); $c = 0; if (Sql_Affected_Rows() == 1) { $row = Sql_fetch_array($result); printf('<input type="hidden" name="listname[%d]" value="%s"><input type="hidden" name="importlists[%d]" value="%d">' . $GLOBALS['I18N']->get('adding_users') . ' <b>%s</b>', $c, stripslashes($row['name']), $c, $row['id'], stripslashes($row['name'])); } else { print '<h3>' . s('Select the lists to add the emails to') . '</h3>'; print ListSelectHTML($import_lists, 'importlists', $subselect); } ?> <script language="Javascript" type="text/javascript"> var fieldstocheck = new Array(); var fieldnames = new Array(); function addFieldToCheck(value,name) { fieldstocheck[fieldstocheck.length] = value; fieldnames[fieldnames.length] = name; } </script> <div class="panel">
} } if (isset($_GET['list'])) { $id = sprintf('%d', $_GET['list']); if (!empty($subselectimp)) { $subselectimp .= ' and id = ' . $id; } else { $subselectimp .= ' where id = ' . $id; } } #print PageLinkDialog('addlist',$GLOBALS['I18N']->get('Add a new list')); print FormStart(' enctype="multipart/form-data" name="import"'); $result = Sql_query("SELECT id,name FROM " . $tables["list"] . "{$subselectimp} ORDER BY listorder"); $total = Sql_Num_Rows($result); $c = 0; if ($total == 1) { $row = Sql_fetch_array($result); $content .= sprintf('<input type="hidden" name="listname[%d]" value="%s"><input type="hidden" name="importlists[%d]" value="%d">' . $GLOBALS['I18N']->get('Adding subscribers') . ' <b>%s</b>', $c, stripslashes($row["name"]), $c, $row["id"], stripslashes($row["name"])); } else { $content .= '<p>' . $GLOBALS['I18N']->get('Select the lists to add the emails to') . '</p>'; $content .= ListSelectHTML($selected_lists, 'importlists', $subselectimp); } $content .= '<p class="information">' . $GLOBALS['I18N']->get('Please enter the emails to import, one per line, in the box below and click "Import Emails"'); #$GLOBALS['I18N']->get('<b>Warning</b>: the emails you import will not be checked on validity. You can do this later on the "reconcile subscribers" page.'); $content .= '</p>'; $content .= '<div class="field"><input type="checkbox" name="checkvalidity" value="1" checked="checked" /> ' . $GLOBALS['I18N']->get('Check to skip emails that are not valid') . '</div>'; $content .= '<div class="field"><input type="submit" name="doimport" value="' . $GLOBALS['I18N']->get('Import emails') . '" ></div>'; $content .= '<div class="field"><textarea name="importcontent" rows="10" cols="40"></textarea></div>'; $panel = new UIPanel('', $content); print $panel->display(); print '</form>';