Total Pageviews
Wednesday, November 30, 2011
Blog Notes: WordPress create a page with out temlpate
Blog Notes: WordPress create a page with out temlpate: Is WordPress create a page with out template? Yes. WordPress creates a page with out template //include wordpress define('WP_USE_THEMES',f...
DRUPAL interview questions and answers
DRUPAL interview questions and answers
What is Drupal?
Just go to 'Administer » Site building » Themes >> Configure' and at the bottom of this page you will find a section called "Shortcut icon settings". There you can change the 'favicon'.Drupal is both content management system and blogging engine.
How to change drupal head icon in address bar / url link / navigation bar on top?avi type
In order for you or your users to start uploading video using Video Module, you must add a Video as a content type on your site.
Go to Administer->Content management->ContentTypes.
Drupal Comments - With the default installation, only users that have logged in can access/post comments.
This can be changed from Administer -> User management -> Permissions. The comments settings are self-explanatory. By default, registered users can post comments (they don't need to wait for moderator approvals).
If you want to let anonymous users post comments, go to Administer -> User management -> Permissions -> comment module.
Go to Administer->Content management->ContentTypes.
Drupal Comments - With the default installation, only users that have logged in can access/post comments.
This can be changed from Administer -> User management -> Permissions. The comments settings are self-explanatory. By default, registered users can post comments (they don't need to wait for moderator approvals).
If you want to let anonymous users post comments, go to Administer -> User management -> Permissions -> comment module.
What the difference is between the "page" node type and the "story" node type?
In terms of basic functionality, there is no difference.
->A page doesn't post author information, timestamps or comments by default.
->A story does post author information, timestamps or comments by default.
By default, a story entry is automatically featured on the site's initial home page, and provides the ability to post comments.
The Page option allows you to create a static page
What is the path to the Drupal user/admin login page?
The path of the Drupal user/admin login page is
http://yourdrupalsitename/user
or
http://yourdrupalsitename/?q=user
What is the option makes Drupal emit "clean" URLs? (i.e. without ?q= in the URL).
Choose the enabled option under clean urls
What are the Drupal System requirements?
Disk space
-15 Megabytes
Web server
-Apache 1.3, Apache 2.x, or Microsoft IIS
Database server
-Drupal 6: MySQL 4.1 or higher, PostgreSQL 7.1,
-Drupal 7: MySQL 5.0.15 or higher with PDO, SQLite 3.3.7 or higher
PHP
Drupal 6: 5.2 recommended
Drupal 7: 5.3 recommended
The Page option allows you to create a static page
What is the path to the Drupal user/admin login page?
The path of the Drupal user/admin login page is
http://yourdrupalsitename/user
or
http://yourdrupalsitename/?q=user
What is the option makes Drupal emit "clean" URLs? (i.e. without ?q= in the URL).
Choose the enabled option under clean urls
Administer->Site configuration->Clean URLs.
What are the Drupal System requirements?
Disk space
-15 Megabytes
Web server
-Apache 1.3, Apache 2.x, or Microsoft IIS
Database server
-Drupal 6: MySQL 4.1 or higher, PostgreSQL 7.1,
-Drupal 7: MySQL 5.0.15 or higher with PDO, SQLite 3.3.7 or higher
PHP
Drupal 6: 5.2 recommended
Drupal 7: 5.3 recommended
WordPress create a page with out temlpate
Is WordPress create a page with out template?
//include wordpress
define('WP_USE_THEMES',false);
requireonce('../wp-load.php');
Drupal Demo Video
Complete video based Drupal learning system which allows you to master all the basic as well as some advanced functions of Drupal in under six hours!
A Step-By-Step Video Tutorial View Drupal Demo Video
A Step-By-Step Video Tutorial View Drupal Demo Video
WordPress is a free and open source blogging tool
WordPress is a free and open source blogging tool and publishing platform powered by PHP and MySQL. It is often customized into a content management system (CMS).It has many features including a plug-in architecture and a template system.
What is a CMS web site?
CMS or a 'Content Management System' it's allows you to control and manage the content within your web site - without technical training. Using this uncomplicated system you can very easily add, delete images and edit text in your web site.
A Content Management System (CMS) is an application through which you can easily create and manage dynamic web content.
A Content Management System (CMS) is an application through which you can easily create and manage dynamic web content.
Drupal hide the blocks by using the url
How to hide the the drupal blocks?
<?php
//hide the blocks by using the url
$match = TRUE;
$url = request_uri();
if (strpos($url, "admin")) {
$match = FALSE;
}
if (strpos($url, "filter/tips")) {
$match = FALSE;
}
if (strpos($url, "node/add")) {
$match = FALSE;
}
if (strpos($url, "edit")) {
$match = FALSE;
}
if (strpos($url, "node/10")) {
$match = FALSE;
}
return $match;
?>
//hide the blocks by using the url
$match = TRUE;
$url = request_uri();
if (strpos($url, "admin")) {
$match = FALSE;
}
if (strpos($url, "filter/tips")) {
$match = FALSE;
}
if (strpos($url, "node/add")) {
$match = FALSE;
}
if (strpos($url, "edit")) {
$match = FALSE;
}
if (strpos($url, "node/10")) {
$match = FALSE;
}
return $match;
?>
Tuesday, November 29, 2011
Data base insert with cmd
Data base insert with cmd
Go to mysql->mysql console
use database name<--!
sourse give the source of the file<--!
ex:
1)use databasename ex: use magento_hp
2)source d:\wamp\www\databasename.sql
Go to mysql->mysql console
use database name<--!
sourse give the source of the file<--!
ex:
1)use databasename ex: use magento_hp
2)source d:\wamp\www\databasename.sql
Saturday, November 19, 2011
PHP interview questions and answers
PHP interview questions and answers
1. What does a special set of tags <?= and ?> do in PHP?Ans:The output is displayed directly to the browser.
2. Who is the father of PHP ?
Ans:Rasmus Lerdorf is known as the father of PHP.
3. How i can get ip address?
Ans:We can use SERVER var $_SERVER['SERVER_ADDR']
and getenv("REMOTE_ADDR") functions to get the IP address.
4.How do you define a constant?Ans:Via define() directive, like define ("MYCONSTANT", 500);
5.How do you pass a variable by value?
Ans:Put an ampersand in front of it, like $a = &$val.
6.Will comparison of string "49" and integer 50 work in PHP?
Ans:Yes, internally PHP will cast everything to the integer type,
so numbers 49 and 50 will be compared.
7. I am trying to assign a variable the value of 0123, but it keeps
coming up with a different number, what’s the problem?
Ans:PHP Interpreter treats numbers beginning with 0 as octal.
8.What’s the difference between htmlentities() and htmlspecialchars()?
Ans:htmlspecialchars only takes care of <, >, single quote ‘, double quote " and ampersand.
htmlentities translates all occurrences of character sequences that have different meaning in HTML.
htmlentities translates all occurrences of character sequences that have different meaning in HTML.
9.In how many ways we can retrieve the data in the result set of MySQL using PHP?
Ans:We can do it by 4 Ways
1. mysql_fetch_row. , 2. mysql_fetch_array , 3. mysql_fetch_object
4. mysql_fetch_assoc
10.How can we create a database using PHP and MySQL?
Ans:We can create MySQL database with the use of mysql_create_db("Database Name")
11.Can we use include ("xyz.PHP") two times in a PHP page "index.PHP"?
1.Numeric array-->A numeric array stores each array element with a numeric index.Ans:We can do it by 4 Ways
1. mysql_fetch_row. , 2. mysql_fetch_array , 3. mysql_fetch_object
4. mysql_fetch_assoc
10.How can we create a database using PHP and MySQL?
Ans:We can create MySQL database with the use of mysql_create_db("Database Name")
11.Can we use include ("xyz.PHP") two times in a PHP page "index.PHP"?
Ans:Yes we can use include("xyz.php") more than one time in any page. but it create a prob when xyz.php file contain some funtions declaration then error will come for already declared function in this file else not a prob like if you want to show same content two time in page then must incude it two time not a prob
12.What is use of header() function in php ?
Ans:The header() function sends a raw HTTP header to a client.We can use herder()
function for redirection of pages. It is important to notice that header() must
be called before any actual output is seen
13. Types of arrays in PHP?function for redirection of pages. It is important to notice that header() must
be called before any actual output is seen
Ans:In PHP, there are three kind of arrays:
2.Associative array-->An associative array, each ID key is associated with a value.
3.Multidimensional array-->In a multidimensional array, each element in the main array can also be an array. And each element in the sub-array can be an array, and so on.
Friday, November 18, 2011
jQuery
What is jQuery?
Dollar Sign is nothing but it's an alias for JQuery.
Over here $ sign can be replaced with "jQuery " keyword.
jQuery(document).ready(function(){
jQuery is a lightweight JavaScript library that emphasizes interaction between JavaScript and HTML
What does dollar Sign ($) means in JQuery?Dollar Sign is nothing but it's an alias for JQuery.
$(document).ready(function(){
});
Over here $ sign can be replaced with "jQuery " keyword.
jQuery(document).ready(function(){
});
Why is jQuery better than javascript?
jQuery is great library for developing ajax based application.
It helps the programmers to keep code simple and concise and reusable
Which sign does jQuery use as a shortcut for jQuery?
$(dollar) sign.
Is jQuery a library for client scripting or server scripting?
Client scripting
Is jQuery a W3C standard?
No
What are jQuery Selectors?
Selectors are used in jQuery to find out DOM elements. Selectors can
find the elements via ID, CSS, Element name and hierarchical position of
the element.
What is the name of jQuery method used for an asynchronous HTTP request?
jQuery.ajax()
How is body onload() function is different from document.ready() function
used in jQuery?
Document.ready() function is different from body onload()function
because off 2 reasons.
1. We can have more than one document.ready() function in a page
where we can have only one onload function.
2. Document.ready() function is called as soon as DOM is loaded
where body.onload() function is called when everything gets loaded on
the page that includes DOM,images & all associated resources of the page.
What are features of JQuery or what can be done using JQuery?
Features of Jquery
1. One can easily provide effects and can do animations.
2. Applying / Changing CSS.
3. Cool plugins.
4. Ajax support
5. DOM selection events
6. Event Handling
Name some of the methods of JQuery used to provide effects?
Some of the common methods are :
1. Show()
2. Hide()
3. Toggle()
4. FadeIn()
5. FadeOut()
Thursday, November 17, 2011
Ago date or time - Time ago/Day ago
Ago date or time - Time ago/Day ago
"year+month+day+time ago" PHP function
<?php
function time_ago($date,$granularity=2) {
$date = strtotime($date);
$difference = time() - $date;
$periods = array('decade' => 315360000,
'year' => 31536000,
'month' => 2628000,
'week' => 604800,
'day' => 86400,
'hour' => 3600,
'minute' => 60,
'second' => 1);
if ($difference < 5) { // less than 5 seconds ago, let's say "just now"
$retval = "posted just now";
return $retval;
} else {
foreach ($periods as $key => $value) {
if ($difference >= $value) {
$time = floor($difference/$value);
$difference %= $value;
$retval .= ($retval ? ' ' : '').$time.' ';
$retval .= (($time > 1) ? $key.'s' : $key);
$granularity--;
}
if ($granularity == '0') { break; }
}
return ' posted '.$retval.' ago';
}
}
//call a function here
echo $date = time_ago('2011-04-22 16:59:06');?>
Wednesday, November 9, 2011
What is a Favicon?
What is a Favicon?
A favicon (short for "favorites icon" and also known as a page icon), is an icon associated with a particular website or webpage that is displayed in the browser address bar next to a site's URL.
Copy and paste the following code to the <head> section of your webpages:
<link rel="shortcut icon" href="/favicon.ico" >
Tuesday, November 8, 2011
jQuery Tutorial
jQuery Tutorial
Running Code When the DOM is Ready
$(document).ready(function() {
// all jQuery code goes here
});
// all jQuery code goes here
});
How to Select the Elements in jQuery
$("div"); // selects all HTML div elements
$("#myElement"); // selects one HTML element with ID "myElement"
$(".myClass"); // selects HTML elements with class "myClass"
$("p#myElement"); // selects HTML paragraph element with ID "myElement"
$("ul li a.navigation"); // selects anchors with class "navigation" that are nested in list items
More selectores
$("p > a"); // selects anchors that are direct children of paragraphs
$("input[type=text]"); // selects inputs that have specified type
$("a:first"); // selects the first anchor on the page
$("p:odd"); // selects all odd numbered paragraphs
$("li:first-child"); // selects each list item that's the first child in its list
jQuery also allows the use of its own custom selectors.
Here are some examples:
$(":animated"); // selects elements currently being animated
$(":button"); // selects any button elements (inputs or buttons)
$(":radio"); // selects radio buttons
$(":checkbox"); // selects checkboxes
$(":checked"); // selects checkboxes or radio buttons that are selected
$(":header"); // selects header elements (h1, h2, h3, etc.)
Subscribe to:
Posts (Atom)