$ls->addElement($element); $ls->setClass($element, 'rows row1'); $ls->addColumn($element, $GLOBALS['I18N']->get('Members'), '<div style="display:inline-block;text-align:right;width:50%;float:left;">' . $membersDisplay . '</div><span class="view" style="text-align:left;display:inline-block;float:right;width:48%;"><a class="button " href="./?page=members&id=' . $row['id'] . '" title="' . $GLOBALS['I18N']->get('View Members') . '">' . $GLOBALS['I18N']->get('View Members') . '</a></span>'); $ls->addColumn($element, $GLOBALS['I18N']->get('Public'), sprintf('<input type="checkbox" name="active[%d]" value="1" %s %s />', $row['id'], $row['active'] ? 'checked="checked"' : '', listUsedInSubscribePage($row['id']) ? ' disabled="disabled" ' : '')); /* $owner = adminName($row['owner']); if (!empty($owner)) { $ls->addColumn($element, $GLOBALS['I18N']->get('Owner'),$GLOBALS['require_login'] ? adminName($row['owner']):$GLOBALS['I18N']->get('n/a')); } if (trim($desc) != '') { $ls->addRow($element, $GLOBALS['I18N']->get('Description'),$desc); } */ $ls->addColumn($element, $GLOBALS['I18N']->get('Order'), sprintf('<input type="text" name="listorder[%d]" value="%d" size="3" class="listorder" />', $row['id'], $row['listorder'])); $deletebutton = new ConfirmButton(s('Are you sure you want to delete this list?') . '\\n' . s('This will NOT remove the subscribers that are on this list.') . '\\n' . s('You can reconnect subscribers to lists on the Reconcile Subscribers page.'), PageURL2('list&delete=' . $row['id']), s('delete this list')); $ls->addRow($element, '', '<span class="edit-list"><a class="button" href="?page=editlist&id=' . $row['id'] . '" title="' . $GLOBALS['I18N']->get('Edit this list') . '"></a></span>' . '<span class="send-list">' . PageLinkButton('send&new=1&list=' . $row['id'], $GLOBALS['I18N']->get('send'), '', '', $GLOBALS['I18N']->get('start a new campaign targetting this list')) . '</span>' . '<span class="add_member">' . PageLinkDialogOnly('importsimple&list=' . $row['id'], s('Add Members')) . '</span>' . '<span class="delete">' . $deletebutton->show() . '</span>', '', '', 'actions nodrag'); $some = 1; } $ls->addSubmitButton('update', $GLOBALS['I18N']->get('Save Changes')); if (!$some) { echo $GLOBALS['I18N']->get('No lists, use Add List to add one'); } else { print $ls->display('', 'draggable'); } /* echo '<table class="x" border="0"> <tr> <td>'.$GLOBALS['I18N']->get('No').'</td> <td>'.$GLOBALS['I18N']->get('Name').'</td> <td>'.$GLOBALS['I18N']->get('Order').'</td>
} else { $enctype = ''; } ### variable initialisation and sanity checks if (isset($_GET['id'])) { $id = sprintf('%d', $_GET['id']); } else { $id = 0; } ## page actions $send = isset($_POST['send']); $prepare = isset($_POST['prepare']); $save = !empty($_POST['save']) || !empty($_POST['followupto']); $savedraft = !empty($_POST['savedraft']); $sendtest = !empty($_POST['sendtest']); $baseurl = PageURL2($_GET['page'] . '&id=' . $id); if (!isset($_GET['tab'])) { $_GET['tab'] = ''; } $_GET['tab'] = strip_tags($_GET['tab']); if (!empty($_GET['tab'])) { $baseurl .= '&tab=' . $_GET['tab']; } ### if we're not working on an existing message, create one and redirect to edit it if (!$id) { $defaulttemplate = getConfig('defaultmessagetemplate'); $defaultfooter = getConfig('messagefooter'); Sql_Query(sprintf('insert into %s (subject, status, entered, sendformat, embargo, repeatuntil, owner, template, tofield, replyto,footer) values("(no title)", "draft", now(), "HTML", now(), now(), %d, %d, "", "", "%s" )', $GLOBALS['tables']['message'], $_SESSION['logindetails']['id'], $defaulttemplate, sql_escape($defaultfooter))); $id = Sql_Insert_Id(); if (isset($_GET['list'])) {
SaveConfig($id, $_POST["values"][$id], 0); Redirect("configure"); exit; } } } if (!$id) { while (list($key, $val) = each($default_config)) { if (is_array($val)) { $dbval = getConfig($key); if (isset($dbval)) { $value = $dbval; } else { $value = $val[0]; } printf('<p><a href="%s">%s</a> <b>%s</b><br/>', PageURL2("configure", "", "id={$key}"), $GLOBALS['I18N']->get('edit'), $GLOBALS['I18N']->get($val[1])); print nl2br(htmlspecialchars(stripslashes($value))) . "<br/><hr/>"; } } } else { $val = $default_config[$id]; printf('%s<p>' . $GLOBALS['I18N']->get('editing') . ' <b>%s</b><br/>', formStart(), $GLOBALS['I18N']->get($val[1])); printf('<input type=hidden name="id" value="%s">', $id); $dbval = getConfig($id); # print $dbval.'<br/>'; if (isset($dbval)) { $value = $dbval; } else { $value = $val[0]; } # print $value . " ".$website . " ".$domain.'<br/>';
$bouncels->addElement($row["bounce"], PageURL2("bounce", $GLOBALS['I18N']->get('view'), "id=" . $row["bounce"])); $bouncels->addColumn($row["bounce"], $GLOBALS['I18N']->get('msg'), $row["message"]); $bouncels->addColumn($row["bounce"], $GLOBALS['I18N']->get('time'), $row["ftime"]); $bounces[$row["message"]] = $row["ftime"]; } } $ls = new WebblerListing($GLOBALS['I18N']->get('Messages')); $msgs = Sql_Query(sprintf('select messageid,entered,viewed,(viewed = 0 or viewed is null) as notviewed, abs(unix_timestamp(entered) - unix_timestamp(viewed)) as responsetime from %s where userid = %d and status = "sent"', $tables["usermessage"], $user["id"])); $num = Sql_Affected_Rows(); printf('%d ' . $GLOBALS['I18N']->get('messages sent to this user') . '<br/>', $num); if ($num) { $resptime = 0; $totalresp = 0; while ($msg = Sql_Fetch_Array($msgs)) { $ls->addElement($msg["messageid"], PageURL2("message", $GLOBALS['I18N']->get('view'), "id=" . $msg["messageid"])); if (CLICKTRACK) { $clicks = Sql_Fetch_Row_Query(sprintf('select sum(clicked) as numclicks from %s where userid = %s and messageid = %s', $GLOBALS['tables']['linktrack'], $user['id'], $msg['messageid'])); $ls->addColumn($msg["messageid"], $GLOBALS['I18N']->get('clicks'), PageLink2('userclicks&userid=' . $user['id'] . '&msgid=' . $msg['messageid'], $clicks[0])); } $ls->addColumn($msg["messageid"], $GLOBALS['I18N']->get('sent'), formatDateTime($msg["entered"], 1)); if (!$msg['notviewed']) { $ls->addColumn($msg["messageid"], $GLOBALS['I18N']->get('viewed'), formatDateTime($msg["viewed"], 1)); $ls->addColumn($msg["messageid"], $GLOBALS['I18N']->get('responsetime'), $msg['responsetime']); $resptime += $msg['responsetime']; $totalresp += 1; } $ls->addColumn($msg["messageid"], $GLOBALS['I18N']->get('bounce'), $bounces[$msg["messageid"]]); } if ($totalresp) { $avgresp = sprintf('%d', $resptime / $totalresp);
} include $GLOBALS["coderoot"] . "date.php"; $errormsg = ''; $rss_content = ''; $done = 0; $messageid = 0; $duplicate_atribute = 0; # not actually used it seems @@@ check $embargo = new date("embargo"); $embargo->useTime = true; $repeatuntil = new date("repeatuntil"); $repeatuntil->useTime = true; if (empty($_GET['id'])) { $_GET['id'] = ''; } $baseurl = PageURL2($_GET["page"] . '&id=' . $_GET["id"]); echo '<script language="Javascript" src="js/jslib.js" type="text/javascript"></script><hr><p>'; // load some variables in a register globals-safe fashion if (isset($_POST['send'])) { $send = $_POST["send"]; // Only get this from the POST variable (not session or anywhere else) } else { $send = ''; } if (isset($_POST['prepare'])) { $prepare = $_POST["prepare"]; } else { $prepage = ''; } if (isset($_GET['id'])) { $id = sprintf('%d', $_GET["id"]);
exit; # print '<div id="actionresult" class="result">'.$actionresult .'</div>'; } if ($total > MAX_USER_PP) { $paging = simplePaging("bounces&tab={$currentTab}", $start, $total, MAX_USER_PP, $status . ' ' . $GLOBALS['I18N']->get('bounces')); $query = sprintf('select * from %s where status %s "unidentified bounce" order by date desc limit %s offset %s', $tables['bounce'], $status_compare, $limit, $offset); $result = Sql_Query($query); } else { $paging = ''; $query = sprintf('select * from %s where status ' . $status_compare . ' "unidentified bounce" order by date desc', $tables['bounce']); $result = Sql_Query($query); } $buttons = new ButtonGroup(new Button(PageURL2('bounces'), s('delete'))); $buttons->addButton(new ConfirmButton($GLOBALS['I18N']->get('are you sure you want to delete all unidentified bounces older than 2 months') . '?', PageURL2("{$baseurl}&action=deleteunidentified"), $GLOBALS['I18N']->get('delete all unidentified (> 2 months old)'))); $buttons->addButton(new ConfirmButton($GLOBALS['I18N']->get('are you sure you want to delete all bounces older than 2 months') . '?', PageURL2("{$baseurl}&action=deleteprocessed"), $GLOBALS['I18N']->get('delete all processed (> 2 months old)'))); $buttons->addButton(new ConfirmButton($GLOBALS['I18N']->get('are you sure you want to delete all bounces') . '?', PageURL2("{$baseurl}&action=deleteall"), $GLOBALS['I18N']->get('Delete all'))); print "<div class='actions'>\n"; print "<div class='minitabs'>\n"; print $tabs->display(); print "</div>\n"; print PageLinkButton('listbounces', $GLOBALS['I18N']->get('view bounces by list')); if (ALLOW_DELETEBOUNCE) { print '<div class="fright">' . $buttons->show() . '</div>'; } print "</div><!-- .actions div-->\n"; if (!Sql_Num_Rows($result)) { switch ($status) { case 'unidentified': print '<p class="information">' . s('no unidentified bounces available') . '</p>'; break; case 'processed':
if ($msg['status'] == 'inprocess' || $msg['status'] == 'submitted') { $actionbuttons .= '<span class="suspend">' . PageLinkButton('messages&suspend=' . $msg['id'], $GLOBALS['I18N']->get('Suspend'), '', '', s('Suspend')) . '</span>'; } elseif ($msg['status'] != 'draft') { $actionbuttons .= '<span class="resend">' . PageLinkButton('messages', $GLOBALS['I18N']->get('Requeue'), 'resend=' . $msg['id'], '', s('Requeue')) . '</span>'; } $actionbuttons .= '<span class="view">' . PageLinkButton('message', $GLOBALS['I18N']->get('View'), 'id=' . $msg['id'], '', s('View')) . '</span>'; if ($clicks[0] && CLICKTRACK) { $actionbuttons .= '<span class="stats">' . PageLinkButton('statsoverview', $GLOBALS['I18N']->get('statistics'), 'id=' . $msg['id'], '', s('Statistics')) . '</span>'; } #0012081: Add new 'Mark as sent' button if ($msg['status'] == 'suspended') { $actionbuttons .= '<span class="marksent">' . PageLinkButton('messages&markSent=' . $msg['id'], $GLOBALS['I18N']->get('Mark sent'), '', '', s('Mark sent')) . '</span>'; $actionbuttons .= '<span class="edit">' . PageLinkButton('send', $GLOBALS['I18N']->get('Edit'), 'id=' . $msg['id'], '', s('Edit')) . '</span>'; } elseif ($msg['status'] == 'draft' || !empty($messagedata['istestcampaign'])) { ## only draft messages should be deletable, the rest isn't $deletebutton = new ConfirmButton(s('Are you sure you want to delete this campaign?'), PageURL2("messages{$url_keep}&delete=" . $msg['id']), s('delete this campaign'), '', 'button'); # $actionbuttons .= sprintf('<span class="delete"><a href="javascript:deleteRec(\'%s\');" class="button" title="'.$GLOBALS['I18N']->get("delete").'">'.$GLOBALS['I18N']->get("delete").'</a></span>',PageURL2("messages$url_keep","","delete=".$msg["id"])); $actionbuttons .= '<span class="edit">' . PageLinkButton('send', $GLOBALS['I18N']->get('Edit'), 'id=' . $msg['id'], '', s('Edit')) . '</span>'; if (empty($clicks[0])) { ## disallow deletion when there are stats $actionbuttons .= '<span class="delete">' . $deletebutton->show() . '</span>'; } } $ls->addColumn($listingelement, $GLOBALS['I18N']->get('Action'), '<div class="messageactions">' . $actionbuttons . '</div>'); } } print $ls->display(); if ($total > 5 && $_GET['tab'] == 'active') { print PageLinkButton('messages', $GLOBALS['I18N']->get('Suspend All'), 'action=suspall'); print PageLinkButton('messages', $GLOBALS['I18N']->get('Mark All Sent'), 'action=markallsent'); }
} else { $listing = $GLOBALS['I18N']->get('Listing 1 to 50'); $limit = "limit 0,50"; $start = 0; } printf('<table border="1"><tr><td colspan="4" align="center">%s</td></tr><tr><td>%s</td><td>%s</td><td> %s</td><td>%s</td></tr></table><p><hr>', $listing, PageLink2("eventlog", "<<", "start=0" . $find_url), PageLink2("eventlog", "<", sprintf('start=%d', max(0, $start - MAX_USER_PP)) . $find_url), PageLink2("eventlog", ">", sprintf('start=%d', min($total, $start + MAX_USER_PP)) . $find_url), PageLink2("eventlog", ">>", sprintf('start=%d', $total - MAX_USER_PP) . $find_url)); $result = Sql_query(sprintf('select * from %s %s order by entered desc,id desc %s', $tables["eventlog"], $where, $limit)); } else { $result = Sql_Query(sprintf('select * from %s %s order by entered desc, id desc', $tables["eventlog"], $where)); } printf("[ <a href=\"javascript:deleteRec2('%s','%s');\">%s</a> |\n <a href=\"javascript:deleteRec2('%s','%s');\">%s</a> ] ", $GLOBALS['I18N']->get('Are you sure you want to delete all events older than 2 months?'), PageURL2("eventlog", "Delete", "start={$start}&action=deleteprocessed"), $GLOBALS['I18N']->get('Delete all (> 2 months old)'), $GLOBALS['I18N']->get('Are you sure you want to delete all events matching this filter?'), PageURL2("eventlog", "Delete", "start={$start}&action=deleteall{$find_url}"), $GLOBALS['I18N']->get('Delete all')); if (!Sql_Affected_Rows()) { print '<p>' . $GLOBALS['I18N']->get('No events available') . '</p>'; } print '<br/><br/>'; printf('<form method="get"> <input type="hidden" name="page" value="eventlog"> <input type="hidden" name="s" value="%d"> %s: <input type=text name="filter" value="%s"> %s <input type="checkbox" name="exclude" value="1" %s> </form><br/>', $s, $GLOBALS['I18N']->get('Filter'), $filter, $GLOBALS['I18N']->get('Exclude filter'), $exclude == 1 ? 'checked' : ''); $ls = new WebblerListing($GLOBALS['I18N']->get('events')); # @@@@ Looks like there are a few del, page, date, message which may not be i18nable. while ($event = Sql_fetch_array($result)) { $ls->addElement($event["id"]); $ls->addColumn($event["id"], $GLOBALS['I18N']->get('del'), sprintf('<a href="javascript:deleteRec(\'%s\');">%s</a>', PageURL2("eventlog", "delete", "start={$start}&delete=" . $event["id"]), $GLOBALS['I18N']->get('del'))); $ls->addColumn($event["id"], $GLOBALS['I18N']->get('page'), $event["page"]); $ls->addColumn($event["id"], $GLOBALS['I18N']->get('date'), $event["entered"]); $ls->addColumn($event["id"], $GLOBALS['I18N']->get('message'), $event["entry"]); } print $ls->display();
} else { $enctype = ''; } ### variable initialisation and sanity checks if (isset($_GET['id'])) { $id = sprintf('%d', $_GET['id']); } else { $id = 0; } ## page actions $send = isset($_POST["send"]); $prepare = isset($_POST['prepare']); $save = !empty($_POST["save"]) || !empty($_POST['followupto']); $savedraft = !empty($_POST["savedraft"]); $sendtest = !empty($_POST["sendtest"]); $baseurl = PageURL2($_GET["page"] . '&id=' . $id); if (!isset($_GET['tab'])) { $_GET['tab'] = ''; } if (!empty($_GET['tab'])) { $baseurl .= '&tab=' . $_GET['tab']; } ### if we're not working on an existing message, create one and redirect to edit it if (!$id) { $defaulttemplate = getConfig('defaultmessagetemplate'); $defaultfooter = getConfig('messagefooter'); $query = " insert into %s" . " (subject, status, entered, sendformat, embargo" . " , repeatuntil, owner, template, tofield, replyto,footer)" . " values" . " ('(no subject)', 'draft', current_timestamp, 'HTML'" . " , current_timestamp, current_timestamp, ?, ?, '', '', ? )"; $query = sprintf($query, $GLOBALS['tables']['message']); Sql_Query_Params($query, array($_SESSION['logindetails']['id'], $defaulttemplate, $defaultfooter)); $id = Sql_Insert_Id($GLOBALS['tables']['message'], 'id'); if (isset($_GET['list'])) {
', $msg["bouncecount"]) : ""); } else { $status = $msg['status'] . '<br/>' . $msg['rsstemplate']; if ($msg['status'] == 'inprocess') { $status .= '<br/>' . '<meta http-equiv="Refresh" content="300">' . $messagedata['to process'] . ' ' . $GLOBALS['I18N']->get('still to process') . '<br/>' . $GLOBALS['I18N']->get('ETA') . ': ' . $messagedata['ETA'] . '<br/>' . $GLOBALS['I18N']->get('Processing') . ' ' . sprintf('%d', $messagedata['msg/hr']) . ' ' . $GLOBALS['I18N']->get('msgs/hr'); } $sendstats = ''; } if ($msg['status'] == 'inprocess' || $msg['status'] == 'submitted') { $status .= '<br/>' . PageLink2('messages&suspend=' . $msg['id'], $GLOBALS['I18N']->get('Suspend Sending')); } $totalsent = $msg['astext'] + $msg['ashtml'] + $msg['astextandhtml'] + $msg['aspdf'] + $msg['astextandpdf']; printf(' <td> %s<br /> </td><td> %s<br /> %s<br /> %s<br /> %s <a href="javascript:deleteRec(\'%s\');">' . $GLOBALS['I18N']->get("delete") . '</a> </td> </tr>', $status . $sendstats, PageLink2("message", $GLOBALS['I18N']->get("View"), "id=" . $msg["id"]), $msg['status'] != 'inprocess' ? PageLink2("messages", $GLOBALS['I18N']->get("Requeue"), "resend=" . $msg["id"]) : $totalsent . " " . $GLOBALS['I18N']->get("sent"), $msg["status"] != 'prepared' ? PageLink2("send", $GLOBALS['I18N']->get("Edit"), "id=" . $msg["id"]) : PageLink2("preparesend", $GLOBALS['I18N']->get("Edit"), "id=" . $msg["id"]), $clicks[0] && CLICKTRACK ? PageLink2("mclicks", $GLOBALS['I18N']->get("click stats"), "id=" . $msg["id"]) . '<br/>' : '', PageURL2("messages{$url_keep}", "", "delete=" . $msg["id"])); } } ?> </table>
<input type=checkbox name="checkall" onClick="checkAll()"><?php echo $GLOBALS['I18N']->get("Tag all users in this page"); ?> <?php $columns = array(); $columns = explode(',', getConfig('membership_columns')); $columns = array('country', 'Lastname'); $ls = new WebblerListing($GLOBALS['I18N']->get("Members")); while ($user = Sql_fetch_array($result)) { $ls->addElement($user["email"], PageUrl2("user&id=" . $user["id"])); $ls->addColumn($user["email"], $GLOBALS['I18N']->get("confirmed"), $user["confirmed"] ? $GLOBALS["img_tick"] : $GLOBALS["img_cross"]); if ($access != "view") { $ls->addColumn($user["email"], $GLOBALS['I18N']->get("tag"), sprintf('<input type=checkbox name="user[%d]" value="1">', $user["id"])); } if ($access != "view") { $ls->addColumn($user["email"], $GLOBALS['I18N']->get("del"), sprintf('<a href="javascript:deleteRec(\'%s\');">' . $GLOBALS['I18N']->get('Del') . '</a>', PageURL2("members", "", "start={$start}&id={$id}&delete=" . $user["id"]))); } $msgcount = Sql_Fetch_Row_Query("select count(*) from {$tables["listmessage"]},{$tables["usermessage"]}\n where {$tables["listmessage"]}.listid = {$id} and {$tables["listmessage"]}.messageid = {$tables["usermessage"]}.messageid\n and {$tables["usermessage"]}.userid = {$user["id"]}"); $ls->addColumn($user["email"], $GLOBALS['I18N']->get("# msgs"), $msgcount[0]); if (ENABLE_RSS) { $msgcount = Sql_Fetch_Row_Query("select count(*) from {$tables["rssitem"]},{$tables["rssitem_user"]}\n where {$tables["rssitem"]}.list = {$id} and {$tables["rssitem"]}.id = {$tables["rssitem_user"]}.itemid and\n {$tables["rssitem_user"]}.userid = {$user["id"]}"); if ($msgcount[0]) { $ls->addColumn($user["email"], $GLOBALS['I18N']->get("# rss"), $msgcount[0]); } if ($user["rssfrequency"]) { $ls->addColumn($user["email"], $GLOBALS['I18N']->get("rss freq"), $user["rssfrequency"]); } $last = Sql_Fetch_Row_Query("select last from {$tables["user_rss"]} where userid = " . $user["id"]); if ($last[0]) { $ls->addColumn($user["email"], $GLOBALS['I18N']->get("last sent"), $last[0]); }
?> <p><?php echo $GLOBALS["I18N"]->get("addnew") . " " . $data["name"] . ', ' . $GLOBALS["I18N"]->get("oneperline"); ?> <br /> <textarea name="itemlist" rows=20 cols=50></textarea><br /> <input type="Submit" name="addnew" value="<?php echo $GLOBALS["I18N"]->get("addnew") . " " . $data["name"]; ?> "><br /> <?php } $result = Sql_query("SELECT * FROM {$table} order by listorder,name"); $num = Sql_Affected_Rows(); if ($num < 100 && $num > 25) { printf('<input type=submit name=action value="%s"><br />', $GLOBALS["I18N"]->get("changeorder")); } while ($row = Sql_Fetch_array($result)) { printf('<a href="javascript:deleteRec(\'%s\');">' . $GLOBALS['I18N']->get('Delete') . '</a> |', PageURL2("editattributes", "", "id={$id}&delete=" . $row["id"])); if ($num < 100) { printf(' <input type=text name="listorder[%d]" value="%s" size=5>', $row["id"], $row["listorder"]); } printf(' %s %s <br />', $row["name"], $row["name"] == $data["default_value"] ? $GLOBALS['I18N']->get('Default') : ""); } if ($num && $num < 100) { printf('<input type=submit name=action value="%s">', $GLOBALS["I18N"]->get("changeorder")); } ?> </form>
} require_once $coderoot . 'structure.php'; $result = Sql_Fetch_Assoc_query(sprintf('select id, subject from %s where id = %d %s', $tables['message'], $id, $owner_select_and)); if (empty($result['id'])) { print $GLOBALS['I18N']->get('No such campaign'); return; } $campaignTitle = $result['subject']; $msgdata = loadMessageData($id); if ($msgdata['status'] == 'draft' || $msgdata['status'] == 'suspended') { print '<div class="actions">'; print '<p>' . PageLinkButton('send&id=' . $id, $GLOBALS['I18N']->get('Edit this message')) . '</p>'; print '</div>'; } else { print '<div class="actions">'; $editbutton = new ConfirmButton(s('Editing an active or finished campaign will place it back in the draft queue, continue?'), PageURL2('send&id=' . $id), s('Edit campaign')); print $editbutton->show(); print '</div>'; } $content = '<table class="messageView">'; $format = '<tr><td valign="top" class="dataname">%s</td><td valign="top">%s</td></tr>'; $content .= sprintf($format, s('entered'), stripslashes($msgdata['entered'])); $content .= sprintf($format, s('fromfield'), stripslashes($msgdata['fromfield'])); $content .= sprintf($format, s('message'), stripslashes($msgdata['message'])); $content .= sprintf($format, s('textmessage'), nl2br(stripslashes($msgdata['textmessage']))); $content .= sprintf($format, s('footer'), stripslashes($msgdata['footer'])); $finishSending = mktime($msgdata['finishsending']['hour'], $msgdata['finishsending']['minute'], 0, $msgdata['finishsending']['month'], $msgdata['finishsending']['day'], $msgdata['finishsending']['year']); $embargoTime = mktime($msgdata['embargo']['hour'], $msgdata['embargo']['minute'], 0, $msgdata['embargo']['month'], $msgdata['embargo']['day'], $msgdata['embargo']['year']); $repeatuntilTime = mktime($msgdata['repeatuntil']['hour'], $msgdata['repeatuntil']['minute'], 0, $msgdata['repeatuntil']['month'], $msgdata['repeatuntil']['day'], $msgdata['repeatuntil']['year']); $requeueuntilTime = mktime($msgdata['requeueuntil']['hour'], $msgdata['requeueuntil']['minute'], 0, $msgdata['requeueuntil']['month'], $msgdata['requeueuntil']['day'], $msgdata['requeueuntil']['year']); if ($embargoTime > time()) {
echo formStart('action=""'); ?> <input type="hidden" name="id" value="<?php echo $listid; ?> "> <?php echo $GLOBALS['I18N']->get('Find an admin'); ?> : <input type=text name="find" value="<?php echo htmlspecialchars($find); ?> " size="40"><input type="submit" value="<?php echo $GLOBALS['I18N']->get('Go'); ?> "> </form></td></tr></table> <?php $ls = new WebblerListing($GLOBALS['I18N']->get('Administrators')); $ls->usePanel($paging); while ($admin = Sql_fetch_array($result)) { $delete_url = sprintf("<a href=\"javascript:deleteRec('%s');\">" . $GLOBALS['I18N']->get('del') . "</a>", PageURL2("admins", "Delete", "start={$start}&delete=" . $admin["id"])); $ls->addElement($admin["loginname"], PageUrl2("admin", $GLOBALS['I18N']->get('Show'), "start={$start}&id=" . $admin["id"] . $remember_find)); if (!$external && $admin['id'] != $_SESSION['logindetails']['id']) { $ls->addColumn($admin["loginname"], $GLOBALS['I18N']->get('Del'), $delete_url); } } print $ls->display(); print '<br/><hr/>'; print PageLinkButton("admin", $GLOBALS['I18N']->get('Add a new administrator'), "start={$start}" . $remember_find); print '<p class="button">' . PageLink2("importadmin", $GLOBALS['I18N']->get('Import list of admins')) . '</p>';
Info($GLOBALS['I18N']->get('Deleted') . " {$delete}"); } print formStart('name="pagelist" class="spageEdit" '); print '<input type="hidden" name="active[-1]" value="1" />'; ## to force the active array to exist $ls = new WebblerListing($GLOBALS['I18N']->get('subscribe pages')); $req = Sql_Query(sprintf('select * from %s %s order by title', $tables["subscribepage"], $subselect)); while ($p = Sql_Fetch_Array($req)) { $ls->addElement($p["id"]); $ls->setClass($p["id"], 'row1'); $ls->addColumn($p["id"], $GLOBALS['I18N']->get('title'), stripslashes($p["title"])); if ($require_login && isSuperUser() || !$require_login) { $ls->addColumn($p["id"], $GLOBALS['I18N']->get('owner'), adminName($p["owner"])); if ($p["id"] == $default) { $checked = 'checked="checked"'; } else { $checked = ""; } $ls->addColumn($p["id"], $GLOBALS['I18N']->get('default'), sprintf('<input type="radio" name="default" value="%d" %s onchange="document.pagelist.submit()" />', $p["id"], $checked)); } else { $adminname = ""; $isdefault = ""; } $ls->addColumn($p["id"], s('active'), sprintf('<input type="checkbox" name="active[%d]" value="1" %s onchange="document.pagelist.submit()" />', $p["id"], $p["active"] ? 'checked="checked"' : '')); $ls->addRow($p["id"], $p["active"] ? '<span class="yes" title="' . $GLOBALS['I18N']->get('active') . '"></span>' : '<span class="no" title="' . $GLOBALS['I18N']->get('not active') . '"></span>', sprintf('<span class="edit"><a class="button" href="%s&id=%d" title="' . $GLOBALS['I18N']->get('edit') . '">%s</a></span>', PageURL2("spageedit", ""), $p["id"], $GLOBALS['I18N']->get('edit')) . sprintf('<span class="delete"><a class="button" href="javascript:deleteRec(\'%s\');" title="' . $GLOBALS['I18N']->get('delete') . '">%s</a></span>', PageURL2("spage", "", "delete=" . $p["id"]), $GLOBALS['I18N']->get('del')) . sprintf('<span class="view"><a class="button" href="%s&id=%d" title="' . $GLOBALS['I18N']->get('view') . '">%s</a></span>', getConfig("subscribeurl"), $p["id"], $GLOBALS['I18N']->get('view'))); } print $ls->display(); print '<p class="button">' . PageLink2("spageedit", s('Add a new subscribe page')) . '</p>'; ?> </form>
Warn(sprintf(s('The maximum POST size is smaller than the maximum upload filesize. If your upload file is too large, import will fail. See the PHP documentation at <a href="%s">%s</a>', 'http://php.net/post_max_size', 'http://php.net/post_max_size'))); } require dirname(__FILE__) . '//structure.php'; require dirname(__FILE__) . '/inc/importlib.php'; register_shutdown_function('my_shutdown'); if (!defined('WEBBLER')) { ob_end_flush(); } if (!empty($_GET['reset']) && $_GET['reset'] == 'yes') { clearImport(); print '<h3>' . $GLOBALS['I18N']->get('Import cleared') . '</h3>'; print PageLinkButton('import2', s('Continue')); return; } else { # if ((!empty($_SESSION["import_file"]) || !empty($_SESSION["test_import"])) && (!isset($_GET['confirm']) || $_GET['confirm'] != 'yes')) { $button = new ConfirmButton(s('Are you sure you want to reset the import session?'), PageURL2('import2&reset=yes', 'reset', ''), s('Reset Import session')); print '<div class="fright">' . $button->show() . '</div>'; # } } if (isset($_POST['import'])) { if (!verifyToken()) { print Error(s('Invalid security token, please reload the page and try again'), 'http://resources.phplist.com/documentation/errors/securitytoken'); return; } $test_import = isset($_POST['import_test']) && $_POST['import_test'] == 'yes'; $_SESSION['test_import'] = $test_import; if (!$_FILES['import_file']) { Fatal_Error($GLOBALS['I18N']->get('File is either too large or does not exist.')); return; } if (empty($_FILES['import_file'])) {
} if (isset($_GET["delete"]) && $_GET["delete"]) { # delete the index in delete print $GLOBALS['I18N']->get('Deleting') . " {$delete} ..\n"; Sql_query(sprintf('delete from %s where id = %d', $GLOBALS["tables"]["admin"], $_GET["delete"])); Sql_query(sprintf('delete from %s where adminid = %d', $GLOBALS["tables"]["admin_attribute"], $_GET["delete"])); Sql_query(sprintf('delete from %s where adminid = %d', $GLOBALS["tables"]["admin_task"], $_GET["delete"])); print '..' . $GLOBALS['I18N']->get('Done') . "<br /><hr><br />\n"; } if ($id) { print $GLOBALS['I18N']->get('Edit Administrator') . ': '; $result = Sql_query("SELECT * FROM {$tables["admin"]} where id = {$id}"); $data = sql_fetch_array($result); print $data["loginname"]; if ($data["loginname"] != "admin" && $accesslevel == "all") { printf("<br /><li><a href=\"javascript:deleteRec('%s');\">Delete</a> %s\n", PageURL2("admin", "", "delete={$id}"), $admin["loginname"]); } } else { print $GLOBALS['I18N']->get('Add a new Administrator'); } print "<br/>"; print '<p>' . $GLOBALS['I18N']->get('Admin Details') . ':' . formStart() . '<table border=1>'; printf('<input type=hidden name="id" value="%d">', $id); reset($struct); while (list($key, $val) = each($struct)) { list($a, $b) = explode(":", $val[1]); if ($a == "sys") { printf('<tr><td>%s</td><td>%s</td></tr>', $GLOBALS['I18N']->get($b), $data[$key]); } elseif ($key == "loginname" && $data[$key] == "admin") { printf('<tr><td>' . $GLOBALS['I18N']->get('Login Name') . '</td><td>admin</td></tr>'); print '<input type=hidden name="loginname" value="admin">';
$ls->addElement($element); $ls->setClass($element, 'rows row1'); $ls->addColumn($element, $GLOBALS['I18N']->get('Members'), '<div style="display:inline-block;text-align:right;width:50%;float:left;">' . $membersDisplay . '</div><span class="view" style="text-align:left;display:inline-block;float:right;width:48%;"><a class="button " href="./?page=members&id=' . $row["id"] . '" title="' . $GLOBALS['I18N']->get('View Members') . '">' . $GLOBALS['I18N']->get('View Members') . '</a></span>'); $ls->addColumn($element, $GLOBALS['I18N']->get('Public'), sprintf('<input type="checkbox" name="active[%d]" value="1" %s %s />', $row["id"], $row["active"] ? 'checked="checked"' : '', listUsedInSubscribePage($row["id"]) ? ' disabled="disabled" ' : '')); /* $owner = adminName($row['owner']); if (!empty($owner)) { $ls->addColumn($element, $GLOBALS['I18N']->get('Owner'),$GLOBALS['require_login'] ? adminName($row['owner']):$GLOBALS['I18N']->get('n/a')); } if (trim($desc) != '') { $ls->addRow($element, $GLOBALS['I18N']->get('Description'),$desc); } */ $ls->addColumn($element, $GLOBALS['I18N']->get('Order'), sprintf('<input type="text" name="listorder[%d]" value="%d" size="3" class="listorder" />', $row['id'], $row['listorder'])); $deletebutton = new ConfirmButton(s('Are you sure you want to delete this list?'), PageURL2("list&delete=" . $row["id"]), s('delete this list')); $ls->addRow($element, '', '<span class="edit-list"><a class="button" href="?page=editlist&id=' . $row["id"] . '" title="' . $GLOBALS['I18N']->get('Edit this list') . '"></a></span>' . '<span class="send-list">' . PageLinkButton('send&new=1&list=' . $row['id'], $GLOBALS['I18N']->get('send'), '', '', $GLOBALS['I18N']->get('start a new campaign targetting this list')) . '</span>' . '<span class="add_member">' . PageLinkDialogOnly('importsimple&list=' . $row["id"], $GLOBALS['I18N']->get('Add Members')) . '</span>' . '<span class="delete">' . $deletebutton->show() . '</span>', '', '', 'actions nodrag'); $some = 1; } $ls->addSubmitButton('update', $GLOBALS['I18N']->get('Save Changes')); if (!$some) { echo $GLOBALS['I18N']->get('No lists, use Add List to add one'); } else { print $ls->display('', 'draggable'); } /* echo '<table class="x" border="0"> <tr> <td>'.$GLOBALS['I18N']->get('No').'</td> <td>'.$GLOBALS['I18N']->get('Name').'</td> <td>'.$GLOBALS['I18N']->get('Order').'</td>
header('Content-disposition: attachment; filename="phpList URL click statistics.csv"'); } ob_start(); } if (!$id) { $req = Sql_Query(sprintf('select forward.id,url, sum(clicked) as numclicks, max(latestclick) as lastclicked, count(messageid) as msgs from %s where clicked %s and forward.id = ml.forwardid and latestclick > date_sub(now(),interval 12 month) group by url order by latestclick desc limit 50', $select_tables, $owner_and)); $ls = new WebblerListing($GLOBALS['I18N']->get('Available URLs')); while ($row = Sql_Fetch_Array($req)) { $some = 1; if (!$download) { $element = shortenTextDisplay($row['url'], 30); } else { $element = $row['url']; } $ls->addElement($element, PageURL2('uclicks&id=' . $row['id'])); $ls->addColumn($element, $GLOBALS['I18N']->get('msgs'), $row['msgs']); $ls->addColumn($element, $GLOBALS['I18N']->get('last clicked'), formatDateTime($row['lastclicked'], 1)); $ls->addColumn($element, $GLOBALS['I18N']->get('clicks'), $row['numclicks']); } if ($download) { ob_end_clean(); print $ls->tabDelimited(); } if ($some) { print '<p>' . $GLOBALS['I18N']->get('Select URL to view') . '</p>'; print '<div class="actions">' . PageLinkButton('uclicks&dl=true', $GLOBALS['I18N']->get('Download as CSV file')) . '</div>'; print $ls->display(); } else { print '<p class="information">' . $GLOBALS['I18N']->get('There are currently no statistics available') . '</p>'; }
$result = Sql_query("SELECT * FROM {$tables['list']} {$subselect} order by listorder"); while ($row = Sql_fetch_array($result)) { $count = Sql_Fetch_Row_Query("select count(*) from {$tables["listuser"]} where listid = {$row["id"]} "); $desc = stripslashes($row["description"]); if ($row["rssfeed"]) { $feed = $row["rssfeed"]; # reformat string, so it wraps if it's very long $feed = ereg_replace("/", "/ ", $feed); $feed = ereg_replace("&", "& ", $feed); $desc = sprintf('RSS source: <a href="%s" target="_blank">%s</a><br/> ', $row["rssfeed"], $feed) . PageLink2("viewrss&id=" . $row["id"], "(View Items)") . '<br/>' . $desc; } $html .= sprintf('<tr><td valign=top>%d</td><td valign=top><b> %s</b><br/>%d members</td><td valign=top><input type=text name="listorder[%d]" value="%d" size=5></td> <td valign=top>%s | %s | <a href="javascript:deleteRec(\'%s\');">delete</a></td> <td valign=top><input type=checkbox name="active[%d]" value="1" %s></td> <td valign=top>%s</td></tr><tr><td> </td><td colspan=5>%s</td></tr><tr><td colspan=6><hr width=50%% size=4></td></tr>', $row["id"], $row["name"], $count[0], $row["id"], $row["listorder"], PageLink2("editlist", "edit", "id=" . $row["id"]), PageLink2("members", "view members", "id=" . $row["id"]), PageURL2("list", "", "delete=" . $row["id"]), $row["id"], $row["active"] ? "checked" : "", $GLOBALS["require_login"] ? adminName($row["owner"]) : "n/a", $desc); $some = 1; } if (!$some) { echo "No lists available, use Add to add one"; } else { echo '<table border=0><tr><td>No</td><td>Name</td><td>Order</td><td>Functions</td><td> Active</td><td>Owner</td><td>' . $html . '<tr><td colspan=6 align=center><input type=submit name="update" value="Save Changes"></td></tr></table>'; } ?> </ul> </form> <p><? if ($GLOBALS["require_login"] && !isSuperUser()) {
## two columns are too confusing and really unnecessary # ON = confirmed && !blacklisted # $ls->addColumn($user["email"], $GLOBALS['I18N']->get('confirmed'), $user["confirmed"] ? $GLOBALS["img_tick"] : $GLOBALS["img_cross"]); # if (in_array("blacklist", $columns)) { $onblacklist = isBlackListed($user['email']); # $ls->addColumn($user["email"], $GLOBALS['I18N']->get('bl l'), $onblacklist ? $GLOBALS["img_tick"] : $GLOBALS["img_cross"]); # } if ($user['confirmed'] && !$onblacklist) { $ls_confirmed = $GLOBALS['img_tick']; } else { $ls_confirmed = $GLOBALS['img_cross']; } $ls_del = ''; # $ls->addColumn($user["email"], $GLOBALS['I18N']->get('del'), sprintf('<a href="%s" onclick="return deleteRec(\'%s\');">del</a>',PageUrl2('users'.$find_url), PageURL2("users&start=$start&delete=" .$user["id"]))); if (isSuperUser()) { $ls_del = sprintf('<a href="javascript:deleteRec(\'%s\');" class="del">del</a>', PageURL2("users&start={$start}&find={$find}&findby={$findby}&delete=" . $user['id'])); } /* if (isset ($user['foreignkey'])) { $ls->addColumn($user["email"], $GLOBALS['I18N']->get('key'), $user["foreignkey"]); } if (isset ($user["display"])) { $ls->addColumn($user["email"], " ", $user["display"]); } */ if (in_array('lists', $columns)) { $lists = Sql_query('SELECT count(*) FROM ' . $tables['listuser'] . ',' . $tables['list'] . ' where userid = ' . $user['id'] . ' and ' . $tables['listuser'] . '.listid = ' . $tables['list'] . '.id'); $membership = Sql_fetch_row($lists); $ls->addColumn($user['email'], $GLOBALS['I18N']->get('lists'), $membership[0]); } if (in_array('messages', $columns)) { $msgs = Sql_query('SELECT count(*) FROM ' . $tables['usermessage'] . ' where userid = ' . $user['id'] . ' and status = "sent"');
Warn(sprintf(s('The maximum POST size is smaller than the maximum upload filesize. If your upload file is too large, import will fail. See the PHP documentation at <a href="%s">%s</a>', 'http://php.net/post_max_size', 'http://php.net/post_max_size'))); } require dirname(__FILE__) . "//structure.php"; require dirname(__FILE__) . '/inc/importlib.php'; register_shutdown_function("my_shutdown"); if (!defined('WEBBLER')) { ob_end_flush(); } if (!empty($_GET["reset"]) && $_GET["reset"] == "yes") { clearImport(); print '<h3>' . $GLOBALS['I18N']->get('Import cleared') . '</h3>'; print PageLinkButton('import2', s('Continue')); return; } else { # if ((!empty($_SESSION["import_file"]) || !empty($_SESSION["test_import"])) && (!isset($_GET['confirm']) || $_GET['confirm'] != 'yes')) { $button = new ConfirmButton(s('Are you sure you want to reset the import session?'), PageURL2("import2&reset=yes", "reset", ""), s('Reset Import session')); print '<div class="fright">' . $button->show() . '</div>'; # } } if (isset($_POST["import"])) { if (!verifyToken()) { print Error(s('Invalid security token, please reload the page and try again'), 'http://resources.phplist.com/documentation/errors/securitytoken'); return; } $test_import = isset($_POST["import_test"]) && $_POST["import_test"] == "yes"; $_SESSION["test_import"] = $test_import; if (!$_FILES["import_file"]) { Fatal_Error($GLOBALS['I18N']->get('File is either too large or does not exist.')); return; } if (empty($_FILES["import_file"])) {
} } } if (isset($action) && $action == "new") { // ?? ?> <p>add new <? echo $data["name"] ?>, one per line<br /> <textarea name="itemlist" rows=20 cols=50></textarea><br /> <input type="Submit" name="submit" value="add new <? echo $data["name"] ?>s"><br /> <?php } $result = Sql_query("SELECT * FROM {$table} order by listorder,name"); $num = Sql_Affected_Rows(); if ($num < 100 && $num > 25) { print '<input type=submit name=action value="change order"><br />'; } while ($row = Sql_Fetch_array($result)) { printf('<a href="javascript:deleteRec(\'%s\');">delete</a> |', PageURL2("editattributes", "", "id={$id}&delete=" . $row["id"])); if ($num < 100) { printf(' <input type=text name="listorder[%d]" value="%s" size=5>', $row[id], $row[listorder]); } printf(' %s %s <br />', $row[name], $row[name] == $data["default_value"] ? "(default)" : ""); } if ($num && $num < 100) { print '<input type=submit name=action value="change order">'; } ?> </form>
</td></tr> </table> <?php $some = 0; $ls = new WebblerListing("users"); if ($result) { while ($user = Sql_fetch_array($result)) { $some = 1; $ls->addElement($user["email"], PageURL2("user&start={$start}&id=" . $user["id"] . $find_url)); $ls->addColumn($user["email"], $GLOBALS['I18N']->get('confirmed'), $user["confirmed"] ? $GLOBALS["img_tick"] : $GLOBALS["img_cross"]); if (in_array("blacklist", $columns)) { $onblacklist = isBlackListed($user["email"]); $ls->addColumn($user["email"], $GLOBALS['I18N']->get('bl l'), $onblacklist ? $GLOBALS["img_tick"] : $GLOBALS["img_cross"]); } $ls->addColumn($user["email"], $GLOBALS['I18N']->get('del'), sprintf("<a href=\"javascript:deleteRec('%s');\">del</a>", PageURL2("users", "delete", "start={$start}&delete=" . $user["id"]))); if (isset($user['foreignkey'])) { $ls->addColumn($user["email"], $GLOBALS['I18N']->get('key'), $user["foreignkey"]); } if (isset($user["display"])) { $ls->addColumn($user["email"], " ", $user["display"]); } if (in_array("lists", $columns)) { $lists = Sql_query("SELECT count(*) FROM " . $tables["listuser"] . "," . $tables["list"] . " where userid = " . $user["id"] . " and " . $tables["listuser"] . ".listid = " . $tables["list"] . ".id"); $membership = Sql_fetch_row($lists); $ls->addColumn($user["email"], $GLOBALS['I18N']->get('lists'), $membership[0]); } if (in_array("messages", $columns)) { $msgs = Sql_query("SELECT count(*) FROM " . $tables["usermessage"] . " where userid = " . $user["id"]); $nummsgs = Sql_fetch_row($msgs); $ls->addColumn($user["email"], $GLOBALS['I18N']->get('msgs'), $nummsgs[0]);
if (isBlackListed($user["email"])) { print "<h3>" . $GLOBALS['I18N']->get('subscriber is blacklisted since') . " "; $blacklist_info = Sql_Fetch_Array_Query(sprintf('select * from %s where email = "%s"', $tables["user_blacklist"], $user["email"])); print $blacklist_info["added"] . "</h3><br/>"; print ''; $isSpamReport = false; $ls = new WebblerListing($GLOBALS['I18N']->get('Blacklist info')); $req = Sql_Query(sprintf('select * from %s where email = "%s"', $tables["user_blacklist_data"], $user["email"])); while ($row = Sql_Fetch_Array($req)) { $ls->addElement($row["name"]); $isSpamReport = $isSpamReport || $row['data'] == 'blacklisted due to spam complaints'; $ls->addColumn($row["name"], $GLOBALS['I18N']->get('value'), stripslashes($row["data"])); } $ls->addElement('<!-- remove -->'); if (!$isSpamReport) { $button = new ConfirmButton(htmlspecialchars($GLOBALS['I18N']->get('are you sure you want to delete this subscriber from the blacklist')) . "?\\n" . htmlspecialchars($GLOBALS['I18N']->get('it should only be done with explicit permission from this subscriber')), PageURL2("userhistory&unblacklist={$user["id"]}&id={$user["id"]}", "button", s('remove subscriber from blacklist')), s('remove subscriber from blacklist')); $ls->addRow('<!-- remove -->', s('remove'), $button->show()); } else { $ls->addRow('<!-- remove -->', s('remove'), s('For this subscriber to be removed from the blacklist, you need to ask them to re-subscribe using the phpList subscribe page')); } print $ls->display(); } $ls = new WebblerListing($GLOBALS['I18N']->get('Subscription History')); $req = Sql_Query(sprintf('select * from %s where userid = %d order by date desc', $tables["user_history"], $user["id"])); if (!Sql_Affected_Rows()) { print $GLOBALS['I18N']->get('no details found'); } while ($row = Sql_Fetch_Array($req)) { $ls->addElement($row["id"]); $ls->setClass($row["id"], 'row1'); $ls->addColumn($row["id"], $GLOBALS['I18N']->get('ip'), $row["ip"]);
$displayValue = s('Yes'); } else { $displayValue = s('No'); } } if ($default_config[$configItem]['type'] == 'image') { if ($value) { $displayValue = sprintf('<img src="./?page=image&id=%d&m=300" />', $value); } } if (!in_array($configItem, $GLOBALS['noteditableconfig'])) { $some = 1; $resourceLink = sprintf('<a class="resourcereference" href="http://resources.phplist.com/%s/config:%s" target="_blank">?</a>', $_SESSION['adminlanguage']['iso'], $configItem); ## disable this until the resources wiki is organised properly $resourceLink = ''; $categoryHTML .= sprintf('<div class="shade%d"><div class="configEdit" id="item_%s"><a href="%s" class="ajaxable" title="%s">%s</a> <b>%s</b> %s</div>', $alternate, $configItem, PageURL2('configure', '', "id={$configItem}"), s('edit this value'), s('edit'), $default_config[$configItem]['description'], $resourceLink); $categoryHTML .= sprintf('<div id="edit_%s" class="configcontent">%s</div></div>', $configItem, $displayValue); if ($alternate == 1) { $alternate = 2; } else { $alternate = 1; } } } $categoryHTML .= '</fieldset>'; if ($some) { print $categoryHTML; } } print '</form>'; } else {
"> <?php echo $GLOBALS['I18N']->get('Find an admin'); ?> : <input type=text name="find" value="<?php echo htmlspecialchars($find); ?> " size="40"><input type="submit" value="<?php echo $GLOBALS['I18N']->get('Go'); ?> "> </form></td> </tr> </table> <?php $ls = new WebblerListing($GLOBALS['I18N']->get('Administrators')); $ls->usePanel($paging); while ($admin = Sql_fetch_array($result)) { $delete_url = sprintf("<a href=\"javascript:deleteRec('%s');\">" . $GLOBALS['I18N']->get('del') . '</a>', PageURL2('admins', 'Delete', "start={$start}&delete=" . $admin['id'])); $ls->addElement($admin['loginname'], PageUrl2('admin', $GLOBALS['I18N']->get('Show'), "start={$start}&id=" . $admin['id'] . $remember_find)); if (!$external && $admin['id'] != $_SESSION['logindetails']['id']) { $ls->addColumn($admin['loginname'], $GLOBALS['I18N']->get('Del'), $delete_url); } } print $ls->display(); print '<br/><hr/>'; print PageLinkButton('admin', $GLOBALS['I18N']->get('Add a new administrator'), "start={$start}" . $remember_find); print '<p class="button">' . PageLink2('importadmin', $GLOBALS['I18N']->get('Import list of admins')) . '</p>';
$query = 'select * from %s %s order by entered desc, id desc %s'; $query = sprintf($query, $tables['eventlog'], $where, $limit); $result = Sql_query($query); } else { $query = 'select * from %s %s order by entered desc, id desc'; $query = sprintf($query, $tables['eventlog'], $where); $result = Sql_Query($query); } $buttons = new ButtonGroup(new Button(PageURL2("eventlog"), 'delete')); $buttons->addButton(new ConfirmButton($GLOBALS['I18N']->get('Are you sure you want to delete all events older than 2 months?'), PageURL2("eventlog", "Delete", "start={$start}&action=deleteprocessed"), $GLOBALS['I18N']->get('Delete all (> 2 months old)'))); $buttons->addButton(new ConfirmButton($GLOBALS['I18N']->get('Are you sure you want to delete all events matching this filter?'), PageURL2("eventlog", "Delete", "start={$start}&action=deleteall{$find_url}"), $GLOBALS['I18N']->get('Delete all'))); print $buttons->show(); if (!Sql_Num_Rows($result)) { print '<p class="information">' . $GLOBALS['I18N']->get('No events available') . '</p>'; } printf('<form method="get" action=""> <input type="hidden" name="page" value="eventlog" /> <input type="hidden" name="start" value="%d" /> %s: <input type="text" name="filter" value="%s" /> %s <input type="checkbox" name="exclude" value="1" %s /> </form><br/>', $start, $GLOBALS['I18N']->get('Filter'), htmlspecialchars(stripslashes($filter)), $GLOBALS['I18N']->get('Exclude filter'), $exclude == 1 ? 'checked="checked"' : ''); $ls = new WebblerListing($GLOBALS['I18N']->get('Events')); # @@@@ Looks like there are a few del, page, date, message which may not be i18nable. while ($event = Sql_fetch_array($result)) { $ls->addElement($event["id"]); $ls->setClass($event["id"], 'row1'); $ls->addColumn($event["id"], $GLOBALS['I18N']->get('date'), $event["entered"]); $ls->addColumn($event["id"], $GLOBALS['I18N']->get('message'), strip_tags($event["entry"])); $delete_url = sprintf('<a href="javascript:deleteRec(\'%s\');" class="del" >%s</a>', PageURL2("eventlog", "delete", "start={$start}&delete=" . $event["id"]), $GLOBALS['I18N']->get('del')); $ls->addRow($event['id'], '<div class="listingsmall">' . $GLOBALS['I18N']->get('page') . ': ' . $event["page"] . '</div>', '<div class="fright">' . $delete_url . ' </div>'); } print $ls->display();
} else { $element = '<!--' . $row['messageid'] . '-->' . shortenTextDisplay($messagedata["subject"], 30); } } else { $element = $messagedata['subject']; } $ls->addElement($element, PageUrl2('mviews&id=' . $row['messageid'])); $ls->setClass($element, 'row1'); if (!empty($row['sent'])) { $ls->addRow($element, '<div class="listingsmall gray">' . $GLOBALS['I18N']->get('date') . ': ' . $row['sent'] . '</div>', ''); } else { $ls->addRow($element, '<div class="listingsmall gray">' . $GLOBALS['I18N']->get('date') . ': ' . $GLOBALS['I18N']->get('in progress') . '</div>', ''); } $ls->addColumn($element, $GLOBALS['I18N']->get('sent'), $row['total']); # $ls->addColumn($element,$GLOBALS['I18N']->get('bounced'),$row['bounced']); $ls->addColumn($element, $GLOBALS['I18N']->get('views'), $row['views'], $row['views'] ? PageURL2('mviews&id=' . $row['messageid']) : ''); $openrate = sprintf('%0.2f', $row['views'] / $row['total'] * 100); $ls->addColumn($element, $GLOBALS['I18N']->get('rate'), $openrate . ' %'); /* $bouncerate = sprintf('%0.2f',($row['bounced'] / $row['total'] * 100)); $ls->addColumn($element,$GLOBALS['I18N']->get('bounce rate'),$bouncerate.' %'); */ } if ($addcomparison) { $total = Sql_Fetch_Array_Query(sprintf('select count(entered) as total from %s um where um.status = "sent"', $GLOBALS['tables']['usermessage'])); $viewed = Sql_Fetch_Array_Query(sprintf('select count(viewed) as viewed from %s um where um.status = "sent"', $GLOBALS['tables']['usermessage'])); $overall = $GLOBALS['I18N']->get('Comparison to other admins'); $ls->addElement($overall); $ls->addColumn($overall, $GLOBALS['I18N']->get('views'), $viewed['viewed']); $perc = sprintf('%0.2f', $viewed['viewed'] / $total['total'] * 100); $ls->addColumn($overall, $GLOBALS['I18N']->get('rate'), $perc . ' %');
$ls->addElement($element); $ls->setClass($element, 'rows row1'); $ls->addColumn($element, $GLOBALS['I18N']->get('Members'), '<div style="display:inline-block;text-align:right;width:50%;float:left;">' . $membersDisplay . '</div><span class="view" style="text-align:left;display:inline-block;float:right;width:48%;"><a class="button " href="./?page=members&id=' . $row['id'] . '" title="' . $GLOBALS['I18N']->get('View Members') . '">' . $GLOBALS['I18N']->get('View Members') . '</a></span>'); $ls->addColumn($element, $GLOBALS['I18N']->get('Public'), sprintf('<input type="checkbox" name="active[%d]" value="1" %s %s />', $row['id'], $row['active'] ? 'checked="checked"' : '', listUsedInSubscribePage($row['id']) ? ' disabled="disabled" ' : '')); /* $owner = adminName($row['owner']); if (!empty($owner)) { $ls->addColumn($element, $GLOBALS['I18N']->get('Owner'),$GLOBALS['require_login'] ? adminName($row['owner']):$GLOBALS['I18N']->get('n/a')); } if (trim($desc) != '') { $ls->addRow($element, $GLOBALS['I18N']->get('Description'),$desc); } */ $ls->addColumn($element, $GLOBALS['I18N']->get('Order'), sprintf('<input type="text" name="listorder[%d]" value="%d" size="3" class="listorder" />', $row['id'], $row['listorder'])); $deletebutton = new ConfirmButton(s('Are you sure you want to delete this list?'), PageURL2('list&delete=' . $row['id']), s('delete this list')); $ls->addRow($element, '', '<span class="edit-list"><a class="button" href="?page=editlist&id=' . $row['id'] . '" title="' . $GLOBALS['I18N']->get('Edit this list') . '"></a></span>' . '<span class="send-list">' . PageLinkButton('send&new=1&list=' . $row['id'], $GLOBALS['I18N']->get('send'), '', '', $GLOBALS['I18N']->get('start a new campaign targetting this list')) . '</span>' . '<span class="add_member">' . PageLinkDialogOnly('importsimple&list=' . $row['id'], s('Add Members')) . '</span>' . '<span class="delete">' . $deletebutton->show() . '</span>', '', '', 'actions nodrag'); $some = 1; } $ls->addSubmitButton('update', $GLOBALS['I18N']->get('Save Changes')); if (!$some) { echo $GLOBALS['I18N']->get('No lists, use Add List to add one'); } else { print $ls->display('', 'draggable'); } /* echo '<table class="x" border="0"> <tr> <td>'.$GLOBALS['I18N']->get('No').'</td> <td>'.$GLOBALS['I18N']->get('Name').'</td> <td>'.$GLOBALS['I18N']->get('Order').'</td>