Shortcode for drupal mp3 player

Shortcode Installation:

This shortcode Installation is like with all normal drupal modules:
extract the ‘mishu_swf.zip’
modules directory from your website (typically sites/all/modules).
go to modules find swf_tools_mod and active it

Shortcode Featur:

1. Shortcode for display mp3 player
2. mp3 player display inline
3. Customize play and sotp icon
4. Use multiple mp3 player
5. In the case of multiple player when you play one others will be pause automatically

Shortcode Usage:

Use shortcode in your post editor like [mishu_swf file=”sites/default/files/01.mp3″]
your short code name must be mishu_swf.
file is the parametar which is contain the mp3 file location
Download shortcode for drupal mp3 player
Hope you like drupal mp3 shortcode.

Web Form Page

 Get current node id Drupal 6

$nodeID = AM_get_current_node();
/**
 * AM_get_current_node()
 *
 * Return current node ID
 *
 * Author: Mishu
 */
function AM_get_current_node() {
    if ( arg(0) == 'node' && is_numeric( arg(1) ) ) {
        return arg(1);
    }
}

 
 

Drop Down Menu

CSS Design for WordPress Vartical Navigation Menus

<div id="nav_menue">
	<?php wp_nav_menu( array( 'menu' => 'headermemu') ); ?>
</div>
 #nav_menue ul li ul{
    position: absolute;
    display: none;
    top: -1px;
    left: 100%;
    width: 80%;
}
#nav_menue  ul li:hover>ul{
    display: block;
}
#nav_menue ul li{
    position: relative;
    margin-top: 0;
    list-style:none;
}
.parent> a{
    background: url(images/right.gif) no-repeat 97% 50%;
}
#nav_menue ul{
    padding: 0;
    margin: 0;
    list-style-type: none;
    font: bold 13px Verdana;
    list-style: none;
    width: 220px;
}
#nav_menue ul li:first-child{
    border-top: 1px solid #778;
}
#nav_menue ul li a{
    display:block;
    overflow: auto; /*force hasLayout in IE7 */
    color: #535353;
    font-size: 14px;
    text-decoration: none;
    padding: 6px;
    border-bottom: 1px solid #778;
    border-right: 1px solid #778;
    border-left: 1px solid #777788;
    margin-top:0;
}
#nav_menue ul li a:link, #nav_menue ul li a:visited, #nav_menue ul li a:active{
    background-color: #EDEDED; /*background of tabs (default state)*/
}
#nav_menue ul li a:hover{
    background-color: black;
    color: #fff;
}

CSS Design for wordpress Horizontal Navigation menu

<div id="header_nav_menu">
	<?php wp_nav_menu( array( 'menu' => 'headermemu') ); ?>
</div>
#header_nav_menu li a,
#header_nav_menu li {
    display: inline-block;
    text-decoration: none;
}
#header_nav_menu li a {
    border-bottom: 0;
    color: #6a6a6a;
    text-transform: uppercase;
    white-space: nowrap;
}
#header_nav_menu li a:hover {
    color: #000;
}
#header_nav_menu li {
    margin: 0 40px 0 0;
    margin: 0 2.857142857rem 0 0;
    position: relative;
}
#header_nav_menu li ul {
    display: none;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 100%;
    z-index: 1;
}
#header_nav_menu li ul ul {
    top: 0;
    left: 100%;
}
#header_nav_menu ul li:hover > ul {
    border-left: 0;
    display: block;
}
#header_nav_menu li ul li a {
    background: #efefef;
    border-bottom: 1px solid #ededed;
    display: block;
    font-size: 11px;
    font-size: 0.785714286rem;
    line-height: 2.181818182;
    padding: 8px 10px;
    padding: 0.571428571rem 0.714285714rem;
    width: 180px;
    width: 12.85714286rem;
    white-space: normal;
}
#header_nav_menu li ul li a:hover {
    background: #e3e3e3;
    color: #444;
}

 

Web Form

Programmatically Create Web form Component Drupal 6

Easily create web form component programmatically (drupal 6).

//Field defination
$component_email = array(
    'type' => 'textfield',
    'nid' => $nodeid,
    'clone' => '',
    'name' => 'email',
    'form_key' => 'app_email',
    'extra' => Array
        (
            'title_display' => 'before',
            'private' => 0,
            'disabled' => 0,
            'unique' => 1,
            'conditional_operator' => '=',
        ),
    'cid' => 2,
    'required' => TRUE,
    'validate' => 'email',
    'mandatory' => 1,
    'weight' => 1,
    'value' => '',
);
AM_webform_comp_create($component_email);
/**
  * AM_webform_comp_create($component_email)
  *
  * Programmatically Create Webform Component
  *
  * Parameters: $component_email(array);
  *
  * Author: Mishu
  */
function AM_webform_comp_create( $component_email ) {
    //include webform.components form webform module
    module_load_include('inc', 'webform', 'includes/webform.components');
    //Get current node id
    if ( arg(0) == 'node' && is_numeric( arg(1) ) ) {
        $nodeid = arg(1);
    }
    //Form key exist or not
    $form_email_key_exist = db_result(db_query("SELECT form_key From webform_component WHERE nid='$nodeid' AND form_key='app_email'"));
    //If form key not exit insert the email field
    if(empty($form_email_key_exist)) {
        webform_component_insert($component_email_id);
    }
    //update webform table
    $tableName = 'webform';
    $data = array(
        'nid' => $node->nid,
        'confirmation' => '',
        'confirmation_format' => 1,
        'redirect_url' => '<confirmation>',
        'status' => 1,
        'block' => 0,
        'teaser' => 0,
        'allow_draft' => 0,
        'auto_save' => 0,
        'submit_notice' => 1,
        'submit_text' => '',
        'submit_limit' => -1,
        'submit_interval' => -1,
        'total_submit_limit ' => -1,
        'total_submit_interval ' => -1,
    );
    AM_dbInsert($tableName, $data);
    $tableName = 'webform_roles';
    $data = array(
        'nid' => $node->nid,
        'rid' => 1,
    );
    AM_dbInsert($tableName, $data);
    $tableName = 'webform_roles';
    $data = array(
        'nid' => $node->nid,
        'rid' => 2,
    );
    AM_dbInsert($tableName, $data);
}
/**
  * AM_dbInsert()
  *
  * Insert data into a table
  *
  * Parameters: $table(string), $data(array) | Example: $table='test'; $data = array( 'field_name' => 'value');
  *
  * Author: Mishu
  */
function AM_dbInsert($table, $data) {
    $field = implode(", ", array_keys($data));
    $values = "'" . implode("', '", array_values($data)) ."'";
    $tbfstfld = db_result(db_query("SHOW COLUMNS FROM {$table}"));
    $StudentPro = db_query("INSERT INTO {$table} ($field) values ($values)");
    if($StudentPro === true) {
        return db_last_insert_id($table, $tbfstfld);;
    }
}

Drupal web form component

It is very difficult to create web form component manually if you have a lot of content with web form.

 Drupal web form

twiIf you like to creating web form component programmatically or find any bug please leave me a comment. Hope you enjoy my Drupal web form post.


Fatal error: Call to undefined function wp_pagenavi() in /home/mishubd/public_html/wp-content/themes/twentyfourteenchild/archive.php on line 45