Example #1
0
 public static function rss($news)
 {
     $string = "<rss version='2.0'>";
     $string .= "<channel>";
     $string .= "<title>Puškice</title>\n\t\t\t\t\t<link>" . Request::root() . "</link>\n\t\t\t\t\t<description>Tačka spajanja studenata FON-a</description>\n\t\t\t\t\t<language>sr-rs</language>\n\t\t\t\t\t<pubDate>" . date("D, d M Y H:i:s e", strtotime("now")) . "</pubDate>\n\t\t\t\t\t<lastBuildDate>" . date("D, d M Y H:i:s e", strtotime("now")) . "</lastBuildDate>\n\t\t\t\t\t<docs>http://blogs.law.harvard.edu/tech/rss</docs>\n\t\t\t\t\t<generator>Puškice generator</generator>\n\t\t\t\t\t<managingEditor>info@puskice.org</managingEditor>\n\t\t\t\t\t<webMaster>info@puskice.org</webMaster>";
     foreach ($news as $article) {
         $string .= "<item>\n\t\t\t\t\t\t\t<title>" . $article->title . "</title>\n\t\t\t\t\t\t\t<link>" . Request::root() . "/vest/" . Puskice::dateToUrl($article->created_at) . "/" . $article->permalink . "</link>\n\t\t\t\t\t\t\t<description><![CDATA[" . Trans::_t($article->short_content) . "]]></description>\n\t\t\t\t\t\t\t<pubDate>" . date("D, d M Y H:i:s e", strtotime($article->created_at)) . "</pubDate>\n\t\t\t\t\t\t\t<guid>" . Request::root() . "/vest/" . Puskice::dateToUrl($article->created_at) . "/" . $article->permalink . "</guid>\n\t\t\t\t\t\t</item>";
     }
     $string .= "</channel>";
     $string .= "</rss>";
     return $string;
 }
 public function memedecode($id, $meme_id, $first_line, $second_line)
 {
     try {
         $image = Meme::findOrFail($meme_id);
         $meme = MemeInstance::findOrFail($id);
     } catch (Exception $e) {
         App::abort('404');
     }
     if (file_exists(PUBLIC_DIR . $image->img)) {
         $font = PUBLIC_DIR . 'assets/font/impact.ttf';
         $img = imagecreatefromjpeg(PUBLIC_DIR . $image->img);
         $white = imagecolorallocate($img, 255, 255, 255);
         $black = imagecolorallocate($img, 0, 0, 0);
         MemeGenerator::imagettftextoutline($img, 20, 0, 10, 45, $white, $black, $font, Trans::_t(mb_strtoupper(htmlspecialchars_decode(urldecode($meme->first_line)))), 2, 'up');
         MemeGenerator::imagettftextoutline($img, 20, 0, 10, 95, $white, $black, $font, Trans::_t(mb_strtoupper(htmlspecialchars_decode(urldecode($meme->second_line)))), 2, 'down');
         ob_start();
         imagejpeg($img);
         $data = base64_encode(ob_get_clean());
     }
     header("Content-Type: image/jpeg");
     echo base64_decode($data);
     //return Response::make("data:image/jpg;base64,".$data, 200, array('content-type' => 'image/jpg'));
 }
Example #3
0
function __($string)
{
    return Trans::_t($string);
}
Example #4
0
    public function function2048()
    {
        View::share('title', "2048 | Пушкице | Тачка спајања студената ФОН-а");
        $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(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;
        }
        $ogimage = Config::get('settings.defaultImage');
        $meta = '<title>2048: #fonbg izdanje</title>
				  <base >
				  <meta name="description" content="#fonbg 2048."> 
				  <link href="//www.puskice.org/usvsth3m.co.uk/2048/style/main.css" rel="stylesheet" type="text/css">

				  <meta name="apple-mobile-web-app-capable" content="yes">

				  <link href="//fonts.googleapis.com/css?family=Open+Sans&subset=latin,latin-ext" rel="stylesheet" type="text/css">
				  <meta name="HandheldFriendly" content="True">
				  <meta name="MobileOptimized" content="320">
				  <!-- <link rel="icon" href="//usvsth3m.co.uk/favicon.ico">  -->
				  <!-- <link rel="image_src" href="../intro.jpg"> -->
				  <!-- <meta property="og:image" content="//community.usvsth3m.com/2048/intro.jpg" /> -->
				  <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0, maximum-scale=1, user-scalable=no, minimal-ui">
				  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
				  <link href="//fonts.googleapis.com/css?family=Open+Sans&subset=latin,latin-ext" rel="stylesheet" type="text/css">
				  
				  <script src="//www.puskice.org/static.usvsth3m.com/js/wrapper.html"></script>
				  <link rel="stylesheet" href="//www.puskice.org/static.usvsth3m.com/css/wrapper.html">

				<style>
				  
				  .tile-text {
				    display:inline-block;
				    vertical-align: middle;
				  }

				  #uvt_box {
				    margin-top: -80px;
				  }
				  
				  
				  .tile-inner { background-position: center center !important; background-size: cover !important; background-repeat: no-repeat !important; }


				    
				    .tile-2 .tile-inner {
				      background-image: url("https://www.puskice.org/i.imgur.com/mDPgBQT.gif") !important; 
				    }
				  
				    
				    .tile-4 .tile-inner {
				      background-image: url("https://www.puskice.org/i.imgur.com/AJCewo6.gif") !important; 
				    }
				  
				    
				    .tile-8 .tile-inner {
				      background-image: url("https://www.puskice.org/i.imgur.com/uYuZILz.gif") !important; 
				    }
				  
				    
				    .tile-16 .tile-inner {
				      background-image: url("https://www.puskice.org/i.imgur.com/rb9cBw7.gif") !important; 
				    }
				  
				    
				    .tile-32 .tile-inner {
				      background-image: url("https://www.puskice.org/i.imgur.com/a6OHkjt.gif") !important; 
				    }
				  
				    
				    .tile-64 .tile-inner {
				      background-image: url("https://www.puskice.org/i.imgur.com/StPZKlu.gif") !important; 
				    }
				  
				    
				    .tile-128 .tile-inner {
				      background-image: url("https://www.puskice.org/i.imgur.com/vjWJLmd.gif") !important; 
				    }
				  
				    
				    .tile-256 .tile-inner {
				      background-image: url("https://www.puskice.org/i.imgur.com/RThRV8V.gif") !important; 
				    }
				  
				    
				    .tile-512 .tile-inner {
				      background-image: url("https://www.puskice.org/i.imgur.com/tmQQswo.gif") !important; 
				    }
				  
				    
				    .tile-1024 .tile-inner {
				      background-image: url("https://www.puskice.org/i.imgur.com/QsE9h31.gif") !important; 
				    }
				  
				    
				    .tile-2048 .tile-inner {
				      background-image: url("https://www.puskice.org/i.imgur.com/SfGbUDU.gif") !important; 
				    }
				  
				    
				  
				  .game-container { background-color: #565656 }
				  
				  
				  .preload, .preload img { position: absolute; top: -100px; -left: 100px; width: 1px; height: 1px; overflow: hidden; }
				  
				  #fix { 
				    position: absolute; top: 0; left: 0; width: 100%; height: 100%; position: fixed; z-index: -1000; 
				        }

				</style>

				  
				<script>
				var external_score; 
				var tile_contents = ["","","","","","","","","","","",""];

				var external_score;

				function tweet() {

				}

				function facebook() {

				}

				var sizes = [];
				function resizeTextOn(whichelement) {

				  if (typeof sizes[whichelement] == "undefined") {

				    $(whichelement + " .tile-inner").css("display", "block");
				    $(whichelement + " .tile-text").css("display", "inline-block");

				    $(whichelement + " .tile-text").css("fontSize", "60px");

				    while ($(whichelement + " .tile-text").width()+30 > $(whichelement + " .tile-inner").width()) {
				      var newSize = (parseInt($(whichelement + " .tile-text").css("fontSize")) - 1) + "px";
				      $(whichelement + " .tile-text").css("fontSize", newSize);
				    }

				    if (typeof newSize == "undefined") { var newSize = "60px"; }

				    $(whichelement + " .tile-text").css("lineHeight", newSize);

				    if (parseInt(newSize) > 50) {
				      $(whichelement + " .tile-text").css("position", "relative");
				      $(whichelement + " .tile-text").css("top", "5px");
				    } else {
				      $(whichelement + " .tile-text").css("position", "relative");
				      $(whichelement + " .tile-text").css("top", "0px");
				    }

				    $(whichelement + " .tile-inner").css("display", "table");
				    $(whichelement + " .tile-text").css("display", "table-cell");

				    sizes[whichelement] = newSize;

				  } else {

				    newSize = sizes[whichelement];

				    $(whichelement + " .tile-text").css("fontSize", newSize);
				    $(whichelement + " .tile-text").css("lineHeight", newSize);

				    if (parseInt(newSize) > 50) {
				      $(whichelement + " .tile-text").css("position", "relative");
				      $(whichelement + " .tile-text").css("top", "5px");
				    } else {
				      $(whichelement + " .tile-text").css("position", "relative");
				      $(whichelement + " .tile-text").css("top", "0px");
				    }

				    $(whichelement + " .tile-inner").css("display", "table");
				    $(whichelement + " .tile-text").css("display", "table-cell");

				  }

				}

				$(document).keypress(function(event) {
				  if ( event.which == 61 ) {
				    $(".tile-container").empty();
				    var tile = new Tile({x:0,y:0},2);
				    HTMLActuator.prototype.addTile(tile);
				    var tile = new Tile({x:1,y:0},4);
				    HTMLActuator.prototype.addTile(tile);
				    var tile = new Tile({x:2,y:0},8);
				    HTMLActuator.prototype.addTile(tile);
				    var tile = new Tile({x:3,y:0},16);
				    HTMLActuator.prototype.addTile(tile);
				    var tile = new Tile({x:0,y:1},32);
				    HTMLActuator.prototype.addTile(tile);
				    var tile = new Tile({x:1,y:1},64);
				    HTMLActuator.prototype.addTile(tile);
				    var tile = new Tile({x:2,y:1},128);
				    HTMLActuator.prototype.addTile(tile);
				    var tile = new Tile({x:3,y:1},256);
				    HTMLActuator.prototype.addTile(tile);
				    var tile = new Tile({x:0,y:2},512);
				    HTMLActuator.prototype.addTile(tile);
				    var tile = new Tile({x:1,y:2},1024);
				    HTMLActuator.prototype.addTile(tile);
				    var tile = new Tile({x:2,y:2},2048);
				    HTMLActuator.prototype.addTile(tile);
				  }
				});

				</script>

				<style>
				@media (min-width: 800px) {
				  .sharer {
				         -moz-column-count: 2;
				         -moz-column-gap: 20px;
				         -webkit-column-count: 2;
				         -webkit-column-gap: 20px;
				         
				  }
				  .sharer a { color: #0000cc; }
				}
				@media (max-width: 800px) {
				  .sharer {
				    padding: 0 10px;
				  }
				  .sharer a { color: #0000cc; }
				}

				</style>
				<meta property="og:image" content="' . $ogimage . '"/>
				<meta property="og:title" content="' . Trans::_t("2048 | Пушкице") . '"/>
				<meta property="fb:app_id" content="355697367892039"/>
				<meta property="og:site_name" content="' . Trans::_t("Пушкице - ФОН Андерграунд") . '"/>
				<meta property="og:type" content="article"/>
				<meta property="og:url" content="' . Request::root() . '/2048"/>
				<meta property="og:description" content="' . Trans::_t("Драге колеге, представљамо вам ФОН верзију популарне игрице 2048 у којој уместо бројева можете пронаћи карикатуре професора са нашег факултета.") . '" />
				<meta name="twitter:card" content="summary_large_image">
				<meta name="twitter:site" content="' . Trans::_t("Пушкице - ФОН Андерграунд") . '">
				<meta name="twitter:creator" content="@puskice">
				<meta name="twitter:domain" content="puskice.org">
				<meta name="twitter:app:name:iphone" content="' . Trans::_t("Пушкице") . '">
				<meta name="twitter:app:name:ipad" content="' . Trans::_t("Пушкице") . '">
				<meta name="twitter:title" content="' . Trans::_t("2048 | Пушкице") . '">
				<meta name="twitter:description" content="' . Trans::_t("Драге колеге, представљамо вам ФОН верзију популарне игрице 2048 у којој уместо бројева можете пронаћи карикатуре професора са нашег факултета.") . '">
				<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);
        $this->setLayout2($data);
        $this->layout->center = View::make('frontend.content.view2048', $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);
    }