Esempio n. 1
0
 public function packages($type)
 {
     $this->load->model('spark');
     $n = $this->input->get('n');
     $n = $n ? $n : 10;
     if ($type == 'latest') {
         $sparks = Spark::getTop($n);
         $data['type'] = 'Latest';
         $data['description'] = 'These are the most recently registered sparks with at least one release.';
     } elseif ($type == 'featured') {
         $sparks = Spark::getLatestOf($n, TRUE);
         $data['type'] = 'Featured';
         $data['description'] = 'These are sparks that the GetSparks team thinks are worth a spin';
     } elseif ($type == 'official') {
         $sparks = Spark::getLatestOf($n, NULL, TRUE);
         $data['type'] = 'Official';
         $data['description'] = 'These are sparks written by GetSparks, the Reactor Team, or CodeIgntier gurus';
     }
     $data['sparks'] = $sparks;
     $this->load->view('rss/sparks', $data);
 }
Esempio n. 2
0
<script type="text/javascript" charset="utf-8">
	$('#lazy_profile').available(function() {
		$.post("/ajax/contributors/get_profile_box", function(data) {
			$("#lazy_profile").html(data);
		});
	});
</script>

<?php 
$this->load->model('spark');
$featured_sparks = Spark::getLatestOf(3, TRUE);
$official_sparks = Spark::getLatestOf(3, NULL, TRUE);
?>

<div class="page-left">
	
	<div class="login-box clearfix">
        <div id="lazy_profile"></div>
	</div>
	
    <!-- Temporary Twitter -->
    
	<div class="info-box clearfix">
        <!-- <h2><a style="color:#33ccff;letter-spacing:3px;" href="http://twitter.com/getsparks">@getsparks</a></h2> -->
        <iframe allowtransparency="true" frameborder="0" scrolling="no"
          src="http://platform.twitter.com/widgets/follow_button.html?screen_name=getsparks&text_color=ffffff&link_color=00aeff"
          style="width:200px; height:20px;"></iframe>
        <p style="padding-top:12px;">Hey! Keep up to date with the project through its beta and public launch by following <a style="color:white;" href="http://twitter.com/getsparks">@getsparks</a>.</p>
        <a href="http://twitter.com/share" class="twitter-share-button" data-url="http://getsparks.org" data-text="GetSparks — The CodeIgniter Package Manager" data-count="horizontal" data-via="getsparks" data-related="_kennyk_">Tweet</a>
	</div>
    
Esempio n. 3
0
 /**
  * The call for showing the package listing page. For type, handles
  *  'latest', 'featured' and 'official'
  * @param string $type
  */
 function browse($type = false)
 {
     UtilityHelper::tryPageCache(1);
     $this->load->model('spark');
     $this->load->model('rating');
     $sparks = array();
     $data['browse_type'] = '';
     $data['description'] = '';
     $data['browse_type_raw'] = $type;
     if ($type == 'latest') {
         $sparks = Spark::getTop(200);
         $data['browse_type'] = 'Browse Latest';
         $data['description'] = 'These are the most recently registered sparks with at least one release.';
     } elseif ($type == 'featured') {
         $sparks = Spark::getLatestOf(FALSE, TRUE);
         $data['browse_type'] = 'Browse Featured';
         $data['description'] = 'These are sparks that the GetSparks team thinks are worth a spin';
     } elseif ($type == 'official') {
         $sparks = Spark::getLatestOf(FALSE, NULL, TRUE);
         $data['browse_type'] = 'Browse Official';
         $data['description'] = 'These are sparks written by GetSparks, the Reactor Team, or CodeIgntier gurus';
     } else {
         # Ugly fix for now, not sure why we didn't have a 'browse all'
         # in the first place :P
         $sparks = Spark::getTop(1000);
         $data['browse_type'] = 'Browse All';
         $data['description'] = 'These are all of GetSparks\' sparks';
     }
     # Get a list of spark ids on this page
     $ids = array();
     foreach ($sparks as $s) {
         $ids[] = $s->id;
     }
     # Wait until the views are donw
     $data['sparks'] = $sparks;
     $data['ratings'] = $this->rating->getRatingsFromList($ids);
     $this->load->view('packages/listing', $data);
 }