Posts

Showing posts with the label drupal

Drupal Memcache setup

Image
Memcached Figure 1. The Memcached client library is responsible for sending requests to the correct servers. Step 1: Application requests keys foo, bar and baz using the client library, which calculates key hash values, determining which Memcached server should receive requests. Step 2: Memcached client sends parallel requests to all relevant Memcached servers. Step 3: Memcached servers send responses to the client library. Step 4: Memcached client library aggregates responses for the application. Install Memcache with Drupal: Windows XP: a. Install the Memcached Service Download memcached binaries for Win32 from http://jehiah.cz/projects/memcached-win32/ Unzip the binaries in a directory (eg. c:\memcached) Run the command “c:\memcached\memcached.exe -d install” for installing the service. Start the server using “c:\memcached\memcached.exe -d start” Server will be listening to port ...

How to secure drupal site

http://drupal.org/writing-secure-cod

Video Tutorial For File Download After making payment

http://www. torontowebsitedeveloper.com/ category/video/ubercart

how to give "no link" or separator to menu in drupal

Special menu items is a Drupal module that provides placeholder and separator menu items. A placeholder is a menu item which is not a link. It is useful with dynamic drop down menus where we want to have a parent menu item which is not linking to a page but just acting as a parent grouping some menu items below it. A separator menu item is something like "-------" which is not linking anywhere but merely a mean to structure menus and "separate" menu items visually.

how to retrieve data stored in the database in different language and print in php, mysql or drupal

While retrieving the data stored in the  database in different languages, it will be retrieved as unknown format(???).   To avoid this problem and to retrieving the original values please use the below given code before your select query  mysql_query("SET NAMES utf8"); mysql_query("SET CHARACTER SET utf8");

To Hide "Log Message" or "Revision information" from node form in drupal

To Hide "Log Message" manually , use the below code in template.php function phptemplate_node_form ( $form ) {   // Remove 'Log message' text area    $form [ 'log' ][ '#access' ] = FALSE ;   return drupal_render ( $form ); } OR  use the below module http://drupal.org/project/removelogmessage

How to get the views datas inside coding in drupal

To get the view datas inside coding , Use the below coding    $display = 'page_1'; // 'page_2' or 'block_1' etc $view = views_get_view('view_name'); $vars['photos'] = $view->preview($display, arg ); $vars['photo_count'] = $view->total_rows; Note: arg should be array arg should he replaced by array($vars['row']->nid) if used template.php file templatename_preprocess_views_view_fields(&$vars) { }

How to retrieve drupal views content using PHP Code

use the following php code for retrieve drupal 6 views content: $display = 'page_1'; // 'page_2' or 'block_1' etc $view = views_get_view('view_name'); $display = $view->execute_display('block_1', $myArg); print $display['content']; ?>

How to Fetch Profile field Values in drupal

We can add additional fields in the user registration form using profile module. The following code is used to fetch these profile field values anywhere in drupal. <?php global $user; profile_load_profile ( $user ); print( $user -> profile_ [ fieldnam e ]); ?>

how to get drupal block contents(using coding)

We can display any Drupal block anywhere in the website using the code given below. <?php $block = module_invoke( [module name], 'block', 'view', [block id] ); print $block['content']; ?>  

How to add js file in module's info file

A very basic .info file for our new module:    ; $Id$ name = my_example_module description = "My Example Module"  core = 6.x Add one more line to our basic .info file. scripts[] = my_example_module1 .js scripts[] = my_example_module2 .js This line won't be used by Drupal, but will be used by our module: function my_example_module_init() {      $path = drupal_get_path('module', 'my_example_module');      $info = drupal_parse_info_file($path . '/my_example_module.info');      foreach ($info['scripts'] as $script) {             drupal_add_js($path . '/' . $script);      } } The above function should be return in the .module file (hook_init)  It will read the module's .info file and load any JavaScript files specified in the scripts[] directive and add to the site using drupal_add_js (hope know abou...