Tuesday, 29 April 2014

CakePhp Get Complete path

You can Have a Complete Path in cakephp using

<?php echo Router::url( $this->here, true ); ?>

If you want a relative path to be shown Use this :

<?php echo  $this->here; ?>

Wednesday, 16 April 2014

Technology Next Generation

Amazing New Technology that are beyond what 

we think

Keep Exploring !!

Thursday, 10 April 2014

Drupal: How to show and Hide form fields on form option select

Drupal Offer a great platform. You do not need to include any javascript or ajax to do so. What all you need to add in your form fields is

            '#states' => array('visible' => array(':input[name="report_for"]' => array('value' => '3'),),),

and all set

Create your select option attribute

$options = array('1' => 'Option1', '2' => 'Option2', '3' => 'Option3');

   $form['field_name'] = array(
            '#title' => t('Field Title'),
            '#type' => 'select',
            '#options' => $options,
            '#empty_option' => NULL,
            '#empty_value' => NULL,
            '#default_value' => 1,
            '#required' => TRUE,

And field that you want to he shown on selection any option in that fields simply right like this

        $form['field_name'] = array(
            '#title' => 'Field Title',
            '#required' => TRUE,
            '#states' => array('visible' => array(':input[name="report_for"]' => array('value' => '3'),),),

Now this field is visible only when a user select option3.

Saturday, 5 April 2014

Bloggers: How to redirect bloggers to your own domian

When You Think That you have enough traffic on your blog now you want to go on with more ideas and for better future o blog, IF you want to go live with the custom domain name, you can redirect bloggers account to your custom domain without loosing your Traffic. What all you need to do is copy and paste following given script.

Steps to be Followed 

  • Login to your bloggers account.
  • Click on Template Menu .
  • Paste the below given script on your template file.

To Redirect all pages from of bloggers to your custom domain Home Page Paste the Following script in your <head> section of a Template.

<script type='text/javascript'>
      var d='<data:blog.url/>';
      d=d.replace(/.*\/\/[^\/]*/, '');
      location.href = 'http://domain.com/';

Keep Exploring!!

Friday, 4 April 2014

Wordpress : Best way to show Twitter Feeds

To show Twittwer Feeds without using Plugin

What all you need to do

Go to Appearence -> widget

Drag and drop Text Widget

Paste the following code in a Text Area

<a class="twitter-timeline"  href="https://twitter.com/screenname"  data-widget-id="309736537778683904" data-screen-name="screenname" data-list-owner-screen-name="screenname_app" data-chrome="noheader nofooter noborders transparent noscrollbar">Tweets by @screenname</a>

<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>

Thursday, 3 April 2014

Php: Remove Admin Bar In Wodpress

add_action('after_setup_theme', 'remove_admin_bar');
function remove_admin_bar() {
    if (!current_user_can('administrator') && !is_admin()) {

Wednesday, 2 April 2014

Php : Get Time in a milisec

 This will result the time in a milisec :

$mileSec = round(microtime(true) * 1000);