本文整理汇总了PHP中WebblerListing::addColumn方法的典型用法代码示例。如果您正苦于以下问题:PHP WebblerListing::addColumn方法的具体用法?PHP WebblerListing::addColumn怎么用?PHP WebblerListing::addColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebblerListing
的用法示例。
在下文中一共展示了WebblerListing::addColumn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: populate
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']);
}
}
示例2: populate
public function populate(WebblerListing $w, $start, $limit)
{
/*
* Populate the webbler list with users who have opened the message
*/
$w->setTitle($this->i18n->get('User email'));
$resultIterator = $this->model->fetchMessageOpens($this->isOpened, $start, $limit);
foreach ($resultIterator as $row) {
$key = $row['email'];
$w->addElement($key, new CommonPlugin_PageURL('user', array('id' => $row['userid'])));
foreach ($this->model->selectedAttrs as $attr) {
$w->addColumn($key, $this->model->attributes[$attr]['name'], $row["attr{$attr}"]);
}
$w->addColumn($key, $this->i18n->get('last viewed'), $row['viewed']);
}
}
示例3: populate
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}"]);
}
}
}
示例4: populate
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');
}
}
示例5: populate
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)) : '');
}
}
示例6: populate
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'] : '');
}
}
示例7: populate
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: Header
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;
}
示例9: Help
if (ALLOW_ATTACHMENTS) {
// If we have a message id saved, we want to query the attachments that are associated with this
// message and display that (and allow deletion of!)
$att_content = '<table><tr><td colspan=2>' . Help("attachments") . ' ' . $GLOBALS['I18N']->get("addattachments") . ' </td></tr>';
$att_content .= '<tr><td colspan=2>
' . $GLOBALS['I18N']->get("uploadlimits") . ':<br/>
' . $GLOBALS['I18N']->get("maxtotaldata") . ': ' . ini_get("post_max_size") . '<br/>
' . $GLOBALS['I18N']->get("maxfileupload") . ': ' . ini_get("upload_max_filesize") . '</td></tr>';
if ($id) {
$result = Sql_Query(sprintf("Select Att.id, Att.filename, Att.remotefile, Att.mimetype, Att.description, Att.size, MsgAtt.id linkid" . " from %s Att, %s MsgAtt where Att.id = MsgAtt.attachmentid and MsgAtt.messageid = %d", $tables["attachment"], $tables["message_attachment"], $id));
$tabletext = "";
$ls = new WebblerListing($GLOBALS['I18N']->get('currentattachments'));
while ($row = Sql_fetch_array($result)) {
# $tabletext .= "<tr><td>".$row["remotefile"]."</td><td>".$row["description"]." </td><td>".$row["size"]."</td>";
$ls->addElement($row["id"]);
$ls->addColumn($row["id"], $GLOBALS['I18N']->get('filename'), $row["remotefile"]);
$ls->addColumn($row["id"], $GLOBALS['I18N']->get('desc'), $row["description"]);
$ls->addColumn($row["id"], $GLOBALS['I18N']->get('size'), $row["size"]);
$phys_file = $GLOBALS["attachment_repository"] . "/" . $row["filename"];
if (is_file($phys_file) && filesize($phys_file)) {
$ls->addColumn($row["id"], $GLOBALS['I18N']->get('file'), $GLOBALS["img_tick"]);
} else {
$ls->addColumn($row["id"], $GLOBALS['I18N']->get('file'), $GLOBALS["img_cross"]);
}
$ls->addColumn($row["id"], $GLOBALS['I18N']->get('del'), sprintf('<input type=checkbox name="deleteattachments[]" value="%s">', $row["linkid"]));
// Probably need to check security rights here...
# $tabletext .= "<td><input type=checkbox name=\"deleteattachments[]\" value=\"".$row["linkid"]."\"></td>";
# $tabletext .= "</tr>\n";
}
$ls->addButton($GLOBALS['I18N']->get('delchecked'), "javascript:document.sendmessageform.submit()");
$att_content .= '<tr><td colspan=2>' . $ls->display() . '</td></tr>';
示例10: count
}
# $listingelement = '<!--'.$msg['id'].'-->'.stripslashes($messagedata["campaigntitle"]);
if ($msg['status'] == 'draft') {
$editlink = PageUrl2('send&id=' . $msg['id']);
}
$ls->addElement($listingelement, $editlink);
$ls->setClass($listingelement, 'row1');
$uniqueviews = Sql_Fetch_Row_Query("select count(userid) from {$tables['usermessage']} where viewed is not null and status = 'sent' and messageid = " . $msg['id']);
$clicks = Sql_Fetch_Row_Query("select sum(clicked) from {$tables['linktrack_ml']} where messageid = " . $msg['id']);
# $clicks = array(0);
/*
foreach ($messagedata as $key => $val) {
$ls->addColumn($listingelement,$key,$val);
}
*/
$ls->addColumn($listingelement, $GLOBALS['I18N']->get('Entered'), formatDateTime($msg['entered']));
$_GET['id'] = $msg['id'];
$statusdiv = '<div id="messagestatus' . $msg['id'] . '">';
include 'actions/msgstatus.php';
$statusdiv .= $status;
$statusdiv .= '</div>';
$GLOBALS['pagefooter']['statusupdate' . $msg['id']] = '<script type="text/javascript">
updateMessages.push(' . $msg['id'] . ');</script>';
$GLOBALS['pagefooter']['statusupdate'] = '<script type="text/javascript">window.setInterval("messagesStatusUpdate()",5000);</script>';
if ($msg['status'] == 'sent') {
$statusdiv = $GLOBALS['I18N']->get('Sent') . ': ' . $msg['sent'];
}
$ls->addColumn($listingelement, $GLOBALS['I18N']->get('Status'), $statusdiv);
if ($msg['status'] != 'draft') {
# $ls->addColumn($listingelement,$GLOBALS['I18N']->get("total"), $msg['astext'] + $msg['ashtml'] + $msg['astextandhtml'] + $msg['aspdf'] + $msg['astextandpdf']);
# $ls->addColumn($listingelement,$GLOBALS['I18N']->get("text"), $msg['astext']);
示例11: sprintf
$ls_del = '';
# $ls->addColumn($user["email"], $GLOBALS['I18N']->get('del'), sprintf('<a href="%s" onclick="return deleteRec(\'%s\');">del</a>',PageUrl2('users'.$find_url), PageURL2("users&start=$start&delete=" .$user["id"])));
if (isSuperUser()) {
$ls_del = sprintf('<a href="javascript:deleteRec(\'%s\');" class="del">del</a>', PageURL2("users&start={$start}&find={$find}&findby={$findby}&delete=" . $user['id']));
}
/* if (isset ($user['foreignkey'])) {
$ls->addColumn($user["email"], $GLOBALS['I18N']->get('key'), $user["foreignkey"]);
}
if (isset ($user["display"])) {
$ls->addColumn($user["email"], " ", $user["display"]);
}
*/
if (in_array('lists', $columns)) {
$lists = Sql_query('SELECT count(*) FROM ' . $tables['listuser'] . ',' . $tables['list'] . ' where userid = ' . $user['id'] . ' and ' . $tables['listuser'] . '.listid = ' . $tables['list'] . '.id');
$membership = Sql_fetch_row($lists);
$ls->addColumn($user['email'], $GLOBALS['I18N']->get('lists'), $membership[0]);
}
if (in_array('messages', $columns)) {
$msgs = Sql_query('SELECT count(*) FROM ' . $tables['usermessage'] . ' where userid = ' . $user['id'] . ' and status = "sent"');
$nummsgs = Sql_fetch_row($msgs);
$ls_msgs = $GLOBALS['I18N']->get('msgs') . ': ' . $nummsgs[0];
}
### allow plugins to add columns
if (isset($GLOBALS['plugins']) && is_array($GLOBALS['plugins'])) {
foreach ($GLOBALS['plugins'] as $plugin) {
if (method_exists($plugin, 'displayUsers')) {
$plugin->displayUsers($user, $user['email'], $ls);
}
}
}
$ls_bncs = '';
示例12: s
if (!empty($pluginDetails['installUrl'])) {
# $ls->addRow($pluginname,s('installation Url'),$pluginDetails['installUrl']);
$details .= '<div class="detail"><span class="label">' . s('installation Url') . '</span>';
$details .= '<span class="value">' . $pluginDetails['installUrl'] . '</span></div>';
}
if (!empty($pluginDetails['developer'])) {
# $ls->addColumn($pluginname,s('developer'),$pluginDetails['developer']);
$details .= '<div class="detail"><span class="label">' . s('developer') . '</span>';
$details .= '<span class="value">' . $pluginDetails['developer'] . '</span></div>';
}
if (!empty($plugin->documentationUrl)) {
$details .= '<div class="detail"><span class="label">' . s('More information') . '</span>';
$details .= '<span class="value"><a href="' . $plugin->documentationUrl . '" target="moreinfoplugin">' . s('Documentation Page') . '</a></span></div>';
}
if (pluginCanEnable($pluginname)) {
$ls->addColumn($pluginname, s('enabled'), $plugin->enabled ? PageLinkAjax('plugins&disable=' . $pluginname, $GLOBALS['img_tick']) : PageLinkAjax('plugins&enable=' . $pluginname, $GLOBALS['img_cross']));
}
if (DEVVERSION) {
//$ls->addColumn($pluginname,s('initialise'),$plugin->enabled ?
//PageLinkAjax('plugins&initialise='.$pluginname,s('Initialise')) : '');
if ($plugin->enabled) {
$details .= '<div class="detail"><span class="label">' . s('initialise') . '</span>';
$details .= '<span class="value">';
$details .= PageLinkAjax('plugins&initialise=' . $pluginname, s('Initialise'));
$details .= '</span></div>';
}
}
if (!empty($pluginDetails['installUrl']) && is_writable($pluginDestination . '/' . $pluginname)) {
## we can only delete the ones that were installed from the interface
$ls->addColumn($pluginname, s('delete'), '<span class="delete"><a href="javascript:deleteRec(\'./?page=plugins&delete=' . $pluginname . '\');" class="button" title="' . s('delete this plugin') . '">' . s('delete') . '</a></span>');
}
示例13: PageLinkActionButton
$_SESSION['action_result'] = $GLOBALS['I18N']->get('Campaign deleted');
}
}
$req = Sql_Query(sprintf('select id,entered,subject,unix_timestamp(now()) - unix_timestamp(entered) as age from %s where status = "draft" %s order by entered desc', $GLOBALS['tables']['message'], $ownership));
$numdraft = Sql_Num_Rows($req);
if ($numdraft > 0 && !isset($_GET['id']) && !isset($_GET['new'])) {
print '<p>' . PageLinkActionButton('send&new=1', $I18N->get('start a new message'), '', '', s('Start a new campaign')) . '</p>';
print '<p><h3>' . $I18N->get('Choose an existing draft message to work on') . '</h3></p><br/>';
$ls = new WebblerListing($I18N->get('Draft messages'));
$ls->noShader();
while ($row = Sql_Fetch_Array($req)) {
$element = '<!--' . $row['id'] . '-->' . $row['subject'];
$ls->addElement($element, PageUrl2('send&id=' . $row['id']));
$ls->setClass($element, 'row1');
# $ls->addColumn($element,$I18N->get('edit'),PageLink2('send&id='.$row['id'],$I18N->get('edit')));
$ls->addColumn($element, $I18N->get('entered'), $row['entered']);
$ls->addColumn($element, $I18N->get('age'), secs2time($row['age']));
$ls->addRow($element, '', '<a class="del" href="' . PageUrl2('send&delete=' . $row['id']) . '" title="' . $I18N->get('del') . '">' . $I18N->get('del') . '</a>');
}
$ls->addButton($I18N->get('delete all'), PageUrl2('send&delete=alldraft'));
print $ls->display();
return;
}
}
include "send_core.php";
if ($done) {
if ($GLOBALS["commandline"]) {
ob_end_clean();
print clineSignature();
print "Message with subject " . $_POST["subject"] . " was sent to " . $lists . "\n";
exit;
示例14: dirname
<?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 = '';
示例15: htmlspecialchars
<textarea name="forwardfooter" cols="65" rows="5">' . htmlspecialchars($messagedata['forwardfooter']) . '</textarea></div>';
if (ALLOW_ATTACHMENTS) {
// If we have a message id saved, we want to query the attachments that are associated with this
// message and display that (and allow deletion of!)
$att_content = '<div class="field"><label for="attach">' . $GLOBALS['I18N']->get('Add attachments to your campaign') . Help('attachments') . '</label>';
$att_content .= '<div class="info">
' . $GLOBALS['I18N']->get('The upload has the following limits set by the server') . ':<br/>
' . $GLOBALS['I18N']->get('Maximum size of total data being sent to the server') . ': ' . ini_get('post_max_size') . '<br/>
' . $GLOBALS['I18N']->get('Maximum size of each individual file') . ': ' . ini_get('upload_max_filesize') . '</div>';
if ($id) {
$result = Sql_Query(sprintf('Select Att.id, Att.filename, Att.remotefile, Att.mimetype, Att.description, Att.size, MsgAtt.id linkid' . ' from %s Att, %s MsgAtt where Att.id = MsgAtt.attachmentid and MsgAtt.messageid = %d', $tables['attachment'], $tables['message_attachment'], $id));
$ls = new WebblerListing($GLOBALS['I18N']->get('Current Attachments'));
$totalSize = 0;
while ($row = Sql_fetch_array($result)) {
$ls->addElement($row['id']);
$ls->addColumn($row['id'], $GLOBALS['I18N']->get('filename'), $row['remotefile']);
$ls->addColumn($row['id'], $GLOBALS['I18N']->get('desc'), $row['description']);
$ls->addColumn($row['id'], $GLOBALS['I18N']->get('size'), formatBytes($row['size']));
$totalSize += $row['size'];
$phys_file = $GLOBALS['attachment_repository'] . '/' . $row['filename'];
if (is_file($phys_file) && filesize($phys_file)) {
$ls->addColumn($row['id'], $GLOBALS['I18N']->get('file'), $GLOBALS['img_tick']);
} else {
$ls->addColumn($row['id'], $GLOBALS['I18N']->get('file'), $GLOBALS['img_cross']);
}
$ls->addColumn($row['id'], $GLOBALS['I18N']->get('del'), sprintf('<input type="checkbox" name="deleteattachments[]" value="%s"/>', $row['linkid']));
}
$ls->addButton(s('Delete checked'), 'javascript:document.sendmessageform.submit()');
$att_content .= '<div>' . $ls->display() . '</div>';
}
if (defined('MAX_MAILSIZE') && 3 * $totalSize > MAX_MAILSIZE) {