Вы находитесь на странице: 1из 22

1. List out the different type of hooks in Drupal?

Ans: 1 hook_boot : Performed with uncached data 2 hook_cron: Perform periodic action 3 hook_exit: This hook is run at the end of each page request. Perform clean up action. 4 hook_menu: This hook enables modules to register paths in order to define how URL requests are handled. 5 hook_help: Provide documentation for module for user help 6 hook_init: Perform setup task. This hook is run at the beginning of the page request. It is typically used to set up global parameters which are needed later in the request. when this hook is called, all modules are already loaded in memory. It is performed with the cached data. 7 hook_mail: Prepare a message based on parameter called from function drupal_mail() 8 hook_perm: Define user permission 9 hook_user: Act on user account actions. This hook allows modules to react when operations are performed on user accounts. 10 hook_block: Declare a block or set of blocks. 11 hook_theme: Register a module (or theme's) theme implementations. 12 hook_access: Define access restrictions. This hook allows node modules to limit access to the node types they define.

2. How many types of menu in Drupal? Ans: 1 MENU_NORMAL_ITEM: Normal menu items show up in the menu tree and can be moved/hidden by the administrator. 2 MENU_CALLBACK: Callbacks simply register a path so that the correct information is generated when the path is accessed. 3 MENU_SUGGESTED_ITEM: Modules may "suggest" menu items that the administrator may enable. 4 MENU_LOCAL_TASK: Local tasks are menu items that describe different displays of data, and are generally rendered as tabs. 5 MENU_DEFAULT_LOCAL_TASK: Every set of local tasks should provide one "default" task, which should display the same page as the parent item. Note: If the menu type is omitted then it assume MENU_NORMAL_ITEM. 3. How many ways you can add css and js into Drupal? Ans: There are three ways to add js and css into Drupal 1 Js

a scripts[] = myscript.js: to your module or theme's .info file b drupal_add_js() : in your module or theme's code c #attached[js] property in a From API or renderable array. 2 css a stylesheets[all][] = somestylesheet.css to a theme's .info file. b drupal_add_css() from module or theme's code. c #attached[css] property in a From API or renderable array. 4. Write the syntax of drupal_add_JS? Ans: drupal_add_js($data = NULL, $type = 'module', $scope = 'header', $defer = FALSE, $cache = TRUE, $preprocess = TRUE) 5. Write the syntax of drupal_add_css? Ans: drupal_add_css($data = NULL, $type = 'module', $media = all, $preprocess = TRUE) 6. How you know the base path of drupal in javascript? Ans: Drupal.settings.basePath 7. How to add base path in js file in Drupal? Ans: Drupal.settings.basePath 8. How to get the 2nd largest value from any field in table? Ans: SELECT column FROM table ORDER BY column DESC LIMIT 1,1; 9. What is Cookie? Ans: A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user's computer. Each time the same computer requests a page with a browser, it will send the cookie too. With PHP, you can both create and retrieve cookie values. 10. How to generate a Cookie? Ans: setcookie(name, value, expire, path, domain);

11. How to destroy a Cookie? Ans: setcookie("user", "", time()-3600);


// set the expiration date to one hour ago

12. What is Session?

Ans: A PHP session variable is used to store information about, or change settings for a user session. Session variables hold information about one single user, and are available to all pages in one application. 13. How to set a session variable? Ans:session_start(); // store session data $_SESSION['views']=1; 14. How to unset a session variable? Ans: unset($_SESSION['views']); session_destroy(); 15. How many placeholders in Drupal and what differences among them? Ans: There are three special variable placeholders in Drupal which are used in the t() function. They are intended to signal different types of variables to be replaced in translation string. !(exclamation) - The text should be inserted 'as is'. This is useful if you are passing in a url via the l() function. @ - the text should be run through check_plain % - the string should be highlighted with theme_placeholder() 17. How to upload a file using ahah? 18. What is Panel in Drupal? Ans: The Panels module allows a site administrator to create customized layouts for multiple uses. At its core it is a drag and drop content manager that lets you visually design a layout and place content within that layout. Integration with other systems allows you to create nodes that use this, landing pages that use this, and even override system pages such as taxonomy and the node page so that you can customize the layout of your site with very fine grained permissions. 19. Access arguments calls which functions? Ans: user_access() 20. What is the port number for MySql & Apache? Ans: Mysql: 3306 https: 80 21. How many types of Mysql engine? 1. MyISAM 2. Heap 3. Merge

4. INNO DB 5. ISAM 22. Which MySql engine use by Drupal 6 and why? MyISAM 23. Which MySql engine use by Drupal 7 and why? . INNO DB 24. How drupal does its caching?

25. What is the uses of .html function in Jquery? Ans: It gives us complete html of a div. 26. What is the use of .bind function in Jquery? Ans: we can bind multiple event with one div. eg: $('#foo').bind({ click: function() { // do something on click }, mouseenter: function() { // do something on mouseenter } });

27. What is the use of array_merge in PHP? Ans: Basically it is used to merge two or multiple array.

28. If we have two types of array. One is index type of and another is associative type of and if we use the array_merge then what will be the type of merged array? Ans: The type of merged array would always associative. 29. What difference between having and where clause? Ans: 1.The WHERE clause specifies the criteria which individual records must meet to be selected by a query. It can be used without the GROUP BY clause. The HAVING clause cannot be used without the GROUP BY clause.

2. The WHERE clause selects rows before grouping. The HAVING clause selects rows after grouping. 3. The WHERE clause cannot contain aggregate functions. The HAVING clause can contain aggregate functions. 30. What is the IN operator in MySql? Ans:The IN operator allows you to specify multiple values in a WHERE clause. eg:- select salary from tblEmployee where salary in (10000, 15000, 20000); 31. How to alter view mysql query in Drupal? Ans: 1 hook_views_query_alter(&$view, &$query) 32. What is Database abstraction layer in Drupal? Allow the use of different database servers using the same code base. Drupal provides a slim database abstraction layer to provide developers with the ability to support multiple database servers easily. The intent of this layer is to preserve the syntax and power of SQL as much as possible, while letting Drupal control the pieces of queries that need to be written differently for different servers and provide basic security checks. Most Drupal database queries are performed by a call to db_query () or db_query_range (). Module authors should also consider using pager_query () for queries that return results that need to be presented on multiple pages, and tablesort_sql () for generating appropriate queries for sortable tables 33. What is Database intergrity. 37. What is web services .? Ans: Drupal site to communicate and interact with other web applications, such as Flickr, Amazon, Mollom, or Twitter, we need to use standard communication protocols in the web development world called web services. Web service protocols will allow applications that reside on external websites and servers to interact and communicate with our Drupal website that is running on our own server. Web services will also allow our Drupal site to pass along content and data to external web applications existing on remote servers. When we define web services, we need to point out that this type of communication provides for interoperability. This means that a web service communication can happen between two completely different environments but still work because we use standard protocols to make it happen.

Web services allow us to call another application on a remote server. Protocol used in web-services: SOAP (Simple Object Access Protocol), UDDI (Universal Description, Discovery and Integration), WSDL (Web Services Description Language), XML-RPC (XML Remote Procedure Call), JSON (JavaScript Object Notation), JSON-RPC, REST (Representational State Transfer) AMF (Action Message Format) For more detail: http://www.packtpub.com/article/introducton-drupal-web-services

38. How many type of protocol used in web services in terms of Drupal? Ans: SOAP (Simple Object Access Protocol), UDDI (Universal Description, Discovery and Integration), WSDL (Web Services Description Language), XML-RPC (XML Remote Procedure Call), JSON (JavaScript Object Notation), JSON-RPC, REST (Representational State Transfer) AMF (Action Message Format)

39. Types of data send method in PHP ? 40. What is view argument ? Ans: Arguments are a way to send information to a view, these arguments can filter the view or modify them. I use them mostly to create dynamic view filters, filters that change according to the content that's on the page, usually with block views or views inside quicktabs. 41. What is the use of template.php in Drupal ? Ans: This file is used to override theme function.

42. What is the use of page.tpl.php in Drupal ? Ans: This template defines the main skeleton for the page. 43. How to create a tpl for particular node ? Ans: Use the given function below in your template.php: function myTheme_preprocess_node(&$vars){ $vars['template_files'][] = 'node-'. $vars['node']->nid; } Note: Make sure this function should not be redeclare in your template.php 44. Where SESSION variable store on server? Ans: By Default it store on temp directory of server. you can get path using function : session_save_path(); 45. How do you know, where SESSION variable store on server? Ans: The location of the $_SESSION variable storage is determined by PHP's "session.save-path" configuration. Usually this is "/tmp" on a Linux/Unix system. Use the phpinfo()function to view your particular settings. 46. How to change path of SESSION variable in server ? Ans: session_save_path('/home/example.com/sessions'); 47. How many type of node available in Drupal ? Ans: Basically 2 types of node available in drupal. 1) Static (page) 2) Dynamic (story) 48. Describe hook_nodeapi with operation ? 49. How to create tpl for front page in drupal. Ans: Just copy page.tpl.php and rename it to page-front.tpl.php 50. How to create a multi site in Drupal .? Ans: Following code is test in fedora 1) Install one Drupal as per standard. ( e.g - multisite) 2) Create A directory in sites directory of your drupal (demo.multisite.com) 3) Create settings.php file in newly created directory 4) Create 2nd database for this second site 5) define your site in hosts file ( vi /etc/hosts ) e.g : 127.0.0.1 www.multisite.com 127.0.0.1 demo.multisite.com

6) Create virtual host in httpd file ( vi /etc/httpd/conf/httpd.conf ) e.g: <VirtualHost 127.0.0.1> DocumentRoot /var/www/html/multisite ServerName www.multisite.com </VirtualHost> <VirtualHost 127.0.0.1> DocumentRoot /var/www/html/multisite ServerName demo.multisite.com </VirtualHost>

7) restart httpd services (sudo service httpd restart) Your second Drupal is ready to install, Please follow the standard step to install this

51. How to create a custom variable in jquery ? Ans: Write this code in your Drupal file:$my_settings = array( 'stream_publish' => 1, 'fb_uid' =>12, ); dupal_add_js(array('fb_perm' => $my_settings), 'setting'); Now you can get these variable in Js like: var stream_publish = Drupal.settings.fb_perm.stream_publish; var fb_uid = Drupal.settings.fb_perm.fb_uid;

52. How to post on facebook using api .? 53. Difference b/w synchronous & Asynchronous in terms of Ajax.? Ans: Ajax can access information on the server without having to reload the web page.

There are two ways that Ajax can access the server. These are synchronous (where the script stops and waits for the server to send back a reply before continuing) and asynchronous (where the script allows the page to continue to be processed and will handle the reply if and when it arrives). 54. How to work Ajax in Synchronous way.? Ans : http://javascript.about.com/od/ajax/a/ajaxasyn.htm 55. How to debug drupal ? Ans: Devel module is used to debug drupal. 56. Which hook run first out of hook_init & hook_boot in drupal ? Ans: Hook_boot 57. How to use two database in Drupal ? Ans: $db_url[default], $db_url[legacy] used just like above in your settings.php 58. How to install two database together in drupal ?

59. What happened, if we changed our database server ..? Ans: nothing wrong with the change database server (plSql). It will work properly. 60. How to use Replace statement in mysql .? Ans: 61. What is composite key in mysql .? Ans: A primary key can consist of one or more columns of a table. When two or more columns are used as a primary key, they are called a composite key. Each single column's data can be duplicated but the combination values of these columns cannot be duplicated. 62. Type of keys in Mysql .? Ans: Super Key Super key is a set of one or more than one keys that can be used to identify a record uniquely in a table. Example : Primary key, Unique key, Alternate key are subset of Super Keys.

Candidate Key A Candidate Key is a set of one or more fields/columns that can identify a record uniquely in a table. There can be multiple Candidate Keys in one table. Each Candidate Key can work as Primary Key. Example: In below diagram ID, RollNo and EnrollNo are Candidate Keys since all these three fields can be work as Primary Key.

Primary Key Primary key is a set of one or more fields/columns of a table that uniquely identify a record in database table. It can not accept null, duplicate values. Only one Candidate Key can be Primary Key. Alternate key A Alternate key is a key that can be work as a primary key. Basically it is a candidate key that currently is not primary key. Example: In below diagram RollNo and EnrollNo becomes Alternate Keys when we define ID as Primary Key. Composite/Compound Key Composite Key is a combination of more than one fields/columns of a table. It can be a Candidate key, Primary key. Unique Key Uniquekey is a set of one or more fields/columns of a table that uniquely identify a record in database table. It is like Primary key but it can accept only one null value and it can not have duplicate values Foreign Key Foreign Key is a field in database table that is Primary key in another table. It can accept multiple null, duplicate values. Example : We can have a DeptID column in the Employee table which is pointing to DeptID column in a department table where it a primary key. 63. How to update your Drupal module in a specified version? Ans: Use hook_updatre_N in your install file. 64. How to normalize your database .? 65. Why Innodb is more faster than Myisam database engine ? Ans: Row-level locking, transactions, foreign key constraints and crash recovery.

66. How to interact with Drupal search system? There are three ways to interact with the search system: Specifically for searching nodes, you can implement nodeapi (update index) and nodeapi (search result). However, note that the search system already indexes all visible output of a node, i.e. everything displayed normally by hook_view () and hook_nodeapi (view). This is usually sufficient. You should only use this mechanism if you want additional, non-visible data to be indexed. Implement hook_search (). This will create a search tab for your module on the /search page with a simple keyword search form. You may optionally implement hook_search_item () to customize the display of your results. Implement hook_update_index (). This allows your module to use Drupals HTML indexing mechanism for searching full text efficiently. If your module needs to provide a more complicated search form, then you need to implement it yourself without hook_search (). In that case, you should define it as a local task (tab) under the /search page (e.g. /search/mymodule) so that users can easily find it.

67. Explain Taxonomy in drupal . Drupal has a system for classifying content, which is known as taxonomy and implemented in the core Taxonomy module. You can define your own vocabularies (groups of taxonomy terms), and add terms to each vocabulary. Vocabularies can be flat or hierarchical, can allow single or multiple selection, and can also be free tagging (meaning that when creating or editing content, you can add new terms on the fly). Each vocabulary can then be attached to one or more content types, and in this way, nodes on your site can be grouped into categories, tagged, or classified in any way you choose. 68 . How database system of drupal works ? Drupal stores information in a database; each type of information has its own database table. For instance, the basic information about the nodes of your site are stored in the Node table, and if you use the CCK module to add fields to your nodes, the field information is stored in separate tables. Comments and Users also have their own database tables, and roles, permissions, and other settings are also stored in database tables. 69. List the SEO modules available in Drupal. 1. Pathauto 2. Nodewords/ Meta tags 3. Service links

4. Google analytics 5. Related Links 6. Search 404 7. Site map 8. Url list 70. What is a patch? A patch is a file that consists of a list of differences between one set of files and another. All code changes, additions, or deletions to Drupal core and contributed modules/themes between developers are done through patches. The differences are presented in a structured, standard way, which means that a program (also named patch) can be used to apply the changes to another copy of the original file. 71. What is difference between Diff and Patch ? diff creates patch In simple terms, the diff command is used to compare differences between two versions of a file. The resulting file is called a patch, and typically is given (by the user) a .patch suffix. This patch file then can be used on other copies of the old file by using the patch command, thus updating their old file(s) to match the new file(s). Why you would use diff When might one use diff to create a patch file? Lets say you are customizing a module to fix a bug, and have saved a new version of the module. How will you pass on your bug fix to others? Simply passing on your version of the module may not work, because its quite possible someone else has modified some other aspect of the code at the same time and you both would be overwriting each others changes. So instead, what you do is run diff between the two files, and then upload the resulting patch which others can then apply to their files using the patch command. (And you can apply other peoples patches against your files, without losing your own changes.) The added benefit of this type of workflow is that changes to the code can easily be tracked and undone, if necessary which is essential in a community-developed project such as Drupal 72. What is PDO? PDO is an acronym for PHP Data Objects. PDO is a lean, consistent way to access databases. This means developers can write portable code much easier. PDO is not an abstraction layer like PearDB. PDO is a more like a data access layer which uses a unified API (Application Programming Interface). 73. How to enable clean urls in drupal ?

The standard Drupal installation contains a sample .htaccess file which supports clean URLs. It is easy to miss copying this file, because of the leading dot. So before trying to enable Clean URLs, make sure this file exists in your Drupal installation. Drupal 6.x In Drupal 6, the installer tests for compatibility with Clean URLs as a part of the installation process. Drupal 5.x Goto the administer >> site configuration >> clean urls section of the administrative interface. Clean urls can be enabled by following the above two options in respective versions of drupal website. 74. Which are the core required modules in drupal 6.x ? 1. Block Controls the boxes that are displayed around the main content. 2. Filter Handles the filtering of content in preparation for display. 3. Node Allows content to be submitted to the site and displayed on pages. 4. System Handles general site configuration for administrators. 5. User Manages the user registration and login system.
75. What are hooks in Drupal ? Allow modules to interact with the Drupal core. Drupals module system is based on the concept of hooks. A hook is a PHP function that is named foo_bar(), where foo is the name of the module (whose filename is thus foo.module) and bar is the name of the hook. Each hook has a defined set of parameters and a specified result type. To extend Drupal, a module need simply implement a hook. When Drupal wishes to allow intervention from modules, it determines which modules implement a hook and calls that hook in all enabled modules that implement it. 76. Where is the data stored in a MySQL database? MySQL uses files to store data. These files are under the data/databasename directory, where databasename is the name of the database. There are three file types: .ISM, .FRM, and .ISD. The .FRM file contain the table schema. The .ISD is the file that actually holds the data. The .ISM file is the file that provides quick access between the two of them. 77. Explain advantages of MyISAM over InnoDB? Ans: Much more conservative approach to disk space management - each MyISAM table is stored in a separate file, which could be compressed then with myisamchk if needed. With InnoDB the tables are stored in tablespace, and not much further optimization is possible. All data except for TEXT and BLOB can occupy 8,000 bytes at most. No full text indexing is available for InnoDB. TRhe COUNT(*)s execute slower than in MyISAM due to tablespace complexity.

78. What are HEAP tables in MySQL? -

Ans: HEAP tables are in-memory. They are usually used for high-speed temporary storage. No TEXT or BLOB fields are allowed within HEAP tables. You can only use the comparison operators = and <=>. HEAP tables do not support AUTO_INCREMENT. Indexes must be NOT NULL. 79. How do you control the max size of a HEAP table? MySQL config variable max_heap_table_size. 80. What are CSV tables? Those are the special tables, data for which is saved into comma-separated values files. They cannot be indexed.

For more Sql question http://www.techinterviews.com/29-mysql-interview-questions http://booleandreams.wordpress.com/php-mysql-interview-question/ 81. What is the difference between Primary Key and Unique key? Ans: Primary Key: A column in a table whose values uniquely identify the rows in the table. A primary key value cannot be NULL. Unique Key: Unique Keys are used to uniquely identify each row in the table. There can be one and only one row for each unique key value. So NULL can be a unique key.There can be only one primary key for a table but there can be more than one unique for a table 82. What are the current versions of apache, PHP, and MySQL?

83.What is drush,and how it is installed? Ans:Drush is a command line shell and scripting interface for Drupal.It is used to access drupal site from command line. Installing Drush 1.Download the drush module from drupal.org. 2.Go to drush path via command line run this command pear install drush .It will install drush on your system.If permission problem occurs then use sudo. 3.Download drupal using drush command drush dl drupal-7.x . 4.For installing drupal using drush run the command given below. sudo drush site-install --db-url=mysql://username:password@server/databasename --account-name=drupalsiteusername --account-pass=drupalsitepassword Like : --site-name=drupalsitename where db-url will be the url for your database with username and password of mysql configuration.

account-name will be drupal username from which you are going to login. account-pass will be drupal password from which you are going to login. Ex: sudo drush site-install --db-url=mysql://root:phpmyadmin@localhost/drupaldrush -account-name=admin --account-pass=drupal123 --site-name="DRUPAL For more command on drush please refer this site http://drush.ws/

84.What is the use of node import module in drupal? Ans:Node import allows users to import content (node, user, taxonomy) from CSV or TSV files.

JavaScript in Drupal (D7)


85. what is default package of javascript inside Drupal Core? Ans: Along with jQuery 1.4.4 the following plugins are provided by Drupal: 1 jQuery UI 1.8.6 2 jQuery Cookie, a simple, lightweight utility plugin for reading, writing, and deleting cookies 3 jQuery Form, a plugin to easily and unobtrusively upgrade HTML forms to use AJAX 4 iQuery Once, which filters out all elements that had the same filter applied to them previously 5 jQuery BBQ, a back button and query library 6 Farbtastic,a color wheel 86. what is tha method by tha way we can write Jquery code in Drupal ? Ans: Drupal sets jQuery up to use its no conflict mode. This means that the $ variable is relinquished so Drupal can work with other JavaScript libraries that may use the $ variable. More detail is available at http://api.jquery.com/jQuery.noConflict. In the absence of $ there are two methods for writing JavaScript that use jQuery. The first is to use jQuery in any place where you may have used the $. For example:

jQuery().ready(function() { ... }); The other way is to wrap your code in an anonymous function and choose an alias. For example: (function($) { $().ready(function() { ...

}); })(jQuery);

87. How to passing variables from PHP to JavaScript in Drupal ? Ans: Drupal provides a means of passing variables from PHP to JavaScript using drupal_add_js(). Drupal calls the variables passed from PHP to JavaScript settings. A simple example of a setting that passes the text "Hello World!" from PHP to JavaScript would look like: drupal_add_js(array('helloWorld' => "Hello World!"), 'setting'); JavaScript can access this at Drupal.settings.helloWorld. For example the following JavaScript would display the "Hello World" as a pop-up: alert(Drupal.settings.helloWorld); Passing multiple settings should be done in a nested array. For example: $settings = array( 'helloWorld' => array( 'display' => 'Messag text 1', 'message' => 'Mesaage text 2!', ), ); drupal_add_js($settings, 'setting'); we can access these js variable by this: Drupal.settings.helloWorld.display, Drupal.settings.helloWorld.message

88. How to Altering JavaScript in Drupal ? Ans: JavaScript added to a page has a last chance to be altered before being rendered to the output page. A module that implements hook_js_alter() has a last chance to act on or change the JavaScript /** * Implements hook_js_alter(). */ function jquery_uncompressed_js_alter(&$javascript) { $path = drupal_get_path('module', 'jquery_uncompressed') $javascript['misc/jquery.js']['data'] = $path . '/jquery.uncompressed.js'; }

89. How to apply theme by Javascript in Drupal ? Ans: Drupal.theme(), It is Js function and responsible for theming in Drupal by Js. A module should provide a theming function within the Drupal.theme.prototype namespace. Then, the module would call Drupal.theme() to access the theme function. The following example illustrates this. (function($) { Drupal.theme.prototype.hello = function(text) { return '<h2>' + text + '</h2>'; } $().ready(function() { $('#hello-world').html(Drupal.theme('hello', 'Hello World!')); }); })(jQuery);

90. How to make Translatable string in Drupal by Js ? Ans: All the text inside the Drupal interface is translatable. Inside the PHP code for Drupal the t() function is used for translations. Inside JavaScript the Drupal.t() function is used to handle translations.

Continuing the Hello World module we can extend it to handle, say "hello" to different cities, where the "hello" part is translatable. (function($) { Drupal.theme.prototype.hello = function(text) { return '<h2>' + Drupal.t('Hello @city', {'@city': text}) + '</h2>'; } $().ready(function() { $('#hello-world').html(Drupal.theme('hello', 'Chicago')); }); })(jQuery); //====/ END of Drupal JS /====//

91. What is difference between PHP exit and Drupal_exit() ?

Ans: PHP exit() function may stop the execution of internal functions (such as session handling) or API hooks. The drupal_exit() function is provided to safely stop the execution of a Drupal request. 92.Most commonly used modules in drupal? 1.CCK:-The Content Construction Kit allows you to add custom fields to nodes using a web browser. 2.Views:-The Views module provides a flexible method for Drupal site designers to control how lists and tables of content, users, taxonomy terms and other data are presented. This tool is essentially a smart query builder that, given enough information, can build the proper query, execute it, and display the results. 3.Administration menu:-Provides a theme-independent administration interface . Administrative links are displayed in a CSS/JS-based menu at the top on all pages of your site. 4.CKEditor:-This module will allow Drupal to replace textarea fields with the CKEditor - a visual HTML editor, sometimes called WYSIWYG editor. This HTML text editor brings many of the powerful WYSIWYG editing functions of known desktop editors like Word to the web. 5.Pathauto:-The Pathauto module automatically generates URL/path aliases for various kinds of content (nodes, taxonomy terms, users) without requiring the user to manually specify the path alias. 6.IMCE:-IMCE is an image/file uploader and browser that supports personal directories and quota. 7.Filefield:-FileField provides a universal file upload field for CCK. It is a robust alternative to core's Upload module and an absolute must for users uploading a large number of files. Great for managing video and audio files for podcasts on your own site. 8.Imagefield:-ImageField provides an image upload field for CCK. ImageField is a CCK-based alternative to the legacy Image project. It boasts features such as multiple images per node, resolution restrictions, default images, and extensive Views support. 9.Imagecache:-ImageCache allows you to setup presets for image processing. 10.ImageAPI:This API is meant to be used in place of the API provided by image.inc. You probably do not need to install this module unless another module are you using requires it. It provides no new features to your Drupal site. It only provides an API other modules can leverage. Currently GD2 and ImageMagick support are distributed with ImageAPI. 11.Panels:-The Panels module allows a site administrator to create customized layouts for multiple uses. At its core it is a drag and drop content manager that lets you visually design a layout and place content within that layout. 12.Chaos tool suite (ctools):-This suite is primarily a set of APIs and tools to improve the developer experience. It also contains a module called the Page Manager whose job is to manage pages. In particular it manages panel pages, but as it grows it will be able to manage far more than just Panels. 13.Devel:-A must have tool for developers to debug their sites. 14.Webform:-A must-have module for every site. Often used for contact forms and has all kinds of useful functionality. 93.How to add date using sql?

ans:-using ADDTIME(@t1,@t2); DATE_ADD(d,INTERVALval unit) can also be used. ex:-DATE_ADD(NOW(),INTERVEL 1 DAY); 94.How to substract dates using sql? ans:-SELECT DATE_SUB(NOW(), INTERVAL 2 DAY); 95.How to update jquery library in drupal? ans:-It can be done by four method 1.Using hook_js_alter:-This hook is used for drupal 7 only. 2.Running 2 versions of jQuery side-by-side - the jQuery noConflict() function. 3.Using jquery_update module 4.Swapping jquery with preprocess page FOR detailed description for each of this method refer to the site http://drupal.org/node/1058168 96.How to create new custom content type in drupal? ans:Follow the step for creating a custom module.Inside .module file use the below mentioned hooks. 1.hook_node_info():-This is a hook used by node modules. This hook is required for modules to define one or more node types. 2.hook_form():-This hook, implemented by node modules, is called to retrieve the form that is displayed when one attempts to "create/edit" an item. go through this link http://www.sanisoft.com/blog/2010/12/06/how-to-create-a-customcontent-type-using-module-in-drupal/ 97.Which modules are used for seo purpose in drupal? ans:pathauto,globalredirect,xmlsitemap,robotstxt,nodewords. 98.What should we use in place of $(document).ready(function(){ // do some fancy stuff }); in drupal? ans:It is recommanded to use Drupal.behaviors.myModuleBehavior = function (context) { //do some fancy stuff }; 99.How to submit a form without using submit button? ans:This can easily be achieved using javasctipt submit() function.An example is given below <html> <head> <script type="text/javascript"> function submitform(){ document.forms["form"].submit(); } </script>

</head> <body> <form id ="form" name="test" method="POST" action="#"> <input type="text" name="name" value="" onChange="submitform()"></input> </form> </body> </html>

100. What is the diff. b/w CONCAT & CONCAT_WS in Mysql. Ans: CONCAT will simply concatenate two column but by using CONCAT_WS function we can add a unique character b/w column name e.g SELECT CONCAT('FIRST ', 'SECOND'); ------------- Result = FIRSTSECOND FIRST,SECOND

SELECT CONCAT_WS( ' , ' , 'FIRST','SECOND');----------------- Result =

101. How to connect with mysql in php? Ans: DEFINE ('DB_USER', 'root'); DEFINE ('DB_PASSWORD', ''); DEFINE ('DB_HOST', 'localhost'); DEFINE ('DB_NAME', 'ayurveda'); //Connect to MySQL and select the database: $dbc = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) or die ('could not connect to MySQL: ' .mysql_connect_error($dbc)); mysql_select_db(DB_NAME) or die('Could not select the database: ' . mysql_error($dbc)); 102. How to find the given number is palindrome? Ans: $a = strtolower("madam") ; $b = strrev($a) ; if($a==$b) { echo "Word is Palindrom " ; }else{ echo "Word is not palindrom" ; }

Read more: http://wiki.answers.com/Q/Program_for_palindrome_in_php#ixzz1zUVZUD7m 103. What is Wild card in mySql? Ans: SQL wildcards can substitute for one or more characters when searching for data in a database. SQL wildcards must be used with the SQL LIKE operator. With SQL, the following wildcards can be used: Wildcard % _ [charlist] [^charlist] or [!charlist] Description A substitute for zero or more characters A substitute for exactly one character Any single character in charlist Any single character not in charlist

104. The first line is a standard. Every .info file should begin with ;$Id$. What is this? Ans: It is the placeholder for the version control system to store information about the file. When the file is checked into Drupal's CVS repository, the line will be automatically expanded to something like this: ;$Id: first.info,v 1.1 2009/03/18 20:27:12 mbutcher Exp $ This information indicates when the file was last checked into CVS, and who checked it in.

View Drupal:
Q. What is view? A. The Views provides a flexible for Drupal site designers to control how lists and tables of
content, users, taxonomy terms and other data are presented. This tool is essentially a smart query builder that, given enough information, can build the proper query, execute it, and display the results. Among other things, Views can be used to generate reports, create summaries, and display collections of images and other content.

Вам также может понравиться