Skip to main content

Posts

drupal interview questions and answers for 2 years experience

drupal interview questions and answers for 2 years experience Compare Joomla and Drupal Terminology Joomla Template is called Theme in Drupal. Component = Module. Module = Block. Mambot/Plugin = Input filter. Menu-Horizontal = Primary Links Menu-Vertical = Navigation Dynamic Content Item = Story Static Content = Page Back-end = there is no back-end in Drupal, SEF = Clean URLs (but some docs refer to SEF, too). Section = Taxonomy Vocabulary/Term Section Title = Taxonomy Term (master) Category = Taxonomy Term (child) Introtext = Teaser Maintext = Body (see explanation below) Pathway = Breadcrumb Q: Drupal current version ? Answer:- The Drupal current varsion is 7.21 Q:What is Drupal ? Drupal is an open-source platform and content management system for building dynamic web sites offering a broad range of features and services including user administration, publishing workflow, discussion capabilities, news aggregation, metadata functionalities using controlled ...

how to get the first 500 record from table in php mysql mysql

we are geting first 500 record form table using php and mysql mysql_connect("hostname", "username","") mysql_select_db("databasename"); $sql = "SELECT * FROM table ORDER BY id DESC LIMIT 50"; $result = mysql_query($sql);   while ($query = mysql_fetch_assoc($result))     {     echo "$query[fieldname1] $query[fieldname2] <br/>"; }

find visitor location php

<?php function geoCheckIP($ip)   {   //check, if the provided ip is valid   if(!filter_var($ip, FILTER_VALIDATE_IP))   {   throw new InvalidArgumentException("IP is not valid");   }   //contact ip-server   $response=@file_get_contents('http://www.netip.de/search?query='.$ip);   if (empty($response))   {   throw new InvalidArgumentException("Error contacting Geo-IP-Server");   }   //Array containing all regex-patterns necessary to extract ip-geoinfo from page   $patterns=array();   $patterns["domain"] = '#Domain: (.*?)&nbsp;#i';   $patterns["country"] = '#Country: (.*?)&nbsp;#i';   $patterns["state"] = '#State/Region: (.*?)<br#i';   $patterns["town"] = '#City: (.*?)<br#i';   //Array where results will be stored   $ipInfo=array();   // &nbsp;   //check response from ipserver for above patterns   foreach ($pa...

how to get google map coordinates by address in php

<?php function getCoordinates($address){ $address = str_replace(" ", "+", $address); // replace all the white space with "+" sign to match with google search pattern $url = "http://maps.google.com/maps/api/geocode/json?sensor=false&address=$address"; $response = file_get_contents($url); $json = json_decode($response,TRUE); //generate array object from the response from the web return ($json['results'][0]['geometry']['location']['lat'].",".$json['results'][0]['geometry']['location']['lng']); } echo getCoordinates('Hyderabad, Andhra Pradesh, India'); ?>

wordpress author related taxonomy posts

wordpress author related taxonomy posts <?php global $post; $author_id=$post->post_author; $args = array(                                     'post_type' => 'deals',                                     'author'=> $author_id                                 );                                 $the_query = new WP_Query( $args );                                 if ( $the_query->have_posts() ) :                                   ...

how to get difference between two dates in php

how to get difference between two dates in php <?php $date1 = new DateTime("2006-09-07"); $date2 = new DateTime("2014-03-19"); $interval = $date1->diff($date2); echo "difference " . $interval->y . " years, " . $interval->m." months, ".$interval->d." days "; ?> Output : difference 7 years, 6 months, 12 days