Tuesday, August 30, 2011

how to change default home page in joomla1.7

In joomla 1.7 if you want to change the Home page

follow these steps in easy ways:


    • LOGIN to site
    • Go to Menu Option
    • Then select the page  you want to New HOME page
    • choose default option. or click on star ( * ).
     
  • Hope you Got it...

Friday, August 26, 2011

Easy way to create Facebook site in Joomla1.7


This is the short and easy method that i share with you how to make a site like Facebook in Joomla1.7.


  • For this:
  • Please check the joomla version and jomsocial version for compatibility before do anything 
    • you have to download free version of JomSocial Component from Internet.
    • then install the Com_community zip folder from the downloaded files in joomla
    • then follow some instruction and click on next.



Wait this i am testing on this tutorial and provide you everyhting about that.


"Under Process....."





Thursday, August 25, 2011

uninstall component from joomla 1. 7?

this is vary easy to uninstall component from joomla 1.7.


Follw these steps:

  1. Login the site
  2. go to extension menu.
  3. then Click on Manage
  4. from right corner drop-downlist select " name of compoment "
  5. check it and click option un-install
  6. So simple :)

This is an example for Remove Jomsocial from jooma1.7

Thursday, August 11, 2011

cake php

  • Before read this i think you have some programming knowledge and client server architecture. 
  • What is Cake PHP:
    • a quick list of features you’ll enjoy when using CakePHP:
    • Active, friendly community
    • Flexible licensing
    • Compatible with versions 4 and 5 of PHP
    • Integrated CRUD for database interaction
    • Application scaffolding
    • Code generation
    • MVC architecture
    • Request dispatcher with clean, custom URLs and routes
    • Built-in validation
    • Fast and flexible templating (PHP syntax, with helpers)
    • View Helpers for AJAX, JavaScript, HTML Forms and more
    • Email, Cookie, Security, Session, and Request Handling Components
    • Flexible ACL
    • Data Sanitization
    • Flexible Caching
    • Localization
    • Works from any web site directory, with little to no Apache configuration involved
  • Requriment for cake php:
    • Requirements

      • HTTP Server. For example: Apache. mod_rewrite is preferred, but by no means required.
      • PHP 4.3.2 or greater. Yes, CakePHP works great on PHP 4 and 5.



      CakePHP supports a variety of database storage engines:
      • MySQL (4 or greater)
      • PostgreSQL
      • Microsoft SQL Server
      • Oracle
      • SQLite

  • It is a MVC based php framework for rapid application development.
  • Used to build a rapidly develop robust web applications, without any loss to flexibility.
Now what is MVC in very easy and static way i explain in 6 step:


  • See the picture above it helps you a lot:
    • step 1 : User send a request for page.
    • step 2 : Request goes to server's controller.
    • step 3 : Controller find the specific page in model(also called a database table , rss feed or any other file) .
    • step 4 : If found come back to controller and after that controller.
    • step 5 : Then controller goes to the view, it is the view who represent the data in the form of html or pdf or other way.
    • step 6 : At last it is the view that transfer to the client back.
  • This is all over MVC hope you got it... 
  • here the file structure of cake php  :
    • the Root folder contain:
      • /app
      • /cake
      • /plugins
      • /vendors
      • .htaccess
      • index.php
      • README
  • The app folder will be where you work your Programming Code files: it’s where your application’s files will be placed.
  • The cake folder contained very useful predefined data files. make sure that you never  edit files in this folder. This is the core of Cake .
  • Finally, the vendors folder is where you’ll place third-party PHP libraries you need to use with your CakePHP applications.

The App Folder

CakePHP’s app folder is where you will do most of your application development. Let’s look a little closer at the folders inside of app.

config : Holds the (few) configuration files CakePHP uses. Database connection details, bootstrapping, core configuration files and more should be stored here.
controllers :Contains your application’s controllers and their components.
libs: Contains 1st party libraries that do not come from 3rd parties or
external vendors. This allows you to separate your organization's internal libraries from vendor libraries.
locale: Stores string files for internationalization.
models: Contains your application’s models, behaviors, and datasources.
plugins: Contains plugin package.
tmp: This is where CakePHP stores temporary data. The actual data it stores depends on how you have CakePHP configured, but this folder is usually used to store model descriptions, logs, and sometimes session information.

Make sure that this folder exists and that it is writable, otherwise the performance of your application will be severely impacted. In debug mode, CakePHP will warn you if it is not the case.
vendors: Any third-party classes or libraries should be placed here. Doing so makes them easy to access using the App::import('vendor', 'name') function. Keen observers will note that this seems redundant, as there is also a vendors folder at the top level of our directory structure. We'll get into the differences between the two when we discuss managing multiple applications and more complex system setups.
views: Presentational files are placed here: elements, error pages, helpers, layouts, and view files.
webroot: In a production setup, this folder should serve as the document root for your application. Folders here also serve as holding places for CSS stylesheets, images, and JavaScript files.


Another important point is CakePhp Convension:

CakePHP Conventions:

  • It will take a time to learn CakePHP’s conventions.
  • But this will helps you save time in the long run.
  • By the following convention you able to do:
    • the maintenance nightmare of tracking config files.
    • Convention also makes for a very uniform system development.
    • Allowing other developers to jump in and help more easily.

File and Classname Conventions:

 

In general, filenames are underscored while classnames are CamelCased. So if you have a class MyNiftyClass, then in Cake, the file should be named my_nifty_class.php. Below are examples of how to name the file for each of the different types of classes you would typically use in a CakePHP application:
  • The Controller class KissesAndLovesController would be found in a file named kisses_and_loves_controller.php (notice _controller in the filename)
  • The Component class MyFutureComponent would be found in a file named my_future.php
  • The Model class OptionValue would be found in a file named option_value.php
  • The Behavior class MyNewBehavior would be found in a file named my_new.php
  • The View class SuperSimpleView would be found in a file named super_simple.php
  • The Helper class BestEverHelper would be found in a file named best_ever.php

Each file would be located in or under (can be in a subfolder) the appropriate folder in your app folder.
--------------------------------------------------------------------------------

Model and Database Conventions:

  1. Model classnames are singular and CamelCased. Person, BigPerson, and ReallyBigPerson are all examples of conventional model names.

  • Table names corresponding to CakePHP models are plural and underscored.
  • The underlying tables for the above mentioned models would be people, big_people, and really_big_people, respectively.
  • Field names with two or more words are underscored like, first_name.

 

Controller Conventions:

Controller classnames are plural, CamelCased, and end in Controller. PeopleController and LatestArticlesController are both examples of conventional controller names.

C.T.M: 

  • The first method you write for a controller might be the index() method.
    When a request specifies a controller but not an action, the default CakePHP behavior is to execute the index() method of that controller. 
    For example, a request for http://www.example.com/apples/ maps to a call on the index() method of the ApplesController, whereas http://www.example.com/apples/view/ maps to a call on the view() method of the ApplesController.

 

URL Considerations for Controller Names:

As you've just seen, single word controllers map easily to a simple lower case URL path. For example, ApplesController (which would be defined in the file name 'apples_controller.php') is accessed from http://example.com/apples.
i keep updating this :   stay tuned.... thanks ..


View Conventions:

  • View template files are named after the controller functions they display, in an underscored form. 
  • The getReady() function of the PeopleController class will look for a view template in /app/views/people/get_ready.ctp. 
  • The basic pattern is /app/views/controller/underscored_function_name.ctp.
Here’s a final example that ties the conventions
  • Database table: "people"
  • Model class: "Person", found at /app/models/person.php
  • Controller class: "PeopleController", found at /app/controllers/people_controller.php
  • View tem
  • plate, found at /app/views/people/index.ctp
-------------------------------------------------------------------
Let us start some delelopment:
The next big thing you have to done is:

Creating the Blog Database:

if you haven't already done this, create an empty database for use in this tutorial, with a name asn you wish.

  • create table name posts

    1. /* First, create our posts table: */
    2. CREATE TABLE posts (
    3. id INT AUTO_INCREMENT PRIMARY KEY,
    4. title VARCHAR(50),
    5. body TEXT,
    6. created DATETIME DEFAULT NULL,
    7. modified DATETIME DEFAULT NULL
    8. );
    9. /* Then insert some posts data  for testing: */
      • INSERT INTO posts (title,body,created)
      • VALUES ('The title', 'This is the post body.', NOW());
      •  
      • INSERT INTO posts (title,body,created)
      • VALUES ('A title once again', 'And the post body follows.', NOW());
      •  
      • INSERT INTO posts (title,body,created)
      • VALUES ('Title strikes back', 'This is really exciting! Not.', NOW());
 After that:


Controller in brief:-

  • if you were building a site for an online examsystem, you might have a OnlineexamController .
  • In CakePHP, controllers are named after the model they handle, in plural form. 
  • So the The OnlineExam model is handled by the OnlineexamController and so on. 
  • Imp Point remember:
    • Your application's controllers are classes that extend the CakePHP AppController class, which in turn extends a core Controller class, which are part of the CakePHP library. 
    • The AppController class can be defined in /app/app_controller.php and it should contain methods that are shared between all of your application’s controllers.
  • Controllers can include any number of methods called as actions. 
  • Actions are controller methods used to display views. An action is a single method of a controller.
   
<?    class OnlinexamController extends AppController {
        function view($id)     {
            //action logic goes here..
        }

        function share($student_id, $stuname_id) {
            //action logic goes here..
        }

        function search($query) {
            //action logic goes here..
        }
    }

    ?>

-------------------------------------------------------------------



Source CakePhp.org

Wednesday, August 10, 2011

Format a number in php

 for this we have a function called : number_fomat();

Syntax is:

< ?php

$myno=123456;

$myno_after_format=number_format($myno);

echo $myno_after_format;

output is:123,456


also another way:


$myno=1234.56;

# this will show only one decimal digit.
$myno_after_format=number_format($myno,1);


echo $myno_after_format;

output is:
1234.5


? >



Friday, August 5, 2011

what is Cloud Computing simple and easy defination


Cloud Computing

First of all know what is cloud computing: ,
A very clean and simple language/words Defination of Cloud Computing is::
  • In old system, we purchase the computer software and other software. Each time we need a CD or DVD so that again install or reinstall that kind of software.
  • This is the problem for every household as well as IT Companies.
  • So to resolve this Big IT Gaint like Google, Yahoo, IBM start the Cloud way.
  • Now you able to understand the definition:
    • Cloud computing is the way to store your software or data in Internet (server) and you simply use this either free or sometime paid.
  • Hope you understand!!  :) 



    what is exactly success in every Field?

    Today i share some experience word with all of you, regarding the Word SUCCESS.if you really want to got success in your field then simple follow some tips that i share.

    1. Success is not for those who are lazy, it's true.
    2. So if you are lazy, then be become punctual and obey the rule.
    3. Count your seconds, it automatically fruitful for you..
      • Above line means never waste time.
    4. Don't fear About Interview, it is the time when you learn most of the things you don't know.SO enjoy it with relief and comfort.
    5. Face the challenge and fix the target.
    6. Till you not set any target you never succeed.
    7. So Set the Target work upon it and see the result.
      1. if something Wrong then  Improve that..




      How to change the width of dropdown list in HTML,PHP,JAVA,DOT NET

      Let us assume the drop down list is this one:--



      <select name="drop-list" style="width: 200px;">
      <option> First value <option>
      <option> second value <option>
      <option> third value <option>
      <option> fourth value <option>
      <option> fifth value <option>
      <select>
       output is :




      It is very simple just do this way:

      ------------------------------------------------------------------------------------

      Now see the large width Drop down List


      Type the following code:

      <select name="drop-list" style="width: 400px;">
      <option> First value <option>
      <option> second value <option>
      <option> third value <option>
      <option> fourth value <option>
      <option> fifth value <option>
      <select>


      see the output:

      Tuesday, August 2, 2011

      Php Array types

      Array is a datatype in php...

      It is mostly used to store multiple item under a single variable name.

      Types of array in PHP:

      1.Numeric or Index array.
      2.Associative array.
      3.Multi-dimensional array.



      1. Numeric array:

      syntax to create this:

      php code begin here


      /*
        #Write a program to Numeric array in PHP
       #comment: make a array variable name $var
       #Author : amit sharma
       */


      $var = array (value1,value2,value3...);

      #in detail

      $var = array(10,20,30,40,50,60);

      now in above line we create a array name $var in php that store 6 values 10,20,30,40,50 and 60 .

      php code end here