public function populate(WebblerListing $w, $start, $limit)
 {
     /*
      * Populate the webbler list with users who have not 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}"]);
         }
     }
 }
 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)
 {
     /*
      * 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)
 {
     /*
      * Populates the webbler list with link click details
      */
     $w->setTitle($this->i18n->get('User email'));
     $resultSet = $this->model->linkClicks($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('clicks'), $row['clicked']);
         $w->addColumn($key, $this->i18n->get('firstclick'), $row['firstclick']);
         $w->addColumn($key, $this->i18n->get('latestclick'), $row['clicked'] > 1 ? $row['latestclick'] : '');
     }
 }
예제 #5
0
 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']);
     }
 }
예제 #6
0
 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']);
     }
 }
예제 #8
0
 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)) : '');
     }
 }
예제 #9
0
        $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 . ' %');
    }
    print $ls->display();
    return;
}
print '<h1>' . $GLOBALS['I18N']->get('View Details for a Message') . '</h1>';
$messagedata = Sql_Fetch_Array_query("SELECT * FROM {$tables['message']} where id = {$id} {$subselect}");
print '<table>
<tr><td>' . $GLOBALS['I18N']->get('Subject') . '<td><td>' . $messagedata['subject'] . '</td></tr>
<tr><td>' . $GLOBALS['I18N']->get('Entered') . '<td><td>' . $messagedata['entered'] . '</td></tr>
<tr><td>' . $GLOBALS['I18N']->get('Sent') . '<td><td>' . $messagedata['sent'] . '</td></tr>
</table><hr/>';
$ls = new WebblerListing($GLOBALS['I18N']->get('Message Open Statistics'));
$req = Sql_Query(sprintf('select um.userid
    from %s um,%s msg where um.messageid = %d and um.messageid = msg.id and um.viewed is not null %s
    group by userid', $GLOBALS['tables']['usermessage'], $GLOBALS['tables']['message'], $id, $subselect));
$total = Sql_Affected_Rows();
$start = sprintf('%d', $_GET['start']);
if (isset($start) && $start > 0) {
    $listing = sprintf($GLOBALS['I18N']->get("Listing user %d to %d"), $start, $start + MAX_USER_PP);
    $limit = "limit {$start}," . MAX_USER_PP;
} else {
    $listing = sprintf($GLOBALS['I18N']->get("Listing user %d to %d"), 1, MAX_USER_PP);
    $limit = "limit 0," . MAX_USER_PP;
    $start = 0;
}
if ($id) {
    $url_keep = '&amp;id=' . $id;
예제 #10
0
   $forwardcontent .= '<tr><td colspan=2>' . $GLOBALS['I18N']->get("forwardfooter") . '. <br/>
   ' . $GLOBALS['I18N']->get("messageforwardfooterexplanation") . '<br/>' . '.</td></tr>
 <tr><td colspan=2><textarea name=forwardfooter cols=65 rows=5>' . $forwardfooter . '</textarea></td></tr>
 </table>';
   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"]."&nbsp;</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>";
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;
}
print $ls->display();
print $bouncels->display();
if (isBlackListed($user["email"])) {
    print "<h3>" . $GLOBALS['I18N']->get('user 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 '';
    print "<a href=\"javascript:deleteRec2('" . str_replace("'", ' ', $GLOBALS['I18N']->get('are you sure you want to delete this user from the blacklist')) . "?\\n" . str_replace("'", ' ', $GLOBALS['I18N']->get('it should only be done with explicit permission from this user')) . "','./?page=userhistory&unblacklist={$user["id"]}&id={$user["id"]}')\">\n  " . $GLOBALS['I18N']->get('remove User from Blacklist') . "</a>" . '<br/><br/>';
    $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"]);
        $ls->addColumn($row["name"], $GLOBALS['I18N']->get('value'), stripslashes($row["data"]));
    }
    print $ls->display();
}
print "<h3>" . $GLOBALS['I18N']->get('user subscription history') . "</h3>";
$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->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"], $GLOBALS['I18N']->get('detail'), nl2br(htmlspecialchars($row["detail"])));
    $ls->addRow($row["id"], $GLOBALS['I18N']->get('info'), nl2br($row["systeminfo"]));
}
print $ls->display();
예제 #13
0
파일: users.php 프로젝트: bramley/phplist3
    $filterpanel .= sprintf('<option value="%d" %s>%s</option>', $row['id'], $row['id'] == $findby ? 'selected="selected"' : '', substr($row['name'], 0, 20));
}
$filterpanel .= '</select><input class="submit" type="submit" value="' . s('Go') . '" />&nbsp;&nbsp;<a href="./?page=users&amp;find=NULL" class="reset">' . s('reset') . '</a>';
$filterpanel .= '</form></div>';
//$filterpanel .= '<tr><td colspan="4"></td></tr>
//</table>';
print Info($countpanel);
$panel = new UIPanel($GLOBALS['I18N']->get('Find subscribers'), $filterpanel);
print $panel->display();
#if (($require_login && isSuperUser()) || !$require_login)
print '<div class="actions">';
print '<div id="add-csv-button">' . PageLinkButton('dlusers', $GLOBALS['I18N']->get('Download all users as CSV file'), 'nocache=' . uniqid('')) . '</div>';
print '<div id="add-user-button">' . PageLinkButton('adduser', $GLOBALS['I18N']->get('Add a User')) . '</div>';
print '</div>';
$some = 0;
$ls = new WebblerListing(s('users'));
$ls->usePanel($paging);
if ($result) {
    while ($user = Sql_fetch_array($result)) {
        $some = 1;
        $ls->addElement($user['email'], PageURL2("user&amp;start={$start}&amp;id=" . $user['id'] . $find_url));
        $ls->setClass($user['email'], 'row1');
        ## we make one column with the subscriber status being "on" or "off"
        ## 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) {
예제 #14
0
$req = Sql_query('select count(*) from ' . $tables['message'] . $whereClause . ' ' . $sortBySql);
$total_req = Sql_Fetch_Row($req);
$total = $total_req[0];
## Browse buttons table
$limit = $_SESSION['messagenumpp'];
$offset = 0;
if (isset($start) && $start > 0) {
    $offset = $start;
} else {
    $start = 0;
}
$paging = '';
if ($total > $_SESSION['messagenumpp']) {
    $paging = simplePaging("messages{$url_keep}", $start, $total, $_SESSION['messagenumpp'], $GLOBALS['I18N']->get('Campaigns'));
}
$ls = new WebblerListing(s('Campaigns'));
$ls->usePanel($paging);
## messages table
if ($total) {
    $result = Sql_query('SELECT * FROM ' . $tables['message'] . " {$whereClause} {$sortBySql} limit {$limit} offset {$offset}");
    while ($msg = Sql_fetch_array($result)) {
        $editlink = '';
        $messagedata = loadMessageData($msg['id']);
        if ($messagedata['subject'] != $messagedata['campaigntitle']) {
            $listingelement = '<!--' . $msg['id'] . '-->' . stripslashes($messagedata['campaigntitle']) . '<br/><strong>' . stripslashes($messagedata['subject']) . '</strong>';
        } else {
            $listingelement = '<!--' . $msg['id'] . '-->' . stripslashes($messagedata['subject']);
        }
        #   $listingelement = '<!--'.$msg['id'].'-->'.stripslashes($messagedata["campaigntitle"]);
        if ($msg['status'] == 'draft') {
            $editlink = PageUrl2('send&id=' . $msg['id']);
예제 #15
0
<?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 = '';
예제 #16
0
<?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();
예제 #17
0
    $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"]);
    $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>';
예제 #18
0
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':
            print '<p class="information">' . s('no processed bounces available') . '</p>';
            break;
    }
}
$ls = new WebblerListing(s($status) . ' ' . s('bounces'));
$ls->usePanel($paging);
while ($bounce = Sql_fetch_array($result)) {
    #@@@ not sure about these ones - bounced list message
    $element = $bounce['id'];
    $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&amp;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']);
예제 #19
0
    }
}
if (isset($_REQUEST['delete'])) {
    $delete = sprintf('%d', $_REQUEST['delete']);
} else {
    $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 = "";
예제 #20
0
    $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 (&gt; 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}&amp;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 . '&nbsp;&nbsp;</div>');
}
print $ls->display();
예제 #21
0
            return $months[intval($month)];
        }
    }
}
$systemstats = array(array('name' => 'New Subscribers', 'query' => sprintf('select count(id) as num,year(entered) year,month(entered) month from %s group by year(entered), month(entered) order by entered desc', $GLOBALS['tables']['user'])), array('name' => 'Total Subscribers', 'query' => sprintf('select count(id) as num,year(entered) year,month(entered) month from %s group by year(entered), month(entered) order by entered asc', $GLOBALS['tables']['user']), 'collate' => true), array('name' => 'Current Subscribers', 'query' => sprintf('select count(id) as num,year(now()) year,month(now()) month from %s', $GLOBALS['tables']['user'])), array('name' => 'Sent Messages by month', 'query' => sprintf('select count(entered) as num,year(entered) as year,month(entered) month from %s where status = "sent" group by year(entered), month(entered) order by entered desc', $GLOBALS['tables']['usermessage'])), array('name' => 'Sent Messages by year', 'query' => sprintf('select count(entered) as num,year(entered) as year from %s where status = "sent" group by year(entered) order by entered desc', $GLOBALS['tables']['usermessage']), 'range' => 'year'), array('name' => 'Opened Messages', 'query' => sprintf('select count(entered) as num,year(entered) as year,month(entered) month from %s where viewed is not null and status = "sent" group by year(entered), month(entered) order by entered desc', $GLOBALS['tables']['usermessage'])), array('name' => 'Campaigns', 'query' => sprintf('select count(entered) as num,year(entered) as year,month(entered) month from %s where status = "sent" group by year(entered), month(entered) order by entered desc', $GLOBALS['tables']['message'])), array('name' => 'Campaigns by year', 'query' => sprintf('select count(entered) as num,year(entered) as year from %s where status = "sent" group by year(entered) order by entered desc', $GLOBALS['tables']['message']), 'range' => 'year'), array('name' => 'Bounces', 'query' => sprintf('select count(id) as num,year(date) year,month(date) month from %s group by year(date), month(date) order by date desc', $GLOBALS['tables']['bounce'])), array('name' => 'Blacklist Additions', 'query' => sprintf('select count(email) as num,year(added) as year,month(added) month from %s group by year(added), month(added) order by added desc', $GLOBALS['tables']['user_blacklist'])), array('name' => 'Spam Complaints', 'query' => sprintf('select count(bl.email) as num,year(added) as year,month(added) month from %s bl,%s bldata where bl.email = bldata.email and bldata.name = "reason" and bldata.data = "blacklisted due to spam complaints" group by year(added), month(added) order by added desc', $GLOBALS['tables']['user_blacklist'], $GLOBALS['tables']['user_blacklist_data'])), array('name' => 'User Clicks', 'query' => sprintf('select count(distinct(userid)) as num ,year(firstclick) as year,month(firstclick) month  from %s where forwardid not in (select id from %s where url like "%%/lists/?p=unsubscribe") group by year(firstclick), month(firstclick) order by firstclick desc', $GLOBALS['tables']['linktrack_uml_click'], $GLOBALS['tables']['linktrack_forward'])), array('name' => 'Unsubscribe Clicks', 'query' => sprintf('select count(distinct(userid)) as num ,year(firstclick) as year,month(firstclick) month  from %s where forwardid in (select id from %s where url like "%%/lists/?p=unsubscribe") group by year(firstclick), month(firstclick) order by firstclick desc', $GLOBALS['tables']['linktrack_uml_click'], $GLOBALS['tables']['linktrack_forward'])), array('name' => 'Next subscriberid', 'query' => sprintf('select Auto_increment as num, year(now()) as year, month(now()) as month FROM information_schema.tables where table_name="%s" AND table_schema="%s"', $GLOBALS['tables']['user'], $GLOBALS['database_name'])));
$chartCount = 0;
foreach ($systemstats as $item) {
    ++$chartCount;
    if (!isset($item['range'])) {
        $item['range'] = 'month';
    }
    if (!isset($item['collate'])) {
        $item['collate'] = false;
    }
    $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 {
예제 #22
0
}
if (defined('PLUGIN_ROOTDIR') && !is_writable(PLUGIN_ROOTDIR)) {
    Info(s('The plugin root directory is not writable, please install plugins manually'));
} elseif (!class_exists('ZipArchive')) {
    Info(s('PHP has no <a href="http://php.net/zip">Zip capability</a>. This is required to allow installation from a remote URL'));
} else {
    print '<h3>' . s('Install a new plugin') . '</h3>';
    print '<p><a class="resourceslink" href="http://resources.phplist.com/plugins/" title="' . s('Find plugins') . '" target="_blank">' . s('Find plugins') . '</a></p>';
    print formStart();
    print '<fieldset>
      <label for="pluginurl">' . s('Plugin package URL') . '</label>
      <div type="field"><input type="text" id="pluginurl" name="pluginurl" /></div>
      <button type="submit" name="download">' . s('Install plugin') . '</button>
      </fieldset></form>';
}
$ls = new WebblerListing(s('Installed plugins'));
if (empty($GLOBALS['allplugins'])) {
    return;
}
ksort($GLOBALS['allplugins'], SORT_FLAG_CASE | SORT_STRING);
foreach ($GLOBALS['allplugins'] as $pluginname => $plugin) {
    $pluginDetails = array();
    $refl = new ReflectionObject($plugin);
    if (is_file(dirname($refl->getFileName()) . '/' . $pluginname . '.info.txt')) {
        $pluginDetails = unserialize(file_get_contents($pluginDestination . '/' . $pluginname . '.info.txt'));
    }
    $ls->addElement($pluginname);
    $ls->setClass($pluginname, 'row1');
    # $ls->addColumn($pluginname,s('name'),$plugin->name);
    $details = '<div class="plugindetails">';
    $details .= '<div class="detail"><span class="label">' . s('name') . '</span>';
예제 #23
0
  #0013076: different content when forwarding 'to a friend'
  $maincontent .= '<div class="field"><label for="footer">' . $GLOBALS['I18N']->get('Footer') . Help('footer') . '.</label>' . '
 <textarea name="footer" cols="65" rows="5">' . htmlspecialchars($messagedata['footer']) . '</textarea></div>';
  $forwardcontent .= '<div class="field"><label for="forwardfooter">' . $GLOBALS['I18N']->get('forwardfooter') . Help('forwardfooter') . '</label>' . '
  <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']));
          }
예제 #24
0
<?php 
$ls = new WebblerListing("Database Structure");
while (list($table, $tablename) = each($GLOBALS["tables"])) {
    $ls->addElement($table);
    if ($table != $tablename) {
        $ls->addColumn($table, "real name", $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);
    $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) {
예제 #25
0
파일: admins.php 프로젝트: gillima/phplist3
">
            <?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}&amp;delete=" . $admin['id']));
    $ls->addElement($admin['loginname'], PageUrl2('admin', $GLOBALS['I18N']->get('Show'), "start={$start}&amp;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>';
예제 #26
0
    }
    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>';
    }
    return;
}
print '<div class="actions">' . PageLinkButton('uclicks&dl=true&id=' . $id, $GLOBALS['I18N']->get('Download as CSV file')) . '</div>';
$ls = new WebblerListing($GLOBALS['I18N']->get('URL Click Statistics'));
$urldata = Sql_Fetch_Array_Query(sprintf('select url from %s where id = %d', $GLOBALS['tables']['linktrack_forward'], $id));
print '<h3>' . $GLOBALS['I18N']->get('Click details for a URL') . ' <b>' . $urldata['url'] . '</b></h3><br/>';
print PageLinkButton('userclicks&fwdid=' . $id, s('View subscribers'));
if ($download) {
    header('Content-disposition:  attachment; filename="phpList URL click statistics for ' . $urldata['url'] . '.csv"');
}
$req = Sql_Query(sprintf('select messageid,firstclick,date_format(latestclick,
  "%%e %%b %%Y %%H:%%i") as latestclick,total,clicked from %s where forwardid = %d and firstclick is not null order by firstclick desc
  ', $GLOBALS['tables']['linktrack_ml'], $id));
$summary = array();
$summary['totalsent'] = 0;
$summary['totalclicks'] = 0;
$summary['uniqueclicks'] = 0;
while ($row = Sql_Fetch_Array($req)) {
    $msgsubj = Sql_Fetch_Row_query(sprintf('select subject from %s where id = %d', $GLOBALS['tables']['message'], $row['messageid']));
    print $GLOBALS['I18N']->get('Invalid Request');
    return;
}
$access = accessLevel('userclicks');
switch ($access) {
    case 'owner':
    case 'all':
        $subselect = '';
        break;
    case 'none':
    default:
        print $GLOBALS['I18N']->get('You do not have access to this page');
        return;
        break;
}
$ls = new WebblerListing($GLOBALS['I18N']->get('User Click Statistics'));
if ($linkid) {
    $urldata = Sql_Fetch_Array_Query(sprintf('select url from %s where linkid = %d', $GLOBALS['tables']['linktrack'], $linkid));
}
if ($msgid) {
    $messagedata = Sql_Fetch_Array_query("SELECT * FROM {$tables['message']} where id = {$msgid} {$subselect}");
}
if ($userid) {
    $userdata = Sql_Fetch_Array_query("SELECT * FROM {$tables['user']} where id = {$userid} {$subselect}");
}
if ($linkid && $msgid) {
    print '<h1>' . $GLOBALS['I18N']->get('User Click Details for a URL in a message');
    print ' ' . PageLink2('uclicks&amp;id=' . $linkid, $urldata['url']);
    print '</h1>';
    print '<table>
  <tr><td>' . $GLOBALS['I18N']->get('Subject') . '<td><td>' . PageLink2('mclicks&amp;id=' . $msgid, $messagedata['subject']) . '</td></tr>
예제 #28
0
        Sql_Query(sprintf('update %s set category = "%s" %s and id = %d ', $tables['list'], sql_escape($val), $subselect, $key));
    }
    if (isset($_GET['show']) && $_GET['show'] == 'all') {
        $_SESSION['action_result'] = s('Category assignments saved');
        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);
    }
예제 #29
0
    ob_start();
}
if (empty($start)) {
    print '<p>' . PageLinkButton('mviews&dl=true&id=' . $id . '&start=' . $start, $GLOBALS['I18N']->get('Download as CSV file')) . '</p>';
}
#print '<h3>'.$GLOBALS['I18N']->get('View Details for a Message').'</h3>';
$messagedata = Sql_Fetch_Array_query("SELECT * FROM {$tables['message']} where id = {$id} {$subselect}");
print '<table class="mviewsDetails">
<tr><td>' . $GLOBALS['I18N']->get('Subject') . '<td><td>' . $messagedata['subject'] . '</td></tr>
<tr><td>' . $GLOBALS['I18N']->get('Entered') . '<td><td>' . $messagedata['entered'] . '</td></tr>
<tr><td>' . $GLOBALS['I18N']->get('Sent') . '<td><td>' . $messagedata['sent'] . '</td></tr>
</table><hr/>';
if ($download) {
    header('Content-disposition:  attachment; filename="phpList Message open statistics for ' . $messagedata['subject'] . '.csv"');
}
$ls = new WebblerListing(ucfirst($GLOBALS['I18N']->get('Open statistics')));
$req = Sql_Query(sprintf('select um.userid
    from %s um,%s msg where um.messageid = %d and um.messageid = msg.id and um.viewed is not null %s
    group by userid', $GLOBALS['tables']['usermessage'], $GLOBALS['tables']['message'], $id, $subselect));
$total = Sql_Affected_Rows();
if (isset($start) && $start > 0) {
    $listing = sprintf($GLOBALS['I18N']->get("Listing user %d to %d"), $start, $start + MAX_USER_PP);
    $limit = "limit {$start}," . MAX_USER_PP;
} else {
    $listing = sprintf($GLOBALS['I18N']->get("Listing user %d to %d"), 1, MAX_USER_PP);
    $limit = "limit 0," . MAX_USER_PP;
    $start = 0;
    $limit = "limit 0," . MAX_USER_PP;
}
## hmm, this needs more work, as it'll run out of memory, because it's building the entire
## listing before pushing it out.
예제 #30
0
파일: send.php 프로젝트: Gerberus/phplist3
            }
            $_SESSION['action_result'] = $GLOBALS['I18N']->get('All draft campaigns deleted');
            print Info($GLOBALS['I18N']->get('campaigns deleted'));
        } else {
            verifyCsrfGetToken();
            deleteMessage(sprintf('%d', $_GET['delete']));
            print Info($GLOBALS['I18N']->get('campaign deleted'));
            $_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&amp;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&amp;id=' . $row['id']));
            $ls->setClass($element, 'row1');
            #    $ls->addColumn($element,$I18N->get('edit'),PageLink2('send&amp;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&amp;delete=' . $row['id']) . '" title="' . $I18N->get('del') . '">' . $I18N->get('del') . '</a>');
        }
        $ls->addButton($I18N->get('delete all'), PageUrl2('send&amp;delete=alldraft'));
        print $ls->display();
        return;
    }
}