public function populate(WebblerListing $w, $start, $limit) { /* * Populate the webbler list with domains */ $w->setTitle($this->i18n->get('Domain')); $resultSet = $this->model->messageByDomain($start, $limit); foreach ($resultSet as $row) { $key = $row['domain']; $w->addElement($key, null); $w->addColumn($key, $this->i18n->get('sent'), $row['sent']); $w->addColumn($key, $this->i18n->get('opened'), $row['opened']); $w->addColumn($key, $this->i18n->get('clicked'), $row['clicked']); } }
public function populate(WebblerListing $w, $start, $limit) { /* * Populate the webbler list with users who have opened the message */ $w->setTitle($this->i18n->get('User email')); $resultIterator = $this->model->fetchMessageOpens($this->isOpened, $start, $limit); foreach ($resultIterator as $row) { $key = $row['email']; $w->addElement($key, new CommonPlugin_PageURL('user', array('id' => $row['userid']))); foreach ($this->model->selectedAttrs as $attr) { $w->addColumn($key, $this->model->attributes[$attr]['name'], $row["attr{$attr}"]); } $w->addColumn($key, $this->i18n->get('last viewed'), $row['viewed']); } }
public function populate(WebblerListing $w, $start, $limit) { /* * Populate the webbler list with users who bounced */ $w->setTitle($this->i18n->get('Bounce ID')); $resultIterator = $this->model->fetchMessageBounces($start, $limit); foreach ($resultIterator as $row) { $key = $row['bounce']; $w->addElement($key, new CommonPlugin_PageURL('bounce', array('s' => 0, 'id' => $row['bounce']))); $w->addColumn($key, 'email', $row['email'], new CommonPlugin_PageURL('userhistory', array('id' => $row['user']), 'left')); foreach ($this->model->selectedAttrs as $attr) { $w->addColumn($key, $this->model->attributes[$attr]['name'], $row["attr{$attr}"]); } } }
public function populate(WebblerListing $w, $start, $limit) { /* * Populate the webbler list with users who have forwarded the message */ $w->setTitle($this->i18n->get('User email')); $resultSet = $this->model->fetchMessageForwards($start, $limit); foreach ($resultSet as $row) { $key = $row['email']; $w->addElement($key, new CommonPlugin_PageURL('userhistory', array('id' => $row['id']))); foreach ($this->model->selectedAttrs as $attr) { $w->addColumn($key, $this->model->attributes[$attr]['name'], $row["attr{$attr}"]); } $w->addColumn($key, $this->i18n->get('count'), $row['count'], null, 'left'); } }
public function populate(WebblerListing $w, $start, $limit) { /* * Populates the webbler list with list details */ $w->setTitle($this->i18n->get('Lists')); $resultIterator = $this->model->fetchLists($start, $limit); $rows = iterator_to_array($resultIterator); if (!($start == 0 && $limit == 1)) { $rows[] = array('id' => '', 'name' => $this->i18n->get('All lists'), 'description' => '', 'active' => '', 'count' => ''); } foreach ($rows as $row) { $key = "{$row['id']} | {$row['name']}"; $latest = $this->model->latestMessage($row['id']); $w->addElement($key, $latest ? new CommonPlugin_PageURL(null, array('type' => 'messages', 'listid' => $row['id'])) : ''); $w->addColumn($key, $this->i18n->get('active'), $row['active']); $w->addColumn($key, $this->i18n->get('total sent'), $row['count']); $w->addColumn($key, $this->i18n->get('latest'), $latest, $latest ? new CommonPlugin_PageURL(null, array('type' => 'opened', 'listid' => $row['id'], 'msgid' => $latest)) : ''); } }
public function populate(WebblerListing $w, $start, $limit) { /* * Populates the webbler list with link details */ $w->setTitle($this->i18n->get('Link URL')); $resultSet = $this->model->links($start, $limit); $query = array('listid' => $this->model->listid, 'msgid' => $this->model->msgid, 'type' => 'linkclicks'); foreach ($resultSet as $row) { $key = preg_replace('%^(http|https)://%i', '', $row['url']); if (strlen($key) > 39) { $key = htmlspecialchars(substr($key, 0, 22)) . ' ... ' . htmlspecialchars(substr($key, -12)); } $key = sprintf('<span title="%s">%s</span>', htmlspecialchars($row['url']), $key); $query['forwardid'] = $row['forwardid']; $w->addElement($key, new CommonPlugin_PageURL(null, $query)); $w->addColumnHtml($key, $this->i18n->get('pers.'), $row['personalise'] ? new CommonPlugin_ImageTag('user.png', 'URL is personalised') : ''); $w->addColumn($key, $this->i18n->get('clicks'), $row['numclicks']); $w->addColumn($key, $this->i18n->get('users'), $row['usersclicked'] > 0 ? sprintf('%d (%0.2f%%)', $row['usersclicked'], $row['usersclicked'] / $row['totalsent'] * 100) : ''); $w->addColumn($key, $this->i18n->get('firstclick'), $row['firstclick']); $w->addColumn($key, $this->i18n->get('latestclick'), $row['numclicks'] > 1 ? $row['latestclick'] : ''); } }
public function populate(WebblerListing $w, $start, $limit) { /* * Populate the webbler list with users who have clicked a link in the message */ $w->setTitle($this->i18n->get('User email')); $resultSet = $this->model->fetchMessageClicks($start, $limit); foreach ($resultSet as $row) { $key = $row['email']; if ($key) { $w->addElement($key, new CommonPlugin_PageURL('userhistory', array('id' => $row['userid']))); foreach ($this->model->selectedAttrs as $attr) { $w->addColumn($key, $this->model->attributes[$attr]['name'], $row["attr{$attr}"]); } $w->addColumn($key, $this->i18n->get('links clicked'), $row['links'], new CommonPlugin_PageURL('userclicks', array('userid' => $row['userid'], 'msgid' => $this->model->msgid)), 'left'); } else { $key = $this->i18n->get('user_not_exist'); $w->addElement($key, ''); $w->addColumn($key, $this->i18n->get('links clicked'), $row['links']); } $w->addColumn($key, $this->i18n->get('clicks_total'), $row['clicks']); } }
print '</p>'; if ($_GET['type'] == 'dl') { ob_end_clean(); Header("Content-type: text/plain"); $filename = 'Bounces on ' . listName($listid); header("Content-disposition: attachment; filename=\"{$filename}\""); } $currentlist = 0; $ls = new WebblerListing(''); while ($row = Sql_Fetch_Array($req)) { if ($currentlist != $row['listid']) { if ($_GET['type'] != 'dl') { print $ls->display(); } $currentlist = $row['listid']; flush(); $ls = new WebblerListing(listName($row['listid'])); } $userdata = Sql_Fetch_Array_Query(sprintf('select * from %s where id = %d', $GLOBALS['tables']['user'], $row['userid'])); if ($_GET['type'] == 'dl') { print $userdata['email'] . "\n"; } $ls->addElement($row['userid'], PageUrl2('user&id=' . $row['userid'])); $ls->addColumn($row['userid'], $GLOBALS['I18N']->get('email'), $userdata['email']); $ls->addColumn($row['userid'], $GLOBALS['I18N']->get('# bounces'), $row['numbounces']); } if ($_GET['type'] != 'dl') { print $ls->display(); } else { exit; }
if (ALLOW_ATTACHMENTS) { // If we have a message id saved, we want to query the attachments that are associated with this // message and display that (and allow deletion of!) $att_content = '<table><tr><td colspan=2>' . Help("attachments") . ' ' . $GLOBALS['I18N']->get("addattachments") . ' </td></tr>'; $att_content .= '<tr><td colspan=2> ' . $GLOBALS['I18N']->get("uploadlimits") . ':<br/> ' . $GLOBALS['I18N']->get("maxtotaldata") . ': ' . ini_get("post_max_size") . '<br/> ' . $GLOBALS['I18N']->get("maxfileupload") . ': ' . ini_get("upload_max_filesize") . '</td></tr>'; if ($id) { $result = Sql_Query(sprintf("Select Att.id, Att.filename, Att.remotefile, Att.mimetype, Att.description, Att.size, MsgAtt.id linkid" . " from %s Att, %s MsgAtt where Att.id = MsgAtt.attachmentid and MsgAtt.messageid = %d", $tables["attachment"], $tables["message_attachment"], $id)); $tabletext = ""; $ls = new WebblerListing($GLOBALS['I18N']->get('currentattachments')); while ($row = Sql_fetch_array($result)) { # $tabletext .= "<tr><td>".$row["remotefile"]."</td><td>".$row["description"]." </td><td>".$row["size"]."</td>"; $ls->addElement($row["id"]); $ls->addColumn($row["id"], $GLOBALS['I18N']->get('filename'), $row["remotefile"]); $ls->addColumn($row["id"], $GLOBALS['I18N']->get('desc'), $row["description"]); $ls->addColumn($row["id"], $GLOBALS['I18N']->get('size'), $row["size"]); $phys_file = $GLOBALS["attachment_repository"] . "/" . $row["filename"]; if (is_file($phys_file) && filesize($phys_file)) { $ls->addColumn($row["id"], $GLOBALS['I18N']->get('file'), $GLOBALS["img_tick"]); } else { $ls->addColumn($row["id"], $GLOBALS['I18N']->get('file'), $GLOBALS["img_cross"]); } $ls->addColumn($row["id"], $GLOBALS['I18N']->get('del'), sprintf('<input type=checkbox name="deleteattachments[]" value="%s">', $row["linkid"])); // Probably need to check security rights here... # $tabletext .= "<td><input type=checkbox name=\"deleteattachments[]\" value=\"".$row["linkid"]."\"></td>"; # $tabletext .= "</tr>\n"; } $ls->addButton($GLOBALS['I18N']->get('delchecked'), "javascript:document.sendmessageform.submit()"); $att_content .= '<tr><td colspan=2>' . $ls->display() . '</td></tr>';
} # $listingelement = '<!--'.$msg['id'].'-->'.stripslashes($messagedata["campaigntitle"]); if ($msg['status'] == 'draft') { $editlink = PageUrl2('send&id=' . $msg['id']); } $ls->addElement($listingelement, $editlink); $ls->setClass($listingelement, 'row1'); $uniqueviews = Sql_Fetch_Row_Query("select count(userid) from {$tables['usermessage']} where viewed is not null and status = 'sent' and messageid = " . $msg['id']); $clicks = Sql_Fetch_Row_Query("select sum(clicked) from {$tables['linktrack_ml']} where messageid = " . $msg['id']); # $clicks = array(0); /* foreach ($messagedata as $key => $val) { $ls->addColumn($listingelement,$key,$val); } */ $ls->addColumn($listingelement, $GLOBALS['I18N']->get('Entered'), formatDateTime($msg['entered'])); $_GET['id'] = $msg['id']; $statusdiv = '<div id="messagestatus' . $msg['id'] . '">'; include 'actions/msgstatus.php'; $statusdiv .= $status; $statusdiv .= '</div>'; $GLOBALS['pagefooter']['statusupdate' . $msg['id']] = '<script type="text/javascript"> updateMessages.push(' . $msg['id'] . ');</script>'; $GLOBALS['pagefooter']['statusupdate'] = '<script type="text/javascript">window.setInterval("messagesStatusUpdate()",5000);</script>'; if ($msg['status'] == 'sent') { $statusdiv = $GLOBALS['I18N']->get('Sent') . ': ' . $msg['sent']; } $ls->addColumn($listingelement, $GLOBALS['I18N']->get('Status'), $statusdiv); if ($msg['status'] != 'draft') { # $ls->addColumn($listingelement,$GLOBALS['I18N']->get("total"), $msg['astext'] + $msg['ashtml'] + $msg['astextandhtml'] + $msg['aspdf'] + $msg['astextandpdf']); # $ls->addColumn($listingelement,$GLOBALS['I18N']->get("text"), $msg['astext']);
$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"'); $nummsgs = Sql_fetch_row($msgs); $ls_msgs = $GLOBALS['I18N']->get('msgs') . ': ' . $nummsgs[0]; } ### allow plugins to add columns if (isset($GLOBALS['plugins']) && is_array($GLOBALS['plugins'])) { foreach ($GLOBALS['plugins'] as $plugin) { if (method_exists($plugin, 'displayUsers')) { $plugin->displayUsers($user, $user['email'], $ls); } } } $ls_bncs = '';
if (!empty($pluginDetails['installUrl'])) { # $ls->addRow($pluginname,s('installation Url'),$pluginDetails['installUrl']); $details .= '<div class="detail"><span class="label">' . s('installation Url') . '</span>'; $details .= '<span class="value">' . $pluginDetails['installUrl'] . '</span></div>'; } if (!empty($pluginDetails['developer'])) { # $ls->addColumn($pluginname,s('developer'),$pluginDetails['developer']); $details .= '<div class="detail"><span class="label">' . s('developer') . '</span>'; $details .= '<span class="value">' . $pluginDetails['developer'] . '</span></div>'; } if (!empty($plugin->documentationUrl)) { $details .= '<div class="detail"><span class="label">' . s('More information') . '</span>'; $details .= '<span class="value"><a href="' . $plugin->documentationUrl . '" target="moreinfoplugin">' . s('Documentation Page') . '</a></span></div>'; } if (pluginCanEnable($pluginname)) { $ls->addColumn($pluginname, s('enabled'), $plugin->enabled ? PageLinkAjax('plugins&disable=' . $pluginname, $GLOBALS['img_tick']) : PageLinkAjax('plugins&enable=' . $pluginname, $GLOBALS['img_cross'])); } if (DEVVERSION) { //$ls->addColumn($pluginname,s('initialise'),$plugin->enabled ? //PageLinkAjax('plugins&initialise='.$pluginname,s('Initialise')) : ''); if ($plugin->enabled) { $details .= '<div class="detail"><span class="label">' . s('initialise') . '</span>'; $details .= '<span class="value">'; $details .= PageLinkAjax('plugins&initialise=' . $pluginname, s('Initialise')); $details .= '</span></div>'; } } if (!empty($pluginDetails['installUrl']) && is_writable($pluginDestination . '/' . $pluginname)) { ## we can only delete the ones that were installed from the interface $ls->addColumn($pluginname, s('delete'), '<span class="delete"><a href="javascript:deleteRec(\'./?page=plugins&delete=' . $pluginname . '\');" class="button" title="' . s('delete this plugin') . '">' . s('delete') . '</a></span>'); }
$_SESSION['action_result'] = $GLOBALS['I18N']->get('Campaign deleted'); } } $req = Sql_Query(sprintf('select id,entered,subject,unix_timestamp(now()) - unix_timestamp(entered) as age from %s where status = "draft" %s order by entered desc', $GLOBALS['tables']['message'], $ownership)); $numdraft = Sql_Num_Rows($req); if ($numdraft > 0 && !isset($_GET['id']) && !isset($_GET['new'])) { print '<p>' . PageLinkActionButton('send&new=1', $I18N->get('start a new message'), '', '', s('Start a new campaign')) . '</p>'; print '<p><h3>' . $I18N->get('Choose an existing draft message to work on') . '</h3></p><br/>'; $ls = new WebblerListing($I18N->get('Draft messages')); $ls->noShader(); while ($row = Sql_Fetch_Array($req)) { $element = '<!--' . $row['id'] . '-->' . $row['subject']; $ls->addElement($element, PageUrl2('send&id=' . $row['id'])); $ls->setClass($element, 'row1'); # $ls->addColumn($element,$I18N->get('edit'),PageLink2('send&id='.$row['id'],$I18N->get('edit'))); $ls->addColumn($element, $I18N->get('entered'), $row['entered']); $ls->addColumn($element, $I18N->get('age'), secs2time($row['age'])); $ls->addRow($element, '', '<a class="del" href="' . PageUrl2('send&delete=' . $row['id']) . '" title="' . $I18N->get('del') . '">' . $I18N->get('del') . '</a>'); } $ls->addButton($I18N->get('delete all'), PageUrl2('send&delete=alldraft')); print $ls->display(); return; } } include "send_core.php"; if ($done) { if ($GLOBALS["commandline"]) { ob_end_clean(); print clineSignature(); print "Message with subject " . $_POST["subject"] . " was sent to " . $lists . "\n"; exit;
<?php include dirname(__FILE__) . '/structure.php'; if (!defined('PHPLISTINIT')) { exit; } print '<h3>' . s('Database structure check') . '</h3>'; unset($_SESSION["dbtables"]); $pass = true; $ls = new WebblerListing(s('Database structure')); while (list($table, $tablename) = each($GLOBALS["tables"])) { $createlink = ''; $indexes = $uniques = $engine = $category = ''; $ls->addElement($table); if ($table != $tablename) { $ls->addColumn($table, "real name", $tablename); } if (Sql_Table_Exists($tablename)) { $req = Sql_Query("show columns from {$tablename}", 0); $columns = array(); if (!Sql_Affected_Rows()) { $ls->addColumn($table, "exist", $GLOBALS["img_cross"]); } while ($row = Sql_Fetch_Array($req)) { $columns[strtolower($row["Field"])] = $row["Type"]; } $tls = new WebblerListing($table); if (isset($DBstruct[$table])) { $struct = $DBstruct[$table]; } else { $struct = '';
<textarea name="forwardfooter" cols="65" rows="5">' . htmlspecialchars($messagedata['forwardfooter']) . '</textarea></div>'; if (ALLOW_ATTACHMENTS) { // If we have a message id saved, we want to query the attachments that are associated with this // message and display that (and allow deletion of!) $att_content = '<div class="field"><label for="attach">' . $GLOBALS['I18N']->get('Add attachments to your campaign') . Help('attachments') . '</label>'; $att_content .= '<div class="info"> ' . $GLOBALS['I18N']->get('The upload has the following limits set by the server') . ':<br/> ' . $GLOBALS['I18N']->get('Maximum size of total data being sent to the server') . ': ' . ini_get('post_max_size') . '<br/> ' . $GLOBALS['I18N']->get('Maximum size of each individual file') . ': ' . ini_get('upload_max_filesize') . '</div>'; if ($id) { $result = Sql_Query(sprintf('Select Att.id, Att.filename, Att.remotefile, Att.mimetype, Att.description, Att.size, MsgAtt.id linkid' . ' from %s Att, %s MsgAtt where Att.id = MsgAtt.attachmentid and MsgAtt.messageid = %d', $tables['attachment'], $tables['message_attachment'], $id)); $ls = new WebblerListing($GLOBALS['I18N']->get('Current Attachments')); $totalSize = 0; while ($row = Sql_fetch_array($result)) { $ls->addElement($row['id']); $ls->addColumn($row['id'], $GLOBALS['I18N']->get('filename'), $row['remotefile']); $ls->addColumn($row['id'], $GLOBALS['I18N']->get('desc'), $row['description']); $ls->addColumn($row['id'], $GLOBALS['I18N']->get('size'), formatBytes($row['size'])); $totalSize += $row['size']; $phys_file = $GLOBALS['attachment_repository'] . '/' . $row['filename']; if (is_file($phys_file) && filesize($phys_file)) { $ls->addColumn($row['id'], $GLOBALS['I18N']->get('file'), $GLOBALS['img_tick']); } else { $ls->addColumn($row['id'], $GLOBALS['I18N']->get('file'), $GLOBALS['img_cross']); } $ls->addColumn($row['id'], $GLOBALS['I18N']->get('del'), sprintf('<input type="checkbox" name="deleteattachments[]" value="%s"/>', $row['linkid'])); } $ls->addButton(s('Delete checked'), 'javascript:document.sendmessageform.submit()'); $att_content .= '<div>' . $ls->display() . '</div>'; } if (defined('MAX_MAILSIZE') && 3 * $totalSize > MAX_MAILSIZE) {
$ls->addElement($element, PageUrl2('bounce&type=' . $status . '&id=' . $bounce['id'])); if (preg_match("#bounced list message ([\\d]+)#", $bounce['status'], $regs)) { $messageid = PageLink2('message&id=' . $regs[1], shortenTextDisplay(campaignTitle($regs[1]), 30)); #sprintf('<a href="./?page=message&id=%d">%d</a>',$regs[1],$regs[1]); } elseif ($bounce['status'] == 'bounced system message') { $messageid = $GLOBALS['I18N']->get('System Message'); } else { $messageid = $GLOBALS['I18N']->get('Unknown'); } /* if (preg_match('/Action: delayed\s+Status: 4\.4\.7/im',$bounce["data"])) { $ls->addColumn($element,'delayed',$GLOBALS['img_tick']); } else { $ls->addColumn($element,'delayed',$GLOBALS['img_cross']); } */ $ls->addColumn($element, s('Campaign'), $messageid); if (preg_match("#([\\d]+) bouncecount increased#", $bounce['comment'], $regs)) { $userid = PageLink2('user&id=' . $regs[1], $regs[1]); #sprintf('<a href="./?page=user&id=%d">%d</a>',$regs[1],$regs[1]); } elseif (preg_match("#([\\d]+) marked unconfirmed#", $bounce['comment'], $regs)) { $userid = PageLink2('user&id=' . $regs[1], $regs[1]); #sprintf('<a href="./?page=user&id=%d">%d</a>',$regs[1],$regs[1]); } else { $userid = $GLOBALS['I18N']->get('Unknown'); } $ls->addColumn($element, $GLOBALS['I18N']->get('user'), $userid); $ls->addColumn($element, $GLOBALS['I18N']->get('date'), $bounce['date']); /* printf( "<tr><td>[ <a href=\"javascript:deleteRec('%s');\">%s</a> | %s ] </td><td>%s</td><td>%s</td><td>%s</td></tr>\n", PageURL2("bounces",$GLOBALS['I18N']->get('delete'),"s=$start&delete=".$bounce["id"]),
<?php require_once dirname(__FILE__) . '/accesscheck.php'; $req = Sql_Query(sprintf('select * from %s where date_add(from_unixtime(unixdate),interval 12 month) > now() order by unixdate', $GLOBALS['tables']['userstats'])); $ls = new WebblerListing($GLOBALS['I18N']->get('Statistics')); while ($row = Sql_Fetch_Array($req)) { $element = $GLOBALS['I18N']->get($row['item']); $ls->addElement($element); switch (STATS_INTERVAL) { case 'monthly': $date = date('M y', $row['unixdate']); break; } $ls->addColumn($element, $date, $row['value']); } print $ls->display();
$delete = 0; } if ($delete) { Sql_Query(sprintf('delete from %s where id = %d', $tables["subscribepage"], $delete)); Sql_Query(sprintf('delete from %s where id = %d', $tables["subscribepage_data"], $delete)); 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'))); }
$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();
} $req = Sql_Query($item['query']); $ls = new WebblerListing(''); $chartData = array(); $collation = 0; while ($row = Sql_Fetch_Assoc($req)) { if (!isset($chartData[$row['year']]) || !is_array($chartData[$row['year']])) { $chartData[$row['year']] = array(); } if ($item['collate']) { $collation = $collation + $row['num']; $row['num'] = $collation; } if ($item['range'] != 'year') { $ls->addElement($row['year'] . ' ' . monthName($row['month'])); $ls->addColumn($row['year'] . ' ' . monthName($row['month']), '#', $row['num']); $chartData[$row['year']][$row['month']] = $row['num']; } else { $ls->addElement($row['year']); $ls->addColumn($row['year'], '#', $row['num']); $chartData[$row['year']][''] = $row['num']; } if (!empty($row['year']) && !empty($row['month']) && !empty($row['num'])) { cl_output($item['name'] . '|' . $row['year'] . '|' . $row['month'] . '|' . $row['num']); } } unset($chartData['2000']); unset($chartData['2001']); unset($chartData['2002']); unset($chartData['2003']); unset($chartData['2004']);
$unconfirmedMembers = (int) ($membercount['total'] - $members); $desc = stripslashes($row['description']); if ($unconfirmedMembers > 0) { $membersDisplay = '<span class="memberCount">' . $members . '</span> <span class="unconfirmedCount">(' . $unconfirmedMembers . ')</span>'; } else { $membersDisplay = '<span class="memberCount">' . $members . '</span>'; } //## allow plugins to add columns // @@@ TODO review this //foreach ($GLOBALS['plugins'] as $plugin) { //$desc = $plugin->displayLists($row) . $desc; //} $element = '<!-- ' . $row['id'] . '-->' . stripslashes($row['name']); $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;
var_dump($_SESSION['import_attribute']); print '</pre>'; */ return; } } ### show summary if (!empty($_SESSION["test_import"])) { if (!isset($_SESSION["systemindex"]["email"])) { Fatal_Error($GLOBALS['I18N']->get('Cannot find column with email, you need to map at least one column to "Email"'), 'http://resources.phplist.com/documentation/errors/importemailmapping'); return; } $ls = new WebblerListing($GLOBALS['I18N']->get('Summary')); foreach ($_SESSION["systemindex"] as $column => $columnid) { $ls->addElement($_SESSION['columnnames'][$columnid]); $ls->addColumn($_SESSION['columnnames'][$columnid], $GLOBALS['I18N']->get('maps to'), 'system: ' . $column); } foreach ($_SESSION["import_attribute"] as $column => $rec) { if (trim($column) != '') { $ls->addElement($column); if ($rec["record"] == "new") { $ls->addColumn($column, $GLOBALS['I18N']->get('maps to'), $GLOBALS['I18N']->get('Create new Attribute')); } elseif ($rec["record"] == "skip") { $ls->addColumn($column, $GLOBALS['I18N']->get('maps to'), $GLOBALS['I18N']->get('Skip Column')); } elseif (is_numeric($rec["record"])) { $ls->addColumn($column, $GLOBALS['I18N']->get('maps to'), $attributes[$rec["record"]]); } elseif (!empty($rec['record'])) { $ls->addColumn($column, $GLOBALS['I18N']->get('maps to'), $rec['record']); } else { $ls->addColumn($column, $GLOBALS['I18N']->get('maps to'), $GLOBALS['I18N']->get('none')); }
$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"]); $ls->addColumn($row["id"], $GLOBALS['I18N']->get('date'), $row["date"]); $ls->addColumn($row["id"], $GLOBALS['I18N']->get('summary'), $row["summary"]); $ls->addRow($row["id"], "<div class='gray'>" . $GLOBALS['I18N']->get('detail') . ": </div>", "<div class='tleft'>" . nl2br(htmlspecialchars($row["detail"])) . "</div>"); $ls->addRow($row["id"], "<div class='gray'>" . $GLOBALS['I18N']->get('info') . ": </div>", "<div class='tleft'>" . nl2br($row["systeminfo"]) . "</div>"); } print $ls->display(); print '</div>'; print '</div>'; ## end of tabbed
Redirect('list'); } else { Info(s('Categories saved'), true); } } $req = Sql_Query(sprintf('select * from %s %s', $tables['list'], $subselect)); if (!Sql_Affected_Rows()) { Info(s('All lists have already been assigned a category') . '<br/>' . PageLinkButton('list', s('Back')), true); } print '<div class="fright">' . PageLinkButton('catlists&show=all', s('Re-edit all lists')) . '</div>'; print '<div class="fright">' . PageLinkButton('configure&id=list_categories&ret=catlists', $I18N->get('Configure Categories')) . '</div>'; $ls = new WebblerListing(s('Categorise lists')); $aListCategories = listCategories(); if (count($aListCategories)) { while ($row = Sql_Fetch_Assoc($req)) { $ls->addELement($row['id']); $ls->addColumn($row['id'], $GLOBALS['I18N']->get('Name'), stripslashes($row['name'])); $catselect = '<select name="category[' . $row['id'] . ']">'; $catselect .= '<option value="">-- ' . s('choose category') . '</option>'; $catselect .= '<option value="">-- ' . s('none') . '</option>'; foreach ($aListCategories as $category) { $category = trim($category); $catselect .= sprintf('<option value="%s" %s>%s</option>', $category, $category == $row['category'] ? 'selected="selected"' : '', $category); } $catselect .= '</select>'; $ls->addColumn($row['id'], s('Category'), $catselect); } } $ls->addButton(s('save'), 'javascript:document.categoryedit.submit();'); print $ls->display(); print '</form>';
"> <?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>';
<?php #if (($require_login && isSuperUser()) || !$require_login) print '<p>' . PageLink2("dlusers", $GLOBALS['I18N']->get('Download all users as CSV file'), "nocache=" . uniqid("")) . ' <br/>'; print PageLink2("user", $GLOBALS['I18N']->get('Add a User')) . '</p>'; ?> </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]);
$req = Sql_Query(sprintf('select user.email,user.id as userid,firstclick,date_format(latestclick, "%%e %%b %%Y %%H:%%i") as latestclick,sum(clicked) as numclicks,messageid,linkid,url from %s as linktrack, %s as user where linktrack.userid = user.id and linktrack.userid = %d and linktrack.clicked group by linktrack.url', $GLOBALS['tables']['linktrack'], $GLOBALS['tables']['user'], $userid)); } #ob_end_flush(); #flush(); $summary = array(); while ($row = Sql_Fetch_Array($req)) { # print $row['email'] . "<br/>"; if (!$userid) { $element = $row['email']; $ls->addElement($element, PageUrl2('userhistory&id=' . $row['userid'])); } else { $element = $row['url']; $ls->addElement($element, PageUrl2('uclicks&id=' . $row['linkid'])); $ls->addColumn($element, $GLOBALS['I18N']->get('message'), PageLink2('mclicks&id=' . $row['messageid'], $row['messageid'])); } # $element = sprintf('<a href="%s" target="_blank" class="url" title="%s">%s</a>',$row['url'],$row['url'],substr(str_replace('http://','',$row['url']),0,50)); # $total = Sql_Verbose_Query(sprintf('select count(*) as total from %s where messageid = %d and url = "%s"', # $GLOBALS['tables']['linktrack'],$id,$row['url'])); # $totalsent = Sql_Fetch_Array_Query(sprintf('select count(*) as total from %s where url = "%s"', # $GLOBALS['tables']['linktrack'],$urldata['url'])); $ls->addColumn($element, $GLOBALS['I18N']->get('firstclick'), formatDateTime($row['firstclick'], 1)); $ls->addColumn($element, $GLOBALS['I18N']->get('latestclick'), $row['latestclick']); $ls->addColumn($element, $GLOBALS['I18N']->get('clicks'), $row['numclicks']); # $ls->addColumn($element,$GLOBALS['I18N']->get('sent'),$total['total']); # $perc = sprintf('%0.2f',($row['numclicks'] / $totalsent['total'] * 100)); # $ls->addColumn($element,$GLOBALS['I18N']->get('clickrate'),$perc.'%'); $summary['totalclicks'] += $row['numclicks']; } $ls->addElement('total');
$columns = array(); if (!Sql_Affected_Rows()) { $ls->addColumn($table, "exist", $GLOBALS["img_cross"]); } while ($row = Sql_Fetch_Array($req)) { $columns[strtolower($row["Field"])] = $row["Type"]; } $tls = new WebblerListing($table); $struct = $DBstruct[$table]; $haserror = 0; foreach ($struct as $column => $colstruct) { if (!ereg("index_", $column) && !ereg("^unique_", $column) && $column != "primary key") { $tls->addElement($column); $exist = isset($columns[strtolower($column)]); if ($exist) { $tls->addColumn($column, "exist", $GLOBALS["img_tick"]); } else { $haserror = 1; $tls->addColumn($column, "exist", $GLOBALS["img_cross"]); } } } if (!$haserror) { $tls->collapse(); $ls->addColumn($table, "ok", $GLOBALS["img_tick"]); } else { $ls->addColumn($table, "ok", $GLOBALS["img_cross"]); } $ls->addColumn($table, "check", $tls->display()); } print $ls->display();
max(um.viewed) as lastview, count(um.viewed) as viewcount, abs(unix_timestamp(um.entered) - unix_timestamp(um.viewed)) as responsetime from %s um, %s user, %s msg where um.messageid = %d and um.messageid = msg.id and um.userid = user.id and um.status = "sent" and um.viewed is not null %s group by userid %s', $GLOBALS['tables']['usermessage'], $GLOBALS['tables']['user'], $GLOBALS['tables']['message'], $id, $subselect, $limit)); $summary = array(); while ($row = Sql_Fetch_Array($req)) { if ($download) { ## with download, the 50 per page limit is not there. set_time_limit(60); $element = $row['email']; } else { $element = shortenTextDisplay($row['email'], 15); } $ls->addElement($element, PageUrl2('userhistory&id=' . $row['userid'])); $ls->setClass($element, 'row1'); $ls->addRow($element, '<div class="listingsmall gray">' . $GLOBALS['I18N']->get('sent') . ': ' . formatDateTime($row['sent'], 1) . '</div>', ''); if ($row['viewcount'] > 1) { $ls->addColumn($element, $GLOBALS['I18N']->get('firstview'), formatDateTime($row['firstview'], 1)); $ls->addColumn($element, $GLOBALS['I18N']->get('lastview'), formatDateTime($row['lastview'])); $ls->addColumn($element, $GLOBALS['I18N']->get('views'), $row['viewcount']); } else { $ls->addColumn($element, $GLOBALS['I18N']->get('firstview'), formatDateTime($row['firstview'], 1)); $ls->addColumn($element, $GLOBALS['I18N']->get('responsetime'), secs2time($row['responsetime'])); } } if ($download) { ob_end_clean(); print $ls->tabDelimited(); } else { print $ls->display(); }
if (!$download) { $element = '<!-- ' . $row['messageid'] . '-->' . shortenTextDisplay($msgsubj[0], 30); } else { $element = '<!-- ' . $row['messageid'] . '-->' . $msgsubj[0]; } # $element = $GLOBALS['I18N']->get('msg').' '.$row['messageid'].': '.substr($msgsubj[0],0,25). '...'; # $element = sprintf('<a href="%s" target="_blank" class="url" title="%s">%s</a>',$row['url'],$row['url'],substr(str_replace('http://','',$row['url']),0,50)); # $total = Sql_Verbose_Query(sprintf('select count(*) as total from %s where messageid = %d and url = "%s"', # $GLOBALS['tables']['linktrack'],$id,$row['url'])); # if (CLICKTRACK_SHOWDETAIL) { $uniqueclicks = Sql_Fetch_Array_Query(sprintf('select count(distinct userid) as users from %s where messageid = %d and forwardid = %d', $GLOBALS['tables']['linktrack_uml_click'], $row['messageid'], $id)); # } $ls->addElement($element, PageUrl2('mclicks&id=' . $row['messageid'])); $ls->setClass($element, 'row1'); $ls->addColumn($element, $GLOBALS['I18N']->get('firstclick'), formatDateTime($row['firstclick'], 1)); $ls->addColumn($element, $GLOBALS['I18N']->get('latestclick'), $row['latestclick']); $ls->addRow($element, '<div class="listingsmall gray">' . $GLOBALS['I18N']->get('sent') . ': ' . $row['total'] . '</div>', ''); # $ls->addColumn($element,$GLOBALS['I18N']->get('clicks'),$row['clicked'].'<span class="viewusers"><a class="button" href="'.PageUrl2('userclicks&msgid='.$row['messageid'].'&fwdid='.$id.'" title="'.$GLOBALS['I18N']->get('view users').'"></a></span>')); # $perc = sprintf('%0.2f',($row['clicked'] / $row['total'] * 100)); # $ls->addColumn($element,$GLOBALS['I18N']->get('clickrate'),$perc.'%'); $summary['totalsent'] += $row['total']; # if (CLICKTRACK_SHOWDETAIL) { $ls->addColumn($element, $GLOBALS['I18N']->get('clicks'), $uniqueclicks['users'] . '<span class="viewusers"><a class="button" href="' . PageUrl2('userclicks&msgid=' . $row['messageid'] . '&fwdid=' . $id) . '" title="' . s('view subscribers who clicked') . '"></a></span>'); $perc = sprintf('%0.2f', $uniqueclicks['users'] / $row['total'] * 100); $ls->addColumn($element, $GLOBALS['I18N']->get('click rate'), $perc . '%'); $summary['uniqueclicks'] += $uniqueclicks['users']; # } $summary['totalclicks'] += $row['clicked']; } $ls->addElement($GLOBALS['I18N']->get('total'));