Thursday, October 13, 2011

Change of particular node id design

Hi Friends,
Today I am giving tips for particular druapl node id design.
Step 1 - Go to your current theme folder
Step 2 - Then copy page.tpl.php
Step 3 - Paste the file and rename file as page--node--[id].tpl.php
Step 5 - Change your design in following page and save.
Step 6 - Then Clear cache from admin.
That it dear try and enjoy this. and give me your valuable feed back

Tuesday, September 27, 2011

Smothly Go On Top With Hep of Jquery

Hello Friends

Today I bring for you how could you go on top of the page smoothly.
here is small piece of code just put it in head of your page and call the function.
{ src="http://code.jquery.com/jquery.js">}{/script>}
{ language="javascript">}{ function gotop(){ < $('html,body').animate({ scrollTop: $("#demo").offset().top}, 1000);}


after that just call that function on click event of the anchor link or button

Note - Here #demo is the div id. Write the bigger test inside of this div including id put link out side of the div and just see the MAGIC. Replace {} with <>

Thursday, September 1, 2011

Problem in Custom premalink.

Hi Friend
Today i will Give small but very tricky tip regarding wordpress.
Are you trying for Premalinks setting. In that one one option is theere "custom structure" where we should have give value is /%postname%
and then save.
But when we check the blog site or url page not found this type of error is comming.
You tried somany times all setting is work well but this one is not working. you
check in .htacess file also. Then what ?
Solution is
Go in
Xampp
apache
conf
httpd.conf
and
search for this line
#LoadModule rewrite_module modules/mod_rewrite.so
and remove # the restart your localhost server.
But before doing this make a back up of this file.
Done use your wordpress custom premaliks and enjoy.

Thursday, August 25, 2011

How can We Create the custom page

Hello Friends,
Today I will give you some tips abot how to create custom page inside wordpress.
Follow these steps -
1. Opne any word editor.
2. Put this line on top of the page.

3. Put Some Html and and javascripts
{html}
{head}
{Title}{/title}
{/head}
{body}
{p}This is custome page{/p}
{/body}
{/html}
4. Save this file inside \wp-content\themes\{CURRENT THEME}
5. Now create page you see your page in Tempelate Drop down as your {template name}
Just Do it and Full Fill Your requirement.

Tuesday, August 23, 2011

Creation Of Drupal Module

Hello Friend,

I am back with new topic. This time I bring HOW TO CREATE DRUPAL custom module.

For creation of Drupal Module mailny we need two files first is .info and second is .module file.

Create a exapmle.info in your example folder. You may do so by using a notepad or any text editors. Copy the codes below

About example.info file

    ;$Id$

name = Test
description = Hello Kunal.
datestamp = "1202913006"

Description –

name (required)

The human readable name can now be set independently from the internal "machine" readable name. This imposes fewer restrictions on the allowed characters.

description (recommended)

A short description. This description is displayed on the module instll

core (required)

From 6.x onward, all .info files for modules and themes must indicate what major version of Drupal core they are compatible with.

Creation of .module

 
function example_help($section) {
  switch ($section) {
    case 'admin/modules#description':
      return t('This module implements an example form.');
  }
}
 
function example_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'example',
      'title' => t('Example'),
      'callback' => 'example_page',
      'access' => TRUE,
      'type' => MENU_CALLBACK
    );
  }
  return $items;
}
 
function example_page() {
  return drupal_get_form('example_page_form');
}
 
function example_page_form() {
  $form['fullname'] = array(
    '#type' => 'textfield',
    '#title' => t('Enter your full name'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  return $form;
}
 
function example_page_form_submit($form_id, $form_values) {
  $message = 'You have submitted the ' . $form_id . ' form which contains the following data:
' . print_r($form_values,true) . '
';
  drupal_set_message(t($message));
}
 
?>
 
After That Put your module inside examplesite/sites/all/modules/{your example  module}.
And Install Your module and make changes as yor wish. 
In my next post I will give you how to make install and unistall module and database access.

Friday, August 19, 2011

Through FCKeditor Image/any document goes to your desired folder

Hello Friends After a long time i put any changes on my blog. This time i have some some
tricks for fckeditors.
That is change in
FCKeditors/editors/filemanager/connectors/config.php

Step 1 -

$Config['Enabled'] = false ;
Change This line to
$Config['Enabled'] = true ;

Step 2 -

$Config['UserFilesPath'] = '/images/' ;
In my case my image folder is in my root. If you dont have this folder then it is created.

Step 3 -

$Config['UserFilesAbsolutePath'] = $_SERVER['DOCUMENT_ROOT'] . $Config['UserFilesPath'] ;

put this line for absolutepath.

Step 4 -

$Config['FileTypesPath']['Image'] = $Config['UserFilesPath'] . 'news/' ;
// Changes to desired folder name in my case news is
$Config['FileTypesAbsolutePath']['Image']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'news/' ;

Change news to as subfolder name.
Thats It.......

Use FCK editor.And upload your images as your desired place.
When you want your uploaded images along with you text it have no problem. Use and Enjoy.

Monday, July 25, 2011

VNC

VNC 4 is not running as root
Solution -Go to that folder in where your team viewer is installed.
In my case it is opt
Teamviewer > teamviewer > 6 > bin > wrapper

open this wrapper in editor
and makes this line as hidden
# if [ $userid = 0 ] ; then
# die "TeamViewer must not be executed as root!"
# fi
The reason behind that $userid == 0 means it is as root so disable this one.
Now run you teamviewer as root. It works
If you have any query then write it to me

Thursday, July 7, 2011

PHP Questions For Freshers

Here i am putting some php and mysql questions for freshers

1. Difference between php4 & php5
2. Would I use print "$a dollars" or "{$a} dollars" to print out the amount of dollars in this example?
3. What is the difference between Split and Explode?
4. What is difference between mysql_connect and mysql_pconnect?
5. What Is a Persistent Cookie?
6. How would you initialize your strings with single quotes or double quotes?
8. What are new features that are in added in PHP5?
9. How To Write the FORM Tag Correctly for Uploading Files?
10. What is difference between require_once(), require(), include() and include_once()? Because above three function usefully use to call a file in another file.
11. What is difference between print, print_r, echo?
12. How can i get ip address?
13. What is the diffrence between Notify URL and Return URL?
14. What is difference between mysql_fetch_array(),mysql_fetch_row() and mysql_fetch_object() please insert with example?
15. How many types of method in php?
16. What is meant by urlencode and urldecode?
17. Which will execute faster on php POST or GET? Explain
18. What is the difference between mysql_fetch_object and mysql_fetch_array?
19. How can I execute a PHP script using command line?
20. What does a special set of tags do in PHP?

Some php questions with Answer
1. How can we submit a form without a submit button?
Ans - The main idea behind this is to use Java script submit() function in order to submit the form without explicitly clicking any submit button. You can attach the document.formname.submit() method to onclick, onchange events of different inputs and perform the form submission. you
can even built a timer function where you can automatically submit the form after xx seconds once the loading is done (can be seen in online test sites).

2. 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')

3. What are the different tables present in MySQL, which type of table is generated when we are creating a table
Ans - Total 5 types of tables present in MySql
1. MyISAM
2. Heap
3. Merge
4. INNO DB
5. ISAM
When we are creating any table with syntax
create table employee (eno int(2),ename varchar(10))
By default MyISAM is generated

4. How To Get the Uploaded File Information in the Receiving Script?
Ans - Once the Web server received the uploaded file, it will call the PHP script specified in the form action attribute to process them. This receiving PHP script can get the uploaded file information through the predefined array called $_FILES. Uploaded file information is organized in $_FILES as a two-dimensional array as:

$_FILES[$fieldName]['name'] – The Original file name on the browser system.

$_FILES[$fieldName]['type'] – The file type determined by the browser.

$_FILES[$fieldName]['size'] – The Number of bytes of the file content.

$_FILES[$fieldName]['tmp_name'] – The temporary filename of the file in which the uploaded file was stored on the server.

$_FILES[$fieldName]['error'] – The error code associated with this file upload.

5. WHAT ARE THE DIFFERENT TYPES OF ERRORS IN PHP?
Ans - Three basic types of runtime errors in PHP:

1. Notices: These are trivial, non-critical errors that PHP encounters while executing a script – for example, accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all – although you can change this default behavior.

2. Warnings: These are more serious errors – for example, attempting to include() a file which does not exist. By default, these errors are displayed to the user, but they do not result in script termination.

3. Fatal errors: These are critical errors – for example, instantiating an object of a non-existent class, or calling a non-existent function. These errors cause the immediate termination of the script, and PHP’s default behavior is to display them to the user when they take place.

Internally, these variations are represented by twelve different error types


If any one need question then reply me on risk.always@gmail.com