Monday, May 21, 2012

WordPress query object keys

December 22, 2010 by Ayo Akinyemi · Leave a Comment 

WP_Query Object ( [query_vars] => Array ( [showposts] =>  [cat] =>  [meta_key] =>  [error] => [m] => 0 [p] => 0 [post_parent] => [subpost] => [subpost_id] => [attachment] => [attachment_id] => 0 [name] => [static] => [pagename] => [page_id] => 0 [second] => [minute] => [hour] => [day] => 0 [monthnum] => 0 [year] => [...]

Permission denied, cake bake console

November 6, 2010 by Ayo Akinyemi · Leave a Comment 

If you are getting a permission denied error while trying to bake, remember to chmod +x on the console file in your cake folder. keep walking…

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 [...]

Comment Rating plugin not working with Thesis 1.7 Theme – Fix

May 18, 2010 by Ayo Akinyemi · Leave a Comment 

Modify /lib/classes/comments.php Change line 276 : if ($output) echo $output; To: if ($output) echo apply_filters(‘comment_text’,$output);

Upgrading 1-2-All

May 7, 2010 by Ayo Akinyemi · 1 Comment 

To update 12all, copy the 12all folder into the root 1. rename /12all/admin/default.authentication_db.inc.php to /12all/admin/authentication_db.inc.php copy this code into the file: < ? PHP define("ACP_AUTHDB_SERVER", "localhost"); define("ACP_AUTHDB_USER", "username"); define("ACP_AUTHDB_PASS", "user_password"); define("ACP_AUTHDB_DB", "databasename"); ?> 2. rename /12all/admin/default. engine.inc.php to /12all/admin/engine.inc.php copy this code into the file: < ? php define(‘ACP_DB_HOST’, ‘localhost’); define(‘ACP_DB_USER’, ‘username’); define(‘ACP_DB_PASS’, ‘user_password’); define(‘ACP_DB_NAME’, [...]

Next Page »