/**
  * Render recent activities feed
  *
  * @param void
  * @return null
  */
 function rss()
 {
     if ($this->active_project->isNew()) {
         $this->httpError(HTTP_ERR_NOT_FOUND);
     }
     // if
     require_once ANGIE_PATH . '/classes/feed/init.php';
     $feed = new Feed(lang(':project project', array('project' => $this->active_project->getName())) . ' - ' . lang('Recent activities'), $this->active_project->getOverviewUrl());
     $feed->setDescription(lang('Recent ":project" activities', array('project' => $this->active_project->getName())));
     $activities = ActivityLogs::findProjectActivitiesByUser($this->active_project, $this->logged_user, 50);
     if (is_foreachable($activities)) {
         foreach ($activities as $activity) {
             $object = $activity->getObject();
             $activity_title = $activity_body = $activity->renderHead(null, true);
             $activity_title = strip_tags($activity_title);
             if ($activity->has_body && ($body = trim($activity->renderBody()))) {
                 $activity_body .= $body;
             }
             // if
             $item = new FeedItem($activity_title, $object->getViewUrl(), $activity_body, $activity->getCreatedOn());
             $item->setId(extend_url($object->getViewUrl(), array('guid' => $activity->getId())));
             $feed->addItem($item);
         }
         // foreach
     }
     // if
     print render_rss_feed($feed);
     die;
 }
Пример #2
0
<?php

render_rss_feed('http://diendan.nhipsinhhoc.vn/rss.php', '<span class="translate" data-lang-ja="' . $span_interfaces['forum']['ja'] . '" data-lang-zh="' . $span_interfaces['forum']['zh'] . '" data-lang-es="' . $span_interfaces['forum']['es'] . '" data-lang-ru="' . $span_interfaces['forum']['ru'] . '" data-lang-en="' . $span_interfaces['forum']['en'] . '" data-lang-vi="' . $span_interfaces['forum']['vi'] . '">' . $span_interfaces['forum'][$lang_code] . '</span>', 'feed_forum');
Пример #3
0
<?php

render_rss_feed('https://twitrss.me/twitter_user_to_rss/?user=tungpham42', 'Twitter', 'feed_twitter');
 /**
  * Render RSS feed for a spcific filter
  *
  * @param void
  * @return null
  */
 function rss()
 {
     if ($this->active_filter->isNew()) {
         $this->httpError(HTTP_ERR_NOT_FOUND);
     }
     // if
     if (!$this->active_filter->canUse($this->logged_user)) {
         $this->httpError(HTTP_ERR_FORBIDDEN);
     }
     // if
     require_once ANGIE_PATH . '/classes/feed/init.php';
     $feed = new Feed($this->owner_company->getName() . ' - ' . $this->active_filter->getName(), $this->active_filter->getUrl());
     $assignments = AssignmentFilters::executeFilter($this->logged_user, $this->active_filter, false);
     if (is_foreachable($assignments)) {
         $project_ids = array();
         foreach ($assignments as $assignment) {
             if (!in_array($assignment->getProjectId(), $project_ids)) {
                 $project_ids[] = $assignment->getProjectId();
             }
             // if
         }
         // foreach
         $projects = array();
         if (is_foreachable($project_ids)) {
             $rows = db_execute_all('SELECT id, name FROM ' . TABLE_PREFIX . 'projects WHERE id IN (?)', $project_ids);
             if (is_foreachable($rows)) {
                 foreach ($rows as $row) {
                     $projects[$row['id']] = $row['name'];
                 }
                 // foreach
             }
             // if
         }
         // if
         foreach ($assignments as $assignment) {
             $title = '[' . array_var($projects, $assignment->getProjectId()) . '] ' . $assignment->getVerboseType() . ' "' . $assignment->getName() . '"';
             $this->smarty->assign('_assignment', $assignment);
             $body = $this->smarty->fetch(get_template_path('_feed_body', 'assignment_filters', RESOURCES_MODULE));
             $item = new FeedItem($title, $assignment->getViewUrl(), $body, $assignment->getCreatedOn());
             $item->setId($assignment->getViewUrl());
             $feed->addItem($item);
         }
         // foreach
     }
     // if
     print render_rss_feed($feed);
     die;
 }
 /**
  * Rss for status updates
  * 
  * @param void
  * @return void
  */
 function rss()
 {
     require_once ANGIE_PATH . '/classes/feed/init.php';
     $archive_url = assemble_url('status_updates');
     $selected_user = $this->request->get('user_id');
     if ($selected_user) {
         if (!in_array($selected_user, $this->logged_user->visibleUserIds())) {
             $this->httpError(HTTP_ERR_FORBIDDEN);
         }
         // if
         $user = Users::findById($selected_user);
         if (!instance_of($user, 'User')) {
             $this->httpError(HTTP_ERR_NOT_FOUND);
         }
         // if
         $archive_url = assemble_url('status_updates', array('user_id' => $user->getId()));
         $latest_status_updates = StatusUpdates::findByUser($user, 20);
         $feed = new Feed(lang(":display_name's Status Updates", array('display_name' => $user->getDisplayName())), $archive_url);
     } else {
         $latest_status_updates = StatusUpdates::findVisibleForUser($this->logged_user, 20);
         $feed = new Feed(lang('Status Updates'), $archive_url);
     }
     // if
     if (is_foreachable($latest_status_updates)) {
         foreach ($latest_status_updates as $status_update) {
             $this->smarty->assign(array('status_update' => $status_update));
             $item = new FeedItem(str_excerpt($status_update->getMessage(), 50), $status_update->getViewUrl(), $this->smarty->fetch(get_template_path('feed_item', 'status', STATUS_MODULE)), $status_update->getLastUpdateOn());
             $item->setId($status_update->getId());
             $feed->addItem($item);
         }
         // foreach
     }
     // if
     print render_rss_feed($feed);
     die;
 }
Пример #6
0
<?php

render_rss_feed('http://gplusrss.com/rss/feed/9b23b73555f81ea2fc963e2d85e8c98854c63ec49ab87', 'Google+', 'feed_googleplus');
Пример #7
0
<?php

render_rss_feed('https://www.facebook.com/feeds/page.php?format=rss20&id=1396517020591413', 'Facebook', 'feed_facebook');
 /**
  * Render recent activities feed
  *
  * @param void
  * @return null
  */
 function rss()
 {
     require_once ANGIE_PATH . '/classes/feed/init.php';
     $projects = Projects::findNamesByUser($this->logged_user);
     $feed = new Feed($this->owner_company->getName() . ' - ' . lang('Recent activities'), ROOT_URL);
     $feed->setDescription(lang('Recent activities in active projects'));
     $activities = ActivityLogs::findActiveProjectsActivitiesByUser($this->logged_user, 50);
     if (is_foreachable($activities)) {
         foreach ($activities as $activity) {
             $object = $activity->getObject();
             $activity_title = $activity_body = $activity->renderHead();
             $activity_title = strip_tags($activity_title);
             if ($activity->has_body && ($body = trim($activity->renderBody()))) {
                 $activity_body .= $body;
             }
             // if
             $item = new FeedItem($activity_title, $object->getViewUrl(), $activity_body, $activity->getCreatedOn());
             $item->setId(extend_url($object->getViewUrl(), array('guid' => $activity->getId())));
             $feed->addItem($item);
         }
         // foreach
     }
     // if
     print render_rss_feed($feed);
     die;
 }
Пример #9
0
<?php

render_rss_feed('http://nhipsinhhoc.vn/blog/feed/', '<span class="translate" data-lang-ja="' . $span_interfaces['blog']['ja'] . '" data-lang-zh="' . $span_interfaces['blog']['zh'] . '" data-lang-es="' . $span_interfaces['blog']['es'] . '" data-lang-ru="' . $span_interfaces['blog']['ru'] . '" data-lang-en="' . $span_interfaces['blog']['en'] . '" data-lang-vi="' . $span_interfaces['blog']['vi'] . '">' . $span_interfaces['blog'][$lang_code] . '</span>', 'feed_blog');