z-index of dropdown menu vs iframe (youtube) video issue

When you are using iframe to display any video, for example if you are using youtube iframe video and on your site it has a dropdown menu and your dropdown memu is showing behind the iframe video you can make it top of iframe video with below written jquery code.

(function ($) {
    $ = jQuery;
    $(function () {
        $video = $("#parentocontainer> iframe");
        $srcVal = $video.attr('src');
        appendedVal = $srcVal + "?wmode=opaque";
        //or
        //appendedVal = $srcVal + "&wmode=opaque";
        $video.attr('src',appendedVal);
    });
 })(jQuery);

Upload featured image on custom post from wordpress front-end

When you are working with wordpress custom post type and you need to allow user can submit new posts where On each post you need to upload photo of the post also that can be a featured image then you need to follow below codes to upload attachmends and to make it featured.

//Just uploading photo or attachments
require_once(ABSPATH . "wp-admin" . '/includes/image.php');
require_once(ABSPATH . "wp-admin" . '/includes/file.php');
require_once(ABSPATH . "wp-admin" . '/includes/media.php');
         

//$file_handler = 'upload_attachment' //Form attachment Field name.
$attach_id = media_handle_upload( $file_handler, $post_id );


//making it featured!
set_post_thumbnail($post_ID, $attach_id );
or
update_post_meta($post_id,'_thumbnail_id',$attach_id);

Replacing media urls on wordpress posts

Sometimes we work for a website with wordpress keeping the development version on sub directory. Say are working for http://www.example.com website and currently it is live and we work for it’s new version in wordpress. So we setup a new wordpress version on new folder so the current development version is http://www.example.com/new

When we are done with all development and uploaded all contents on that new setup that means all media files and contents media urls are targeting with http://www.example.com/new

So when we are going to make the site live we need to do something manually to replace media paths for contents. Or if we directly copy contents from another hosting in that case same things will happen.

For the faster replacement of each media guid, contents media url or other meta values below mentioned 3 mysql query is nice.

Note: After running below code we need to ensure that all wp-contents/uploads folders contents are available as it was on new development directory.

update wp_posts set guid = replace(guid, 'http://www.example.com/new', 'http://www.example.com')

update wp_posts set post_content = replace(post_content, 'http://www.example.com/new', 'http://www.example.com')

update wp_postmeta set meta_value = replace(meta_value, 'http://www.example.com/new', 'http://www.example.com')

update wp_options SET option_value = 'http://www.example.com' WHERE option_name = 'home' OR option_name = 'siteurl';

 

With this above queries below listed things will happen –
1. Replace all resource or post guid
2. Replace all old media src url to new src url in post contents
3. Replace all meta resource url like image, video or audio etc
4. Replace site home page and siteurl url

dd simple photo gallery wordpress plugin

It is to introduce my recently developed wordpress simple photo gallery plugins. If you are maintaining a wordpress enabled website, If you are searching for a photo gallery which is simple to use, simple to modify to developer and simple in looks then you are quitely invited to use this “dd simple photo gallery”.
From the begining of the release version 1.0 of this wordpress plugins I got a lot of thanks giving email and bug report. Some of discussion already available on this plugins home page http://www.dropndot.com/blog/wordpress/dd-simple-photo-gallery-wordpress-plugin/

You can download it from wordpess extension directory here http://wordpress.org/extend/plugins/dd-simple-photo-gallery/ to know more about this you can review the discussion on http://www.dropndot.com/blog/wordpress/dd-simple-photo-gallery-wordpress-plugin/
Read More

developing cakephp multilingual website

To develop any multilingual website (Translated database content only) using cakephp framework all basic steps are discussed below. If you want fully multilingual website with translated button text or label text then go forward with Internationalizing your application
To manage multiple language translated content for any specific models specific field cakephp has a core behavior named TranslateBehavior.
Suppose we want a website with multiple number of language support and site administrator can add/edit/delete any language and front-end user can choose any language to visit the website.
Here are the list of steps given below.
Step 1: Create a db language table

CREATE TABLE `languages` (
  `id` int(11) NOT NULL auto_increment,
  `title` varchar(120) NOT NULL,
  `flag` varchar(100) default NULL,
  `code_2_digit` varchar(2) NOT NULL,
  `code_4_digit` varchar(6) NOT NULL,
  `created` datetime NOT NULL,
  `modified` datetime NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

now do a management for languages db table for site administrator
Read More

page scraping on php

if you are looking for page scraping help on php you can use below mentioned 2 function to fetch a web page then parse it as you wish. It’s using php curl extension and some string processing functions. Before start using it you need to enable the php_curl extension first then follow the below steps.

Getting a full webpage content:

< ?php
$pageUrl = 'http://maps.google.com';
$pageHtmlContent = getPage($pageUrl);
?>

Parsing a page html content:

< ?php
$subHtmlContent =  getValueByTagName($pageHtmlContent, '
', ''); ?>

Then you can now process the rest of content as you need. Above mentioned getPage and getValueByTagName functions are defined below you need to include them on you php page to use it.
Read More

installing ImageMagick on windows with wamp

After wamp installation on windows ImageMagick extension is not installed by default. Installing ImageMagick on windows with wamp is quite simple like other extension installation.

To install ImageMagick on windows follow below listed 7 steps

Step 1: go to http://www.imagemagick.org/script/binary-releases.php#windows and download latest version of imagemagick windows-dll.exe

Step 2: download php_imagick.dll from http://www.dlldll.com/php_imagick.dll_download.html

Step 3: install imagemagick(*.*.*)windows-dll.exe

Step 4: copy php_imagick.dll to (*)wampbinphpphp5.2.5ext directory
Read More

codeigniter framework for web apps development

There are a couple of web application development open source php framework. For example Cakephp, Codeigniter, Zend, Symfony, Kohana, Prado etc also you can visit http://www.webdesignbooth.com/22-open-source-php-frameworks-to-shorten-your-development-time/ for others. To develop a MVC structured well organized LAMP based application which open source framework you will choose? Which one is lightweight, less time required, secured, rich community and well documented?
Recently I wrote a post on forrst.com to know what frameworks are most favorites to developers world wide. The post link is http://bit.ly/dozgrH you can take a review. It seems most of the web developers like codeigniter as standard framework. Yes it’s me also :0 But last 1 years I was using cakephp in fact for dropndot cms which are currently under development on dropndot are using cakephp also. Before moving on development based on any framework I thought Codeigniter is for small application and very easy to use and not much rich community like Cakephp. That was the only reason to use it.
Read More

google Maps JavaScript API By Example

Below written code is a example of google map api which you can find from google when you sign up for google map. Using your site url and also there are a key that’s are valid only for your given link or site.
Hope your script running nice But one things!

You may confused!
<code>
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
</code>
How can you set GLatlng parameter! is not it?
yap This two parameter is

1) Latitude
2) Longitude

For More about Latitude and Longitude Just search in google by writing
1) define:Latitude
2) define:Longitude

You may understand just visit this link(By Yahoo inc) where you find a given addresses latitude and longitude
http://www.batchgeocode.com/lookup/

Read More