public function show()
 {
     $this->out->elementStart('div', array('id' => 'notices_primary'));
     $total = parent::show();
     $this->out->elementEnd('div');
     return $total;
 }
示例#2
0
文件: tag.php 项目: Br3nda/laconica
 function showContent()
 {
     $notice = Notice_tag::getStream($this->tag, ($this->page - 1) * NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
     $nl = new NoticeList($notice, $this);
     $cnt = $nl->show();
     $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'tag', array('tag' => $this->tag));
 }
示例#3
0
文件: all.php 项目: Br3nda/laconica
 function showContent()
 {
     $notice = $this->user->noticesWithFriends(($this->page - 1) * NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
     $nl = new NoticeList($notice, $this);
     $cnt = $nl->show();
     $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'all', array('nickname' => $this->user->nickname));
 }
示例#4
0
文件: tag.php 项目: Grasia/bolotweet
 function showContent()
 {
     if (Event::handle('StartTagShowContent', array($this))) {
         $nl = new NoticeList($this->notice, $this);
         $cnt = $nl->show();
         $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'tag', array('tag' => $this->tag));
         Event::handle('EndTagShowContent', array($this));
     }
 }
示例#5
0
 function showContent()
 {
     $prefs = array();
     foreach (array('addressees', 'attachments', 'maxchars', 'options', 'show_n') as $key) {
         $prefs[$key] = $this->{$key};
     }
     $prefs['id_prefix'] = $this->divId();
     // args: notice object, html outputter, preference array for notice lists and their items
     $list = new NoticeList($this->getNotices(), $this->out, $prefs);
     $total = $list->show();
     // returns total amount of notices available
     return $total > $this->show_n;
     // do we have more to show?
 }
 /**
  * Content area
  *
  * Shows the list of popular notices
  *
  * @return void
  */
 function showContent()
 {
     $groupId = intval($this->group->id);
     $weightexpr = common_sql_weight('fave.modified', common_config('popular', 'dropoff'));
     $cutoff = sprintf("fave.modified > '%s'", common_sql_date(time() - common_config('popular', 'cutoff')));
     $qry = 'SELECT notice.*, ' . $weightexpr . ' as weight ' . 'FROM notice ' . "JOIN group_inbox ON notice.id = group_inbox.notice_id " . 'JOIN fave ON notice.id = fave.notice_id ' . "WHERE {$cutoff} AND group_id = {$groupId} " . 'GROUP BY id,profile_id,uri,content,rendered,url,created,notice.modified,reply_to,is_local,source,notice.conversation ' . 'ORDER BY weight DESC';
     $offset = ($this->page - 1) * NOTICES_PER_PAGE;
     $limit = NOTICES_PER_PAGE + 1;
     if (common_config('db', 'type') == 'pgsql') {
         $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
     } else {
         $qry .= ' LIMIT ' . $offset . ', ' . $limit;
     }
     $notice = Memcached_DataObject::cachedQuery('Notice', $qry, 600);
     $nl = new NoticeList($notice, $this);
     $cnt = $nl->show();
     if ($cnt == 0) {
         //$this->showEmptyList();
     }
     $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'groupfavorited', array('nickname' => $this->group->nickname));
 }
示例#7
0
 /**
  * Show content in the content area
  *
  * The default StatusNet page has a lot of decorations: menus,
  * logos, tabs, all that jazz. This method is used to show
  * content in the content area of the page; it's the main
  * thing you want to overload.
  *
  * This method also demonstrates use of a plural localized string.
  *
  * @return void
  */
 function showContent()
 {
     $nl = new NoticeList($this->notices, $this);
     $cnt = $nl->show();
     if ($cnt == 0) {
         $this->showEmptyList();
     }
     $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'bookmarks', array('nickname' => $this->user->nickname));
 }
示例#8
0
文件: tag.php 项目: himmelex/NTW
 function showContent()
 {
     $nl = new NoticeList($this->notice, $this);
     $cnt = $nl->show();
     $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'tag', array('tag' => $this->tag));
 }
示例#9
0
 /**
  * Fill the content area
  *
  * Shows a list of the notices in the public stream, with some pagination
  * controls.
  *
  * @return void
  */
 function showContent()
 {
     $notice = Notice::publicStream(($this->page - 1) * NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
     if (!$notice) {
         $this->serverError(_('Could not retrieve public stream.'));
         return;
     }
     $nl = new NoticeList($notice, $this);
     $cnt = $nl->show();
     $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'public');
 }
示例#10
0
 /**
  * Content area
  *
  * Shows the list of popular notices
  *
  * @return void
  */
 function showContent()
 {
     $stream = new PopularNoticeStream(Profile::current());
     $notice = $stream->getNotices(($this->page - 1) * NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
     $nl = new NoticeList($notice, $this);
     $cnt = $nl->show();
     if ($cnt == 0) {
         $this->showEmptyList();
     }
     $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'favorited');
 }
示例#11
0
 /**
  * Show the content
  *
  * A list of notices that this user has marked as a favorite
  *
  * @return void
  */
 function showContent()
 {
     $nl = new NoticeList($this->notice, $this);
     $cnt = $nl->show();
     if (0 == $cnt) {
         $this->showEmptyListMessage();
     }
     $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'showfavorites', array('nickname' => $this->user->nickname));
 }
示例#12
0
 /**
  * Show the group notices
  *
  * @return void
  */
 function showGroupNotices()
 {
     $notice = $this->group->getNotices(($this->page - 1) * NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
     $nl = new NoticeList($notice, $this);
     $cnt = $nl->show();
     $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'showgroup', array('nickname' => $this->group->nickname));
 }
示例#13
0
 /**
  * Show main page content.
  *
  * Shows a list of the notices that link to the given URL
  *
  * @return void
  */
 function showContent()
 {
     $nl = new NoticeList($this->notices, $this);
     $nl->show();
     $cnt = $nl->show();
     $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'noticebyurl', array('id' => $this->file->id));
 }
 function showContent()
 {
     $this->elementStart('div', 'qna-full-question');
     $this->raw($this->question->asHTML());
     $answer = $this->question->getAnswers();
     $this->elementStart('div', 'qna-full-question-answers');
     $answerIds = array();
     // @fixme use a filtered stream!
     if (!empty($answer)) {
         while ($answer->fetch()) {
             $answerIds[] = $answer->getNotice()->id;
         }
     }
     if (count($answerIds) > 0) {
         $notice = new Notice();
         $notice->query(sprintf('SELECT notice.* FROM notice WHERE notice.id IN (%s)', implode(',', $answerIds)));
         $nli = new NoticeList($notice, $this);
         $nli->show();
     }
     $user = common_current_user();
     if (!empty($user)) {
         $profile = $user->getProfile();
         $answer = QnA_Question::getAnswer($profile);
         if (empty($answer)) {
             $form = new QnanewanswerForm($this, $this->question, false);
             $form->show();
         }
     }
     $this->elementEnd('div');
     $this->elementEnd('div');
 }
示例#15
0
 function show_notice_list($notice)
 {
     $nl = new NoticeList($notice);
     return $nl->show();
 }
示例#16
0
 function showNotices()
 {
     $pnl = new NoticeList($this->notice, $this);
     $cnt = $pnl->show();
     if (0 == $cnt) {
         $this->showEmptyListMessage();
     }
     $args = array('nickname' => $this->target->getNickname());
     if (!empty($this->tag)) {
         $args['tag'] = $this->tag;
     }
     $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'showstream', $args);
 }
示例#17
0
 function showUserNotices()
 {
     if ($this->error) {
         $this->elementStart('p');
         $this->raw('Volver a <a href=' . common_local_url('gradereport') . '>Grade Reports</a>.');
         $this->elementEnd('p');
     } else {
         $nl = new NoticeList($this->notice, $this);
         $cnt = $nl->show();
         $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'gradeshowuser', array('nickgroup' => $this->group->nickname, 'nickname' => $this->alumno->nickname));
     }
 }
示例#18
0
 function showNotices()
 {
     if (Event::handle('StartShowProfileTagContent', array($this))) {
         $nl = new NoticeList($this->notice, $this);
         $cnt = $nl->show();
         if (0 == $cnt) {
             $this->showEmptyListMessage();
         }
         $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'showprofiletag', array('tag' => $this->peopletag->tag, 'tagger' => $this->tagger->nickname));
         Event::handle('EndShowProfileTagContent', array($this));
     }
 }
示例#19
0
 function showNoticeList($notice)
 {
     $nl = new NoticeList($notice, $this);
     return $nl->show();
 }
示例#20
0
 /**
  * Content area
  *
  * Shows the list of popular notices
  *
  * @return void
  */
 function showContent()
 {
     if (common_config('db', 'type') == 'pgsql') {
         $weightexpr = 'sum(exp(-extract(epoch from (now() - fave.modified)) / %s))';
     } else {
         $weightexpr = 'sum(exp(-(now() - fave.modified) / %s))';
     }
     $qry = 'SELECT notice.*, ' . $weightexpr . ' as weight ' . 'FROM notice JOIN fave ON notice.id = fave.notice_id ' . 'GROUP BY id,profile_id,uri,content,rendered,url,created,notice.modified,reply_to,is_local,source ' . 'ORDER BY weight DESC';
     $offset = ($this->page - 1) * NOTICES_PER_PAGE;
     $limit = NOTICES_PER_PAGE + 1;
     if (common_config('db', 'type') == 'pgsql') {
         $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
     } else {
         $qry .= ' LIMIT ' . $offset . ', ' . $limit;
     }
     $notice = Memcached_DataObject::cachedQuery('Notice', sprintf($qry, common_config('popular', 'dropoff')), 600);
     $nl = new NoticeList($notice, $this);
     $cnt = $nl->show();
     $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'favorited');
 }
示例#21
0
文件: public.php 项目: himmelex/NTW
 /**
  * Fill the content area
  *
  * Shows a list of the notices in the public stream, with some pagination
  * controls.
  *
  * @return void
  */
 function showContent()
 {
     $nl = new NoticeList($this->notice, $this);
     $cnt = $nl->show();
     if ($cnt == 0) {
         $this->showEmptyList();
     }
     $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'public');
 }
示例#22
0
 /**
  * Show the content
  *
  * A list of notices that this user has marked as a favorite
  *
  * @return void
  */
 function showContent()
 {
     $notice = $this->user->favoriteNotices(($this->page - 1) * NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
     if (!$notice) {
         $this->serverError(_('Could not retrieve favorite notices.'));
         return;
     }
     $nl = new NoticeList($notice, $this);
     $cnt = $nl->show();
     $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'showfavorites', array('nickname' => $this->user->nickname));
 }
示例#23
0
 function showContent()
 {
     if (Event::handle('StartShowAllContent', array($this))) {
         $nl = new NoticeList($this->notice, $this);
         $cnt = $nl->show();
         if (0 == $cnt) {
             $this->showEmptyListMessage();
         }
         $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'all', array('nickname' => $this->user->nickname));
         Event::handle('EndShowAllContent', array($this));
     }
 }
示例#24
0
 /**
  * Content area
  *
  * Shows the list of popular notices
  *
  * @return void
  */
 function showContent()
 {
     $pop = new Popularity();
     $pop->offset = ($this->page - 1) * NOTICES_PER_PAGE;
     $pop->limit = NOTICES_PER_PAGE;
     $pop->expiry = 600;
     $notice = $pop->getNotices();
     $nl = new NoticeList($notice, $this);
     $cnt = $nl->show();
     if ($cnt == 0) {
         $this->showEmptyList();
     }
     $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'favorited');
 }