Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| Overview | |
| -------- | |
| The idea here is to have a single "library" (in this case it's actually a driver) | |
| that loads an API from _other_ add-ons. | |
| For instance, say you wanted you application to interact with Google Maps for | |
| ExpressionEngine, but you want to do it in a nice easy to use fashion without loading | |
| a whole bunch of dependencies and reverse engineer someone's code. With an effort to | |
| eliminate duplicate code and make life easier for all developers, we can now use |
| private function param($param, $default = FALSE, $boolean = FALSE, $required = FALSE) | |
| { | |
| $name = $param; | |
| $param = $this->EE->TMPL->fetch_param($param); | |
| if($required && !$param) show_error('You must define a "'.$name.'" parameter in the '.__CLASS__.' tag.'); | |
| if($param === FALSE && $default !== FALSE) | |
| { | |
| $param = $default; |
| <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
| class Email_Template { | |
| public $to, | |
| $from, | |
| $cc, | |
| $bcc, | |
| $channel_id, | |
| $categories, |
| <!-- This goes in the document HEAD and will add an additional click event to the objects with a class of 'trigger' --> | |
| <script type="text/javascript"> | |
| /* By using the $(document).ready() function, we can ensure this JavaScript gets loaded after all the global map variables are set. */ | |
| $(document).ready(function() { | |
| $('.trigger').click(function() { | |
| var $t = $(this); |
| <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
| /** | |
| * Simple Date Formatting Plugin | |
| * | |
| * @package ExpressionEngine | |
| * @category Plugin | |
| * @author Justin Kimbrell | |
| * @copyright Copyright (c) 2012, Justin Kimbrell | |
| * @link http://objectivehtml.com/ |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| <?php | |
| // backwards compabitility for EE < 2.4 | |
| defined('URL_THIRD_THEMES') OR define('URL_THIRD_THEMES', $this->EE->config->item('theme_folder_url').'third_party/'); |
| SELECT GROUP_CONCAT(CONVERT(CONCAT(',', `exp_category_posts`.`cat_id`), CHAR(8)) SEPARATOR ' ') as `category_ids` | |
| FROM `exp_channel_data` | |
| LEFT JOIN `exp_category_posts` ON `exp_channel_data`.`entry_id` = `exp_category_posts`.`entry_id` | |
| LEFT JOIN `exp_channel_titles` ON `exp_channel_data`.`entry_id` = `exp_channel_titles`.`entry_id` | |
| GROUP BY `exp_channel_data`.`entry_id` | |
| HAVING `category_ids` LIKE '%,10 %' AND `category_ids` LIKE '%,1 %' | |
| LIMIT 0 , 30 |
| <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
| /** | |
| * ExpressionEngine - by EllisLab | |
| * | |
| * @package ExpressionEngine | |
| * @author ExpressionEngine Dev Team | |
| * @copyright Copyright (c) 2003 - 2011, EllisLab, Inc. | |
| * @license http://expressionengine.com/user_guide/license.html | |
| * @link http://expressionengine.com |
| <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> | |
| <script type="text/javascript"> | |
| $(document).ready(function() { | |
| function submit(form, callback) { | |
| var action = form.attr('action'); | |
| var post = {}; | |
| form.find('input, select, textarea').each(function() { | |
| var $t = $(this); |