This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// an array to hold our parsed shots. | |
var str = []; | |
// next we iterate over the shots and find the URL we want to update. | |
var shots = function() { | |
$.getShotsByPlayerId( "popular", function(data) { | |
$.each(data.shots, function( i, shot ) { | |
var shot_url = shot.image_image_url.replace("http", "https"); | |
str.push('<li><a href="' + shot.url + '"><img src="' + shot_url+ '" alt="' + shot.title + '">'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//create a stub to add our parsed shots to. | |
$str = ''; | |
// here we assume you have already captured the API request content. | |
$shots = json_decode( $shots ); | |
// next we iterate over the shots and find the URL we want to update. | |
foreach( $shots->shots as $shot ) { | |
$shot_url = str_replace( 'http', 'https', $shot->image_url ); | |
$str .= '<li><a href="' . $shot->url . '"><img alt="' . $shot->title . '" src="' . $shot_url . '"></a></li>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach( $projects->objects as $project ) { | |
if( $project->date_due ) { | |
foreach( $project->team as $person ) { | |
$deets = $blimp->get( 'user', array('url' => $person) ); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function add_templates() { | |
$this->add_template( 'dash', dirname(__FILE__) . '/templates/dash.php' ); | |
$this->add_template( 'locations', dirname(__FILE__) . '/templates/location.multiple.php' ); | |
$this->add_template( 'new.location', dirname(__FILE__) . '/templates/location.new.php' ); | |
} | |
public function action_before_act_admin( $that ) { | |
if( !isset($that->handler_vars['page']) && $that->handler_vars['entire_match'] == 'admin' ) { | |
Utils::redirect( Site::get_url('admin') . '/dash/' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function action_modify_form_habari_login(FormUI $form) { | |
$form->add_class( 'large-7 large-centered columns' ); | |
$form->set_property( 'id', 'login-form' ); | |
$form->remove( $form->title ); | |
$form->remove( $form->reset_message ); | |
$form->habari_username->set_property( 'placeholder', 'Email Address' ); | |
$form->habari_password->set_property( 'placeholder', 'Password' ); | |
$buttons = $form->append( FormControlWrapper::create('buttons')->set_setting('wrap_element', 'ul')->add_class('button-group radius')->set_setting('wrap_each', '<li>%s</li>') ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function action_modify_form_habari_login(FormUI $form) { | |
$form->remove( $form->title ); | |
$form->remove( $form->reset_message ); | |
$buttons = $form->append( FormControlWrapper::create('buttons')->set_setting('wrap_element', 'ul')->set_setting('wrap_each', '<li>%s</li>') ); | |
$form->move_into( $form->login, $buttons ); | |
$form->remove( $form->submit_button ); | |
$buttons->append( FormControlSubmit::create('register')->set_caption('Register?')->on_success(function(){ /* do registraion things */}) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function theme_route_display_docpage($theme) { | |
$theme->document = Document::get( array('slug' => $theme->matched_rule->named_arg_values['slug']) ); | |
$theme->page = Page::get( array('document_id' => $theme->document->id, 'name' => $theme->matched_rule->named_arg_values['page']) ); | |
$theme->pages = Pages::get( array('document_id' => $theme->document->id, 'orderby' => 'id ASC') ); | |
$theme->title = $theme->document->title . ' » ' . $theme->page->title; | |
$theme->post_id = $theme->page->id; | |
$i = 0; | |
$str = ''; | |
$dom = new HTMLDoc( $theme->page->content ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach( $dom->find('h4') as $hs ) { | |
$slug = Utils::slugify( $hs->node->nodeValue ); | |
$heading = $dom->get( $hs ); | |
$heading->id = $slug; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#stars { | |
float:left; | |
width: 100%; | |
} | |
#stars p { | |
text-indent: -99999px; | |
} | |
.rating { | |
float:left !important; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="stars"> | |
<p>3.5 stars out of 5</p> | |
<div class="rating"> | |
<i class="icon-rating bottom hide">z</i> | |
<i class="icon-rating top"><span class="amount hundred">z</span></i> | |
</div> | |
<div class="rating"> | |
<i class="icon-rating bottom hide">z</i> | |
<i class="icon-rating top"><span class="amount hundred">z</span></i> | |
</div> |