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']);
     }
 }
예제 #2
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']);
     }
 }
 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}"]);
         }
     }
 }
예제 #6
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)) : '');
     }
 }
예제 #7
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'] : '');
     }
 }
예제 #8
0
## 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']);
        }
        $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>';
예제 #9
0
파일: send.php 프로젝트: Gerberus/phplist3
            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;
    }
}
include "send_core.php";
if ($done) {
    if ($GLOBALS["commandline"]) {
        ob_end_clean();
예제 #10
0
    $users = explode("\n", $_POST['usercheck']);
    foreach ($users as $user) {
        $user = trim($user);
        if (isset($_POST['check']) && $_POST['check'] == 'foreignkey') {
            $exists = Sql_Query(sprintf('select id,foreignkey,email from %s where foreignkey = "%s"', $tables['user'], sql_escape($user)));
        } else {
            $exists = Sql_Query(sprintf('select id,foreignkey,email from %s where email = "%s"', $tables['user'], sql_escape($user)));
        }
        if (Sql_Num_Rows($exists)) {
            $id = Sql_Fetch_Array($exists);
            $element = strip_tags($user);
            $lsexist->addElement($element, PageUrl2('user&amp;id=' . $id['id']));
            $lsexist->addColumn($element, $GLOBALS['I18N']->get('email'), $id['email']);
            $lsexist->addColumn($element, $GLOBALS['I18N']->get('key'), $id['foreignkey']);
        } else {
            $lsnonexist->addElement(strip_tags($user));
        }
    }
    print $lsexist->display();
    print $lsnonexist->display();
} else {
    $_POST['usercheck'] = '';
}
/*
print $GLOBALS["I18N"]->get("Page to check the existence of users in the database");
*/
$content .= '<form method="post" action="">';
$content .= '<table class="usercheckForm">';
$content .= '<tr><td>' . s('What is the type of information you want to check') . '</td></tr>';
$content .= '<tr><td><label for="foreignkey">' . s('Foreign Key') . '</label> <input type="radio" id="foreignkey" name="check" value="foreignkey"></td></tr>';
$content .= '<tr><td><label for="email">' . s('Email') . '</label> <input type="radio" id="email" name="check" value="email"></td></tr>';
예제 #11
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 = '';
예제 #12
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();
예제 #13
0
 $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']));
         }
         $ls->addButton(s('Delete checked'), 'javascript:document.sendmessageform.submit()');
         $att_content .= '<div>' . $ls->display() . '</div>';
     }
예제 #14
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();
예제 #15
0
     $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 {
         $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']);
예제 #16
0
      <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>';
    $details .= '<span class="value">' . $plugin->name . '</span></div>';
    $details .= '<div class="detail"><span class="label">' . s('version') . '</span>';
    $details .= '<span class="value">' . $plugin->version . '</span></div>';
    $details .= '<div class="detail"><span class="label">' . s('description') . '</span>';
    $details .= '<span class="value">' . $plugin->description . '</span></div>';
    if (!empty($GLOBALS['developer_email'])) {
        ## show the origin of the plugin, as many may exist
        $details .= '<div class="detail"><span class="label">' . s('origin') . '</span>';
        $details .= '<span class="value">' . $plugin->origin . '</span></div>';
    }
    #  $ls->addRow($pluginname,s('description'),$plugin->description);
예제 #17
0
파일: users.php 프로젝트: atlcurling/tkt
<tr><td colspan=4>
<?php 
#if (($require_login && isSuperUser()) || !$require_login)
print '<p>' . PageLink2("dlusers", $GLOBALS['I18N']->get('Download all users as CSV file'), "nocache=" . uniqid("")) . '&nbsp;<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"], "&nbsp;", $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);
예제 #18
0
            print '<pre>';
            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'));
예제 #19
0
 function checkAll() {
   for (i=0;i<document.users.length;i++) {
      document.users.elements[i].checked = document.users.checkall.checked;
   }
 }
 </script>
 <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"]) {
예제 #20
0
파일: users.php 프로젝트: bramley/phplist3
//</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) {
            $ls_confirmed = $GLOBALS['img_tick'];
        } else {
            $ls_confirmed = $GLOBALS['img_cross'];
        }
        $ls_del = '';
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;
}
예제 #22
0
    $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 = "";
        $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"' : ''));
예제 #23
0
        $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
예제 #24
0
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']);
          } else {
            $ls->addColumn($element,'delayed',$GLOBALS['img_cross']);
          }
        */
    $ls->addColumn($element, s('Campaign'), $messageid);
예제 #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
     $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) {
     $tls->collapse();
     $ls->addColumn($table, "ok", $GLOBALS["img_tick"]);
 } else {
     $ls->addColumn($table, "ok", $GLOBALS["img_cross"]);
 }
    "%%e %%b %%Y %%H:%%i") as latestclick,sum(clicked) as numclicks from %s as linktrack, %s as user where linktrack.userid = user.id 
    and linktrack.messageid = %d and linktrack.clicked group by linktrack.userid', $GLOBALS['tables']['linktrack'], $GLOBALS['tables']['user'], $msgid));
} elseif ($userid) {
    print '<h1>' . $GLOBALS['I18N']->get('User Click Details') . '</h1>';
    $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));
예제 #28
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']));
    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&amp;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&amp;msgid='.$row['messageid'].'&amp;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&amp;msgid=' . $row['messageid'] . '&amp;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'];
예제 #29
0
}
$req = Sql_Query(sprintf('select userid,email,um.entered as sent,min(um.viewed) as firstview,
    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&amp;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 {
예제 #30
0
    /*  if (!in_array($confirmed,$row['domain'])) {
        $ls->addElement($row['domain']);
      }*/
    if (in_array($row['domain'], array_keys($confirmed))) {
        if ($row['num'] > 5) {
            $ls->addColumn($row['domain'], $GLOBALS['I18N']->get('unconfirmed'), $row['num']);
            $perc = sprintf('%0.2f', $row['num'] / $total * 100);
            $ls->addColumn($row['domain'], '<!--unc-->' . $GLOBALS['I18N']->get('perc'), $perc);
        }
        $ls->addColumn($row['domain'], $GLOBALS['I18N']->get('num'), $row['num'] + $confirmed[$row['domain']]);
        $perc = sprintf('%0.2f', ($row['num'] + $confirmed[$row['domain']]) / $total * 100);
        $ls->addColumn($row['domain'], $GLOBALS['I18N']->get('perc'), $perc);
    }
}
if ($download) {
    ob_end_clean();
    print $ls->tabDelimited();
}
print $ls->display();
print '<br /><br />';
$req = Sql_Query(sprintf('select lcase(substring_index(email,"@",1)) as preat,count(email) as num from %s where confirmed group by preat order by num desc limit 25', $GLOBALS['tables']['user']));
$ls = new WebblerListing($GLOBALS['I18N']->get('Top 25 pre-@ of email addresses'));
while ($row = Sql_Fetch_Array($req)) {
    if ($row['num'] > 10) {
        $ls->addElement($row['preat']);
        $ls->addColumn($row['preat'], s('amount'), $row['num']);
        $perc = sprintf('%0.2f', $row['num'] / $total * 100);
        $ls->addColumn($row['preat'], $GLOBALS['I18N']->get('perc'), $perc);
    }
}
print $ls->display();