Esempio n. 1
0
function PageMain()
{
    global $TMPL, $LNG, $CONF, $db, $loggedIn, $settings;
    $feed = new feed();
    $feed->db = $db;
    $feed->url = $CONF['url'];
    if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
        $verify = $loggedIn->verify();
        if ($verify['username']) {
            $feed->user = $verify;
            $feed->username = $verify['username'];
            $feed->id = $verify['idu'];
        }
    }
    $feed->per_page = $settings['qperpage'];
    $feed->categories = $feed->getCategories();
    $feed->time = $settings['time'];
    $feed->l_per_post = $settings['lperpost'];
    $TMPL_old = $TMPL;
    $TMPL = array();
    $skin = new skin('shared/rows');
    $rows = '';
    // If the $_GET keyword is empty [user]
    if ($_GET['q'] == '') {
        header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    if ($_GET['filter'] == 'tracks') {
        list($tracks, $error) = $feed->searchTracks(0, $_GET['q']);
        $TMPL['messages'] = $tracks;
    } elseif ($_GET['filter'] == 'playlists') {
        $playlist = $feed->getPlaylists(0, 2, $_GET['q']);
        $error = $feed->showError('no_results', 1);
        $TMPL['messages'] = empty($playlist) ? $error[0] : $playlist;
    } else {
        $TMPL['messages'] = $feed->getSearch(0, $settings['qperpage'], $_GET['q'], $_GET['filter']);
    }
    $rows = $skin->make();
    $skin = new skin('search/sidebar');
    $sidebar = '';
    $TMPL['trending'] = $feed->sidebarTrending($_GET['tag'], 10);
    $TMPL['filters'] = $feed->sidebarFilters($_GET['filter'], $_GET['q']);
    $TMPL['ad'] = generateAd($settings['ad6']);
    $sidebar = $skin->make();
    $TMPL = $TMPL_old;
    unset($TMPL_old);
    $TMPL['top'] = $top;
    $TMPL['rows'] = $rows;
    $TMPL['sidebar'] = $sidebar;
    if (isset($_GET['logout']) == 1) {
        $loggedIn->logOut();
        header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    $TMPL['url'] = $CONF['url'];
    $TMPL['title'] = $LNG['search'] . ' - ' . htmlspecialchars($_GET['q']) . ' - ' . $settings['title'];
    $TMPL['header'] = pageHeader($LNG['search'] . ' - ' . $_GET['q']);
    $skin = new skin('shared/content');
    return $skin->make();
}
Esempio n. 2
0
 /**
  * returns the content of this item
  *
  * @return string content
  */
 public function getContent()
 {
     $contentFromReadability = $this->fetchFromReadability(parent::getLink());
     if ($contentFromReadability === false) {
         return "readability parse error <br />" . parent::getContent();
     }
     return $contentFromReadability;
 }
Esempio n. 3
0
 /**
  * Demonstrates how to parse RSS feeds by using DOMDocument.
  */
 function rss()
 {
     // Parse an external atom feed
     $feed = feed::parse('http://codeigniter.com/feeds/atom/news/');
     // Show debug info
     echo Kohana::debug($feed);
     echo Kohana::lang('core.stats_footer');
 }
Esempio n. 4
0
 /**
  * Demonstrates how to parse RSS feeds by using DOMDocument.
  */
 function rss()
 {
     // Parse an external atom feed
     $feed = feed::parse('http://dev.kohanaphp.com/projects/kohana2/activity.atom');
     // Show debug info
     echo Kohana::debug($feed);
     echo Kohana::lang('core.stats_footer');
 }
Esempio n. 5
0
 /**
  * Demonstrates how to parse RSS feeds by using DOMDocument.
  */
 function rss()
 {
     // Parse an external atom feed
     $feed = feed::parse('feed:http://github.com/feeds/enormego/commits/EightPHP/master');
     // Show debug info
     echo Eight::debug($feed);
     echo Eight::lang('core.stats_footer');
 }
Esempio n. 6
0
 /**
  * returns the content of this item
  *
  * @return string content
  */
 public function getContent()
 {
     $contentFromInstapaper = $this->fetchFromInstapaper(parent::getLink());
     if ($contentFromInstapaper === false) {
         return "instapaper parse error <br />" . parent::getContent();
     }
     return $contentFromInstapaper;
 }
 /**
  * Demonstrates how to parse RSS feeds by using DOMDocument.
  */
 function rss()
 {
     // Parse an external atom feed
     $feed = feed::parse('http://trac.kohanaphp.com/timeline?changeset=on&format=rss');
     // Show debug info
     echo Kohana::debug($feed);
     echo Kohana::lang('core.stats_footer');
 }
Esempio n. 8
0
 /**
  * @test
  *
  * @dataProvider provider_create
  *
  * @covers feed::create
  *
  * @param string  $info     info to pass
  * @param integer $items    items to add
  * @param integer $matcher  output
  */
 public function test_create($info, $items, $enviroment, $matcher_item, $matchers_image)
 {
     $this->setEnvironment($enviroment);
     $this->assertTag($matcher_item, feed::create($info, $items), '', FALSE);
     foreach ($matchers_image as $matcher_image) {
         $this->assertTag($matcher_image, feed::create($info, $items), '', FALSE);
     }
 }
Esempio n. 9
0
 public static function server($server)
 {
     $server = strtolower($server);
     $servers = feed::servers();
     if (in_array($server, array_keys($servers))) {
         return $servers[$server];
     }
     return false;
 }
Esempio n. 10
0
 public function campaigns($limit = 20)
 {
     $this->info['description'] = 'Spicer\'s Campaigns';
     $this->info['lastBuildDate'] = date(DATE_RFC2822, Orm::factory('campaign')->where('status', 'approved')->find()->created);
     $campaigns = Orm::factory('campaign')->where('status', 'approved')->find_all($limit);
     foreach ($campaigns as $campaign) {
         $items[] = array('title' => $campaign->name, 'link' => 'campaigns/view/' . $campaign->name, 'guid' => 'campaigns/view/' . $campaign->name, 'description' => $campaign->description, 'author' => 'admin@spicers.com.au (Spicers)', 'pubDate' => date(DATE_RFC2822, $campaign->created));
     }
     echo feed::create($this->info, $items);
 }
 /**
  * Get all the replies from a specified url
  *
  * @param string $href - replies feed url 
  * @param boolean $formatted - format the data in a more usable manner (my personal opinion)
  * @return array of replies
  */
 public static function get_replies($href, $formatted = true)
 {
     $data = feed::parse($href);
     if (!$formatted) {
         return $data;
     }
     $replies = array();
     // format the data in a more organised manner (personal opinion)
     foreach ($data as $d) {
         $replies[] = array("date" => $d['published'], "content" => $d['content'], "author" => $d['author']);
     }
     return $replies;
 }
Esempio n. 12
0
 static function get($block_id)
 {
     $block = new Block();
     switch ($block_id) {
         case "welcome":
             $block->css_id = "gWelcome";
             $block->title = t("Welcome to Gallery3");
             $block->content = new View("admin_block_welcome.html");
             break;
         case "photo_stream":
             $block->css_id = "gPhotoStream";
             $block->title = t("Photo Stream");
             $block->content = new View("admin_block_photo_stream.html");
             $block->content->photos = ORM::factory("item")->where("type", "photo")->orderby("created", "DESC")->find_all(10);
             break;
         case "log_entries":
             $block->css_id = "gLogEntries";
             $block->title = t("Log Entries");
             $block->content = new View("admin_block_log_entries.html");
             $block->content->entries = ORM::factory("log")->orderby("timestamp", "DESC")->find_all(5);
             break;
         case "stats":
             $block->css_id = "gStats";
             $block->title = t("Gallery Stats");
             $block->content = new View("admin_block_stats.html");
             $block->content->album_count = ORM::factory("item")->where("type", "album")->where("id <>", 1)->count_all();
             $block->content->photo_count = ORM::factory("item")->where("type", "photo")->count_all();
             break;
         case "platform_info":
             $block->css_id = "gPlatform";
             $block->title = t("Platform Information");
             $block->content = new View("admin_block_platform.html");
             if (is_readable("/proc/loadavg")) {
                 $block->content->load_average = join(" ", array_slice(split(" ", array_shift(file("/proc/loadavg"))), 0, 3));
             } else {
                 $block->content->load_average = t("Unavailable");
             }
             break;
         case "project_news":
             $block->css_id = "gProjectNews";
             $block->title = t("Gallery Project News");
             $block->content = new View("admin_block_news.html");
             $block->content->feed = feed::parse("http://gallery.menalto.com/node/feed", 3);
             break;
         case "block_adder":
             $block->css_id = "gBlockAdder";
             $block->title = t("Dashboard Content");
             $block->content = self::get_add_block_form();
     }
     return $block;
 }
Esempio n. 13
0
 /**
  * returns the content of this item
  *
  * @return string content
  */
 public function getContent()
 {
     if ($this->items !== false && $this->valid()) {
         $content = parent::getContent();
         foreach (@current($this->items)->get_enclosures() as $enclosure) {
             if ($enclosure->get_medium() == 'image') {
                 $title = htmlspecialchars(strip_tags($enclosure->get_title()));
                 $content .= '<img src="' . $enclosure->get_link() . '" alt="' . $title . '" title="' . $title . '" />';
             }
         }
         return $content;
     }
     return parent::getContent();
 }
Esempio n. 14
0
 public function index()
 {
     $this->template->content = new View('feed');
     $this->template->title = 'Feed';
     $limit = '0,20';
     if (isset($_POST['limit'])) {
         $limit = $_POST['limit'];
     }
     $messages = Message_Model::get_translated_messages($limit);
     $info = array('notes' => 'This is an RSS feed of the translated SMS messages.');
     $items = array();
     foreach ($messages as $id => $msg) {
         $items[] = array('title' => string_manipulation::xmlentities($msg['sms']), 'link' => 'http://localhost:8888/SMSTurks/feed/' . $id, 'description' => string_manipulation::xmlentities($msg['translation']), 'author' => $msg['number'], 'pubDate' => date('D, d M Y H:i:s O', strtotime($msg['received'])));
     }
     $this->template->content->display = feed::create($info, $items);
 }
Esempio n. 15
0
File: feed.php Progetto: rigidus/ea
    function itunes($array)
    {
        self::$itunes_dtd = 'xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"';
        $itunes = array('explicit' => 'No', 'subtitle' => '', 'author' => '', 'summary' => '', 'image' => '', 'keywords' => '', 'duration' => '');
        $itunes = array_merge($itunes, $array);
        self::$item[self::$index] .= '<itunes:explicit>' . $itunes['explicit'] . '</itunes:explicit>
			<itunes:subtitle>' . $itunes['subtitle'] . '</itunes:subtitle>
			<itunes:author>' . $itunes['author'] . '</itunes:author>
			<itunes:summary>' . $itunes['summary'] . '</itunes:summary>
			<itunes:keywords>' . $itunes['keywords'] . '</itunes:keywords>
			<itunes:duration>' . $itunes['duration'] . '</itunes:duration>
			';
        if ($itunes['image']) {
            self::$item[self::$index] .= '<itunes:image href="' . $itunes['image'] . '" />';
        }
    }
Esempio n. 16
0
 static function get($block_id)
 {
     $block = new Block();
     switch ($block_id) {
         case "welcome":
             $block->css_id = "gWelcome";
             $block->title = t("Welcome to Gallery3");
             $block->content = new View("admin_block_welcome.html");
             break;
         case "photo_stream":
             $block->css_id = "gPhotoStream";
             $block->title = t("Photo Stream");
             $block->content = new View("admin_block_photo_stream.html");
             $block->content->photos = ORM::factory("item")->where("type", "photo")->orderby("created", "desc")->find_all(10);
             break;
         case "log_entries":
             $block->css_id = "gLogEntries";
             $block->title = t("Log Entries");
             $block->content = new View("admin_block_log_entries.html");
             $block->content->entries = ORM::factory("log")->orderby("timestamp", "desc")->find_all(5);
             break;
         case "stats":
             $block->css_id = "gStats";
             $block->title = t("Gallery Stats");
             $block->content = new View("admin_block_stats.html");
             $block->content->album_count = ORM::factory("item")->where("type", "album")->count_all();
             $block->content->photo_count = ORM::factory("item")->where("type", "photo")->count_all();
             break;
         case "platform_info":
             $block->css_id = "gPlatform";
             $block->title = t("Platform Information");
             $block->content = new View("admin_block_platform.html");
             break;
         case "project_news":
             $block->css_id = "gProjectNews";
             $block->title = t("Gallery Project News");
             $block->content = new View("admin_block_news.html");
             $block->content->feed = feed::parse("http://gallery.menalto.com/node/feed", 3);
             break;
         case "block_adder":
             $block->css_id = "gBlockAdder";
             $block->title = t("Dashboard Content");
             $block->content = self::get_add_block_form();
     }
     return $block;
 }
Esempio n. 17
0
 public function comments()
 {
     header('Content-Type: text/xml; charset=UTF-8', TRUE);
     if ($cache = $this->cache->get('s7n_blog_feed_comments')) {
         echo $cache;
         return;
     }
     $comments = ORM::factory('blog_comment')->orderby('id', 'desc')->find_all(20);
     $info = array('title' => config::get('s7n.site_title') . ' (Latest Comments)', 'link' => url::current_site(), 'generator' => 'S7Ncms - http://www.s7n.de/');
     $items = array();
     foreach ($comments as $comment) {
         $items[] = array('author' => html::specialchars($comment->author), 'pubDate' => date('r', strtotime($comment->date)), 'title' => 'New comment for "' . $comment->blog_post->title . '"', 'description' => html::specialchars($comment->content), 'link' => $comment->blog_post->url(), 'guid' => $comment->blog_post->url());
     }
     $feed = feed::create($info, $items);
     $this->cache->set('s7n_blog_feed_comments', $feed);
     echo $feed;
 }
Esempio n. 18
0
			</dl>
<?php		
	if(feed::doesExistXmlURL($feed['xmlURL'])) {
?>			
		<div class="warning_messages_wrap">
			<br />
				<?php echo _t('이 블로그는 이미 등록되어 있어 재등록 하실 수 없습니다.');?>		
			<br /><br />
			<a href="#" class="normalbutton" onclick="history.back(); return false;"><span><?php echo _t('뒤로');?></span></a>

		</div>
<?php
	} else {
		$result = $event->on('Add.getFeed', $xml);
		if(!is_array($result)) {
			$result = feed::getFeedItems($xml);
		}

		requireComponent('Bloglounge.Data.Groups');

		$groups = Group::getGroupsAll();
		$users = User::getMembers();

		if(count($result)>0) {
?>
			<dl>
					<dt><?php echo _t('글');?></dt>
					<dd class="text">
						<?php echo _f('가장 최신의 글 "%1"(을)를 포함한 %2개의 글이 존재합니다.','<span class="point">'.UTF8::lessen($result[0]['title'],40).'</span>', '<span class="cnt">'.count($result).'</span>');?>
					</dd>
			</dl>
Esempio n. 19
0
 /**
  * parse feed and send feed items to database
  */
 private function _parse_feed()
 {
     // Max number of feeds to keep
     $max_feeds = 100;
     // Today's Date
     $today = strtotime('now');
     // Get All Feeds From DB
     $feeds = ORM::factory('feed')->find_all();
     foreach ($feeds as $feed) {
         $last_update = $feed->feed_update;
         // Has it been more than 24 hours since the last update?
         // Since its a manual refresh, we don't need to set a time
         if ((int) $today - (int) $last_update > 0) {
             // Parse Feed URL using Feed Helper
             $feed_data = feed::simplepie($feed->feed_url);
             foreach ($feed_data->get_items(0, 50) as $feed_data_item) {
                 $title = $feed_data_item->get_title();
                 $link = $feed_data_item->get_link();
                 $description = $feed_data_item->get_description();
                 $date = $feed_data_item->get_date();
                 $latitude = $feed_data_item->get_latitude();
                 $longitude = $feed_data_item->get_longitude();
                 // Make Sure Title is Set (Atleast)
                 if (isset($title) && !empty($title)) {
                     // We need to check for duplicates!!!
                     // Maybe combination of Title + Date? (Kinda Heavy on the Server :-( )
                     $dupe_count = ORM::factory('feed_item')->where('item_title', $title)->where('item_date', date("Y-m-d H:i:s", strtotime($date)))->count_all();
                     if ($dupe_count == 0) {
                         // Does this feed have a location??
                         $location_id = 0;
                         // STEP 1: SAVE LOCATION
                         if ($latitude && $longitude) {
                             $location = new Location_Model();
                             $location->location_name = Kohana::lang('ui_admin.unknown');
                             $location->latitude = $latitude;
                             $location->longitude = $longitude;
                             $location->location_date = date("Y-m-d H:i:s", time());
                             $location->save();
                             $location_id = $location->id;
                         }
                         $newitem = new Feed_Item_Model();
                         $newitem->feed_id = $feed->id;
                         $newitem->location_id = $location_id;
                         $newitem->item_title = $title;
                         if (isset($description) && !empty($description)) {
                             $newitem->item_description = $description;
                         }
                         if (isset($link) && !empty($link)) {
                             $newitem->item_link = $link;
                         }
                         if (isset($date) && !empty($date)) {
                             $newitem->item_date = date("Y-m-d H:i:s", strtotime($date));
                         } else {
                             $newitem->item_date = date("Y-m-d H:i:s", time());
                         }
                         if (isset($feed_type) && !empty($feed_type)) {
                             $newitem->feed_type = $feed_type;
                         }
                         $newitem->save();
                     }
                 }
             }
             // Get Feed Item Count
             $feed_count = ORM::factory('feed_item')->where('feed_id', $feed->id)->count_all();
             if ($feed_count > $max_feeds) {
                 // Excess Feeds
                 $feed_excess = $feed_count - $max_feeds;
                 // Delete Excess Feeds
                 foreach (ORM::factory('feed_item')->where('feed_id', $feed->id)->orderby('id', 'ASC')->limit($feed_excess)->find_all() as $del_feed) {
                     $del_feed->delete($del_feed->id);
                 }
             }
             // Set feed update date
             $feed->feed_update = strtotime('now');
             $feed->save();
         }
     }
 }
Esempio n. 20
0
function PageMain()
{
    global $TMPL, $LNG, $CONF, $db, $loggedIn, $settings;
    if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
        $verify = $loggedIn->verify();
        if (empty($verify['username'])) {
            // If fake cookies are set, or they are set wrong, delete everything and redirect to home-page
            $loggedIn->logOut();
            header("Location: " . $CONF['url'] . "/index.php?a=welcome");
        } else {
            // Start displaying the Feed
            $feed = new feed();
            $feed->db = $db;
            $feed->url = $CONF['url'];
            $feed->user = $verify;
            $feed->id = $verify['idu'];
            $feed->username = $verify['username'];
            $feed->per_page = $settings['perpage'];
            $feed->time = $settings['time'];
            $feed->censor = $settings['censor'];
            $feed->smiles = $settings['smiles'];
            $feed->c_per_page = $settings['cperpage'];
            $feed->c_start = 0;
            $feed->l_per_post = $settings['lperpost'];
            $feed->online_time = $settings['conline'];
            $feed->friends_online = $settings['ronline'];
            $feed->subscriptionsList = $feed->getSubs($verify['idu'], 0);
            $feed->subscribersList = $feed->getSubs($verify['idu'], 1);
            $feed->updateStatus($verify['offline']);
            // Useed in timeline javascript which checks for new messages
            $TMPL['subs'] = 1;
            $TMPL_old = $TMPL;
            $TMPL = array();
            $skin = new skin('shared/rows');
            $rows = '';
            if (empty($_GET['filter'])) {
                $_GET['filter'] = '';
            }
            // Allowed types
            list($timeline, $message) = $feed->getFeed(0, $_GET['filter']);
            $TMPL['messages'] = $timeline;
            $rows = $skin->make();
            $skin = new skin('feed/sidebar');
            $sidebar = '';
            $TMPL['editprofile'] = $feed->fetchProfileWidget($verify['username'], realName($verify['username'], $verify['first_name'], $verify['last_name']), $verify['image']);
            $TMPL['sidebar'] = $feed->sidebarTypes($_GET['filter'], $feed->subscriptions);
            $TMPL['dates'] = $feed->sidebarDates($_GET['filter'], $feed->subscriptions);
            $TMPL['trending'] = $feed->sidebarTrending($_GET['tag'], 5);
            $TMPL['users'] = $feed->onlineUsers();
            $TMPL['subscriptions'] = $feed->sidebarSubs(0, 0);
            $TMPL['subscribers'] = $feed->sidebarSubs(1, 0);
            $TMPL['friendsactivity'] = $feed->sidebarFriendsActivity(20, 1);
            if (count($feed->subscriptionsList[0]) < 6) {
                $TMPL['suggestions'] = $feed->sidebarSuggestions();
            }
            $TMPL['ad'] = generateAd($settings['ad3']);
            $sidebar = $skin->make();
            $skin = new skin('shared/top');
            $top = '';
            // $TMPL['top'] = $feed->getForm();
            $TMPL['theme_url'] = $CONF['theme_url'];
            $TMPL['private_message'] = $verify['privacy'];
            $TMPL['avatar'] = $verify['image'];
            $TMPL['url'] = $CONF['url'];
            $top = $skin->make();
            $TMPL = $TMPL_old;
            unset($TMPL_old);
            $TMPL['top'] = $top;
            $TMPL['rows'] = $rows;
            $TMPL['sidebar'] = $sidebar;
            // If the username input string is an e-mail, switch the query
            if (isset($_SESSION['username'])) {
                if (filter_var($_SESSION['username'], FILTER_VALIDATE_EMAIL)) {
                    $result = $db->query("SELECT * FROM `users` WHERE `email` = '" . $_SESSION['username'] . "' AND `password` = '" . $_SESSION['password'] . "'");
                } else {
                    $result = $db->query("SELECT * FROM `users` WHERE `username` = '" . $_SESSION['username'] . "' AND `password` = '" . $_SESSION['password'] . "'");
                }
            } elseif (isset($_COOKIE['username'])) {
                if (filter_var($_COOKIE['username'], FILTER_VALIDATE_EMAIL)) {
                    $result = $db->query("SELECT * FROM `users` WHERE `email` = '" . $_COOKIE['username'] . "' AND `password` = '" . $_COOKIE['password'] . "'");
                } else {
                    $result = $db->query("SELECT * FROM `users` WHERE `username` = '" . $_COOKIE['username'] . "' AND `password` = '" . $_COOKIE['password'] . "'");
                }
            }
            while ($row = $result->fetch_assoc()) {
                $status = $row['status'];
            }
            if ($status == 0) {
                header("Location: " . $CONF['url'] . "/index.php?a=contact");
            } elseif ($status == 1) {
                header("Location: " . $CONF['url'] . "/index.php?a=employee");
            }
        }
    } else {
        // If the session or cookies are not set, redirect to home-page
        header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    if (isset($_GET['logout']) == 1) {
        $loggedIn->logOut();
        header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    $TMPL['url'] = $CONF['url'];
    $TMPL['title'] = $LNG['title_feed'] . ' - ' . $settings['title'];
    $skin = new skin('shared/timeline');
    return $skin->make();
}
Esempio n. 21
0
 /**
  * parse feed and send feed items to database
  */
 public function index()
 {
     // Max number of feeds to keep
     $max_feeds = 100;
     // Today's Date
     $today = strtotime('now');
     // Get All Feeds From DB
     $feeds = ORM::factory('feed')->find_all();
     foreach ($feeds as $feed) {
         $last_update = $feed->feed_update;
         // Parse Feed URL using Feed Helper
         $feed_data = feed::simplepie($feed->feed_url);
         foreach ($feed_data->get_items(0, 50) as $feed_data_item) {
             $title = $feed_data_item->get_title();
             $link = $feed_data_item->get_link();
             $description = $feed_data_item->get_description();
             $date = $feed_data_item->get_date();
             $latitude = $feed_data_item->get_latitude();
             $longitude = $feed_data_item->get_longitude();
             $categories = $feed_data_item->get_categories();
             // HT: new code
             $category_ids = new stdClass();
             // HT: new code
             // Make Sure Title is Set (Atleast)
             if (isset($title) && !empty($title)) {
                 // We need to check for duplicates!!!
                 // Maybe combination of Title + Date? (Kinda Heavy on the Server :-( )
                 $dupe_count = ORM::factory('feed_item')->where('item_title', $title)->where('item_date', date("Y-m-d H:i:s", strtotime($date)))->count_all();
                 if ($dupe_count == 0) {
                     // Does this feed have a location??
                     $location_id = 0;
                     // STEP 1: SAVE LOCATION
                     if ($latitude and $longitude) {
                         $location = new Location_Model();
                         $location->location_name = "Unknown";
                         $location->latitude = $latitude;
                         $location->longitude = $longitude;
                         $location->location_date = date("Y-m-d H:i:s", time());
                         $location->save();
                         $location_id = $location->id;
                     }
                     $newitem = new Feed_Item_Model();
                     $newitem->feed_id = $feed->id;
                     $newitem->location_id = $location_id;
                     $newitem->item_title = $title;
                     if (isset($description) and !empty($description)) {
                         $newitem->item_description = $description;
                     }
                     if (isset($link) and !empty($link)) {
                         $newitem->item_link = $link;
                     }
                     if (isset($date) and !empty($date)) {
                         $newitem->item_date = date("Y-m-d H:i:s", strtotime($date));
                     } else {
                         $newitem->item_date = date("Y-m-d H:i:s", time());
                     }
                     // HT: new code
                     if (!empty($categories)) {
                         foreach ($categories as $category) {
                             $categoryData = ORM::factory('category')->where('category_title', $category->term)->find();
                             if ($categoryData->loaded == TRUE) {
                                 $category_ids->feed_item_category[$categoryData->id] = $categoryData->id;
                             } elseif (Kohana::config('settings.allow_feed_category')) {
                                 $newcategory = new Category_Model();
                                 $newcategory->category_title = $category->term;
                                 $newcategory->parent_id = 0;
                                 $newcategory->category_description = $category->term;
                                 $newcategory->category_color = '000000';
                                 $newcategory->category_visible = 0;
                                 $newcategory->save();
                                 $category_ids->feed_item_category[$newcategory->id] = $newcategory->id;
                             }
                         }
                     }
                     // HT: End of new code
                     $newitem->save();
                     // HT: New code
                     if (!empty($category_ids->feed_item_category)) {
                         feed::save_category($category_ids, $newitem);
                     }
                     // HT: End of New code
                     // Action::feed_item_add - Feed Item Received!
                     Event::run('ushahidi_action.feed_item_add', $newitem);
                 }
             }
         }
         // Get Feed Item Count
         $feed_count = ORM::factory('feed_item')->where('feed_id', $feed->id)->count_all();
         if ($feed_count > $max_feeds) {
             // Excess Feeds
             $feed_excess = $feed_count - $max_feeds;
         }
         // Set feed update date
         $feed->feed_update = strtotime('now');
         $feed->save();
     }
 }
Esempio n. 22
0
function PageMain()
{
    global $TMPL, $LNG, $CONF, $db, $loggedIn, $settings;
    $_GET['u'] = htmlspecialchars($_GET['u']);
    if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
        $verify = $loggedIn->verify();
        if (empty($verify['username'])) {
            // If fake cookies are set, or they are set wrong, delete everything and redirect to home-page
            $loggedIn->logOut();
            header("Location: " . $CONF['url'] . "/index.php?a=welcome");
        }
        // If the $_GET user is empty, define default user as current logged in user, else redirect to home-page
        if ($_GET['u'] == '') {
            $_GET['u'] = !empty($verify['username']) ? $verify['username'] : header("Location: " . $CONF['url'] . "/index.php?a=welcome");
        }
    }
    // Start displaying the Feed
    $feed = new feed();
    $feed->db = $db;
    $feed->url = $CONF['url'];
    $feed->user = $verify;
    $feed->id = $verify['idu'];
    $feed->username = $verify['username'];
    $feed->per_page = $settings['perpage'];
    $feed->categories = $feed->getCategories();
    $feed->time = $settings['time'];
    $feed->c_per_page = $settings['cperpage'];
    $feed->c_start = 0;
    $feed->l_per_post = $settings['lperpost'];
    if ($verify['username']) {
        $feed->updateStatus($verify['offline']);
    }
    // If the $_GET user is empty, define default user as current logged in user, else redirect to home-pag
    if ($_GET['u'] == '') {
        $_GET['u'] = !empty($feed->username) ? $feed->username : header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    $feed->profile = $_GET['u'];
    $feed->profile_data = $feed->profileData($_GET['u']);
    $feed->subscriptionsList = $feed->getSubs($feed->profile_data['idu'], 0, null);
    $feed->subscribersList = $feed->getSubs($feed->profile_data['idu'], 1, null);
    $TMPL_old = $TMPL;
    $TMPL = array();
    $skin = new skin('shared/rows');
    $rows = '';
    if (empty($_GET['filter'])) {
        $_GET['filter'] = '';
    }
    // Allowed types
    list($timeline, $message) = $feed->getProfile(0, $_GET['filter']);
    if ($_GET['r'] == 'subscriptions') {
        if ($message !== 1) {
            $feed->s_per_page = $settings['sperpage'];
            $feed->subsList = $feed->getSubs($feed->profile_data['idu'], 0, 0);
            $TMPL['messages'] = $feed->listSubs(0);
        } else {
            $TMPL['messages'] = $timeline;
        }
        $title = $LNG['subscriptions'];
    } elseif ($_GET['r'] == 'subscribers') {
        if ($message !== 1) {
            $feed->s_per_page = $settings['sperpage'];
            $feed->subsList = $feed->getSubs($feed->profile_data['idu'], 1, 0);
            $TMPL['messages'] = $feed->listSubs(1);
        } else {
            $TMPL['messages'] = $timeline;
        }
        $title = $LNG['subscribers'];
    } elseif ($_GET['r'] == 'likes') {
        if ($message !== 1) {
            $likes = $feed->getLikes(0, 1);
            $TMPL['messages'] = $likes[0];
        } else {
            $TMPL['messages'] = $timeline;
        }
        $title = $LNG['likes'];
    } elseif ($_GET['r'] == 'playlists') {
        if ($message !== 1) {
            $TMPL['messages'] = $feed->getPlaylists(0, 1);
        } else {
            $TMPL['messages'] = $timeline;
        }
        $title = $LNG['playlists'];
    } else {
        $TMPL['messages'] = $timeline;
    }
    $rows = $skin->make();
    $skin = new skin('profile/sidebar');
    $sidebar = '';
    // If the username doesn't exist
    if ($message !== 1) {
        $TMPL['about'] = $feed->fetchProfileInfo($feed->profileData($_GET['u']));
        $TMPL['dates'] = $feed->sidebarDates($_GET['filter'], 'profile');
        $TMPL['ad'] = generateAd($settings['ad4']);
    } else {
        $skin = new skin('profile/sidebar');
        $sidebar = '';
        $TMPL['ad'] = generateAd($settings['ad4']);
    }
    $sidebar = $skin->make();
    $TMPL = $TMPL_old;
    unset($TMPL_old);
    $TMPL['rows'] = $rows;
    $TMPL['sidebar'] = $sidebar;
    $TMPL['cover'] = $feed->fetchProfile($feed->profile_data);
    if (isset($_GET['logout']) == 1) {
        $loggedIn->logOut();
        header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    $TMPL['url'] = $CONF['url'];
    $TMPL['title'] = (!empty($title) ? $title : $LNG['title_profile']) . ' - ' . realName($_GET['u'], $feed->profile_data['first_name'], $feed->profile_data['last_name'], 1) . ' - ' . $settings['title'];
    $TMPL['meta_description'] = realName($_GET['u'], $feed->profile_data['first_name'], $feed->profile_data['last_name'], 1) . ' ' . $feed->profile_data['description'];
    $skin = new skin('shared/content');
    return $skin->make();
}
Esempio n. 23
0
<?php 
include "../includes/config.php";
include "../includes/classes.php";
require_once getLanguage(null, !empty($_GET['lang']) ? $_GET['lang'] : $_COOKIE['lang'], 2);
session_start();
$db = new mysqli($CONF['host'], $CONF['user'], $CONF['pass'], $CONF['name']);
if ($db->connect_errno) {
    echo "Failed to connect to MySQL: (" . $db->connect_errno . ") " . $db->connect_error;
}
$db->set_charset("utf8");
$resultSettings = $db->query(getSettings());
$settings = $resultSettings->fetch_assoc();
// The theme complete url
$CONF['theme_url'] = $CONF['theme_path'] . '/' . $settings['theme'];
if (isset($_POST['start']) && isset($_POST['q']) && ctype_digit($_POST['start'])) {
    $feed = new feed();
    $feed->db = $db;
    $feed->url = $CONF['url'];
    if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
        $loggedIn = new loggedIn();
        $loggedIn->db = $db;
        $loggedIn->url = $CONF['url'];
        $loggedIn->username = isset($_SESSION['username']) ? $_SESSION['username'] : $_COOKIE['username'];
        $loggedIn->password = isset($_SESSION['password']) ? $_SESSION['password'] : $_COOKIE['password'];
        $verify = $loggedIn->verify();
        $feed->username = $verify['username'];
        $feed->id = $verify['idu'];
        $feed->online_time = $settings['conline'];
        if (!empty($_POST['list'])) {
            echo $feed->onlineUsers(2, $_POST['q']);
            return;
Esempio n. 24
0
 public function getitems()
 {
     $items = array();
     if ($album = @$this->options['album']) {
         if ($image = @$this->options['image']) {
             if (!is_array($image)) {
                 $image = array($image);
             }
             foreach ($image as $filename) {
                 $obj = newImage(NULL, array('folder' => $album, 'filename' => $filename), true);
                 if ($obj->exists) {
                     $items[] = $obj;
                 }
             }
         } else {
             if (!is_array($album)) {
                 $album = array($album);
             }
             foreach ($album as $folder) {
                 $obj = newAlbum($folder, true);
                 if ($obj->exists) {
                     $items[] = $obj;
                 }
             }
         }
         return $items;
     }
     if ($this->feedtype == 'news' && ($news = @$this->options['titlelink'])) {
         if (!is_array($news)) {
             $news = array($news);
         }
         foreach ($news as $article) {
             $obj = new ZenpageNews($article, false);
             if ($obj->loaded) {
                 $items[] = array('titlelink' => $article);
             }
         }
         return $items;
     }
     if ($this->feedtype == 'pages' && ($pages = @$this->options['titlelink'])) {
         if (!is_array($pages)) {
             $pages = array($pages);
         }
         foreach ($pages as $page) {
             $obj = new ZenpagePage($page, false);
             if ($obj->loaded) {
                 $items[] = array('titlelink' => $page);
             }
         }
         return $items;
     }
     return parent::getitems();
 }
Esempio n. 25
0
function PageMain()
{
    global $TMPL, $LNG, $CONF, $db, $loggedIn, $settings;
    if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
        $verify = $loggedIn->verify();
        if (empty($verify['username'])) {
            // If fake cookies are set, or they are set wrong, delete everything and redirect to home-page
            $loggedIn->logOut();
            header("Location: " . $CONF['url'] . "/index.php?a=welcome");
        } else {
            $feed = new feed();
            $feed->db = $db;
            $feed->url = $CONF['url'];
            $feed->user = $verify;
            $feed->id = $verify['idu'];
            $feed->username = $verify['username'];
            $feed->time = $settings['time'];
            $feed->updateStatus($verify['offline']);
            $TMPL_old = $TMPL;
            $TMPL = array();
            $skin = new skin('track/edit');
            $rows = '';
            $TMPL['url'] = $CONF['url'];
            $TMPL['page_title'] = $LNG['upload'];
            $TMPL['form_url'] = $CONF['url'] . '/requests/post_track.php';
            $feed->art_size = $settings['artsize'];
            $feed->art_format = $settings['artformat'];
            $feed->paypalapp = $settings['paypalapp'];
            $feed->track_size_total = $feed->getProStatus($feed->id, 1) ? $settings['protracktotal'] : $settings['tracksizetotal'];
            $feed->track_size = $feed->getProStatus($feed->id, 1) ? $settings['protracksize'] : $settings['tracksize'];
            $feed->track_format = $settings['trackformat'];
            $TMPL['art'] = 'default.png';
            $date = explode('-', $TMPL['release']);
            $TMPL['years'] = generateDateForm(0, $date[0]);
            $TMPL['months'] = generateDateForm(1, $date[1]);
            $TMPL['days'] = generateDateForm(2, $date[2]);
            // Se the download to off by default
            $TMPL['doff'] = ' selected="selected"';
            // Set the visiblity to public by default
            $TMPL['pon'] = ' selected="selected"';
            if ($TMPL['license'] == 0) {
                $TMPL['ar'] = 'checked';
            } else {
                $TMPL['cc'] = 'checked';
                $license = str_split($TMPL['license']);
                $TMPL['nc'] = $license[1];
                $TMPL['nd_sa'] = $license[2];
            }
            $TMPL['display'] = 'inhert';
            $TMPL['onclick'] = 'startUpload()';
            $TMPL['btntext'] = $LNG['upload'];
            $rows = $skin->make();
            $skin = new skin('upload/sidebar');
            $sidebar = '';
            $TMPL['statistics'] = $feed->sidebarStatistics(null, 2);
            $TMPL['go_pro'] = $feed->goProMessage(1, 1);
            $sidebar = $skin->make();
            $TMPL = $TMPL_old;
            unset($TMPL_old);
            $TMPL['rows'] = $rows;
            $TMPL['sidebar'] = $sidebar;
        }
    } else {
        // If the session or cookies are not set, redirect to home-page
        header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    if (isset($_GET['logout']) == 1) {
        $loggedIn->logOut();
        header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    $TMPL['url'] = $CONF['url'];
    $TMPL['title'] = $LNG['upload'] . ' - ' . $settings['title'];
    $skin = new skin('upload/content');
    return $skin->make();
}
Esempio n. 26
0
<?php 
include "../includes/config.php";
include "../includes/classes.php";
require_once getLanguage(null, !empty($_GET['lang']) ? $_GET['lang'] : $_COOKIE['lang'], 2);
session_start();
$db = new mysqli($CONF['host'], $CONF['user'], $CONF['pass'], $CONF['name']);
if ($db->connect_errno) {
    echo "Failed to connect to MySQL: (" . $db->connect_errno . ") " . $db->connect_error;
}
$db->set_charset("utf8");
$resultSettings = $db->query(getSettings());
$settings = $resultSettings->fetch_assoc();
// The theme complete url
$CONF['theme_url'] = $CONF['theme_path'] . '/' . $settings['theme'];
if (isset($_POST['start']) && ctype_digit($_POST['start'])) {
    $feed = new feed();
    $feed->db = $db;
    $feed->url = $CONF['url'];
    if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
        $loggedIn = new loggedIn();
        $loggedIn->db = $db;
        $loggedIn->url = $CONF['url'];
        $loggedIn->username = isset($_SESSION['username']) ? $_SESSION['username'] : $_COOKIE['username'];
        $loggedIn->password = isset($_SESSION['password']) ? $_SESSION['password'] : $_COOKIE['password'];
        $verify = $loggedIn->verify();
        $feed->user = $verify;
        $feed->username = $verify['username'];
        $feed->id = $verify['idu'];
    }
    $feed->per_page = $settings['perpage'];
    $feed->c_per_page = $settings['cperpage'];
Esempio n. 27
0
 /**
  * returns the content of this item
  *
  * @return string content
  */
 public function getContent()
 {
     $start_marker = "<!-- Artikel -->";
     $end_marker = "<!-- NOPRINT Start -->";
     if ($this->items !== false && $this->valid()) {
         $originalContent = @file_get_contents($this->getLink());
         if ($originalContent) {
             $originalContent = mb_convert_encoding($originalContent, 'UTF-8', 'ISO-8859-1');
             // cut the article from the page
             $text_start_pos = strpos($originalContent, $start_marker);
             $text_end_pos = strrpos($originalContent, $end_marker);
             if ($text_start_pos != False && $text_end_pos != False) {
                 $content = substr($originalContent, $text_start_pos + strlen($start_marker), $text_end_pos - $text_start_pos - strlen($start_marker));
                 // remove most html coding and return result
                 return htmLawed($content, $this->htmLawedConfig);
             }
         }
     }
     return parent::getContent();
 }
$db = new mysqli($CONF['host'], $CONF['user'], $CONF['pass'], $CONF['name']);
if ($db->connect_errno) {
    echo "Failed to connect to MySQL: (" . $db->connect_errno . ") " . $db->connect_error;
}
$db->set_charset("utf8");
$resultSettings = $db->query(getSettings());
$settings = $resultSettings->fetch_assoc();
// The theme complete url
$CONF['theme_url'] = $CONF['theme_path'] . '/' . $settings['theme'];
if (!empty($_POST['id']) && !empty($_POST['start']) && !empty($_POST['cid'])) {
    if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
        $loggedIn = new loggedIn();
        $loggedIn->db = $db;
        $loggedIn->url = $CONF['url'];
        $loggedIn->username = isset($_SESSION['username']) ? $_SESSION['username'] : $_COOKIE['username'];
        $loggedIn->password = isset($_SESSION['password']) ? $_SESSION['password'] : $_COOKIE['password'];
        $verify = $loggedIn->verify();
    }
    $feed = new feed();
    $feed->db = $db;
    $feed->url = $CONF['url'];
    $feed->censor = $settings['censor'];
    $feed->smiles = $settings['smiles'];
    $feed->time = $settings['time'];
    // Verify if it's logged in, then send the username to the class property to determine if any buttons is shown
    if ($verify['username']) {
        $feed->username = $verify['username'];
    }
    $feed->c_per_page = $settings['cperpage'];
    echo $feed->getComments($_POST['id'], $_POST['cid'], $_POST['start']);
}
$db->delete("AdCode");
$db->insert("AdCode", "site,clientid,format,locale,code,codeType,impRemaining,status", "'smallBanner','0','smallBanner','homeSmallBanner','<html><head>\n\t<script type=\"text/javascript\" src=\"http://partner.googleadservices.com/gampad/google_service.js\">\n\t</script>\n\t<script type=\"text/javascript\">\n\t  GS_googleAddAdSenseService(\"ca-pub-9975156792632579\");\n\t  GS_googleEnableAllServices();\n\t</script>\n\t<script type=\"text/javascript\">\n\t  GA_googleAddSlot(\"ca-pub-9975156792632579\", \"Needle_Small\");\n\t</script>\n\t<script type=\"text/javascript\">\n\t  GA_googleFetchAds();\n\t</script>\n\t</head>\n\t<body>\n\t<script type=\"text/javascript\">\n\t  GA_googleFillSlot(\"Needle_Small\");\n\t</script>\n\t</body>\n\t</html>','iframe','0','active'");
$db->insert("AdCode", "site,clientid,format,locale,code,codeType,impRemaining,status", "'smallBanner','0','smallBanner','anySmallBanner','<html><head>\n\t<script type=\"text/javascript\" src=\"http://partner.googleadservices.com/gampad/google_service.js\">\n\t</script>\n\t<script type=\"text/javascript\">\n\t  GS_googleAddAdSenseService(\"ca-pub-9975156792632579\");\n\t  GS_googleEnableAllServices();\n\t</script>\n\t<script type=\"text/javascript\">\n\t  GA_googleAddSlot(\"ca-pub-9975156792632579\", \"Needle_Small\");\n\t</script>\n\t<script type=\"text/javascript\">\n\t  GA_googleFetchAds();\n\t</script>\n\t</head>\n\t<body>\n\t<script type=\"text/javascript\">\n\t  GA_googleFillSlot(\"Needle_Small\");\n\t</script>\n\t</body>\n\t</html>','iframe','0','active'");
$db->insert("AdCode", "site,clientid,format,locale,code,codeType,impRemaining,status", "'largeBanner','0','largeBanner','anyLargeBanner','<html><head>\n\t<script type=\"text/javascript\" src=\"http://partner.googleadservices.com/gampad/google_service.js\"></script>\n\t<script type=\"text/javascript\">\n\t  GS_googleAddAdSenseService(\"ca-pub-9975156792632579\");\n\t  GS_googleEnableAllServices();\n\t</script>\n\t<script type=\"text/javascript\">\n\t  GA_googleAddSlot(\"ca-pub-9975156792632579\", \"AnyLargeBanner\");\n\t</script>\n\t<script type=\"text/javascript\">\n\t  GA_googleFetchAds();\n\t</script>\n\t</head>\n\t<body>\n\t<script type=\"text/javascript\">\n\t  GA_googleFillSlot(\"AnyLargeBanner\");\n\t</script></body></html>','iframe','0','active'");
$db->insert("AdCode", "site,clientid,format,locale,code,codeType,impRemaining,status", "'skyscraper','0','skyscraper','anySkyscraper','<html><head><script type=\\'text/javascript\\' src=\\'http://partner.googleadservices.com/gampad/google_service.js\\'>\n\t</script>\n\t<script type=\\'text/javascript\\'>\n\t  GS_googleAddAdSenseService(\\'ca-pub-9975156792632579\\');\n\t  GS_googleEnableAllServices();\n\t</script>\n\t<script type=\\'text/javascript\\'>\n\t  GA_googleAddSlot(\\'ca-pub-9975156792632579\\', \\'Needly_Skyscraper\\');\n\t</script>\n\t<script type=\\'text/javascript\\'>\n\t  GA_googleFetchAds();\n\t</script></head><body>\n\t<script type=\\'text/javascript\\'>\n\t  GA_googleFillSlot(\\'Needly_Skyscraper\\');\n\t</script></body></html>','iframe','0','active'");
// Add news feed
$db->delete("Feeds", "rss='http://www.csmonitor.com/rss/top.rss'");
$db->insert("Feeds", "wireid,title,url,rss,lastFetch,feedType,specialType,loadoptions,userid,tagList", "0,'Christian Science Monitor','http://www.csmonitor.com','http://www.csmonitor.com/rss/top.rss','date_sub(NOW(), INTERVAL 3 DAY)','wire','default','none',0,''");
if (defined('ENABLE_IMAGES') and ENABLE_IMAGES) {
    $db->delete("Feeds", "rss='http://api.flickr.com/services/feeds/photos_public.gne?id=44917946@N03&lang=en-us&format=atom'");
    $db->insert("Feeds", "wireid,title,url,rss,lastFetch,feedType,specialType,loadoptions,userid,tagList", "0,'Flickr Default Pool','http://www.flickr.com/photos/44917946@N03/','http://api.flickr.com/services/feeds/photos_public.gne?id=44917946@N03&lang=en-us&format=atom','date_sub(NOW(), INTERVAL 30 DAY)','images','flickrContent','all',0,''");
}
// Fetch newswire articles
echo 'Reading in newswire feed...<br />';
require_once SRC_ROOT . '/core/classes/feed.class.php';
$feedObj = new feed($db);
$feedObj->fetchFeeds();
echo 'Completed newswire fetch...<br />';
if (defined('ENABLE_IMAGES') and ENABLE_IMAGES) {
    echo 'Reading in media flickr feed...<br />';
    $feedObj->fetchImages();
    echo 'Completed media flickr fetch...<br />';
}
// Populate Micro blog twitter room
if (defined('ENABLE_MICRO')) {
    if (TWITTER_USER == '' or TWITTER_PWD == '') {
        echo 'Please set TWITTER_USER and TWITTER_PWD in your constants.php file and/or .ini file <br />';
    } else {
        echo 'Reading in twitter accounts...<br />';
        // sync twitter service accounts for micro blog room - done daily
        require_once PATH_FACEBOOK . "/classes/micro.class.php";
Esempio n. 30
0
function PageMain()
{
    global $TMPL, $LNG, $CONF, $db, $loggedIn, $settings;
    if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
        $verify = $loggedIn->verify();
        if (empty($verify['username'])) {
            // If fake cookies are set, or they are set wrong, delete everything and redirect to home-page
            $loggedIn->logOut();
            header("Location: " . $CONF['url'] . "/index.php?a=welcome");
        } else {
            // Start displaying the Feed
            $feed = new feed();
            $feed->db = $db;
            $feed->url = $CONF['url'];
            $feed->user = $verify;
            $feed->id = $verify['idu'];
            $feed->username = $verify['username'];
            $feed->per_page = $settings['perpage'];
            $feed->time = $settings['time'];
            $feed->censor = $settings['censor'];
            $feed->smiles = $settings['smiles'];
            $feed->c_per_page = $settings['cperpage'];
            $feed->c_start = 0;
            $feed->l_per_post = $settings['lperpost'];
            $feed->online_time = $settings['conline'];
            $feed->friends_online = $settings['ronline'];
            $feed->subscriptionsList = $feed->getSubs($verify['idu'], 0);
            $feed->subscribersList = $feed->getSubs($verify['idu'], 1);
            $feed->updateStatus($verify['offline']);
            $TMPL['uid'] = $verify['idu'];
            $TMPL_old = $TMPL;
            $TMPL = array();
            $skin = new skin('shared/rows');
            $rows = '';
            if (empty($_GET['filter'])) {
                $_GET['filter'] = '';
            }
            // Allowed types
            list($timeline, $message) = $feed->getTimeline(0, $_GET['filter']);
            $TMPL['messages'] = $timeline;
            $rows = $skin->make();
            $skin = new skin('timeline/sidebar');
            $sidebar = '';
            $TMPL['editprofile'] = $feed->fetchProfileWidget($verify['username'], realName($verify['username'], $verify['first_name'], $verify['last_name']), $verify['image']);
            $TMPL['sidebar'] = $feed->sidebarTypes($_GET['filter'], 'timeline');
            $TMPL['dates'] = $feed->sidebarDates($_GET['filter'], 'timeline');
            $TMPL['trending'] = $feed->sidebarTrending($_GET['tag'], 5);
            $TMPL['users'] = $feed->onlineUsers();
            $TMPL['subscriptions'] = $feed->sidebarSubs(0, 0);
            $TMPL['subscribers'] = $feed->sidebarSubs(1, 0);
            $TMPL['friendsactivity'] = $feed->sidebarFriendsActivity(20, 1);
            if (count($feed->subscriptionsList[0]) < 6) {
                $TMPL['suggestions'] = $feed->sidebarSuggestions();
            }
            $TMPL['ad'] = generateAd($settings['ad2']);
            $sidebar = $skin->make();
            $skin = new skin('shared/top');
            $top = '';
            // $TMPL['top'] = $feed->getForm();
            $TMPL['theme_url'] = $CONF['theme_url'];
            $TMPL['private_message'] = $verify['privacy'];
            $TMPL['avatar'] = $verify['image'];
            $TMPL['url'] = $CONF['url'];
            $top = $skin->make();
            $TMPL = $TMPL_old;
            unset($TMPL_old);
            $TMPL['top'] = $top;
            $TMPL['rows'] = $rows;
            $TMPL['sidebar'] = $sidebar;
        }
    } else {
        // If the session or cookies are not set, redirect to home-page
        header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    if (isset($_GET['logout']) == 1) {
        $loggedIn->logOut();
        header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    $TMPL['url'] = $CONF['url'];
    $TMPL['title'] = $LNG['title_timeline'] . ' - ' . $settings['title'];
    $skin = new skin('shared/timeline');
    return $skin->make();
}