Tipstank - tipstank.com
General Information:
Latest News:
WordPress more tag doesn’t work 21 Apr 2013 | 09:11 pm
When trying to get post in WordPress inside files other than the main page, the more tag may not work. In my example, I try to get the more tag to work when calling the_content() inside a WordPress pa...
How to code comments with avatars in WordPress 4 Apr 2013 | 02:01 pm
Here is how you should do to get comments and their Avatars in WordPress. Observe. $comments = get_comments( $atts ); echo ' '; foreach ( $comments as $comment ){ echo ' ' . get_avatar($comment->co...
Set home page using default controller and default action in Yii 2 Apr 2013 | 11:38 am
To set your home page using a default controller and a default action in Yii, you can do this. Inside your protected/config/main.php, do this. This controller will be used if no controller can be matc...
Git and tracking branches 29 Mar 2013 | 05:47 pm
Tracking branches are local branches that tracks and pulls from a branch that exist in remote. Here are some actions you do dealing with tracking branches. Create a new branch story45 as a tracking br...
Using Yii Framework to add JavaScript within the head tag 28 Mar 2013 | 10:25 am
With Yii, To add a JavaScript reference inside the HEAD tag, you may do it like this. Yii::app()->clientScript->registerScriptFile('scripts/geoloc.js', CClientScript::POS_HEAD); Which will generate a ...
Using Yii Framework too add JavaScript within the head tag 28 Mar 2013 | 10:25 am
With Yii, To add a JavaScript reference inside the HEAD tag, you may do it like this. Yii::app()->clientScript->registerScriptFile('scripts/geoloc.js', CClientScript::POS_HEAD); Which will generate a ...
Yii – using CListView to construct a ul / unordered list 26 Mar 2013 | 01:16 pm
By default when using CListView, the widget will give us a div container. To return a ul container, one have to do this. $this->widget('zii.widgets.CListView', array( 'dataProvider' => $dataProvider, ...
Rails assets not loading during test 24 Mar 2013 | 05:38 am
When testing your Rails application, if you’ve discover the test cases that requires JavaScript are failing, chances are your assets are not loaded during the test. Use save_and_open_page or use debug...
Yii Pagination Using CListView and CLinkPager 15 Mar 2013 | 08:00 am
This is an example of how I implement pagination in Yii using CListView and CLinkPager. From my limited test, what I found is that by defining a custom pager ourselves, Yii will use the limit and offs...
MySQL Stored Procedure – Loop Through Select Result Example 5 Mar 2013 | 01:42 pm
Here is an example of a MySQL stored procedure. What it does is it loops through each row of a query, process it, and then stores it in another table. BEGIN #declare variable DECLARE v_agent_name, v_c...