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
/** | |
* A cross-browser method to get the correct event target | |
* @param object e The event being fired | |
* @return object targ The event target | |
*/ | |
Navigation.prototype.getEventTarget = function(e) | |
{ | |
var targ; | |
if (e.target) { // W3C |
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 | |
App::uses('AppController', 'Controller'); | |
/** | |
* Users Controller | |
* | |
* @property User $User | |
*/ | |
class UsersController extends AppController { |
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 | |
// set up a stack | |
$options = array(); | |
/* our list of values to ignore (the ones that are permitted to be duplicates) | |
(made into an array so that you can easily add other options to be ignored, | |
without having to modify the other rules) */ | |
$exceptions = array('10'); |
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
# Dump of table release_notes | |
# ------------------------------------------------------------ | |
CREATE TABLE `release_notes` ( | |
`id` int(11) unsigned NOT NULL AUTO_INCREMENT, | |
`version_id` int(11) DEFAULT NULL, | |
`detail` text, | |
PRIMARY KEY (`id`) | |
) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
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 | |
/** | |
* image Generator -- see trac ticket #778 and #795 | |
* | |
* Resizes an image | |
* | |
* For proper documentation see the phpdoc for the imageGenerator function. | |
*/ | |
// If there isn't a directory for cached images, make one. |
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 | |
/* HEADLINE ARTICLE */ | |
if (isset($headline)) : | |
?> | |
<div id="headline" class="search_result"> | |
<a href="http://<?php print $DOMAIN . buildNewsArticleURL($headline[0]->id);?>"> | |
<?php | |
if ($headline[0]->imageURL != "") { | |
print imageGenerator('http://' . $DOMAIN . '/images/'. $headline[0]->imageURL, array( |
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 | |
/** | |
* image Generator -- see trac ticket #778 | |
* | |
* takes an image and does some magic on it. | |
*/ | |
/** | |
* Resizes an image | |
* | |
* Once an image has been generated by this function, it is cached and subsequent |
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 | |
// Now this is a story, all about how my $dirTree got flipped-turned upside down | |
$reversed_dirTree = array_reverse($dirTree); | |
// and I'd like to take a minute, just sit right there, I'll tell you how loop the object to get the default category down there. | |
foreach ($reversed_dirTree as $dirTree_category) { | |
if (in_array($dirTree_category->name, $directory_category_names)) { | |
$parent_cat_name = $dirTree_category->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
<?php | |
$value = ($short_form == 'sent') ? 'Sent' : 'Send'; | |
?> | |
<input type="submit" value="<?=$value;?>" /> |
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 getNeighbours($moblog, $limit = 3, $order = 'Moblog.modified') { | |
// check for existence of order param in session, and use it if so | |
if ($this->Session->check('Moblog.order')) { | |
$order = $this->Session->read('Moblog.order'); | |
} | |
// modify the find statements based on the order param |