Flipkart

Wednesday, June 22, 2011

Drupal Module List

Here is the link where you can find all the module list based on the usage per week.

http://drupal.org/project/usage


Below you can find the video which explains the usage of the each module in real time.

http://gotdrupal.com/videos/top-drupal-modules


Monday, June 20, 2011

Reset admin(uid = 1) password in drupal 7

When the password for the user to Drupal (the administrator) is lost and the e-mail notification does not work, you can set the password via an SQL query.

But you must first generate a password hash that apply to your site.

Run the following commands from the command line, in the Drupal root directory:
For Linux:
./scripts/password-hash.sh newpassword

For Windows:
php .\scripts\password-hash.sh newpassword 

Then it will generate the Hash Password which somethink like
$S$CTo9G7Lx28rzCfpn4WB2hUlknDKv6QTqHaf82WHTsTHiod

Then execute the following query on the Drupal database:
UPDATE users SET pass ='thepasswordhash' WHERE uid = 1; 

OR you can use below code to get the Password:

require_once 'includes/password.inc';
echo user_hash_password('newpassword'); 
die();

Add above lines in index.php below this
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);


And refresh it .

Friday, June 17, 2011

Downloaded modules not showing up Drupal

There are mant reasons to not displaying downloaded modules in admin->site_build->modules. I f you face similar issue then please check below methods to resolve it

Run Cron Manually
Apply Permission to 755 to modules folder
Check whether same module is existing with other name(Check file names in side the module folder)
safe_mode should be OFF(check in phpinfo())

Friday, June 10, 2011

Run Linux on Windows Using VMWare Player

Here is the Good article links which explains clearly how can we install Linux on windows like any other Program using VMWare Player


http://www.lifehack.org/articles/technology/beginners-guide-run-linux-like-any-other-program-in-windows.html


http://www.makeuseof.com/tag/3-ways-to-install-linux-on-windows-or-mac/

Get Firefox Bookmarks from Hard Drive

If you see files on your hard drive, you can get the HTML file that stores all bookmarks. It is stored in the Profiles folder created by Mozilla.

In Windows XP/2000
C:\Documents and Settings\username\Application Data\Mozilla\Firefox\Profiles\xxxxx.default

In Windows Vista
C:\Users\username\AppDataRoaming\Mozilla\Firefox\Profiles\xxxxxxxx.defaultbookmarks.html

In Windows 98 & ME
C:\WINDOWS\Application Data\Mozilla\Firefox\Profiles\xxxxxxxx.defaultbookmarks.html

You can import bookmarks and the location of files from your old hard drive in Firefox or IE on your computer.









Implement Start Number and End Number of the Search Results in Drupal

Here is the code for implement start result and end result of the search results in Drupal.
 First we need to define Global variables of the Pager.


global $pager_page_array, $pager_total, $pager_total_items;

//establish page variables
  $total_pages = $pager_total['0'];
  $total_page_count = $total_pages - 1;
  //approx number of results based on page count
  $approx_results = $total_pages * 10;
  //calculate range
  $page_number = $pager_page_array['0'];
  $start_result = $page_number * 10 + 1;
  $end_result = $page_number * 10 + 10;

Customize "Your search yielded no results" Text in Search Results Drupal

Below is the sample code for customizing the "Your search yielded no results"  message in Template.php file

function theme_name_box($title, $content, $region = 'main') {

  if ($title == 'Your search yielded no results')

  {

    $title = 'Sorry, we couldn\'t find what you were looking for';
    $content = 'Check if your spelling is correct.';
}

 $output = '<div style="margin:10px"><h3>'. $title .'</h3>'. $content .'</div>';

  return $output;

}

Wednesday, June 8, 2011

Ajax Module With Image Button Drupal

If you are using Ajax module for Drupal Forms which having image button, then you can not submit the form.
To fix that kind of issue then we have to use  '#button_type' => 'submit ajax-trigger', attribute to submit button. Below is the sample code...

$path = drupal_get_path('theme', 'tradenet').'/images/image_button.png';
      $form['#ajax'] = array(
        'enabled' => TRUE
      );
      $form['submit'] = array(
             '#type' => 'image_button',
             '#access' => 1,
             '#button_type' => 'submit ajax-trigger',
             '#src'=>$path,
             '#ajax' => array('submitter' => TRUE ),

            
          );

Remove colon from label Drupal

To remove Colon from label for form elements just add this below code in to your template.php of the active theme. And replace Theme with your theme name. You can find Original code at includes/form.inc

 
function theme_form_element($element, $value) {
  // This is also used in the installer, pre-database setup.
  $t = get_t();

  $output = '


  if (!empty($element['#id'])) {
    $output .= ' id="'. $element['#id'] .'-wrapper"';
  }
  $output .= ">\n";
  $required = !empty($element['#required']) ? '*' : '';

  if (!empty($element['#title'])) {
    $title = $element['#title'];
    if (!empty($element['#id'])) {
      $output .= ' \n";
    }
    else {
      $output .= ' \n";
    }
  }

  $output .= " $value\n";

  if (!empty($element['#description'])) {
    $output .= '
'. $element['#description'] ."
\n";
  }

  $output .= "
\n";

  return $output;
}

Friday, June 3, 2011

Drupal 7 supports RDF

RDF (Resource Description Framework), which is a standard for encoding metadata and other information on the Semantic Web. In the Semantic Web, data processing applications using the dissemination of structured information in a decentralized and distributed all over the web today. RDF is an abstract, how to break information into separate pieces, and even if it is more popularly known in / RDF XML syntax, RDF can be stored in different formats. This article discusses the abstract RDF model, two specific serialization formats such as RDF is used and how it differs from the standard XML, the higher the level of the RDF semantics, best practices, implementation and querying RDF data sources.

Here are the some good Video Tutorials about RDF:




PhpPgAdmin First time Login Problem

A problem that occurs very often the error message "Access is prohibited for safety reasons," which occurs when a user tries to access a blank password, a common (presumably well-protected) on development machines. For such access, set ['extra_login_security'] to FALSE in the conf/config.inc.php.

['extra_login_security'] = false;

Wednesday, June 1, 2011

Configure PostgreSQL in WAMP Server

Here is the good PDF file which explains how to install PostgreSQL in WAMP server.

Installing-WampServer2-0c-With-PostgreSQL

If you are using php 5.2.6, there is some problem in adapter of php5.2.6, thats it is unable connect to PostgreSQL. For making connection we are using adapter of php5.2.5. you can download dll files using below link if you dont find in online.

php5.2.4 dll files