/** * Get the logged-in user's gravatar * @param int $size The size of avatar to grab, default is 80px * @return string The URL of the avatar */ public static function getAvatarURL($size = 80) { $CI =& get_instance(); $CI->load->spark('gravatar-helper/1.1'); $CI->load->helper('gravatar'); return Gravatar_helper::from_email(self::getEmail(), NULL, $size, NULL); }
public function _remap() { // Initierar data, urldecodar om man valt att söka från URL eller utan javascript (submit) $site = $data['site'] = $this->uri->rsegment(2, 'all'); $search_string = $data['search_string'] = urldecode(trim($this->uri->rsegment(3, ''))); // Om siten inte finns i config/search_settings.php gå till base_url if( ! (array_key_exists($site, $this->search_model->search_engines) || $site === 'all')) redirect("/"); // Ser om vi postat utan javascript enablat if($this->input->post('submit') !== FALSE) $this->submit($site); // Bygger meny $data['menu_array'] = array( 'all' => array('active' => FALSE, 'title' => 'Sök på alla sökmotorer samtidigt!'), 'google' => array('active' => FALSE, 'title' => 'Sök på Google!'), 'yahoo' => array('active' => FALSE, 'title' => 'Sök på Yahoo!'), 'bing' => array('active' => FALSE, 'title' => 'Sök på Bing!') ); // Sätter aktivt menyval $data['menu_array'][$site]['active'] = TRUE; // Testar Sparks (getsparks.org) och Gravatar_helper $data['gravatar'] = Gravatar_helper::from_email('*****@*****.**', 'G', 150); // Gör en sökning om vi har någonting i söksträngen if($search_string !== '') $data['search_results']['results'] = $this->search($site, $search_string); // Echoar ut sökresultaten vi requestar med ajax if($this->input->is_ajax_request()) echo $this->load->view('search_results', $data['search_results'], TRUE); else $this->load->view('search_index', $data); }
function testWithDefault() { $url = 'http://goo.gl/HOtWh'; $this->assertEquals(Gravatar_helper::from_hash('1', null, null, $url), self::$base . "?gravatar_id=1&default={$url}"); }
<ul> <li class="clearfix"> <a style="font-size:16px;" href="#"> <img src="<?php echo Gravatar_helper::from_email('*****@*****.**', null, 40); ?> " /> </a> <p> <a style="font-size:16px;" href="#">Kenny Katzgrau</a><br /> </p> <br class="clear" /> <p><em>Something here...</em></p> </li> <li class="clearfix"> <a style="font-size:16px;" href="#"> <img src="<?php echo Gravatar_helper::from_email('*****@*****.**', null, 40); ?> " /> </a> <p> <a style="font-size:16px;" href="#">Beau Frusetta</a><br /> </p> <br class="clear" /> <p><em>Something here...</em></p> </li> </ul> <?php $this->load->view('global/_new_footer.php');
?> " alt="Kenny Katzgrau" /></a> <a title="John Crepezzi (@seejohnrun)" target="_blank" href="http://johncrepezzi.com/"><img src="<?php echo Gravatar_helper::from_email('*****@*****.**', null, 50); ?> " alt="John Crepezzi" /></a> <a title="Beau Frusetta (@beaufrusetta)" target="_blank" href="http://beau.frusetta.com/"><img src="<?php echo Gravatar_helper::from_email('*****@*****.**', null, 50); ?> " alt="Beau Frusetta" /></a> <a title="Mike Pauley (@mdpauley)" target="_blank" href="http://www.mdpauley.com/"><img src="<?php echo Gravatar_helper::from_email('*****@*****.**', null, 50); ?> " alt="Mike Pauley" /></a> <a title="Seán Downey (@downey_sean)" target="_blank" href="https://twitter.com/#!/downey_sean"><img src="<?php echo Gravatar_helper::from_email('*****@*****.**', null, 50); ?> " alt="Seán Downey" /></a> </p> <h3>The Project</h3> <p>Here's some project details:</p> <ol> <li>Issue Tracker / Project Management: <a href="http://getsparks.lighthouseapp.com/projects/70187-getsparksorg-repository/overview">http://getsparks.lighthouseapp.com/projects/70187-getsparksorg-repository/overview</a></li> <li>Code Repository: <a href="https://github.com/katzgrau/getsparks.org">https://github.com/katzgrau/getsparks.org</a></li> </ol> <h3>Special Thanks</h3>
<div class="right-col"> <h2>Recent Sparks</h2> <ul> <?php foreach ($top_sparks as $spark) { ?> <li class="clearfix"> <a style="font-size:16px;" href="<?php echo base_url(); ?> packages/<?php echo $spark->name; ?> /versions/HEAD/show"><img src="<?php echo Gravatar_helper::from_email($spark->email, null, 40); ?> " /></a> <p> <a style="font-size:16px;" href="<?php echo base_url(); ?> packages/<?php echo $spark->name; ?> /versions/HEAD/show"><?php echo $spark->name; ?> </a><br /> by: <a href="<?php echo base_url();
function testProfileWithBadEmail() { $res = Gravatar_helper::profile_from_email('*****@*****.**'); $this->assertNull($res); }