wordpress

  • I have been looking for a way to access multisite data trough WP API, but it seems very hard to find. One and only the best reference i get is from git the_glue but need some update since it not updated. Below is my version or u can get form my git  <?php /* * Plugin…

    Baca catatan

  • Develop pulgin yang menggunakan shortcodes ini perlu tahu beberapa perkara Widget text tak support shortcodes secara default. Jika anda ingin menggunakan shortcodes pada bahagian widget. Pasti anda akan gunakan Widget Text. Tetapi secara defaultnya, widget text tak support shortcodes. Anda perlu aktifkan seperti berikut //Remove the filter if it already exists remove_filter(‘widget_text’, ‘do_shortcode’); //Add the…

    Baca catatan

  • Download this mail extension here  http://www.yiiframework.com/extension/mail. Extract the files. Move the vendors folder to protected/components/vendors/ Move YiiMail.php and YiiMailMessage.php to protected/components/ Add on protected/config/main.php [php] ‘components’=>array( … ‘mail’ => array( ‘class’ => ‘YiiMail’, ‘transportType’ => ‘php’, ‘transportType’ => ‘smtp’, ‘transportOptions’=>array( ‘host’=>’ghazalitajuddin.com’, //’encryption’=>’tls’, ‘username’=>’***@ghazalitajuddin.com’, ‘password’=>’******’, ‘port’=>25, ), ‘logging’ => true, ‘dryRun’ => false ), … ), [/php]…

    Baca catatan

  • Sample using CActiveDataProvider Sample 1: [php] $dataProvider=new CActiveDataProvider(‘User’,array( ‘criteria’=>array( ‘condition’=>’activationstatus = 1’), )); [/php] Sample 2: [php] $dataProvider=new CActiveDataProvider(‘Event’, array( ‘criteria’=>array( ‘condition’=>’date >= "’.date(‘Y-m-d’, strtotime(‘-2 years’)).’"’, ), )); [/php] Sample 3: [php] $dataProvider=new CActiveDataProvider(‘Post’, array( ‘pagination’=>array( ‘pageSize’=>5, ), ‘criteria’=>$criteria, )); [/php] Sample 4: [php] $dataProvider=new CActiveDataProvider(‘User’) [/php]

    Baca catatan

  • Some function is created to make code easy to read and manageable. The Lookup function is so powerfull to simplified data storage. Usually we store Approve, Not Approved, Qualified, Not Qualified in words for each records, but with Lookup class, we can make it short to an integer for each properties. Table scheme “tbl_lookup” [php]…

    Baca catatan

  • CGridView is one of Zii Components There is other than CGridView, CDetailView, CListView. Look here. CGridView use DataProvider which define in controller CGridView display data in tables. Supports paginating, sorting, searching. Also support view, update, delete method Define our data provider in controller like this [php] /** * Lists all models. */ public function actionIndex()…

    Baca catatan