Condition based MySQL left join with CASE

Happy to write post after long time šŸ™‚ I had a scenario that there is are some fields in a table like `id`,`group`,`object_id`. `group` field(ENUM) has three groups named `user`, `deal`, `scene` and `object_id`(it will have the primary key for corresponding group). ie., If the row has group name of `user`, then `object_id` refers to […]

Read Moreā€¦

jQuery auto-focus on particular text field after page load

Below code will help us to focus on particular text field in page. It will be used for users to start typing their queries after page is loaded. We can use this in login, search pages etc., for quick access. jQuery(document).ready(function() { var txtField = jQuery(“#autocomplete”).get(0); var elemLen = txtField.value.length; txtField.selectionStart = elemLen; txtField.selectionEnd = […]

Read Moreā€¦

Upload SWF file in wordpress

Here is the code to Upload swf file in wordpress. function swf_upload($mimes) { if (function_exists(‘current_user_can’)){ $unfiltered = $user ? user_can($user, ‘unfiltered_html’) : current_user_can(‘unfiltered_html’); } if (!empty($unfiltered)) { $mimes[‘swf’] = ‘application/x-shockwave-flash’; } return $mimes; } add_filter(‘upload_mimes’, ‘swf_upload’); We can use Kimili Flash plugin to embed the flash file.

Read Moreā€¦