Thursday, December 6, 2012

Simplest Way To Create a Multilingual Website.

Are you interested in having a multilingual website? This is a tutorial that shows you how you can do that in PHP.


php-multi-language-site

php-multi-language-site


The first thing we need to do is to create a couple of files that will contain the text for each of the languages that will be supported by the website. For demo purpose I have chosen English, Spanish and German. Make a directory named “directory”. In this directory create 3 files: lang.de.php, lang.en.php, and lang.es.php. In our main file (index.php) we will include a file (common.php) containing a piece of code that gets the requested language. Here’s the content of those 3 language files:

lang.en.php


01.<?php

02./*

03.------------------

04.Language: English

05.------------------

06.*/

07.

08.$lang = array();

09.

10.$lang['PAGE_TITLE'] = 'My website page title';

11.$lang['HEADER_TITLE'] = 'My website header title';

12.$lang['SITE_NAME'] = 'My Website';

13.$lang['SLOGAN'] = 'My slogan here';

14.$lang['HEADING'] = 'Heading';

15.

16.// Menu

17.

18.$lang['MENU_HOME'] = 'Home';

19.$lang['MENU_ABOUT_US'] = 'About Us';

20.$lang['MENU_OUR_PRODUCTS'] = 'Our products';

21.$lang['MENU_CONTACT_US'] = 'Contact Us';

22.$lang['MENU_ADVERTISE'] = 'Advertise';

23.$lang['MENU_SITE_MAP'] = 'Site Map';

24.?>



lang.es.php


01.<?php

02./*

03.-----------------

04.Language: Spanish

05.-----------------

06.*/

07.

08.$lang = array();

09.

10.$lang['PAGE_TITLE'] = 'Título de la página de mi sitio web';

11.$lang['HEADER_TITLE'] = 'Mi sitio web de la cabecera título';

12.$lang['SITE_NAME'] = 'Mi Sitio Web';

13.$lang['SLOGAN'] = 'Mi lema aquí';

14.$lang['HEADING'] = 'Título';

15.

16.// Menu

17.

18.$lang['MENU_HOME'] = 'Inicio';

19.$lang['MENU_ABOUT_US'] = 'Sobre Nosotros';

20.$lang['MENU_OUR_PRODUCTS'] = 'Nuestros productos';

21.$lang['MENU_CONTACT_US'] = 'Contáctenos';

22.$lang['MENU_ADVERTISE'] = 'Publicidad';

23.$lang['MENU_SITE_MAP'] = 'Mapa del Sitio';

24.?>



lang.de.php


01.<?php

02./*

03.-----------------

04.Language: German

05.-----------------

06.*/

07.

08.$lang = array();

09.

10.$lang['PAGE_TITLE'] = 'Meine Webseite Titel';

11.$lang['HEADER_TITLE'] = 'Meine Website-Header Titel';

12.$lang['SITE_NAME'] = 'Meine Website';

13.$lang['SLOGAN'] = 'Mein Slogan hier';

14.$lang['HEADING'] = 'Position';

15.

16.// Menu

17.

18.$lang['MENU_HOME'] = 'Heim';

19.$lang['MENU_ABOUT_US'] = 'Ãœber uns';

20.$lang['MENU_OUR_PRODUCTS'] = 'Unsere Produkte';

21.$lang['MENU_CONTACT_US'] = 'Kontaktieren Sie uns';

22.$lang['MENU_ADVERTISE'] = 'Werben';

23.$lang['MENU_SITE_MAP'] = 'Site Karte';

24.?>



As you can notice, some constants are created using the define() function. In every file the defined constants have the same name, bu the values is different. We will output the values of the constants inside the index.php file. Therefore we will see different text every time we will call other language file.

Determine the right language


Let’s analyze the common.php file:


01.<?php

02.session_start();

03.header('Cache-control: private'); // IE 6 FIX

04.

05.if(isSet($_GET['lang']))

06.{

07.$lang = $_GET['lang'];

08.

09.// register the session and set the cookie

10.$_SESSION['lang'] = $lang;

11.

12.setcookie('lang', $lang, time() + (3600 * 24 * 30));

13.}

14.else if(isSet($_SESSION['lang']))

15.{

16.$lang = $_SESSION['lang'];

17.}

18.else if(isSet($_COOKIE['lang']))

19.{

20.$lang = $_COOKIE['lang'];

21.}

22.else

23.{

24.$lang = 'en';

25.}

26.

27.switch ($lang) {

28.case 'en':

29.$lang_file = 'lang.en.php';

30.break;

31.

32.case 'de':

33.$lang_file = 'lang.de.php';

34.break;

35.

36.case 'es':

37.$lang_file = 'lang.es.php';

38.break;

39.

40.default:

41.$lang_file = 'lang.en.php';

42.

43.}

44.

45.include_once 'languages/'.$lang_file;

46.?>



After we determine the value of $lang, we use switch() to compare its value with some different values, and execute a different piece of code depending on which value it equals to. After the value of the $lang_file is determined, the script will include the necessary language file. As you can see I have used sessions to register the value of $lang. This way users can navigate through the whole site and see the content in the chosen language (lang=[language here] does not need to be passed in every URL). Additionally, I have used cookies to store the selected language in users computer for 30 days. When the visitor will come back he will see the site in the language that he previously selected.

How if the website’s language requested?


In this demo I have chosen to use some image flags, each image having a link to index.php?lang=[LANG HERE]. So, to see the site in german we will use the German image flag which links to index.php?lang=de.

Lastly, the constants values should be outputted in the page. Examples:

for document title


1.<title><?php echo $lang['PAGE_TITLE']; ?></title>



for header menu


1.<ul>

2.<li><a href="/"><?php echo $lang['MENU_HOME']; ?></a></li>

3.<li><a href="about_us"><?php echo $lang['MENU_ABOUT_US']; ?></a></li>

4.<li><a href="our_products"><?php echo $lang['MENU_OUR_PRODUCTS']; ?></a></li>

5.<li><a href="contact_us"><?php echo $lang['MENU_CONTACT_US']; ?></a></li>

6.<li><a href="advertise"><?php echo $lang['MENU_ADVERTISE']; ?></a></li>

7.<li><a href="sitemap"><?php echo $lang['MENU_SITE_MAP']; ?></a></li>

8.</ul>







Wednesday, December 5, 2012

How To Create Multi-Language websites in PHP











Would you like to provide multi-language support on your site? In this article, we discuss three different ways in which you could organize your site to support multiple languages. We do not say that the three ways discussed in this article are the only ways of achieving the goal but this could be a good starting point.The three methods discussed in this article are:1. Dynamic Content Generation
2. Site Replication, and
3. Selective Replication

Let us now discuss these three methods, and also discuss the advantages and disadvantages of each.

METHOD 1
Dynamic Content Generation
Although this method is a very complicated way of organizing your site to support different languages, it could be an option if you have only two languages, or even three to support on a fast server. It is also a good idea to use this option only if your site is not huge.


In this method all the text of the site is stored in a database. Every page carries a variable (a session variable or a query string) to identify which language the site is to be displayed in. Based on that, the content is pulled out from the respective tables for the language chosen, and displayed.


You might now be wondering, what about Graphics? You have two choices. If the amount of graphics that your site uses is very minimal, you could consider storing them in the database itself as blob fields. Another way is to simply open up a new table with the following structure:









NameEnglishGermanFrench

Stored in this manner, you could give each image a name, and store only the relative paths to the different images in the database. When pulling it onto the client page, get the path and pull it out from the file system.

The messages can be stored in the database in a similar format, except instead of "Name" use a unique ID for each message. This message can then be called in the necessary pages of the site. You could also declare an array which you include in all pages, that contains all the messages. Please take care to keep the message numbers constant once assigned because if the messages re-shuffle, it could be a tedious task to re-do all the messages on the site.

This method has many disadvantages. A few significant ones are:

  • There could be a performance degradation of the site if the amount of content of the site is huge.

  • Editing the site would require you to either directly edit the content in the tables, or alternatively provide an admin panel to edit the content of each page on the site!

  • The load on the database is too high which could lead to lower performance



As you can see, this method is good for small websites that have less content and graphics. Providing for a complete administration panel for the content is a big thing in itself, and the reliability can never be guaranteed.

METHOD 2

Site Replication


This is one of the most commonly used methods on the web. In this approach the main site, which is in the default language of the website, resides in the root folder of the site. This basically is how a website is when it's a single-language site. When you want a site in German you would replicate the entire site into a directory, say German. The links in the German site should refer to the corresponding pages on the German site only. Now typing www.mysite.com would give the site in the default language, but www.mysite.com/german would give the German version of the site. On every page of the site you would have a select box with language choices. All this box does is to re-direct the user to the same page that sits on the chosen language site.
Do use proper tools when replicating the site. If you were to do it manually you will have to edit each other files on the site and correct the links on them to point to the pages on the language site. If you use a tool like Dreamweaver, for example, this task will be done automatically.

Now there are a few pages where the select box cannot be placed. These are pages that utilize what are called hidden form fields, which carry form information from page to page. Passing these over to another page would be a problem unless you have a mechanism to detect all the form variables and redirect to the same page on the other language site with the variables passed in the query string.

This method has a disadvantage too:
Any bug that is cleared on the main site needs to be cleared in all the other language sites.

If you have 3 languages that you support, apart from the default language then this would increase work involved in any maintenance/bug-fixing/content-changing task 3-fold.


You would have to make the change in the main language site, and then the change in each of the 3 other sites.

This does have a work-around. In your initial design of the site if you take care of code/content to be re-usable, this would not be an issue. All the language sites use the same includes so if there is any change in functionality all you would have to do is change the include file.

METHOD 3


Selective Replication

Of the three methods we discuss in this article, this is the most efficient one. Although difficult to set up the first time, the maintenance effort is lower than the other two methods discussed. This method is used by many major websites, including Microsoft, for multi-language support.


In Selective Replication we have the main site, which has no content or images whatsoever. The various images sit in various folders marked EN, GR, ES, etc depending on the languages. All the files that go into each of these directories have the same names. So, the English logo file name will be logo.gif, and so will the logo file for the other languages too.

The content (messages, JavaScript alerts, etc) have two places in which they can be stored. One way is to store each individual message as separate text files, or an alternative way is to make them sit in an array which is included in every ASP file and the message that needs to appear is called from the array. Each language has a separate array which resides in its directory. So the array include depends on the language that is chosen by the user.

This method has no stress on the database. The database is designed to hold generic information applicable for all the languages.

The problem in this approach arrives only when the site is re-designed, the template changed and the content reworked. You will then have to re-create all the files in the language directories and change all the calls in the site files to include the newly created template files. Using text files for storing major content and storing all one/two line messages in an array or database tables could significantly drop time in maintenance of simple content changes.

CONCLUSION
In all the three steps discussed, bear in mind that the database needs to be able to handle Unicode characters. German characters like the §, etc need Unicode support to show up. By default, Windows installs with the Western European (ISO) encoding standard which supports all Unicode characters.


It would be a good idea to keep re-usability as priority one when designing the site. The more code/graphics/content you can make reusable for all the sites, the lesser the headache for maintenance and bug-fixing.

You might also want to mix features of these three methods and derive a method suitable to your site. For example, you could use Selective Replication for the graphics and files and store all the content in the database using the Dynamic Content Generation method.








Saturday, December 1, 2012

Hang Your Friend's PC From Notepad to drive him insane

Sometime you may like to tease your friends to prove yourself a tech freak. And believe me after this trick is successful, your friend is definitely coming after you to learn it. okay , here is the trick.

When your friend is away, and his computer system is opened, just open notepad and write following lines of code in the notepad file

------------------------------------------------------------
@ECHO off
:top
START %SystemRoot%system32notepad.exe
GOTO top
----------------------------------------------------------

Now save this file as "confidential.bat'

When your friend will be back , he will definitely check this file by clicking on it. Now what will happen next?

Well, try it and watch yourself, but don't throw stones on my face :-p

Wednesday, November 28, 2012

Add Watermark to an Excel Document

Unfortunately, the printed watermark feature is not available on any version of Excel (including Excel 2007, 2010). However, there are some workaround methods to add text or images into an Excel document that would result something similar to a watermark.

The followings are examples of Excel Documents with text and image "watermark":



 








 

Step-by-step to add a watermark to an Excel document (applied for Microsoft Word 97-2010):

A. TEXT WATERMARK:
The trick is to place a WordArt on the background of the Excel sheet.

Microsoft Excel 97/2000/XP (2002)/2003:

  1. Open the Excel document that you want to add watermark to.

  2. Select "Insert" from the top menu, then select "Picture" > "WordArt...".

  3. In the "WordArt Gallery" dialog, select a WordArt style that you like then click "OK".

  4. In the "Edit WordArt Text" dialog, type in your desired text, select the font style and size, then click "OK".

  5. Right-click on the newly inserted WordArt on the Excel document, then select "Format WordArt...".

  6. In the "Format WordArt..." dialog, select "No fill" for "Fill"/"Color".
    Also select a brighter color (i.e. gray) for "Line"/"Color" then click "OK".

  7. Right-click on the WordArt on the Excel document, then select "Order." > "Send to Back".

  8. Click and drag the WordArt to position it where you like.
    Note: The WordArt needs to be manually placed on each page of the document.


Microsoft Excel 2007/2010:

  1. Open the Excel document that you want to add watermark to.

  2. Select the "Insert" tab from the top menu, then in the group "Text", select "WordArt".

  3. Select the WordArt style you want, then type the text for your watermark.

  4. Under "Drawing Tools", select "Format".

  5. In the group "WordArt Styles" change "Text Fill" to "No fill".

  6. Also in the same group "WordArt Styles", change "Text Outline" to "Automatic".

  7. In the group "Arrange" select "Send to Back".

  8. Click and drag the WordArt to your preferred position.
    Note: The WordArt needs to be manually placed on each page of the document.


B. IMAGE WATERMARK:
To insert an image watermark, use the header feature in Excel as follows...

Microsoft Excel 97/2000/XP (2002)/2003:

  1. Open the Excel document that you want to add watermark to.

  2. Select "View" from the top menu, then select "Header and Footer".

  3. In the "Page Setup" dialog, click on the "Custom Header..." button in the middle of the dialog.

  4. In the "Header" dialog, click on the middle box "Center section"

  5. In the middle of this dialog box, there are some tool buttons. We're going to use the last two buttons to insert and format the image.

  6. Click on the Insert Picture button (the second-to-last button with an image of a mountain)

  7. Navigate to the folder where your watermark image is located. Select the image and click "Insert".

  8. A text "&[Picture]" is now placed in the middle box named "Center section".

  9. Click on the Format Picture button (the last, right-most button).

  10. Adjust the scale and size if you wish, then select the "Picture" tab. Change the "Color" under "Image Control" to "Washout", then click "OK".

  11. At this point, you can click "OK" to finish, and do a "Print Preview" to see your watermark. However, you will notice that the image is placed far on the top of the page, which doesn't look usual for watermarks. To fix this, click on the middle box named "Center section" again and enter a few blank lines before the text "&[Picture]".

  12. Once you're all done, click "OK" to exit and open "Print Preview" to see your watermark. (The watermark will not be displayed in normal view.)


Microsoft Excel 2007/2010:

  1. Open the Excel document that you want to add watermark to.

  2. Select the "Insert" tab from the top menu, then in the group "Text", select "Header & Footer".

  3. Excel will now switch to Page Layout view, and the cursor will be moved to the center top of the page.

  4. On the "Design" Tab, in the group "Header & Footer elements" Select "Picture".

  5. Navigate to the folder where your watermark image is located. Select the image and click "Insert".

  6. A text "&[Picture]" is now placed in the middle box of the header.

  7. To move the picture down on the page, click on the header and place the cursor before the text "&[Picture]", then hit Enter a few times.

  8. To see the watermark, either open the "Print Preview" or click on any cell of the document.

Tuesday, November 27, 2012

How to add watermark to a Word Document

Add Watermark to a Word Document


You can insert a watermark into a Microsoft Word document as either text or image.
Here is a sample Word Document with text watermark:



And here is an example of picture watermark:








 

Step-by-step to add a watermark to Word document (applied for Microsoft Word 97-2010):

Microsoft Word 97/2000/XP (2002)/2003:

  1. Open the Word document that you want to add watermark to.

  2. Select "Format" from the top menu, then select "Background", then "Printed Watermark".

  3. In the "Printed Watermark" dialog:A.To insert a text watermark:

    • Select the "Text watermark".

    • Then, either select a pre-defined text from the drop-down, or type in your desire text on the "Text" field.

    • Customize your watermark with other options in this dialog such as text size, text color, etc, then click "OK".

    • Watermark is now inserted into your document.


    B.To insert an image watermark:

    • Select the "Picture watermark".

    • Then click on the button "Select Picture...".

    • Navigate to the directory where your watermark picture is located. Select it and click "Insert".

    • Select a customized scale if desired, then click "OK".

    • The image is now inserted into your document as watermark.




Microsoft Word 2007/2010:

  1. Open the Word document that you want to add watermark to.

  2. Select the "Page Layout" Tab from the top menu

  3. In the "Page Background" group, select "Watermark".

  4. You can now select one of the pre-defined watermarks, or if you wish to use your own text/image, select "Custom Watermark" at the bottom.
    At the "Printed Watermark" dialog:A.To insert a text watermark:

    • Select the "Text watermark".

    • Then, either select a pre-defined text from the drop-down, or type in your desire text on the "Text" field.

    • Customize your watermark with other options in this dialog such as text size, text color, etc, then click "OK".

    • Watermark is now inserted into your document.


    B.To insert an image watermark:

    • Select the "Picture watermark".

    • Then click on the button "Select Picture...".

    • Navigate to the directory where your watermark picture is located. Select it and click "Insert".

    • Select a customized scale if desired, then click "OK".

    • The image is now inserted into your document as watermark.



Monday, November 26, 2012

Turn your iPhone/iPod 1.01 into remote control of your friends' computers. [TrickMaker ]

Make tricks on your friends' computers from iPhone/iPod.


TrickMaker is the perfect app to make "Tricks" on your friend's computer, in the office or even to your girlfriend, simply from your iPhone/iPod Touch. TrickMaker is the incredible application that turns your iPhone/iPod into a remote control for computer that allows you to take possession of a friend's PC, and remotely administer it by choosing from a large number of "Trick" provides.

Some Tricks available:

- Move the mouse cursor
- Show ScreenSaver
- Open and close the panel programs simulates pressing the Windows Start
- Switch off for two the second monitor
- chat between iPhone/iPod
- Open Close the sliding of the CD or DVD
- Reverse the mouse buttons
- Press the right left mouse
- Get a screenshot from the PC
- Playing sounds nice as Fart, Burp, from pc
- Beep Speaker
- Text to Speeh, convert your text into voice and play it from PC with many voice available, and many others.

The operation is very simple, you download and launch from the computer of your friend TrickMakerclient for PC (no installation required, TrickMaker is a standalone tool), free downloadable from the website http://trickmaker.dyndns.org , and put PinCode provided by the Client Windows into TrickMaker Client for iPhone/iPod. That's it, now you're ready to drive anyone crazy or prove to possess magical qualities.

Requirements for operation:
1. TrickMaker client for Windows (XP, Vista, Seven). Free download from http://trickmaker.dyndns.org

2. TrickMaker client app foriPhone/ iPod Touch with WIFI connection (WiFi)

Not only can you download it and start having fun.

Watch this video to learn more and comment below if you face problem.

http://www.youtube.com/watch?feature=player_embedded&v=mSGM4AC415Y

Disclaimer
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION).

Drive your friend crazy by this simple PC trick

This article of  mine is not for all you tech freaks. Because you all are already aware of this trick. This article is an ice breaking simple and old trick for those people who are not much aware of computer tricks, but aware about my blog.  :-) (Kidding).

Press Ctrl+Alt+Left Arrow on your key board. Something happened? Your desktop screen must flip horizontally and all your mouse should move in completely unintentional direction. But it is also possibility that nothing might happen. {Because this also depends on configuration of your PC } . If its works on your computer, your desktop screen should look like screenshot below



Although, if nothing happens, you can try this. Go to your desktop screen, right click then go to Graphic Options ->Hot Keys ->Enable . If you see "Enable" option already checked there and nothing is happening on pressing Ctrl+Alt+[Any arrow key on keyboard out of four arrow keys]. Then your pc probably does not support this feature of flipping your desktop vertically [Ctrl+Alt+Down Arrow or Up Arrow] or Horizontally [Ctrl+Alt+Down Arrow or Up Arrow] . Desktop can be restored to previous state by pressing the opposite arrow key with Ctrl+Alt sign.

It is quite possible that your friend might already know this trick of flipping desktop but its very rare that he knows enabling or disabling this feature by right clicking on desktop and then going to Graphic Options ->Hot Keys ->Enable/Disable to enable or disable this desktop flipping technique.

So what you can do to drive your friend crazy is,  press Ctrl+Alt+Left arrow while he is away and then go to Graphic Options ->Hot Keys ->Disable and disable this feature. So when he will be back he will not be able to restore his desktop without your help if he does not know about enabling or disabling this feature. :-)

Keep me posted on comment section if something interesting happens on your end.  :-p

Sunday, November 25, 2012

How to check which wordPress theme or plugin a site is using.

Sometime you may like a WordPress site or a feature of plugin being displayed on the site but you may not be sure about which theme that site is using. If you try to ask the owner of site by contacting through contact from, you probably will never get an answer because no one is going to tell you about their secret that you liked.

Well, we have a solution for this. You can check or determine which wordPress theme a site is using. To know this, go to http://whatwpthemeisthat.com , enter the url of wordpress site that you want to check for theme, and you will get the result.

This site also displays a list of most searched themes so you know which theme is most popular. It will also display a list of plugins being used on the wordPress site in some cases. But it cant check the name of a customized WordPress theme.

Friday, November 23, 2012

How to post your Tweets from USA while sitting in India

Yes, this can be done using twitter's random location Geotag feature.

On Twitter, if you do not wish to reveal your geographic location in your tweets, you can either completely disable the location feature from Twitter settings or you can can attach some random (read, fake) location to your tweet.

For instance, here’s a recent tweet that specific my location as the White House in Washington DC though it was written from a place that is at least 8000 miles away.

Fake your geographic location on Twitter

Attach any Location to your Tweets


Now most Twitter mobile clients won’t let you attach random locations to your tweets but there’s a web-based app called PleaseDontStalkMe.com that may come handy here. Here you can pick any location on a Google Map – either drag the marker or use the search box to reach an exact address – and tweet.

Since the Twitter website no longer displays the app name that was used to send that tweet, your followers on Twitter are less likely to know that you faked your location in the tweet. Do remember to limit the length of your tweet to 140 characters else the tweet would fail but without offering an explanation.

You can geotag your tweets from the Twitter.com website as well (click the Location icon near the tweet button) but in that case, you can only attach a city-level location to the tweet and not an exact location.

 

 

Monday, October 29, 2012

Best Facebook Clone Script Download

Today, We are extremely pleased and excited about introducing this blockbuster Facebook clone script, Extended Facebook script, Super Facebook, Next Gen Facebook script, Facebook replica or whatever you want to call it.



This is an amazing social networking script made in simple core php using smarty for your convenience. You can customize it frequently to fit your suit or hire me  for the customization.

Facebook clone script has many more feature then Facebook and its free to use or redistribute but not to sale without prior permission from my end.

Click here  to go to the site using this script and then sign up there.



Mail us using contact form on site, if you face some issues after purchase or before.

Add on plugins included in this version.

1. Wall plugin

Lets you post photos, links, video, audios and status on your wall and customize who can see your posts.

2. Mobile Version Plugin

Redirect you to mobile version of site when you visit the site on a mobile device. The mobile version is awesome.



How to get this script for free
Method 1: If you have more then 500 twitter follower , more then 500 Facebook fans or frnds or followers. just share this link to your Facebook and twitter profile and email us with your twitter and Facebook account url. once verified we will send you this script for free.

2. Just bring us two more paying leads to purchase this script and we will give this script to you for free.  :-)

WARNING: YOU AGREE TO THE TERMS OF PURCHASE AND CANNOT SELL THIS SCRIPT FURTHER FOR BUSINESS USE. THIS SCRIPT IS JUST FOR PERSONAL USE.

CONTACT US IF YOU NEED RESALE RIGHTS FROM US.

Friday, October 26, 2012

FOLLOW US AND GET AWARDED

For all the amazing scripts on this website , that we have created , We can't put them free to download on blog How ever, I will randomly chose 2 people every week from the blog followers (feed subscribers, Facebook, Twitter) and then We will send them the Full Version script copy on their email address.

Tuesday, October 23, 2012

HTML 5 Sphere Effect.

Today I decided to play with HTML 5  and its surprisingly cool effects , that can be made using its canvas elements. I am posting two different HTML 5 sphere effect over here, where sphere has been created using HTML 5 and JavaScript.

Click the links below to got to previews:

Demo 1

Demo 2

 

 

 

Monday, October 22, 2012

AJAX Pagination using jQuery and PHP with Animation



I have created an Ajax JQuery based pagination few months before which my users liked very much and there are thousands of downloads of that tutorial. So, I thought to create on another tutorial for pagination with some jquery effects to make stylish and attractive. Its animated loading of records using jquery animation. I hope you will like it very much as it looks nice.
Thanks !

 


 

Database




CREATE TABLE IF NOT EXISTS `records` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`message` text NOT NULL,
`image` varchar(200) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `records`
--

INSERT INTO `records` (`id`, `message`, `image`) VALUES
(1, 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry''s standard dummy text ever since the 1500s,', '1.png'),
(2, 'There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don''t look even slightly believable.', '2.png');



JQuery Code




$(document).ready(function(){

function showLoader(){

$('.search-background').fadeIn(200);
}

function hideLoader(){

$('.search-background').fadeOut(200);
};

$("#paging_button li").click(function(){

showLoader();

$("#paging_button li").css({'background-color' : ''});
$(this).css({'background-color' : '#006699'});

$("#content").load("data.php?page=" + this.id, hideLoader);

return false;
});

$("#1").css({'background-color' : '#006699'});
showLoader();
$("#content").load("data.php?page=1", hideLoader);

});



 

HTML




<div>

<div id="container">

<div class="search-background">
<label><img src="loader.gif" alt="" /></label></div>
</div>

<div id="paging_button">

<ul>
'.$i.'

';
}?&gt;
</ul>
</div>
</div>


Super Shopping Cart with JQuery



You have seen and like the previous shopping cart tutorials and here is part 2 for that one. I was wondering over internet and I checked a cart which I liked very much and I thought to create a cart with some animation like that. So I created this one.Ajax and JQuery shopping carts are my favorite way to implement a cart in to website. I hope you will love it.

 


 

JQuery Code




$(document).ready(function() {

var Arrays=new Array();

$('.add-to-cart-button').click(function(){

var thisID = $(this).parent().parent().attr('id').replace('detail-','');

var itemname = $(this).parent().find('.item_name').html();
var itemprice = $(this).parent().find('.price').html();

if(include(Arrays,thisID))
{
var price = $('#each-'+thisID).children(".shopp-price").find('em').html();
var quantity = $('#each-'+thisID).children(".shopp-quantity").html();
quantity = parseInt(quantity)+parseInt(1);

var total = parseInt(itemprice)*parseInt(quantity);

$('#each-'+thisID).children(".shopp-price").find('em').html(total);
$('#each-'+thisID).children(".shopp-quantity").html(quantity);

var prev_charges = $('.cart-total span').html();
prev_charges = parseInt(prev_charges)-parseInt(price);

prev_charges = parseInt(prev_charges)+parseInt(total);
$('.cart-total span').html(prev_charges);

$('#total-hidden-charges').val(prev_charges);
}
else
{
Arrays.push(thisID);

var prev_charges = $('.cart-total span').html();
prev_charges = parseInt(prev_charges)+parseInt(itemprice);

$('.cart-total span').html(prev_charges);
$('#total-hidden-charges').val(prev_charges);

var Height = $('#cart_wrapper').height();
$('#cart_wrapper').css({height:Height+parseInt(45)});

$('#cart_wrapper .cart-info').append('
<div id="each-'+thisID+'">
<div>'+itemname+'</div>
<div> $<em>'+itemprice+'</em></div>
<span>1</span><img src="remove.png" alt="" /><br /></div>
');

}

});

$('.remove').livequery('click', function() {

var deduct = $(this).parent().children(".shopp-price").find('em').html();
var prev_charges = $('.cart-total span').html();

var thisID = $(this).parent().attr('id').replace('each-','');

var pos = getpos(Arrays,thisID);
Arrays.splice(pos,1,"0")

prev_charges = parseInt(prev_charges)-parseInt(deduct);
$('.cart-total span').html(prev_charges);
$('#total-hidden-charges').val(prev_charges);
$(this).parent().remove();

});

$('#Submit').livequery('click', function() {

var totalCharge = $('#total-hidden-charges').val();

$('#cart_wrapper').html('Total Charges: $'+totalCharge);

return false;

});

function include(arr, obj) {
for(var i=0; i

[ad#co-4]
<h2>HTML</h2>
<pre lang="php">
<div style="min-height: 800px;">
<div id="cart_wrapper">
<form id="cart_form" action="#">
<div class="cart-total">

<strong>Total Charges:          </strong> $<span>0</span>
<input id="total-hidden-charges" name="total-hidden-charges" type="hidden" value="0" /></div>
<button id="Submit">CheckOut</button>
</form></div>
<div id="wrap">

<a id="show_cart" href="javascript:void(0)">View Cart</a>
<ul>
<li id="1">
<img class="items" src="product_img/1.jpg" alt="" height="100" />
<div>Red Grocery Bag</div></li>
<li id="2">
<img class="items" src="product_img/2.jpg" alt="" height="100" />
<div>Reusable Grocery Bag</div></li>
<li id="3">
<img class="items" src="product_img/3.jpg" alt="" height="100" />
<div>White Grocery Bag</div></li>
<li id="4">
<img class="items" src="product_img/4.jpg" alt="" height="100" />
<div>Yellow Grocery Bag</div></li>
<!-- Detail Boxes for above four li -->
<div id="detail-1" class="detail-view">
<div class="close">
<a href="javascript:void(0)">x</a></div>
<img class="detail_images" src="product_img/1.jpg" alt="" width="340" height="310" />
<div class="detail_info">

<label class="item_name">Red Grocery Bag</label>

shopping bag, shopping, bag, merchandise, consumerism, gift:

$<span class="price">80.00</span>

<button class="add-to-cart-button">Add to Cart</button></div>
</div>
<div id="detail-2" class="detail-view">
<div class="close">
<a href="javascript:void(0)">x</a></div>
<img class="detail_images" src="product_img/2.jpg" alt="" width="340" height="310" />
<div class="detail_info">

<label class="item_name">Reusable Grocery Bag</label>

shopping bag, shopping, bag, merchandise, consumerism, gift:

$<span class="price">70.00</span>

<button class="add-to-cart-button">Add to Cart</button></div>
</div>
<div id="detail-3" class="detail-view">
<div class="close">
<a href="javascript:void(0)">x</a></div>
<img class="detail_images" src="product_img/3.jpg" alt="" width="340" height="310" />
<div class="detail_info">

<label class="item_name">White Grocery Bag</label>

shopping bag, shopping, bag, merchandise, consumerism, gift:

$<span class="price">50.00</span>

<button class="add-to-cart-button">Add to Cart</button></div>
</div>
<div id="detail-4" class="detail-view">
<div class="close">
<a href="javascript:void(0)">x</a></div>
<img class="detail_images" src="product_img/4.jpg" alt="" width="340" height="310" />
<div class="detail_info">

<label class="item_name">Yellow Grocery Bag</label>

shopping bag, shopping, bag, merchandise, consumerism, gift:

$<span class="price">90.00</span>

<button class="add-to-cart-button">Add to Cart</button></div>
</div></ul>
</div>
</div>



CSS




html, body{
margin:0;
padding:0;
border:0;
outline:0;
}

#wrap{ width:100%; min-height:900px; top:0px; position:relative; bottom:0px; }
#wrap ul{ margin:0px; padding:0px; width: 700px;text-align:center; }

#wrap .detail-view {
/* background: none repeat scroll 0 0 #F3F4EE;*/
border: 1px solid #E2E2E2;
border-top: 1px solid #E2E2E2;
left: 0;
height:380px;
overflow: hidden;
clear:both;
display:none;
margin-left:13px;
margin-bottom:15px;
width: 96%;
}

#wrap .detail-view .close{ text-align:right; width:98%; margin:5px; }
#wrap .close a{ padding:6px; height:10px; width:20px; color:#525049; }
#wrap .detail-view .detail_images{ float:left}

#wrap .detail-view .detail_info{
float:right;
font-family: "Helvetica Neue",Helvetica,"Nimbus Sans L",Arial,sans-serif;
color:#525049;
margin-right:20px;
margin-top:30px;
text-align:justify;
width:250px;
font-size:12px;
}

#wrap .detail-view .detail_info label{ font-size:12px;text-transform:uppercase; letter-spacing:1px; line-height:60px;}

#wrap .detail-view .detail_info p{ height:110px;}

a#show_cart{
background: none repeat scroll 0 0 #FFFFFF;
border: 1px solid #E8E7DC;
cursor: pointer;
display:block;
display: inline-block;
font: 9px/21px "Helvetica Neue",Helvetica,"Nimbus Sans L",Arial,sans-serif;
letter-spacing: 2px;
color:#525049;
padding:8px;
text-decoration:none;

text-transform: uppercase;
}
.add-to-cart-button{
background: none repeat scroll 0 0 #FFFFFF;
border: 1px solid #E8E7DC;
cursor: pointer;
display: inline-block;
font: 9px/21px "Helvetica Neue",Helvetica,"Nimbus Sans L",Arial,sans-serif;
letter-spacing: 2px;
padding-top: 10px;color:#525049;
margin-top:15px;
text-transform: uppercase;
}

.add-to-cart-button:hover {
background: none repeat scroll 0 0 #F8F8F3;
}

.shopp{background: none repeat scroll 0 0 #F8F8F3;}

#wrap ul li{

list-style-type:none;
height:146px;
width:160px;
margin-left:10px;
margin-bottom:15px;
float:left;
padding:15px 0px 0px 0px;
font-family:"LubalGraphBdBTBold",Tahoma;
font-size:2em;
border:solid #fff 1px;
overflow:hidden;
}

.footer{ height:400px; background:#E2E2E2}

#wrap ul li:hover{ border:solid #f3f4ee 1px; }

#wrap ul li div{

height:31px;
text-align:center;
width:160px;
margin-top:10px;
position:relative;
bottom:0px;
padding-top:6px;
padding-bottom:4px;
background:#f3f4ee ;
font: 12px/21px "Helvetica Neue",Helvetica,"Nimbus Sans L",Arial,sans-serif;
opacity:0.8;
color: #525049 ;
text-shadow: 0px 2px 3px #555;
}

img#cart{bottom:0px;position:fixed; margin-left:30px; /* keep the bar on top */}

#wrap ul li { cursor:pointer;}

#cart_wrapper {
border:solid #E8E7DC 1px;
min-height:120px;
width:100%;
padding-top:15px;
display:none;
background:#E2E2E2;
font: 12px/21px "Helvetica Neue",Helvetica,"Nimbus Sans L",Arial,sans-serif;

position:relative
}

#Submit {
height: 78px;
float:left;
}

.closeCart{ cursor:pointer;}

button {
background: none repeat scroll 0 0 #FFFFFF;
border: 1px solid #E8E7DC;
width:140px;
cursor: pointer;
display: inline-block;
font: 9px/21px "Helvetica Neue",Helvetica,"Nimbus Sans L",Arial,sans-serif;
letter-spacing: 2px;
padding-top: 12px;color:#525049;
margin-top:1px;
border:solid #ccc 1px; padding:8px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
margin-left:20px;
text-transform: uppercase;
}

button:hover {
background: none repeat scroll 0 0 #F8F8F3;
}

.cart-total{background: none repeat scroll 0 0 #F8F8F3;}

.shopp,.cart-total{
border:solid #E8E7DC 1px; padding:8px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px; font-size:12px;
background:url(remove.png) center right no-repeat 5px;
border-radius: 8px;
font-family:"LubalGraphBdBTBold",Tahoma;
margin-top:3px;
width:320px;
float:left;
}

#cart_form{ width:570px; padding-left:15px;}

div.shopp span{ float:left;}
div.shopp div.label{ width:130px; float:left; }
div.shopp div.shopp-price{ width:70px; float:left;}
.quantity{ float:left; margin-top:-3px; width:20px;}

img.remove{float:right;cursor:pointer;}
.cart-total b{width:130px;}



reCaptcha style Captcha with JQuery and PHP




This tutorial is about to creating a captcha same as recaptcha. I used CSS and PHP for this. You can find few tutorials about creating and integrating captcha/recaptcha in php over dalip.in, but now you can create your own recaptcha style captcha with php and jquery. I have created a form with captcha few months before.

JQuery Code




$(document).ready(function() { 

// refresh captcha
$('img#captcha-refresh').click(function() {

change_captcha();
});

function change_captcha()
{
document.getElementById('captcha').src="get_captcha.php?rnd=" + Math.random();
}

});




HTML




<!-- Captcha HTML Code -->

<div id="captcha-wrap">
<div class="captcha-box">
<img src="get_captcha.php" alt="" id="captcha" />
</div>
<div class="text-box">
<label>Type the two words:</label>
<input name="captcha-code" type="text" id="captcha-code">
</div>
<div class="captcha-action">
<img src="refresh.jpg" alt="" id="captcha-refresh" />
</div>
</div>

<!-- Copy and Paste above html in any form and include CSS, get_captcha.php files to show the captcha -->




CSS




/* 
Recaptcha Style Captcha
=======================
re-Captcha Style Captcha with php and jQuery

Created By: Zeeshan Rasool
URL : http://www.99Points.info

Get JQuery, PHP, AJAX, Codeigniter and MYSQL Tutorials and Demos on Blog
*/

#captcha-wrap{
border:solid #870500 1px;
width:270px;
-webkit-border-radius: 10px;
float:left;
-moz-border-radius: 10px;
border-radius: 10px;
background:#870500;
text-align:left;
padding:3px;
margin-top:3px;
height:100px;
margin-left:80px;
}
#captcha-wrap .captcha-box{
-webkit-border-radius: 7px;
background:#fff;
-moz-border-radius: 7px;
border-radius: 7px;
text-align:center;
border:solid #fff 1px;
}
#captcha-wrap .text-box{
-webkit-border-radius: 7px;
background:#ffdc73;
-moz-border-radius: 7px;
width:140px;
height:43px;
float:left;
margin:4px;
border-radius: 7px;
text-align:center;
border:solid #ffdc73 1px;
}

#captcha-wrap .text-box input{ width:120px;}
#captcha-wrap .text-box label{
color:#000000;
font-family: helvetica,sans-serif;
font-size:12px;
width:150px;
padding-top:3px;
padding-bottom:3px;
}
#captcha-wrap .captcha-action{
float:right; width:117px;
background:url(logos.jpg) top right no-repeat;
height:44px; margin-top:3px;
}
#captcha-wrap img#captcha-refresh{
margin-top:9px;
border:solid #333333 1px;
margin-right:6px;
cursor:pointer;
}