/** * Display the specified resource. * GET /frontend/publiccontact/{id} * * @param int $id * @return Response */ public function show($id) { try { $contact = Contact::findOrFail($id); $articles = News::inCategories(Config::get('settings.homepage'))->where('published', '=', 2)->where('post_type', '=', 1)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(10)->get(); $featured = News::where('published', '=', 2)->where('featured', '=', 1)->where('post_type', '=', 1)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->orderBy('created_at', 'desc')->take(3)->get(); $results = News::inCategories(Config::get('settings.results'))->distinct('permalink')->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('published', '=', 2)->where('post_type', '=', 1)->groupBy('permalink')->orderBy('news.created_at', 'desc')->take(10)->get(); $featuredImage = News::inCategories(array(25))->where('published', '=', 2)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('post_type', '=', 1)->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(3)->get(); $didYouKnow = News::inCategories(array(30))->where('published', '=', 2)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('post_type', '=', 1)->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(3)->get(); $magazine = News::inCategories(Config::get('settings.magazine'))->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('published', '=', 2)->where('post_type', '=', 1)->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(4)->get(); $ourComment = News::inCategories(array(17))->where('published', '=', 2)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('post_type', '=', 1)->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(4)->get(); $feed = getFeed('http://bazaznanja.puskice.org/feed/qa.rss', 4); $poll = null; $poll = Poll::where('published', '=', '1')->where('end_date', '>', date("Y-m-d H:i:s", strtotime('now')))->where('created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->first(); if (isset($poll->id)) { $poll->pollOptions; } View::share('title', $contact->title . " " . $contact->first_name . " " . $contact->last_name . " | Пушкице | Тачка спајања студената ФОН-а"); $ogimage = Puskice::firstContactImage($contact); $meta = "\t<meta property='og:image' content='" . $ogimage . "'/>\n\t\t\t\t\t\t<meta property='og:title' content='" . __($contact->title . " " . $contact->first_name . " " . $contact->last_name . " | Пушкице | Тачка спајања студената ФОН-а") . "'/>\n\t\t\t\t\t\t<meta property='fb:app_id' content='355697367892039'/>\n\t\t\t\t\t\t<meta property='og:site_name' content='" . __("Пушкице - ФОН Андерграунд") . "'/>\n\t\t\t\t\t\t<meta property='og:type' content='article'/>\n\t\t\t\t\t\t<meta property='og:url' content='" . _l(Request::root() . "/ljudi/" . $contact->id) . "'/>\n\t\t\t\t\t\t<meta property='og:description' content='" . __($contact->description) . "' />\n\t\t\t\t\t\t<meta name='twitter:card' content='summary_large_image'>\n\t\t\t\t\t\t<meta name='twitter:site' content='" . __("Пушкице - ФОН Андерграунд") . "'>\n\t\t\t\t\t\t<meta name='twitter:creator' content='@puskice'>\n\t\t\t\t\t\t<meta name='twitter:domain' content='puskice.org'>\n\t\t\t\t\t\t<meta name='twitter:app:name:iphone' content='" . __("Пушкице") . "'>\n\t\t\t\t\t\t<meta name='twitter:app:name:ipad' content='" . __("Пушкице") . "'>\n\t\t\t\t\t\t<meta name='twitter:title' content='" . __($contact->title . " " . $contact->first_name . " " . $contact->last_name . " | Пушкице") . "'>\n\t\t\t\t\t\t<meta name='twitter:description' content='" . __($contact->description) . "'>\n\t\t\t\t\t\t<meta name='twitter:image' content='" . $ogimage . "'>"; $data = array('articles' => $articles, 'featured' => $featured, 'results' => $results, 'ourComment' => $ourComment, 'magazine' => $magazine, 'featuredImage' => $featuredImage, 'didYouKnow' => $didYouKnow, 'feed' => $feed, 'poll' => $poll, 'meta' => $meta, 'contact' => $contact); $this->setLayout($data); $this->layout->center = View::make('frontend.content.contact', $data); } catch (Exception $e) { App::abort(404); } }
function getRecentChanges() { global $config; $value = ""; $value .= "<h2><a href='" . $config["GitHub feed"] . "' class='rss'>Recent changes</a></h2>"; $value .= getFeed($config["GitHub feed"], 5); return $value; }
function getInfos($input) { if (strpos($input, '.')) { $r = getFeed('people.findByEmail', array('find_email' => $input)); return array('stat' => $r['stat'], 'nsid' => $r['user']['nsid'], 'username' => $r['user']['username']['_content']); } else { $r = getFeed('people.getInfo', array('user_id' => $input)); return array('stat' => $r['stat'], 'nsid' => $r['person']['nsid'], 'username' => $r['person']['username']['_content'], 'realname' => '(' . $r['person']['realname']['_content'] . ')'); } }
/** * import all feeds of a given outline tag */ function getFeedsOutline($outline, $cat_id) { $feeds = array(); foreach ($outline->children() as $child) { if (isset($child['xmlUrl'])) { $feeds[] = getFeed($child, $cat_id); } else { $feeds = array_merge($feeds, getFeedsOutline($child, $cat_id)); } } return $feeds; }
include $faqPath; ?> </dl> </div> </div> <?php } else { ?> <!-- Carousel ================================================== --> <div id="myCarousel" class="carousel slide" data-ride="carousel"> <?php $feed = getFeed(); $items = createItemsForCarouselFromFeedObject($feed); $currVersion = isset($feed->currentVersion) ? $feed->currentVersion : $configObject->version; $newsItems = isset($feed->news) ? $feed->news : array(); ?> <!-- Indicators --> <?php if (count($items) > 0) { ?> <ol class="carousel-indicators"> <li data-target="#myCarousel" data-slide-to="0" class="active"></li> <?php for ($i = 0; $i < count($items); $i++) { ?>
} if (sizeof($column) < 1) { printHeader(); printf("<p>Please add feeds!</p>\n"); printFooter(); exit; } printHeader(); /* Calculate width of individual columns. */ $COLUMN_WIDTH = round(100 / sizeof($column)); foreach ($column as $x => $col) { if (is_array($col)) { print "<div class=\"blog\" style=\"width: {$COLUMN_WIDTH}%;\">\n"; /* Iterate through elements. */ foreach ($col as $y => $feed) { $data = getFeed($feed, $x, $y); $p = new feedParser(); $info = $p->parseFeed($data["data"]); if (sizeof($info["item"]) > 0) { print "<div class=\"blogTitle\">"; if ($info["channel"]["link"] != "") { print "<a href=\"" . $info["channel"]["link"] . "\">" . $info["channel"]["title"] . "</a>\n"; } else { print $info["channel"]["title"] . "\n"; } print "<a href=\"" . $feed["url"] . "\">\n"; print "<img src=\"xml-tiny.png\" /></a></div>"; print "<div class=\"manage\">("; print $x . $ALPHA[$y] . ": \n"; print "<a href=\""; $tmp = $column;
function view($pdo) { global $paginate, $item_pre_page, $btn_pre_page; #get source $sql = "select * from news_source"; $stmt = $pdo->query($sql); $source_item = array(); $source = ''; $side_tpl = '<div class="source_side">{source}</div>'; $source_item_tpl = '<a href="' . BASE_PATH . '/news/?source={id}"><div>{name}</div></a>'; if ($stmt->rowCount()) { $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); foreach ($rows as $row) { $src_item = $source_item_tpl; $src_item = str_replace("{id}", $row['id'], $src_item); $src_item = str_replace("{name}", $row['name'], $src_item); $source_item[] = $src_item; } $side_tpl = str_replace("{source}", implode("\n", $source_item), $side_tpl); } else { $side_tpl = str_replace("{source}", "", $side_tpl); } #get news $news_item = array(); $news_list_tpl = '<div class="news_list">{news}<br/>{paginate}</div>'; $news_tpl = ' <div class="news_post"> <div class="title"><a href="' . BASE_PATH . '/news/?news={id}">{title}</a></div> <div class="content">{content}</div> {control} <div class="meta">{date}</div> </div> '; $control = ''; if (isset($_SESSION['login']) && isset($_SESSION['permission']) && $_SESSION['permission'] == 'admin') { $control = '<div class="media"><a href="javascript:void(0)" onclick=\'if(confirm('Are you sure?')) {window.location="' . BASE_PATH . '/news/?do=delete&news={id}&token=' . $_SESSION['token'] . '&source={id}" }else{ return false; }\'>Delete</a> | <a href="' . BASE_PATH . '/news/?do=add_news&news={id}&token=' . $_SESSION['token'] . '">Edit</a></div>'; } if (isset($_GET['source']) && !empty($_GET['source']) && intval($_GET['source'])) { $sql = "select * from news_source where `id`=:id"; $stmt = $pdo->prepare($sql); $stmt->bindvalue(":id", intval($_GET['source']), PDO::PARAM_INT); } else { if (isset($_GET['news']) && !empty($_GET['news']) && intval($_GET['news'])) { $sql = "select * from news where id=" . intval($_GET['news']); } else { $sql = "select * from news_source where `default`=1"; } $stmt = $pdo->prepare($sql); } $stmt->execute(); if ($stmt->rowCount()) { if (!isset($_GET['news'])) { $source = $stmt->fetch(PDO::FETCH_ASSOC); if ($source['type'] == 2) { #RSS Feed $tpl = '<div class="news_list">'; $html = getFeed($source['url'], $source['id']); $tpl = $tpl . "\n" . $html['news']; $tpl = $tpl . "\n" . '<br/>'; $tpl = $tpl . "\n" . $html['paginate']; $tpl = $tpl . "\n" . '</div>'; return $side_tpl . "\n" . $tpl; } else { if (!empty($source)) { $sql = "select count(*) as `count` from news where source=" . $source['id']; $stmt = $pdo->query($sql); $news_count = $stmt->fetchColumn(0); if ($news_count > 0) { $page = 1; if (isset($_GET['page']) && !empty($_GET['page']) && is_numeric($_GET['page']) && intval($_GET['page'])) { $page = abs($_GET['page']); } $start = ($page - 1) * $item_pre_page; $paginate->init($news_count, $item_pre_page, $btn_pre_page, $page, array('template' => '<a href="{url}"><li class="tooltip" title="{info}">{number}</li></a>', 'info' => 'page {currentPage} of {totalPages}', 'currentItemTemplate' => '<a href="{url}"><li class="active tooltip" title="{info}">{number}</li></a>', 'url' => '/news/', 'urlParameters' => 'source=' . $source['id'], 'separator' => "\n")); $sql = "select * from news where source=" . $source['id'] . " LIMIT " . $start . " , " . $item_pre_page; $stmt = $pdo->query($sql); if ($stmt->rowCount()) { $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); foreach ($rows as $news) { $nt = $news_tpl; $c = $control; $nt = str_replace("{id}", $news['id'], $nt); $nt = str_replace("{title}", $news['title'], $nt); $nt = str_replace("{content}", $news['content'], $nt); $nt = str_replace("{date}", $news['date'], $nt); $c = str_replace("{id}", $news['id'], $c); $nt = str_replace("{control}", $c, $nt); $news_item[] = $nt; } $news_list_tpl = str_replace("{news}", implode("\n", $news_item), $news_list_tpl); $news_list_tpl = str_replace("{paginate}", $paginate->displayLink(), $news_list_tpl); $output = $side_tpl . "\n" . $news_list_tpl; return $output; } } //count $news_list_tpl = str_replace("{news}", "", $news_list_tpl); $news_list_tpl = str_replace("{paginate}", "", $news_list_tpl); $output = $side_tpl . "\n" . $news_list_tpl; return $output; } //source } } else { //NOT NEWS ID $news = $stmt->fetch(PDO::FETCH_ASSOC); $nt = $news_tpl; $c = $control; $nt = str_replace("{id}", $news['id'], $nt); $nt = str_replace("{title}", $news['title'], $nt); $nt = str_replace("{content}", $news['content'], $nt); $nt = str_replace("{date}", $news['date'], $nt); $c = str_replace("{id}", $news['id'], $c); $nt = str_replace("{control}", $c, $nt); $news_list_tpl = str_replace("{news}", $nt, $news_list_tpl); $news_list_tpl = str_replace("{paginate}", "", $news_list_tpl); $output = $side_tpl . "\n" . $news_list_tpl; return $output; } } else { $news_list_tpl = str_replace("{news}", "", $news_list_tpl); $news_list_tpl = str_replace("{paginate}", "", $news_list_tpl); $output = $side_tpl . "\n" . $news_list_tpl; return $output; } }
/** get RSS from cache or query delicious for it */ function delFeed($feed_path, $fn) { // check age of cache $now = time(); if (is_file($fn)) { $age = $now - filemtime($fn); if ($age < DEL_CACHE_AGE) { return file_get_contents($fn); } } // create the cache path if needed $dir = dirname($fn); if (!is_dir($dir)) { $curr = DEL_GEOTAG_PATH; $local = str_replace($curr . '/', '', $dir); $parts = explode('/', $local); while (count($parts) > 0) { $curr .= '/' . array_shift($parts); if (!is_dir($curr)) { mkdir($curr); } } } // get RSS from delicious and put into cache file $data = getFeed($feed_path); file_put_contents($fn, $data); return $data; }
<div id="revoke" align="left"> <h2>revoke your tickets:</h2> <form name="myForm" action="revoke.php" method="post"> <table style="padding-top:20px; border-spacing:13px;"> <tr><td>Username:</td><td> <input type="text" name="username"></td> </tr> <tr><td>Password : </td><td><input type="password" name="password"></td> </tr> <tr><td>flight : </td><td><input type="text" name="flight"></td> </tr> </table><br> <input id="submit" type="submit" name="submitLogin" value="revoke" > </form> </div> <!--end div for login--> <div id ="news" align="center"><font color = "#FF00FF"> <?php echo getFeed("http://rss.cnn.com/rss/edition.rss"); ?> </font></div> <div id="wrap"> <h2>Add comment:</h2> <form name="addcomment" action="submit.php" method="post"> <label for="fname">Name:</label> <input type="text" id="fname" name="name" /> <label for="email">Email:</label> <input type="text" id="email" name="email" /> <label for="fmessage">Message:</label> <textarea rows="4" cols="15" id="fmessage" name="message"></textarea> <input id="submit" type="submit" value="Send" /> <script type="text/javascript"> var fname = new LiveValidation('fname'); // validate email fname.add(Validate.Presence); var fmessage = new LiveValidation('fmessage'); // validate message fmessage.add(Validate.Presence); </script>
<p>To edit please click on a date cells, choose state and submit your changes.</p> <form name="myform" method="post"> <?php calendar($cyear, 1); ?> </form> <?php } ?> <div id="footer" style="padding: 15px 7px;"> <div id="feedcontainer" style="float: left; width: 250px;"> <?php getFeed("http://feeds.kreci.net/KreCiBlogger"); ?> </div> <div id="foot" style="float: left; width: 500px;"> <h2>Follow me!</h2> For script updates, tips & freebies please <a href="http://www.twitter.com/KreCiDev">follow me</a> on twitter. <h2>Script customization</h2> If you want this script to be customized for your website please <a href="http://blog.kreci.net/contact-me/">contact me</a>. <h2>Donations are welcome</h2> <a href="http://blog.kreci.net/code/booking-calendar-lite/">Booking Calendar Lite</a> is free of charge but your donations help to pay some hosting bills and motivate me to continue my work. <p> <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
public function newMeme() { $title = "Нови постер | Пушкице"; View::share('title', strip_tags($title)); $memes = Meme::all(); Session::put('antispam1', rand(0, 20)); Session::put('antispam2', rand(0, 20)); //$articles = News::inCategories(Config::get('settings.homepage'))->where('published', '=', 2)->where('post_type', '=', 1)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(10)->get(); $featured = News::where('published', '=', 2)->where('featured', '=', 1)->where('post_type', '=', 1)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->orderBy('created_at', 'desc')->take(3)->get(); $results = News::inCategories(Config::get('settings.results'))->where('published', '=', 2)->where('post_type', '=', 1)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(4)->get(); $featuredImage = News::inCategories(array(25))->where('published', '=', 2)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('post_type', '=', 1)->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(3)->get(); $didYouKnow = News::inCategories(array(30))->where('published', '=', 2)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('post_type', '=', 1)->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(3)->get(); $magazine = News::inCategories(Config::get('settings.magazine'))->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('published', '=', 2)->where('post_type', '=', 1)->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(4)->get(); $ourComment = News::inCategories(array(17))->where('published', '=', 2)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('post_type', '=', 1)->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(4)->get(); $feed = getFeed('http://bazaznanja.puskice.org/feed/qa.rss', 4); $poll = null; $poll = Poll::where('published', '=', '1')->where('end_date', '>', date("Y-m-d H:i:s", strtotime('now')))->where('created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->first(); if (isset($poll->id)) { $poll->pollOptions; } $meta = "\t<meta property='og:image' content='" . Config::get('settings.defaultImg') . "'/>\n\t\t\t\t\t\t<meta property='og:title' content='" . __("Меме генератор | Пушкице | Тачка спајања студената ФОН-а") . "'/>\n\t\t\t\t\t\t<meta property='fb:app_id' content='355697367892039'/>\n\t\t\t\t\t\t<meta property='og:site_name' content='" . __("Пушкице - ФОН Андерграунд") . "'/>\n\t\t\t\t\t\t<meta property='og:type' content='article'/>\n\t\t\t\t\t\t<meta property='og:url' content='" . _l(Request::root() . "/memes/new") . "'/>\n\t\t\t\t\t\t<meta property='og:description' content='" . __("Меме генератор | Пушкице") . "' />\n\t\t\t\t\t\t<meta name='twitter:card' content='summary_large_image'>\n\t\t\t\t\t\t<meta name='twitter:site' content='" . __("Пушкице - ФОН Андерграунд") . "'>\n\t\t\t\t\t\t<meta name='twitter:creator' content='@puskice'>\n\t\t\t\t\t\t<meta name='twitter:domain' content='puskice.org'>\n\t\t\t\t\t\t<meta name='twitter:app:name:iphone' content='" . __("Пушкице") . "'>\n\t\t\t\t\t\t<meta name='twitter:app:name:ipad' content='" . __("Пушкице") . "'>\n\t\t\t\t\t\t<meta name='twitter:title' content='" . __("Меме генератор | Пушкице") . "'>\n\t\t\t\t\t\t<meta name='twitter:description' content='" . __(strip_tags("Меме генератор")) . "'>\n\t\t\t\t\t\t<meta name='twitter:image' content='" . Config::get('settings.defaultImg') . "'>"; $data = array('featured' => $featured, 'results' => $results, 'ourComment' => $ourComment, 'magazine' => $magazine, 'featuredImage' => $featuredImage, 'didYouKnow' => $didYouKnow, 'feed' => $feed, 'poll' => $poll, 'meta' => $meta, 'memes' => $memes); $this->setLayout($data); $this->layout->center = View::make('frontend.content.newMeme', $data); }
Types of alerts: RSS Library: http://www.nws.noaa.gov/rss/ Severe Weather: -Watch/Warnings/Advisories: http://alerts.weather.gov/cap/us.php?x=1 */ $acceptedTypes = array("FloodWarning", "FloodAdvisory", "FlashFloodWatch", "SpecialWeatherStatement", "SevereThunderstormWarning", "TornadoWarning"); $url = "http://alerts.weather.gov/cap/us.php?x=1"; $rawxml = curlPage($url); $xml = new SimpleXMLElement($rawxml); http: //alerts.weather.gov/cap/wwacapget.php?x=AL1253B4A2F0D4.HeatAdvisory.1253B4AFB6C0AL.MOBNPWMOB.37dd2dbeec77dcbd81e72718a99b8b2f // ALL ENTRIES: //$entry = $xml->xpath("/*/*[local-name()='entry']/*[local-name()='id']/text()"); // MOST RECENT 10: $entry = $xml->xpath("/*/*[local-name()='entry'][position() >= 0 and position() < 12]/*[local-name()='id']/text()"); $newxml = new SimpleXMLElement('<xml/>'); foreach ($entry as $id) { $type = substr($id, 61, -58); $link = $id; if (in_array($type, $acceptedTypes)) { $xmlitem = $newxml->addChild('entry'); $xmlitem->addChild('type', "" . $type . ""); $xmlitem->addChild('link', "" . $link . ""); //echo $link."<br />"; } } Header('Content-type: text/xml'); print $newxml->asXML(); } getFeed();
function blogtalkradio($atts) { extract(shortcode_atts(array("username" => 'Default', "itemcount" => '10', "itunes" => 'false', "logo" => 'true'), $atts)); // Retrieve the image url, and the URL, title, and description of each episode // from http://www.blogtalkradio/username.rss $description_array = getFeed('http://www.blogtalkradio.com/' . $username . '.rss'); // Retrieve the itunes link, and the URL, show_id, and embed code for each episode from // http://www.blogtalkradio/username/playlist.xml $ident_array = getIdent('http://www.blogtalkradio.com/' . $username . '/play_list.xml?itemcount=' . $itemcount); // Retrieve the host_id from http://www.blogtalkradio/username/playlist.xml $host_id = getHostID('http://www.blogtalkradio.com/' . $username . '/play_list.xml'); // Extract the image url $image_url = $description_array['image_url']; // Extract the itunes link $itunes_link = $ident_array[0]['itunes']; unset($description_array['image_url'], $ident_array[0]); // Combine the ident_array and description_array $show_array = array(); foreach ($ident_array as $ident) { foreach ($description_array as $description) { if ($ident['url'] === $description['url']) { $show_array[] = array('id' => $ident['show_id'], 'url' => $ident['url'], 'title' => $description['title'], 'description' => $description['description'], 'embed_code' => $ident['embed_code']); } } } // Display the logo if ($logo == 'true') { echo '<div class="blogtalk-logo" style="display: inline-block; width: 100%; text-align: center;"> <a href="http://www.blogtalkradio.com/' . $username . '"> <img src="' . $image_url . '" width="400" height="400" style="display: inline-block;"/> </a> </div>'; } // Display the itunes link if ($itunes == 'true') { echo '<div class="blogtalk-itunes" style="display: inline-block; width: 100%; text-align: center;"> <br> <a href="' . $itunes_link . '" target="itunes_store"> Check us out in iTunes! </a> <br> <br> </div>'; } // Display the each episode echo '<div class="blogtalk-wrapper" style="width: 100%; text-align: center;">'; foreach ($show_array as $show) { echo '<h2 style="text-align: left;">' . $show['title'] . '</h2>'; echo '<div class="blogtalk-embed" style="min-width: 280px; width: 45%; margin: 10px 0px; display: inline-block; vertical-align: top;"> <iframe width="280px" height="200px" src="http://player.cinchcast.com/?platformId=1&assetType=single&assetId=' . $show['id'] . '" frameborder="0" allowfullscreen> </iframe>'; echo '<div class="blogtalk-link" style="font-size: 10px;">' . $show['embed_code'] . '</div> </div> <div class="blogtalk-description" style="min-width: 300px; width: 51%; padding: 0px 10px; margin: 10px 0px; display: inline-block; text-align: left; vertical-align: top;"> <a href="' . $show['url'] . '">' . $show['title'] . '</a> - ' . $show['description'] . ' </div> <div style="clear: both;"></div><br>'; } echo '</div>'; }
public function postKviz() { $rules = array('kadsuculi' => 'Required', 'vladar' => 'Required', 'zgrada' => 'Required', 'konasvoli' => 'Required', 'nikadniste' => 'Required', 'promene' => 'Required', 'stavoli' => 'Required', 'epsilon' => 'Required', 'clan' => 'Required', 'biliclan' => 'Required'); $validator = Validator::make(Input::all(), $rules); if ($validator->fails()) { return Redirect::to(_l(URL::to('/') . '/kviz'))->withErrors($validator)->withInput(); } else { $kviz = new Kviz(); $kviz->kadsuculi = Input::get('kadsuculi'); $kviz->vladar = is_array(Input::get('vladar')) ? serialize(Input::get('vladar')) : ''; $kviz->zgrada = Input::get('zgrada'); $kviz->konasvoli = is_array(Input::get('konasvoli')) ? serialize(Input::get('konasvoli')) : ''; $kviz->nikadniste = is_array(Input::get('nikadniste')) ? serialize(Input::get('nikadniste')) : ''; $kviz->promene = Input::get('promene'); $kviz->stavoli = is_array(Input::get('stavoli')) ? serialize(Input::get('stavoli')) : ''; $kviz->epsilon = Input::get('epsilon'); $kviz->biliclan = Input::get('biliclan'); $kviz->clan = is_array(Input::get('clan')) ? serialize(Input::get('clan')) : ''; $kviz->save(); try { $articles = News::inCategories(Config::get('settings.homepage'))->where('published', '=', 2)->where('post_type', '=', 1)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(10)->get(); $results = News::inCategories(Config::get('settings.results'))->where('published', '=', 2)->where('post_type', '=', 1)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(4)->get(); $featured = News::where('published', '=', 2)->where('featured', '=', 1)->where('post_type', '=', 1)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->orderBy('created_at', 'desc')->take(3)->get(); $featuredImage = News::inCategories(array(25))->where('published', '=', 2)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('post_type', '=', 1)->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(3)->get(); $didYouKnow = News::inCategories(array(30))->where('published', '=', 2)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('post_type', '=', 1)->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(3)->get(); $magazine = News::inCategories(Config::get('settings.magazine'))->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('published', '=', 2)->where('post_type', '=', 1)->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(4)->get(); $ourComment = News::inCategories(array(17))->where('published', '=', 2)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('post_type', '=', 1)->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(4)->get(); $feed = getFeed('http://bazaznanja.puskice.org/feed/qa.rss', 4); $poll = null; $poll = Poll::where('published', '=', '1')->where('end_date', '>', date("Y-m-d H:i:s", strtotime('now')))->where('created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->first(); if (isset($poll->id)) { $poll->pollOptions; } View::share('title', "Квиз | Пушкице"); $ogimage = Config::get('settings.defaultImage'); $meta = "\t<meta property='og:image' content='" . $ogimage . "'/>\n\t\t\t\t\t\t\t<meta property='og:title' content='" . __("Квиз | Пушкице") . "'/>\n\t\t\t\t\t\t\t<meta property='fb:app_id' content='355697367892039'/>\n\t\t\t\t\t\t\t<meta property='og:site_name' content='" . __("Пушкице - ФОН Андерграунд") . "'/>\n\t\t\t\t\t\t\t<meta property='og:type' content='article'/>\n\t\t\t\t\t\t\t<meta property='og:url' content='" . _l(Request::root() . "/kviz/") . "'/>\n\t\t\t\t\t\t\t<meta property='og:description' content='" . __("Квиз за ФОН-овце") . "' />\n\t\t\t\t\t\t\t<meta name='twitter:card' content='summary_large_image'>\n\t\t\t\t\t\t\t<meta name='twitter:site' content='" . __("Пушкице - ФОН Андерграунд") . "'>\n\t\t\t\t\t\t\t<meta name='twitter:creator' content='@puskice'>\n\t\t\t\t\t\t\t<meta name='twitter:domain' content='puskice.org'>\n\t\t\t\t\t\t\t<meta name='twitter:app:name:iphone' content='" . __("Пушкице") . "'>\n\t\t\t\t\t\t\t<meta name='twitter:app:name:ipad' content='" . __("Пушкице") . "'>\n\t\t\t\t\t\t\t<meta name='twitter:title' content='" . __("Квиз | Пушкице") . "'>\n\t\t\t\t\t\t\t<meta name='twitter:description' content='" . __("Квиз за ФОН-овце") . "'>\n\t\t\t\t\t\t\t<meta name='twitter:image' content='" . $ogimage . "'>"; $data = array('articles' => $articles, 'featured' => $featured, 'results' => $results, 'ourComment' => $ourComment, 'magazine' => $magazine, 'featuredImage' => $featuredImage, 'didYouKnow' => $didYouKnow, 'feed' => $feed, 'poll' => $poll, 'kviz' => $kviz, 'meta' => $meta); $this->setLayout2($data); $this->layout->boxes = View::make('frontend.boxes', $data); $this->layout->imageOfTheWeek = View::make('frontend.sidebar.imageOfTheWeek', $data); $this->layout->didYouKnow = View::make('frontend.sidebar.didYouKnow', $data); $this->layout->twitter = View::make('frontend.sidebar.twitter'); $this->layout->poll = View::make('frontend.sidebar.poll', $data); $this->layout->center = View::make('frontend.content.kvizKraj', $data); } catch (Exception $e) { return App::abort(404); } } }
array_pop($summary); $summary = implode(' ', $summary); return $summary . '...'; } function getIdTitle($title) { $r = preg_replace("/[^a-zA-Z]/", "", $title); $r = substr($r, 0, 20); return $r; } function getLettersOnly($string) { $r = preg_replace("/[^a-zA-Z]/", "", $string); return $r; } $rss = getFeed($xml); ?> <div class="row row-centered"> <div class="col-md-9 col-centered" role="main"> <form> <div name="editor1" contenteditable="true"> <?php //show navbar if ($showNavbar) { include AMSDIR_BASE . DS . 'components/extras/navbar.php'; } //end navbar
$content = file_get_contents($feed_url); $x = new SimpleXmlElement($content); echo "<ul>"; foreach ($x->channel->item as $entry) { echo "<li><a href='{$entry->link}' title='{$entry->title}'>" . $entry->title . "</a></li>"; $i++; if ($i == 3) { break; } } echo "</ul>"; } ?> <?php getFeed('http://blog.giraffeideas.com/CMS/UI/Modules/BizBlogger/rss.aspx?tabid=1157151&moduleid=2515297&maxcount=25&t=aaeb5e04ce16501bfc57f7afe7847982'); ?> </div> <div class="cols-4"> <b class="title">PUBLICA EN NUESTRO BLOG<i class="icon-rss"></i></b> <p>Estamos buscando expertos en BRANDING, INBOUND MARKETING y VIDEOS EXPLICATIVOS</p> <p>¿QUIERES ESCRIBIR PARA NUESTRO BLOG?</p> <p>Envianos tus artículos a:<br>mvalencia@giraffeideas.com</p> </div> </div> </section> <?php get_footer();
<?php Route::get('/', function () { $feed = getFeed('http://3523.cupe.ca/feed/'); $feedCupe = getFeed('http://cupe.ca/rss/promoted'); return view('welcome')->withFeed($feed)->withCupe($feedCupe); }); /* |-------------------------------------------------------------------------- | Application Routes |-------------------------------------------------------------------------- | | This route group applies the "web" middleware group to every route | it contains. The "web" middleware group is defined in your HTTP | kernel and includes session state, CSRF protection, and more. | */ Route::group(['middleware' => 'web'], function () { // Authentication Routes... $this->get('login', 'Auth\\SessionsController@login'); $this->post('login', 'Auth\\SessionsController@postLogin'); $this->get('logout', 'Auth\\SessionsController@logout'); // Registration Routes... $this->get('register', 'Auth\\RegistrationController@register'); $this->post('register', 'Auth\\RegistrationController@postRegister'); $this->get('register/confirm/{token}', 'Auth\\RegistrationController@confirmEmail'); // Password Reset Routes... $this->get('password/reset/{token?}', 'Auth\\PasswordController@showResetForm'); $this->post('password/email', 'Auth\\PasswordController@sendResetLinkEmail'); $this->post('password/reset', 'Auth\\PasswordController@reset'); Route::get('/home/events/new', 'EventsController@create');
<th></th> </tr> </thead> <tbody> <?php getFeed("http://icetracker.org/get_rss.php?user=Jobs&cat=8&passkey=f22615c5c857aae94708b379e1594ecd", 1); ?> </tbody> </table> </div> <div id="animated" class="tab-pane fade"> <table class="table table-deildu"> <thead> <tr> <th></th> <th></th> <th></th> </tr> </thead> <tbody> <?php getFeed("http://icetracker.org/get_rss.php?user=Jobs&cat=7&passkey=f22615c5c857aae94708b379e1594ecd", 2); ?> </tbody> </table> </div> </div> </div> <?php include 'includes/footer.php';
</div><!--/.nav-collapse --> </div> </nav> <div class="container"> <h1>rss feed</h1> <?php function getFeed($url) { $x = simplexml_load_file($url); echo "<ul>"; foreach ($x->channel->item as $entry) { echo "<li><a href={$entry->link}' title='{$entry->title}'>" . $entry->title . "</a></li>"; } echo "<ul>"; } echo getFeed("http://www.thebagforum.com/external.php?type=RSS2&forumids=30"); ?> </div> <div class="container"> <!--footer--> <hr> <footer> <div class="row"> <div class="col-lg-12"> <p>Copyright 2015 © Turbo ltd </p> </div> </div> </footer> </div><!--Footer--> <!-- Bootstrap core JavaScript ================================================== --> <!-- Placed at the end of the document so the pages load faster -->
public function getMyProfile() { try { View::share('title', "Моје Пушкице | Пушкице | Тачка спајања студената ФОН-а"); $user = User::findOrFail(Session::get('id')); $articles = News::inCategories(Config::get('settings.homepage'))->where('published', '=', 2)->where('post_type', '=', 1)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(10)->get(); $featured = News::where('published', '=', 2)->where('featured', '=', 1)->where('post_type', '=', 1)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->orderBy('created_at', 'desc')->take(3)->get(); $results = News::inCategories(Config::get('settings.results'))->distinct('permalink')->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('published', '=', 2)->where('post_type', '=', 1)->groupBy('permalink')->orderBy('news.created_at', 'desc')->take(10)->get(); $featuredImage = News::inCategories(array(25))->where('published', '=', 2)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('post_type', '=', 1)->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(3)->get(); $didYouKnow = News::inCategories(array(30))->where('published', '=', 2)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('post_type', '=', 1)->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(3)->get(); $magazine = News::inCategories(Config::get('settings.magazine'))->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('published', '=', 2)->where('post_type', '=', 1)->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(4)->get(); $ourComment = News::inCategories(array(17))->where('published', '=', 2)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('post_type', '=', 1)->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(4)->get(); $feed = getFeed('http://bazaznanja.puskice.org/feed/qa.rss', 4); $poll = null; $poll = Poll::where('published', '=', '1')->where('end_date', '>', date("Y-m-d H:i:s", strtotime('now')))->where('created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->first(); if (isset($poll->id)) { $poll->pollOptions; } $ogimage = Config::get('settings.defaultImage'); $meta = "\t<meta property='og:image' content='" . $ogimage . "'/>\n\t\t\t\t\t\t<meta property='og:title' content='" . __("Моје Пушкице | Пушкице | Тачка спајања студената ФОН-а") . "'/>\n\t\t\t\t\t\t<meta property='fb:app_id' content='355697367892039'/>\n\t\t\t\t\t\t<meta property='og:site_name' content='" . __("Пушкице - ФОН Андерграунд") . "'/>\n\t\t\t\t\t\t<meta property='og:type' content='article'/>\n\t\t\t\t\t\t<meta property='og:url' content='" . _l(Request::root() . "/login/my-profile") . "'/>\n\t\t\t\t\t\t<meta property='og:description' content='" . __("Креирајте свој профил на Пушкицама и остварите приступ бројним погодностима које нудимо студентима") . "' />\n\t\t\t\t\t\t<meta name='twitter:card' content='summary_large_image'>\n\t\t\t\t\t\t<meta name='twitter:site' content='" . __("Пушкице - ФОН Андерграунд") . "'>\n\t\t\t\t\t\t<meta name='twitter:creator' content='@puskice'>\n\t\t\t\t\t\t<meta name='twitter:domain' content='puskice.org'>\n\t\t\t\t\t\t<meta name='twitter:app:name:iphone' content='" . __("Пушкице") . "'>\n\t\t\t\t\t\t<meta name='twitter:app:name:ipad' content='" . __("Пушкице") . "'>\n\t\t\t\t\t\t<meta name='twitter:title' content='" . __("Моје Пушкице | Пушкице | Тачка спајања студената ФОН-а") . "'>\n\t\t\t\t\t\t<meta name='twitter:description' content='" . __("Креирајте свој профил на Пушкицама и остварите приступ бројним погодностима које нудимо студентима") . "'>\n\t\t\t\t\t\t<meta name='twitter:image' content='" . $ogimage . "'>"; $data = array('articles' => $articles, 'featured' => $featured, 'results' => $results, 'ourComment' => $ourComment, 'magazine' => $magazine, 'featuredImage' => $featuredImage, 'didYouKnow' => $didYouKnow, 'feed' => $feed, 'poll' => $poll, 'meta' => $meta, 'user' => $user); $this->setLayout($data); $this->layout->center = View::make('frontend.content.profile', $data); //$this->layout->carousel = View::make('frontend.carousel', $data); $this->layout->boxes = View::make('frontend.boxes', $data); $this->layout->imageOfTheWeek = View::make('frontend.sidebar.imageOfTheWeek', $data); $this->layout->didYouKnow = View::make('frontend.sidebar.didYouKnow', $data); $this->layout->twitter = View::make('frontend.sidebar.twitter'); $this->layout->poll = View::make('frontend.sidebar.poll', $data); } catch (Exception $e) { return Redirect::to('login')->with('message', __("Потребно је да се прво улогујете"))->with('notif', 'success'); } }