Exemplo n.º 1
0
 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));
 }
Exemplo n.º 2
0
 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));
 }
Exemplo n.º 3
0
 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));
     }
 }
Exemplo n.º 4
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?
 }
Exemplo n.º 5
0
 public function show()
 {
     $this->out->elementStart('div', array('id' => 'notices_primary'));
     $total = parent::show();
     $this->out->elementEnd('div');
     return $total;
 }
 function __construct(Notice $notice, Action $out = null, $profile = -1)
 {
     parent::__construct($notice, $out);
     if (is_int($profile) && $profile == -1) {
         $profile = Profile::current();
     }
     $this->userProfile = $profile;
 }
Exemplo n.º 7
0
 /**
  * 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));
 }
Exemplo n.º 8
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));
 }
Exemplo n.º 9
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');
 }
Exemplo n.º 10
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));
 }
Exemplo n.º 11
0
 /**
  * constructor
  *
  * @param Notice $notice stream of notices from DB_DataObject
  */
 function __construct($notice, $out = null)
 {
     parent::__construct($notice, $out);
 }
Exemplo n.º 12
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));
 }
Exemplo n.º 13
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));
 }
Exemplo n.º 14
0
 function __construct($notice, $out = null, $terms)
 {
     parent::__construct($notice, $out);
     $this->terms = $terms;
 }
Exemplo n.º 15
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');
 }
Exemplo n.º 16
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));
     }
 }
Exemplo n.º 17
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);
 }
Exemplo n.º 18
0
 function showNoticeList($notice)
 {
     $nl = new NoticeList($notice, $this);
     return $nl->show();
 }
Exemplo n.º 19
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');
 }
 /**
  * Get notices
  *
  * @return array notices
  */
 function getNotices()
 {
     $notices = array();
     $stream = new PeopletagNoticeStream($this->list);
     $notice = $stream->getNotices(($this->page - 1) * $this->count, $this->count, $this->since_id, $this->max_id);
     $notices = $notice->fetchAll();
     NoticeList::prefill($notices);
     return $notices;
 }
Exemplo n.º 21
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));
 }
Exemplo n.º 22
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));
     }
 }
Exemplo n.º 23
0
Arquivo: tag.php Projeto: 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));
 }
Exemplo n.º 24
0
 function show_notice_list($notice)
 {
     $nl = new NoticeList($notice);
     return $nl->show();
 }
Exemplo n.º 25
0
 /**
  * Get notices
  *
  * @return array notices
  */
 function getNotices()
 {
     $notices = array();
     $profile = $this->auth_user ? $this->auth_user->getProfile() : null;
     $stream = new PublicNoticeStream($profile);
     $notice = $stream->getNotices(($this->page - 1) * $this->count, $this->count, $this->since_id, $this->max_id);
     $notices = $notice->fetchAll();
     NoticeList::prefill($notices);
     return $notices;
 }
Exemplo n.º 26
0
 /**
  * @see	\wcf\data\ISortableAction::validateUpdatePosition()
  */
 public function validateUpdatePosition()
 {
     WCF::getSession()->checkPermissions($this->permissionsUpdate);
     if (!isset($this->parameters['data']['structure']) || !is_array($this->parameters['data']['structure'])) {
         throw new UserInputException('structure');
     }
     $noticeList = new NoticeList();
     $noticeList->getConditionBuilder()->add('notice.noticeID IN (?)', array($this->parameters['data']['structure'][0]));
     if ($noticeList->countObjects() != count($this->parameters['data']['structure'][0])) {
         throw new UserInputException('structure');
     }
     $this->readInteger('offset', true, 'data');
 }
Exemplo n.º 27
0
 /**
  * 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');
 }
Exemplo n.º 28
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');
 }
Exemplo n.º 29
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));
     }
 }
Exemplo n.º 30
0
 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');
 }