當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WebblerListing::addColumnHtml方法代碼示例

本文整理匯總了PHP中WebblerListing::addColumnHtml方法的典型用法代碼示例。如果您正苦於以下問題:PHP WebblerListing::addColumnHtml方法的具體用法?PHP WebblerListing::addColumnHtml怎麽用?PHP WebblerListing::addColumnHtml使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WebblerListing的用法示例。


在下文中一共展示了WebblerListing::addColumnHtml方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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'] : '');
     }
 }
開發者ID:jbenicky,項目名稱:phplist-plugin-statistics,代碼行數:23,代碼來源:Links.php

示例2: populate

 public function populate(WebblerListing $w, $start, $limit)
 {
     /*
      * Populates the webbler list with message details
      */
     global $wkhtmltopdfOptions;
     $w->setTitle($this->i18n->get('Campaigns'));
     $rows = iterator_to_array($this->model->fetchMessages(false, $start, $limit));
     $this->messageResults = array_reverse($rows);
     $query = array('listid' => $this->model->listid, 'type' => 'opened');
     foreach ($rows as $row) {
         $fields = $this->messageStats($row);
         $query['msgid'] = $fields['id'];
         $key = "{$fields['id']} | {$fields['subject']}";
         $w->addElement($key, new CommonPlugin_PageURL(null, $query));
         $w->addColumn($key, $this->i18n->get('date'), $fields['datesent']);
         $w->addColumn($key, $this->i18n->get('sent'), $fields['sent'], '');
         $w->addColumn($key, $this->i18n->get('opened'), "{$fields['openrate']}% ({$fields['opens']})");
         $w->addColumnHtml($key, $this->i18n->get('clicked'), $fields['clickUsers'] > 0 ? "{$fields['clickrate']}%&nbsp;({$fields['clickUsers']}) |&nbsp;{$fields['totalClicks']} |&nbsp;{$fields['clickopenrate']}%" : '0');
         $w->addColumn($key, $this->i18n->get('bounced'), $fields['bouncecount'] > 0 ? "{$fields['bouncerate']}% ({$fields['bouncecount']})" : '0');
         $w->addColumn($key, $this->i18n->get('views'), "{$fields['viewed']} ({$fields['avgviews']})");
         if (isset($wkhtmltopdfOptions) && is_executable($wkhtmltopdfOptions['bin'])) {
             $w->addColumnHtml($key, $this->i18n->get('print'), new CommonPlugin_ImageTag('doc_pdf.png', $this->i18n->get('print to PDF')), new CommonPlugin_PageURL(null, array('listid' => $this->model->listid, 'action' => 'print', 'msgid' => $fields['id'])));
         }
     }
 }
開發者ID:jbenicky,項目名稱:phplist-plugin-statistics,代碼行數:26,代碼來源:Messages.php


注:本文中的WebblerListing::addColumnHtml方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。