Thursday, February 23, 2012

Multiple modal box on one page, cakePHP-jQuery

November 6, 2010 by Ayo Akinyemi · Leave a Comment 

You must have installed jquery, called ajax helper in your controller and also call jquery in your layout Dynamically calling multiple modal box on a single page: In your view page, <?php echo $html->scriptStart() ?> $(function() { $(‘a#userinfoID’).click(function() { var uid = $(this).attr(‘userinfo’); $(‘#userdialog’ + uid).dialog(‘open’); return false; }); }); <?php echo $html->scriptEnd() ?> <?php [...]

Disabling comments on media page, WordPress

September 13, 2010 by Ayo Akinyemi · Leave a Comment 

Comment out the code calling the comments template in your custom theme. For twenty ten theme, line 111 in the attachment.php file comment out

cakePHP ‘created’ truncated to the date only

September 7, 2010 by Ayo Akinyemi · Leave a Comment 

$this->yourTableName->find(“all”,array(‘conditions’ => array(‘yourTableName.id’ => $this->params['pass'][0], ‘DATE(yourTableName.created) ‘ => date(“Y-m-d”,strtotime(“-0 day”))))); ‘created’ DB column name in cakePHP has a datetime format. the code finds record using the date(“Y-m-d”) condition.

Submit button as image, CakePHP

August 6, 2010 by Ayo Akinyemi · Leave a Comment 

echo $form->submit(‘submit’, array(‘type’ => ‘image’, ‘src’ =>$this->webroot . ‘img/myimage.jpg’, ‘height’ => ’15′, ‘width’ => ’15′)); or echo $form->end(‘myimage.jpg’); – no option to set the height or width, you’d have to put in css

CakePHP 1.3/PHP 5.3 ‘strtotime error’

June 29, 2010 by Ayo Akinyemi · Leave a Comment 

Caking and getting a strtotime ? PHP Warning: strtotime(): It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function…blah blah blah In the file app/config/core.php, simply uncomment this line: date_default_timezone_set(‘UTC’); Error will disappear.

CakePHP 1.3 ‘No Such File’ Fix – Mac User

June 29, 2010 by Ayo Akinyemi · Leave a Comment 

Method 1: Create a symbolic link (temporary) ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock This is temporary because the symlink is automatically deleted when MAMP deletes the temporary mysql.sock file. Method 2: Change MAMP’s configuration (permanent) Edit the following configuration files: /Applications/MAMP/bin/startMysql.sh and /Applications/MAMP/bin/stopMysql.sh Replace socket=/Applications/MAMP/tmp/mysql/mysql.sock with socket=/tmp/mysql.sock Important: Now shut your server down and start it back [...]

Smush your homepage images.

April 30, 2010 by Ayo Akinyemi · Leave a Comment 

Does your home page takes forever to load? Now you can Smush those images and reduce your image sizes. Smush.it uses optimization techniques specific to image format to remove unnecessary bytes from image files. It is a “lossless” tool, which means it optimizes the images without changing their look or visual quality. After Smush.it runs [...]

Javascript slideshows

March 11, 2010 by Ayo Akinyemi · Leave a Comment 

http://www.leigeber.com/2008/12/javascript-slideshow/ there is a demo link at the bottom of the page. This is a nice one http://smoothgallery.jondesign.net/showcase/gallery/#myGallery-picture%283%29 http://www.electricprism.com/aeron/slideshow/ this one is different and you could customize the graphics around it http://www.e2interactive.com/e2-gallery-pro/ its $15 but worth it http://tutorialblog.org/12-javascript-image-galleries/ this is a list of them http://devkick.com/lab/galleria/ http://valums.com/javascript-image-galleries/ another list Thanks to Teresa Lea for sharing this.

Google OS, netbooks and cloud computing

March 9, 2010 by Ayo Akinyemi · Leave a Comment 

Cloud solutions are here to stay but having netbooks run exclusively using cloud computing beats me. While Chrome OS boast of a blazing speed, putting data in the cloud means accepting the latency inherent in data transmission. In continents where bandwidth have been a major issue, data connection are usually very slow -except Google’s target [...]

Thesis theme, WordPress: Making time stamp appear in your byline

March 6, 2010 by Ayo Akinyemi · 1 Comment 

If you are using the Thesis theme on your WordPress site, noticed when you view your post page, there is no time stamp for the posts until you click on the individual post? here is how to make it show: navigate to this folder: /wp-content/themes/thesis/lib/functions/content.php add echo the_time(‘ g:i a’); to line 116… so it [...]

Next Page »