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
<?php | |
function save($category) { | |
$packageguide = JRequest::get( 'POST' ); | |
$files = JRequest::get( 'FILES' ); | |
if (isset($files['image_upload']) && !$files['image_upload']['error']) { | |
$dir = JPATH_ROOT.DS.'media'.DS.'packageguide'.DS.$category; | |
if(!file_exists($dir)) { | |
mkdir($dir, 0777, true); | |
} | |
move_uploaded_file($files['image_upload']['tmp_name'], $dir.DS.$files['image_upload']['name']); |
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 class="block_content"> | |
<?php $c = 0; foreach ($dossiers as $k => $dossier): | |
if ($c % 4 == 0) print '<div class="clearfix">';?> | |
<div class="dossier <?php if ($k % 4 == 3) print 'last'; ?>"> | |
<?php if (!empty($dossier->article_image_filepath)): ?> | |
<a href="<?php print url('node/'.$dossier->nid); ?>"><?php print theme('imagecache', 'op_list', $dossier->article_image_filepath, '', '', array('class' => 'dossier_img')); ?></a> | |
<?php endif; ?> | |
<h4><a href="<?php print url('node/'.$dossier->nid); ?>"><?php print $dossier->title; ?></a></h4> | |
</div> | |
<?php if ($c % 4 == 3 || $count == (count($dossiers))) print '</div>'; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Moo test</title> | |
</head> | |
<body> | |
<h1>Moo</h1> | |
<p>Lorem ipsum..</p> | |
</body> | |
</html> |
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
<?php | |
function partners_field_attach_form($entity_type, $entity, &$form, &$form_state, $langcode) { | |
if ($entity_type != 'field_collection_item' || $entity->field_name != 'field_partner_products') { | |
return; | |
} | |
$form['#after_build'][] = 'partners_products_after_build'; | |
$id = drupal_html_id('partners_field'); | |
$form['#prefix'] = '<div id="'. $id .'">'; |
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
<?php | |
$query = new EntityFieldQuery(); | |
$entities = $query->entityCondition('entity_type', 'node') | |
->entityCondition('bundle', array('column','blog')) | |
->propertyCondition('uid', $user->uid) | |
->propertyCondition('status', 1) | |
->propertyOrderBy('created', 'DESC') | |
->range(0, 3) | |
->execute(); |
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
// Cherry pick; edit message | |
git cherry-pick --edit 3fbd473 | |
// Cherry pick; see where its cherry picked from | |
git cherry-pick -x bdf9578 | |
// Cherry pick; put your username on the cherry pick | |
git cherry-pick --signoff bdf9578 |
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
<?php | |
/* Register custom post types on the 'init' hook. */ | |
add_action( 'init', 'my_register_post_types' ); | |
/** | |
* Registers post types needed by the plugin. | |
* | |
* @since 0.1.0 | |
* @access public |
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
# model; quotations.rb | |
class Quotation < MailForm::Base | |
attribute :name, :validate => true | |
attribute :email, :validate => /\A([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\z/i | |
attribute :organisation, :validate => true | |
attribute :telephone, :validate => true | |
attribute :attachment, :attachment => true | |
attribute :message | |
# Declare the e-mail headers. It accepts anything the mail method |
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
<?php $flickr_photostream = get_field('flickr_photoset'); ?> | |
<?php if (isset($flickr_photostream['items'])): ?> | |
<ul class="flickr-items"> | |
<?php foreach ($flickr_photostream['items'] as $id => $photo): ?> | |
<li> | |
<a href="<?php echo $photo['large']; ?>" title="<?php echo $photo['title']; ?>"> | |
<img src="<?php echo $photo['thumb']; ?>" /> | |
</a> | |
</li> |
OlderNewer