faq.jpg

Android (14)

What kind of open-source project is Android?

Google oversees the development of the core Android open-source platform, and works to create robust developer and user communities. For the most part the Android source code is licensed under the permissive Apache Software License 2.0, rather than a "copyleft" license. The main reason for this is because our most important goal is widespread adoption of the software, and we believe that the ASL2.0 license best achieves that goal.

Permalink.

Do all the Activities and Services of an application run in a single process?

All Activities and Services in an application run in a single process by default. If needed, you can declare an android:process attribute in your manifest file, to explicitly place a component (Activity/Service) in another process.

Permalink.

What is the Android Open Source Project?

The people oversee the project and develop the actual source code. The processes refer to the tools and procedures we use to manage the development of the software. The net result is the source code that you can use to build cell phone and other devices.

Permalink.

How does the AOSP relate to the Android Compatibility Program?

The Android Open-Source Project maintains the Android software, and develops new versions. Since it's open-source, this software can be used for any purpose, including to ship devices that are not compatible with other devices based on the same source.

The function of the Android Compatibility Program is to define a baseline implementation of Android that is compatible with third-party apps written by developers. Devices that are "Android compatible" may participate in the Android ecosystem, including Google Play; devices that don't meet the compatibility requirements exist outside that ecosystem.

In other words, the Android Compatibility Program is how we separate "Android compatible devices" from devices that merely run derivatives of the source code. We welcome all uses of the Android source code, but only Android compatible devices — as defined and tested by the Android Compatibility Program — may participate in the Android ecosystem.

Permalink.

Why are parts of Android developed in private?

It typically takes over a year to bring a device to market, but of course device manufacturers want to ship the latest software they can. Developers, meanwhile, don't want to have to constantly track new versions of the platform when writing apps. Both groups experience a tension between shipping products, and not wanting to fall behind.

To address this, some parts of the next version of Android including the core platform APIs are developed in a private branch. These APIs constitute the next version of Android. Our aim is to focus attention on the current stable version of the Android source code, while we create the next version of the platform as driven by flagship Android devices. This allows developers and OEMs to focus on a single version without having to track unfinished future work just to keep up. Other parts of the Android system that aren't related to application compatibility are developed in the open, however. It's our intention to move more of these parts to open development over time.

Permalink.

What is involved in releasing the source code for a new Android version?

Releasing the source code for a new version of the Android platform is a significant process. First, the software gets built into a system image for a device, and put through various forms of certification, including government regulatory certification for the regions the phones will be deployed. It also goes through operator testing. This is an important phase of the process, since it helps shake out a lot of software bugs.

 

Once the release is approved by the regulators and operators, the manufacturer begins mass producing devices, and we turn to releasing the source code.

Simultaneous to mass production the Google team kicks off several efforts to prepare the open source release. These efforts include final API changes and documentation (to reflect any changes that were made during qualification testing, for example), preparing an SDK for the new version, and launching the platform compatibility information.

Also included is a final legal sign-off to release the code into open source. Just as open source contributors are required to sign a Contributors License Agreement attesting to their IP ownership of their contribution, Google too must verify that it is clear to make contributions.

Starting at the time mass production begins, the software release process usually takes around a month, which often roughly places source code releases around the same time that the devices reach users.

Permalink.

How can I check if an Activity is already running before starting it?

The general mechanism to start a new activity if its not running— or to bring the activity stack to the front if is already running in the background— is the to use the NEW_TASK_LAUNCH flag in the startActivity() call.

Permalink.

Do all Activities run in the main thread of an application process?

By default, all of the application code in a single process runs in the main UI thread. This is the same thread that also handles UI events. The only exception is the code that handles IPC calls coming in from other processes. The system maintains a separate pool of transaction threads in each process to dispatch all incoming IPC calls. The developer should create separate threads for any long-running code, to avoid blocking the main UI thread.

Permalink.

Why is Google in charge of Android?

Launching a software platform is complex. Openness is vital to the long-term success of a platform, since openness is required to attract investment from developers and ensure a level playing field. However, the platform itself must also be a compelling product to end users.

That's why Google has committed the professional engineering resources necessary to ensure that Android is a fully competitive software platform. Google treats the Android project as a full-scale product development operation, and strikes the business deals necessary to make sure that great devices running Android actually make it to market.

By making sure that Android is a success with end users, we help ensure the vitality of Android as a platform, and as an open-source project. After all, who wants the source code to an unsuccessful product?

Google's goal is to ensure a successful ecosystem around Android, but no one is required to participate, of course. We opened the Android source code so anyone can modify and distribute the software to meet their own needs.

Permalink.

How is the Android software developed?

Each platform version of Android (such as 1.5, 1.6, and so on) has a corresponding branch in the open-source tree. At any given moment, the most recent such branch will be considered the "current stable" branch version. This current stable branch is the one that manufacturers port to their devices. This branch is kept suitable for release at all times.

Simultaneously, there is also a "current experimental" branch, which is where speculative contributions, such as large next-generation features, are developed. Bug fixes and other contributions can be included in the current stable branch from the experimental branch as appropriate.

Permalink.

CakePHP (18)

How can you include a javascript menu throughout the site. Give steps.

By adding the javascript files in webroot and call them in default views if needed everywhere or just in the related veiws.

Permalink.

List some of the features in Cake php.

  1. Compatible with versions 4 and 5 of PHP
  2. MVC architecture
  3. Built-in validations
  4. Caching
  5. Scaffolding

Permalink.

What is a Component in cakephp?

Components are packages of logic that are shared between controllers. They are useful when a common logic or code is required between different controllers.

Permalink.

What are are drawbacks of cakephp.

The learning curve, and it loads full application before it starts your task. Its not recommended for small projects because of its resource heavy structure.

Permalink.

How cakephp URL looks in address bar?

Example: http://example.com/controller/action/param1/param2/param3

Permalink.

What is a component,helper and why are they used, is there other way we can do same thing, what is better.

A component is an independent piece of code written for specific task that can be used by calling in controllers (example : email component), helper is used for helping cakephp in rendering the data to be shown to user with views, these only adds to modularity in code otherwise same coding can be implemented in conrollers.

Permalink.

What are commonly used components of cakephp?

  1. Security
  2. Sessions
  3. Access control lists
  4. Emails
  5. Cookies
  6. Authentication
  7. Request handling

Permalink.

What is MVC (model, view, and controller) in cakephp?

Model–view–controller (MVC) is an architectural pattern used in software engineering.
Model: Databases function exist in the model
View: Design parts written here
Controller: Business Login

Permalink.

Why cakephp have two vendor folder?

There is two vendor folder, one folder in root and another is in “app” folder

Permalink.

What is the naming convention in cakephp?

Table names are plural and lowercased,model names are singular and CamelCased: ModelName, model filenames are singular and underscored: model_name.php, controller names are plural and CamelCased with *Controller* appended: ControllerNamesController, controller filenames are plural and underscored with *controller* appended: controller_names_controller.php.

Permalink.

Cpanel (87)

How do I find my DNS server?

You can use a tool such as WHOIS.com to see what nameservers are registered to your domain.

You can also ask your web hosting provider for information about your DNS server.

Permalink.

How can I create a demo version of cPanel & WHM?

To create a demo version of cPanel & WHM, perform the following steps:

  1. Create a new "dummy" account in WHM. You can use a fake domain name.
  2. Use branding to modify the account with your company's logo and look.
  3. Access WHM's Manage Demo Mode interface (Home >> Account Functions >> Manage Demo Mode).
  4. Select the account that you wish to turn to demo mode.
  5. Click Modify.
  6. Click Enable.

Permalink.

How do I block an IP address from my server?

You can block IP addresses with WHM's Host Access Control interface (Home >> Security Center >> Host Access Control).

Permalink.

How do I stop the “There is a problem with this website’s security certificate” message when a user logs in to cPanel?

In the Manage Service SSL Certificates interface (Home >> Service Configuration >> Manage Service SSL Certificates), you can change the certificates for cPanel & WHM, webmail, your mail servers, etc. You must replace the self-signed certificate with one trusted by the common browsers.

To do this, purchase an SSL certificate through WHM for your hostname in the Purchase & Install SSL Certificate interface (Home >> SSL/TLS >> Purchase & Install SSL Certificate).

Permalink.

How do I enable anonymous uploads with Pure-FTPd?

In WHM, navigate to the FTP Server Configuration interface (Home >> Service Configuration >> FTP Server Configuration.) Find the Allow Anonymous Uploads option and select Yes or No.

Permalink.

How do I restart a daemon ?

You can restart most services in WHM's Restart Services interface (Home >> Restart Services). However, you may need to restart some services in the command line.

The following example is typical of the contents that you will find in the /etc/rc.d/init.d/ directory:

root@host [~] # ls /etc/rc.d/init.d/ 
./ atd* exim* httpd.tmpeditlib kdcrotate* named* nscd* rawdevices* snmpd* yppasswdd*
../ autofs* filelimits* identd* keytable* netfs* portmap* rstatd* sshd* ypserv* 
anacron* bandmin* functions* ipaliases* killall* network* portsentry* rusersd* syslog* ypxfrd*
antirelayd* chkservd* gpm* ipchains* kudzu* nfs* proftpd* rwalld* xfs* 
apmd* cpanel3* halt* iptables* lpd* nfslock* radvd* rwhod* xinetd* 
arpwatch* crond* httpd@ isdn* mysql* nofsck* random* single* ypbind*

Take note of the following files:

  • cpanel — This file starts and stops cPanel & WHM. This also includes cppop and DNS cluster management services.
  • exim — This file starts and stops the Exim mail server.
  • httpd — This file starts and stops the Apache web server.
  • mysql — This file starts and stops the MySQL® database server.
  • named — This file starts and stops the BIND DNS server.
  • proftpd — This file starts and stops the ProFTPd or Pure-FTPd FTP server, based on which service is enabled.

Run these files as scripts to restart a daemon. For example, if you need to restart the named (BIND) daemon, run the following command as the root user:

/etc/rc .d/init.d /named start

You should see the script start up, with a green [OK] message on the left side of the terminal window.

If you see a red [FAILED] message, run the following command to check the /var/log/messages file:

tail /var/log/messages 

The error message will display. If you cannot fix it yourself, submit a ticket.

Some of these services have many options.

For example, if you have several domains that are on your DNS server and you do not want to stop and restart the  named daemon because you edited one domain, run the following command:

rndc reload

If you make a minor change to the /usr/local/apache/conf/httpd.conf file, but do not want to restart it, run the following command to perform a graceful restart:

/etc/rc .d /init .d /httpd graceful

Permalink.

How can I copy files from one domain directory to another?

You need root user privileges to copy the files with the cp command.

  • For example, copy one directory to another place with the cp -R /home/dave/public_html/photos/; /home/john/public_html/images/; command.

For more information on the cp command, run the man cp command on the command line.

You can also download the files that you wish to copy in cPanel's File Manager interface (Home >> Files >> File Manager). Then, log in to the other domain's account and use the File Manager to upload the files to that account.

Permalink.

Is it possible for the root user to access a cPanel account without the help of WHM?

You can grant the root user access to a cPanel user account with the Accounts that can access a cPanel user account option in the WHM Tweak Settings interface (Home >> Server Configuration >> Tweak Settings). This setting grants the root user access to a cPanel account by default.

Permalink.

How can I fix ndc connection refused errors?

To fix ndc connection refused errors, run the following scripts:

/scripts/upcp
/scripts/fixndc
/scripts/fixndc

Permalink.

I just created a new account. Why does it show that disk space is already used?

  • When you terminate a user's account from the system, their UID may still own files. When you create new account, the system assigns it the next available UID, which is usually that of a terminated account. Thus the new account assumes ownership of all files that the old user owns, and gives the appearance that the user is already over quota though, even though nothing has been uploaded.
  • Tarballs ( .tgz .tar .tar.gz) may have files that the user who tarred them up on a separate system owns. When you untar files on your server, they are assigned ownership of whatever account has that UID.

Permalink.

CSS (73)

What is CSS rule ‘at-rule’?

There are two types of CSS rules: ruleset and at-rule. At-rule is a rule that applies to the whole style sheet and not to a specific selector only (like in ruleset). They all begin with the @ symbol followed by a keyword made up of letters a-z, A-Z, digits 0-9, dashes and escaped characters, e.g. @import or @font-face.

Permalink.

What font units are available in CSS?

When using CSS to define font sizes with the font-size or font style properties you have several options when it comes to font size units:

Relative Font Size Units

  • em
    This is the default font size set in the users' browser preferences. It refers to the width of the letter m in the font used. Font sizes are determined relative to this initial measure.
  • ex
    This refers to the x-height of a font, or the size of the lowercase x in the font. Font sizes are determined relative to this initial measure.
  • pixels (px)
    This refers to the number of pixels in the viewing device. Font sizes are determined relative to the viewing device resolution.

Absolute Font Size Units

  • inches (in)
  • centimeters (cm)
  • millimeters (mm)
  • points (pt)
    In CSS 2, points are equal to 1/72th of an inch.
  • picas (pc)
    One pica is equal to 12 points.

Other Measurement Units

  • absolute sizes
    These are:

    xx-small
    x-small
    small
    medium
    large
    x-large
    xx-large

    These are font sizes defined and computed by the user agent, there is a recommended scaling of 1.2 between the different sizes. For example, if the medium font is 12pt, then the large font would be 1.2 times larger or 14.4pt. These sizes are completely up to the browser viewing the document and provide very little control to the Web designer.

  • relative sizes
    These are:

    larger
    smaller

    These are interpreted relative to the parent element's font size. As with absolute sizes, the user agent controls the actual size of the fonts used.
  • percentage (%)
    A percentage font size specifies a value in direct relation to the size of the parent element.

Permalink.

Can Style Sheets and HTML stylistic elements be used in the same document?

Yes. Style Sheets will be ignored in browsers without CSS-support and HTML stylistic elements used.

Permalink.

What is The CLASS?

The CLASS is a reference to any element on a page that needs to look a specific way when this reference is used. For example, if you frequently want to highlight a word or two within your text (we'll use red as a highlight color in this instance), you might have a CLASS selector in your style sheet like this:

.hilite { color: red}
and the reference in your HTML might look like this:
...this is some text about something
I want <span class="hilite">in red</span>. And 
some more rambling here...
As you can see, the difference between ID and CLASS selectors in the style sheet is that an ID uses a pound sign (#name) and a CLASS uses a period (.name) . ID references must be unique on a page and used once. CLASS references can be used repeatedly in the same page.

Permalink.

What is a User Style Sheet?

User style sheets allow you to control how Web pages that you visit look. This is especially useful if you have accessibility issues. But it's also helpful if you just want to avoid seeing annoying things like the <blink> tag or <marquee>.

Permalink.

How do I combine multiple sheets into one?

To combine multiple/partial style sheets into one set the TITLE attribute taking one and the same value to the LINK element. The combined style will apply as a preferred style, e.g.:

<LINK REL=Stylesheet HREF="default.css" TITLE="combined">
<LINK REL=Stylesheet HREF="fonts.css" TITLE="combined">
<LINK REL=Stylesheet HREF="tables.css" TITLE="combined">

Permalink.

Use CSS3 to Transform Horizontally Oriented Text to Vertically Oriented

CSS3 provides two new style properties: transform and transform-origin that you can use to rotate text so that it is positioned vertically on the page, rather than horizontally.

For example, to change an H1 headline to vertical text, you could write:

h1 {
  -webkit-transform:rotate(90deg);
  -moz-transform:rotate(90deg);
  -o-transform: rotate(90deg);
  transform: rotate(90deg);
  -webkit-transform-origin: 0% 100%;
  -moz-transform-origin: 0% 100%;
  -o-transform-origin: 0% 100%;
  transform-origin: 0% 100%;
  white-space: nowrap;
} 

Note that there is also the white-space CSS property. This keeps the headline all on one line.

Permalink.

What is cascading order?

Cascading order is a sorting system consisting of rules by which declarations are sorted out so that there are not conflicts as to which declaration is to influence the presentation. The sorting begins with rule no 1. If a match is found the search is over. If there is no match under rule no 1 the search continues under rule no 2 and so on.

  1. Find all declarations that apply to a specific selector/property and declare the specified style if the selector matches the element if there isn't any
    Let the element inherit its parent property if there isn't any
    Use initial value

  2. Sort by weight (! important)
    Increased weight take precedence over normal weight

  3. Sort by origin
    Rules with normal weight declared in author's style sheet will override rules with normal weight declared in user's personal style sheets
    Rules with increased weight declared in user's personal style sheet will override rules with normal weight declared in author's style sheet
    Rules with increased weight declared in author's style sheet will override rules with increased weight declared in user's personal style sheets
    Author's and user's rules will override UA's default style sheet.

  4. Sort by selector's specificity
    More specific selector will override less specific one:

    ID-selector (most specific), followed by
    Classified contextual selectors (TABLE P EM.fot)
    Class selectors (EM.fot)
    Contextual selectors – the "lower down" the more weight, (TABLE P EM), (TABLE P EM STRONG) – STRONG has more weight than EM.

  5. Sort by order specified
    If two rules have the same weight, the latter specified overrides ones specified earlier. Style sheets are sorted out as follows:

    The STYLE attribute (inline style) overrides all other styles
    The Style element (embedded style) overrides linked and imported sheets
    The LINK element (external style) overrides imported style
    The @import statement – imported style sheets also cascade with each other in the same order as they are imported

Permalink.

What is ‘important’ declaration?

Important declaration is a declaration with increased weight. Declaration with increased weight will override declarations with normal weight. If both reader's and author's style sheet contain statements with important declarations the author's declaration will override the reader's.

BODY {background: white ! important; color: black}

In the example above the background property has increased weight while the color property has normal.

Permalink.

Which characters can CSS-names contain?

The CSS-names; names of selectors, classes and IDs can contain characters a-z, A-Z, digits 0-9, period, hyphen, escaped characters, Unicode characters 161-255, as well as any Unicode character as a numeric code. The names cannot start with a dash or a digit. (Note: in HTML the value of the CLASS attribute can contain more characters).

Permalink.

HTML5 (14)

What is an HTML5 application?

There are several new capabilities in HTML5 which directly address the need for creating interactive applications. Of course, HTML has had interactive capabilities since its early days with text-based input forms and HMTL5 expands these with new input types. New capabilities include page and session-based data storage in the user’s browser, Web sockets for inter-application communications, and a drawing environment, the canvas element, for creating and manipulating image data.

Permalink.

What about Internet Explorer?

Internet Explorer is late to the HTML5 party. There’s no HTML5 support in IE8 or previous versions. However, adding a JavaScript library such as Google’s HTML5 shim or Modernizer enables IE 6, 7 & 8 to recognize the new semantic level elements so they can be styled with CSS. HTML5 support is good in the beta version of IE9 which is available for Windows Vista and Seven users. Unfortunately, the Windows 7 mobile browser is built largely on the IE7 code base.

Permalink.

Is HTML5 is a threat to Microsoft?

No. Microsoft embraces HTML5. The IE9 beta has received high marks for its HTML5 support. Silverlight is not the only path to interactivity in Redmond

Permalink.

What is new about HTML5?

Several things. The biggest change is that HTML5 documents are explicitly recognized as interactive applications. Every document element in HTML5 has a corresponding JavaScript API that describes how that element should behave in response to user actions and other events.

Permalink.

Will HTML5 kill Adobe’s Flash?

Nope, Flash will be around for a long time. As a media player, Flash accommodates digital rights management (DRM) which hasn’t been addressed in the HTML5 specs. As an applications platform, Flash has a large, installed base in corporate environments where there’s no compelling rationale for rewriting working applications in HTML5. For new applications, HTML5 has advantages over Flash: content is better exposed to search engines, there’s complete integration with other document elements, no plugins are required and HTML5 tools are free.

Permalink.

Where can I get an HTML5 browser?

Opera, Chrome and Safari provide pretty solid support for HTML5 in their current versions including their browsers for iPhones, iPads and Droids. Firefox’s support for HTML5 is weak in its current version (3.6) but quite robust in the Firefox4 public beta.

Permalink.

Is HTML5 video better than Flash video?

Yes, but not in terms of video quality which is a function of how the video data is encoded. HTML5 video is better because the video element can interact with other elements on the page and can be styled using CSS. Also, HTML5 video should use less resources because it is built into the browser.

Permalink.

Are there new HTML5 tags?

Yes, there are new HTML5 elements that provide richer semantic descriptions of documents: section, article, header, hgroup, footer, aside and nav; new media elements: audio, video and canvas; new form input types: email, url, number range and search; and a bunch of new element attributes.

Permalink.

Is HTML5 ready for prime time?

Some of it is and some of it isn’t. New HTML5 semantic elements have good support in all modern browsers, including IE if an HTML5 shim or the Modernizer JavaScript library is loaded into a web page. The audio, video and canvas elements are not supported in Internet Explorer yet, but these elements are designed to gracefully fail and fallback to other technologies, like Flash and Silverlight, in legacy browsers. Other technologies that are associated with HTML5 such as Mathematical Markup Language (MathML), Scalable Vector Graphics (SVG), Web Sockets, Web Storage and Geo-location have only limited support in the current crop of browsers.

Permalink.

What exactly is HTML5 Video?

Nothing, really. The term HTML5 video is used to differentiate the playing of a video directly by a browser encountering a web page’s video element, as opposed to being played by a third-party browser plugin via an object or embed element. There is nothing intrinsic about any video that makes it HTML5-ish as opposed to Flash-ish. The distinction is entirely a matter of how the a web page is coded to present the video.

Permalink.

Java (225)

What’s the difference between = & ==?

One of the most common programming mistakes that one can make is to confuse the equal sign (=) with a double equal signs (==). While experienced programmers can still make the same mistake, knowing the difference between the two is a good way to avoid it.

When we wish to assign a value to a variable or member, we use the equals sign (=). As an example, the following would assign the value of three to the variable a.

a = 1 + 2; // assignment operation

When we wish to make a comparison, such as in an if statement, we use the double equals sign (==). A simple example would be the following

if ( a == b ) then System.out.println ("Match found!");

Now consider what would have happened if we used an assignment operator instead. A would be assigned the value of B – destroying the current contents of A and giving us an incorrect comparison. Finding this type of error can be difficult, because the two operators look so similar. So why does Java use such confusing operators? Java draws its roots from C, which shares the same problem. Unfortunately, its something that all Java programmers must learn to live with.

Permalink.

Why would I save my classes to disk on the client browser?

Some applets are quite large, even with JAR and CAB compression. This results in download time that may be unacceptable for some applications. To remedy this problem, both Netscape and Microsoft have proprietary means of saving your Java classes to the users hard disk, such that, the only time a user must download the applet is when the classes have changed.

	---- snip ------- from email message from jxski@spies.com ---- snip ----

another reason for putting classes on the local disk (section 6) — at least for Netscape — is making use of native methods. Netscape will only let classes loaded from the local disk load native libraries. Once the lib is loaded, however, netloaded classes can call the native methods (provided they have access to the class, the method isn't private, etc. — normal Java stuff).

Permalink.

What is the Java Platform, Enterprise Edition (Java EE)?

Java Platform, Enterprise Edition (Java EE) is the industry standard for developing portable, robust, scalable and secure server-side Java applications. Building on the solid foundation of Java SE, Java EE provides component development, web services, management, and communications APIs that make it the industry standard for implementing enterprise class service-oriented architecture (SOA) and Web 2.0 applications.

Permalink.

How can I redirect a page to a different address, even if the user has JavaScript turned off?

Use suspenders and a belt — both the Refresh pragma and a JavaScript redirect in the <head> of the page, like this:

<meta http-equiv="Refresh" content="0; url=http://site.com/page.html">

<script> window.location="http://www.mysite.com/mypage.html"; </script>

Make sure to set both url's the same, and be careful of the punctuation in the Refresh pragma.

The other way to do this is server-side via the .htaccess file in your web root.  Do this with caution, and always check your server documentation or with your server administrator to be certain it's allowed on your host — though the technique is very much standard on UNIX/LINUX boxes.

Add a Redirect request to your .htaccess file in the following general form:

Redirect whatpage.html http://www.mysite.com/otherpage.html

In this example, whatpage.html>/span> is redirected to http://www.mysite.com/otherpage.html.

Permalink.

My version of JDK won’t run classes, even when they’re in the current directory. What should I set my classpath to?

Remember always to include the current directory in your classpath. For example, on Windows systems, you might need to try

jre -cp .\  MyJavaApplication ,  or

java -cp .\ MyJavaApplication

Permalink.

What is the difference between public, private, and protected keywords? Do I even need to use them?

We use these keywords to specify access levels for member variables, or for member functions (methods).

  • Public variables, are variables that are visible to all classes.
  • Private variables, are variables that are visible only to the class to which they belong.
  • Protected variables, are variables that are visible only to the class to which they belong, and any subclasses.

Deciding when to use private, protected, or public variables is sometimes tricky. You need to think whether or not an external object (or program), actually needs direct access to the information. If you do want other objects to access internal data, but wish to control it, you would make it either private or protected, but provide functions which can manipulate the data in a controlled way.

Take the following example :

public class bank_balance
{
	public String owner;
	public int balance; 

	public bank_balance( String name, int dollars )
	{
		owner = name;

		if (dollars >= 0)
			balance = dollars;
		else
			dollars =0;
	}
}

We have declared our string and integer to be public. This means that any object in the system can change the balance (setting it to zero, or even giving us a negative balance). This could cause the program to fall over, even though we wrote code in our constructor to prevent negative balances.

Instead, we should have provided a getBalance/setBalance method, and made our balance private or proteced. Other objects can still access the data, but they can't put invalid data in.

public class bank_balance
{
	public String owner;
	private int balance; 

	public bank_balance( String name, int dollars )
	{
		owner = name;

		if (dollars >= 0)
			balance = dollars;
		else
			dollars =0;
	}

	public int getBalance()
	{
		return balance;
	}

	public void setBalance(int dollars)
	{
		if (dollars >= 0)
			balance = dollars;
		else
			dollars = 0;		
	}
}

Permalink.

What does it mean that a method or class is abstract?

An abstract class cannot be instantiated. Only its subclasses can be instantiated. You indicate that a class is abstract with the abstract keyword like this:

public abstract class Container extends Component {

Abstract classes may contain abstract methods. A method declared abstract is not actually implemented in the current class. It exists only to be overridden in subclasses. It has no body. For example,

public abstract float price();

Abstract methods may only be included in abstract classes. However, an abstract class is not required to have any abstract methods, though most of them do.

Each subclass of an abstract class must override the abstract methods of its superclasses or itself be declared abstract.

For more details, see section 8.1.2.1 of the Java Language Specification.

Permalink.

What email addresses are available?

Information about our internal e-mail addresses is available at

Java Software e-mail addresses.

Permalink.

How do I get the scrollbar to show on the left of a textarea instead of the right?

Add dir="rtl" to the <textarea> tag, like this:

<textarea dir="rtl">

You can do the same thing in the page <html> tag, as well, and it will flip the whole layout (but not text) to a right-to-left orientation, with the page scrollbar on the left instead of the right.  The technique is intended for languages (Arabic, for instance) that read from right to left, rather than left to right; but can occasionally be used to good effect for special purposes.

Note that this works in IE4&up and NS6&up; but is ignored in older browsers.

Permalink.

Joomla (200)

How can you view a live site while developing, but hide it from others?

Introduction

The method described below should be used for relatively minor modifications, such as adjusting menus or quickly reorganizing content sections. More complex tasks, such as installing new components or adjusting complex configuration settings should be performed and tested on a development server first. Not only does this keep your public site up and running, but it also lets you test at your leisure, thus reducing errors. One way to do it is to create a sub-domain (i. e., dev.yourdomain.com) and install Joomla! there just as it is installed on your public site.


Directions

  • Log in to the Back-end, and choose: Site > Global Configuration.
  • The first option you'll see is is to set the site offline. Choose "Yes" and press the Save button. This will prevent display of all site pages and replace them with the following message:

    This site is down for maintenance. Please check back again soon.
  • While you are logged into the Back-end administrator system, you can still view the Front-end, by

    • v3.0: clicking the site name in the top left corner
    • v2.5: clicking the Preview link in the top right corner
    This will display the site as it would appear to users along with a warning at the top that the site is down for maintenance.

Permalink.

What is the contact creator?

The contact creator is a plugin that automatically creates a linked contact record every time you create a new user.

The contact creator is disabled by default; enable it in the plugin manage.

Permalink.

How do I tune for speed with PHP5 and MySQL5?

This is just a point by point summary of how I've been tuning and tweaking our Joomla sites to get them running as quickly as possible. For reference, we run all our sites off a Rackspace dedicated server, with 1Gb RAM, a 2Ghz dual core Athlon, running Apache 2.0.x (current revision), PHP 5.0.x (current revision) and MySQL 5.0.18.
These are listed in terms of apparent speed increase – that is, not the sheer speed for the full page, but the speed before the page is usable to view content, even if not all features are loaded.
  • PHP caching. I had been running eAccelerator, but switched to APC today, and it has made the system even faster than before, and eAccelerator was a big boost over uncached PHP. Joomla is a big complex system, so using precompiled code is a big time saver. I use a 128Mb in-memory cache, which is plenty for our needs.
  • MySQL Query Caching. This one will vary depending on how dynamic your site is, and you can really kill the benefits by using the wrong extensions (any date/time based will need checking), but if you are serving pretty much the same queries each page load, it will drop the load times noticably.
  • Template Image optimisation – template images really slow down the initial page load for first time visitors, so optimising the hell out of them makes sense. Remember that your template is probably not going to change as often as your story content, so you can afford to spend more time on optimising the images for it that you would otherwise. I recommend Irfanview, with the pngout plugin active for PNG images, and it isn't bad for JPG and GIF images either. Don't forget to ramp up the compression level of PNGs, and, if possible, reducing them to indexed pallettes.
  • CSS compression. Easy one this – put a little script to output a gzipped version of your CSS file(s) and point your index.php at it. Example script below – I didn't write it, but it's short, to the point, and works.
             ob_start ("ob_gzhandler");
             header("Content-type: text/css");
             header("Cache-Control: must-revalidate");
             $offset = 60 * 60 ;
             $ExpStr = "Expires: " .
             gmdate("D, d M Y H:i:s",
             time() + $offset) . " GMT";
             header($ExpStr);
  • Strip unneeded modules, components, mambots from Joomla. If you haven't used them, the impact on your loading time is minimal, but with more components/modules active, there are more points of failure, and Apache errors are slow!
  • Scrutinise the Apache error log. It is amazing how many errors can crop up even with a fairly minimal Joomla install, and they don't necessarily affect the appearance of the page. Check your error log, especially if you are using custom components/modules, or any non-standard config settings. Once you've noticed any problems, it's time to fix the code creating them, and test thoroughly before uploading the fixed versions.
  • Keep rechecking as you add/remove features, redesign or change any server configuration options. Even things like adding virtual servers in Apache can affect speed of the server, as a missed config setting can cause general Apache delays.

Permalink.

Why don’t all of my menu items show up in the module assignment lists?

Modules are assigned to specific pages using a list of menu links that is visible when you edit the module in the module manager (on the right of the page). In older versions of Joomla! this list does NOT include menu links of the type "URL." This is an anomaly from the history of the development of Joomla! carried over from Mambo. Although you can use the URL type for any link, including internal Joomla! links, the original idea was that these would be used for links to external sites which would not display Joomla! modules. Some Joomla! component extensions use URL links (rather than component links with parameters) as a simple way to access specific views of the components.

Permalink.

What do Error 1, Error 2, and Error 3 mean?

Error 1 = FATAL ERROR: MySQL not supported…

You need to compile MySQL support into PHP or the MySQL server is down.

Error 2 = FATAL ERROR: Connection to database …

Joomla! cannot talk to the database, most likly you have a typo in the username or password settings in configuration.php, or you are trying to access a database table with the wrong table prefix.

Error 3 = FATAL ERROR: Database not found…

The database cannot be found. Check the database settings in configuration.php

The MySQL variables in configuration.php (found in Joomla!'s root directory) can be modified to correct these problems.

For Joomla! 1.0.xx

$mosConfig_host = 'localhost';
$mosConfig_user = 'accountname__username';
$mosConfig_password = 'userpassword';
$mosConfig_db = 'accountname_dbName';
$mosConfig_dbprefix = 'jos_';

Modifying the $mosConfig_host to an IP Address of a remote host works for hosts that have separate MySQL servers from the client hosting servers.

Permalink.

Why should I choose Joomla!

Joomla is an award-winning content management system (CMS), which enables you to build Web sites and powerful online applications. Many aspects, including its ease-of-use and extensibility, have made Joomla the most popular Web site software available. Best of all, Joomla is an open source solution that is freely available to everyone with a strong community to help users and develop features.

Permalink.

How do you assign a module to specific pages?

Navigate to Extensions>>Module Manager. Select the module you want to assign and edit it.

In Joomla 1.5 on the left there is a list of menu items. In Joomla 2.5/3.0 this is found beneath the details section of the module.

You can chose between None, All and Select Menu Item(s) from the List. To assign to some but not all pages choose the third option and select the menu links that you want the module associated with.

Notes:

  • If your module is assigned to a position that does not exist in the template used to display a page, the module will not appear even if it is assigned to a specific page.
  • If your module is not published/enabled it will not appear even if assigned to a page.
  • You cannot assign a module to a URL link. This is because URL links do not have Itemids assigned to them.
  • You cannot directly assign modules to pages that are only linked via content (for example, a link from one article to another) or other, non-menu modules (for example, a link to an article from a module), because these also do not have Itemids. One work-around for this problem is to have an unpublished menu that contains links to the items you wish to link through non-menus. This will create an itemid that can be included in the url you link to.

Permalink.

What are components, modules and plugins?

Components

Content elements or applications that are usually displayed in the center of the main content area of a template. This depends on the design of the template in use. Components are core elements of Joomla!’s functionality. These core elements include Content, Banners, Contact, News Feeds, Polls and Web Links. Members of the Joomla! community produce third party Joomla! components on a continuous basis. They are freely available to download from http://extensions.joomla.org/ and a number of other web sites. See also Modules.

Plugins

A plugin is a small, task-oriented function that intercepts content before it is displayed and manipulates it in some way. Joomla! provides a number of Plugins in the core distribution, e.g. WYSIWYG editors, but there are many other Plugins available for specific tasks. Some 3rd Party developer components have their own Plugins which need to be installed in order to make the component work properly.

Modules

Modules extend the capabilities of Joomla! giving the software new functionality. Modules are small content items that can be displayed anywhere that your template allows it to be displayed by assigning them to positions and pages through the module manager in the administrative interface. Modules are installed in the Admin Section. Joomla! modules may include: Main Menu, Top menu, Template Chooser, Polls, Newsflash, Hit Counter, etc. Members of the Joomla! Community produce Joomla! modules on a continuous basis. Many are freely available at http://forge.joomla.org/ for download.

In addition, some 3rd party components, modules and mambots themselves have plugins.

Permalink.

What is the calculation for an extension to be ‘Top Rated’?

An extension has to have at least 15 votes to be eligible to be listed as Top Rated Extension. Top Rated extensions are ordered by the average rating given by users.

Permalink.

How do I implement the core Search Engine Friendly URLs (SEF) on a Windows Server?

Many Joomla! Community members are using ther local Windows based PC's to test and develop Joomla! sites on and one of the most frustrating items about Apache on Windows is that Winodws cannot support many of the Apache functions that can be used on Linux/Unix based production sites.

Joomla! SEF Capability on Windows/Apache

1 ) Ensure that you have the Apache Rewrite Module ( mod_rewrite.so ) installed/available in the Apache " modules/ " directory.

2 ) Enable Apache " mod_rewrite " in httpd.conf by removing the " # " ( hash sign ) from the following line in httpd.conf

       # Remove the "#" if it exists from the following line in the modules section
       LoadModule rewrite_module modules/mod_rewrite.so 

3 ) Restart Apache to check that the ReWrite Module is loading correctly and not crashing Apache

       apache -k restart


4 ) Again, modify the following lines in your httpd.conf to support Windows File Naming conventions

          # AccessFileName: The name of the file to look for in each directory
          # for additional configuration directives.  See also the AllowOverride
          # directive.
          #
          #AccessFileName .htaccess
          # Allows for Joomla! SEF functionality on Windows (Notice, No dot)
          AccessFileName htaccess
         #
         # The following lines prevent .htaccess and .htpasswd files from being viewed by Web clients.
         #
         #<FilesMatch "^\.ht">
         # Allows for Joomla! SEF functionality on Windows (Notice, No dot)
         <FilesMatch "^\ht">
            Order allow,deny
            Deny from all
            Satisfy All
        </FilesMatch> 

3 ) Restart Apache to check that the FileMatch Rule is not in error and not crashing Apache

       apache -k restart

6 ) Rename htaccess.txt to " htaccess " (notice, no "dot", unlike the *nix equivalent)

7 ) Modify $mosConfig_sef = 0 to now be a 1 (turning on SEF)

8 ) Access you local WebSite and check your SEF is working.

Permalink.

Magento (57)

Reindex Magento Data via SSH

The fastest way to reindex Magento data is manually via SSH.

To reindex the Magento data manually, you need to have an SSH access to your web hosting account. All SiteGround hosting accounts come with SSH access.

All you need to do to reindex your Magento data manually is to log in your hosting account via SSH, go to your Magento installation directory (e.g. public_html/store) and execute the following command:

/usr/local/bin/php shell/indexer.php reindexall
	

This command will reindex data by all indexers.

Permalink.

Is any core code or templates overwritten?

Overwriting core code is at the heart of many performance problems and can lead to problems when making any upgrades in functionality (new extensions or when moving to a new version of the platform).
To ensure that you are getting the most out of Enterprise Edition, make sure you are working with a certified Magento developer. Developers spend hundreds of hours learning the Magento code in order to become certified and show their dedication to the Magento platform by taking (and passing) a rigorous test.

Permalink.

Adding a new product in Magento

If you are building a store with more than one store view, you must understand the concept of attribute scope and how it is used for products and categories.

Note: Before you add products, define the complete sales tax rules you will be using. Correcting the tax class for each product afterwards may be extremely time-consuming.

Product Name

Enter the full product name. For a simple product, there will be no way to customize the product in any way. If you have several similar products. you need to differentiate their product names: “Large boxes”, “Medium boxes” etc. If you sell the same product in different packages, you may want to include the quantity in the product name, e.g. “Large boxes, 10-pack”.

Description

Enter the long product description that is used in the detail section of the product page.

This field has some odd behaviors as it has a nl2br function that turns line endings to <br /> which can totally mess up things like table display. If you are using the WYSIWYG editor, you will probably edit the code to remove nl2br which will force re-edit of all your existing descriptions to use proper HTML for display.

Short Description

Enter the short product description that is used on the catalog page in list view, and as the Quick Overview on the product page.

SKU

In the SKU field (http://en.wikipedia.org/wiki/Stock_Keeping_Unit), enter the unique SKU for this product.

Weight

The Weight field is mandatory. If you don’t know the weight for this product, just enter 1.

Manufacturer

The manufacturer attribute is a drop-down selector.

You need to go into attribute management, pull up the Manufacturer attribute and add values to the list so the drop-down will be populated.

It’s done this way so you don’t end up with “tag spew”, that unenviable property of user produced tag clouds where you have a properly spelled manufacturer name surrounded by every possible misspelling and anyone trying to do a search on that attribute never gets a full search result because the one item they want to find is in one of the misspelled tag collections.

Status

Set the Status field to Enabled to ensure that the product is visible in the catalog. If a product runs out of stock, it will be assigned an Out-of-stock status until stock has been replenished. Use the Disabled status before introducing a new product, or after you’ve phased it out.

URL key

The URL key will be used in links to this product, if you’re not happy with just the product name. When sites are ranked in search results, it is considered an advantage to have as many keywords as possible in the URL. If your product is called “Large boxes”, you may want to set this field to “large-handmade-designer-boxes” to include two additional keywords in the link.

Visibility

The Visibility setting determines whether a visitor can find this product by browsing the catalog, by searching for the product, or both.

Click on “Save And Continue Edit”. Note that the product is not visible in the catalog until it has been assigned to at least one website and category.

Enter your ordinary selling price for the product.

You may also enter your cost for purchasing the product.

Assign the correct Tax Class.

Use the Tier Price list to specify volume discounts.

Use the Special Price setting for campaigns. The Special Price is insensitive to volume and is used within the dates set by Special Price From Date and Special Price To Date. The Promotions tab in the Admin tool provides additional, more advanced price management options.

The Page Title is by default set to the name of the product. You may want to extend this to aid the user or a search engine, e.g. for a product called “Large boxes” you may want to use a title like “Large handmade designer boxes for bowling balls”.

The Meta Keywords and Meta Description are by default set to the site defaults, making them useless. You should at least copy the first 255 characters of the unique Description field for each product to its Meta Description field, since this helps search engines display a summary of the contents on the page. Many experts on search engine optimization consider Meta Keywords a thing of the past, and not worth a major effort. If you want to provide Meta Keywords, they should summarize each page by its most important keywords, separated by commas, e.g. “handmade boxes, large boxes, bowling ball boxes”. The Meta Keywords should be unique for each page.

Specify the location of the thumbnail image, small image and main image for this product. In the demo template, these images have the following sizes:

  • thumbnail: 50 x 50 pixels

  • small image 135 x 135 pixels

  • main image 1100 x 1100 pixels

Any images you upload will be scaled to the correct size, so you can use the same image in all three fields. However, if the template requires a particular aspect ratio, you should convert your images to this aspect ratio before you upload them, since they may become distorted otherwise.

The aspect ratio used by the demo template is 1:1, i.e. your product images should be square.

For the main image, a cute zooming feature is used on the main product page. For this feature to work properly, your product images should not be smaller than the size of the main image for the template.

Press Browse to locate and select each of the image files for this product. Press Upload Files to upload the selected files to the Magento server. Select which image to use in each situation (Thumbnail, Small image, Base image). Give each image a label, which will also be used as the Alt text for the image.

Magento inventory management is largely controlled by settings on the System > Configuration > (Catalog) Inventory tab. If you set Decrease Stock When Order is Placed to Yes, Magento keeps track of inventory by automatically maintaining the Quantity in Stock for each product.

In the Qty field for the product, enter the exact current quantity in stock, or a high value if you don’t keep track of inventory (System > Configuration > (Catalog) Inventory > Decrease Stock When Order is Placed is set to No).

Use the Minimum Qty for Item’s Status to be Out of Stock setting to define when the product enters an Out of Stock status and no longer can be ordered. If you sell the same products both online and in a regular store, you may want to set a certain threshold where online orders are no longer accepted even though you still have a minimal quantity in stock.

The Minimum and Maximum Qty Allowed in Shopping Cart setting prevents customers from ordering less than a designated minimum quantity, or more than a maximum quantity.

The Qty Uses Decimals setting determines whether decimals will be used in the quantity field for the product (e.g. “3.5 yards”) or not.

Enter Notify for Quantity Below. When a stock of any product goes below this level, Magento will automatically notify you viaRSS Feed. This ability works in conjunction with the Decrease Stock When Order is Placed drop-down above, because Magento cannot notify you of a low stock unless you also enable it to keep track of stock reduction. In this field, enter the quantity level at which Magento will send a notification. Note that the default of 0 disables out-of-stock >RSS notifications. In order to subscribe to the RSS feed, navigate to Catalog > Manage Products, and click the Notify Low Stock RSS link at the top of the page. You will be prompted to enter your User Name and Password. These are the same that you use to access the Magento admin panel. You will be redirected to the RSS page, where you can select which reader you would like to use for receiving this feed.

The Stock Availability setting shows you whether Magento considers the product in stock or not. If the Qty value is higher than the Minimum Qty for Item’s Status to be Out of Stock, you should ensure that Stock Availability is set to “In Stock”.

Select in what websites you want this product to be visible. Note that you must assign the product to one or more categories in each website before it appears in the catalog for that website.

Select in what categories the product will appear. Note that the settings on the Websites tab also affects the appearance of the product in each website.

Click on “Save And Continue Edit”. The product should now be visible in the stores and catalogs you have selected.

Permalink.

How to install Magento

These instructions document the default installation for Magento. At the end, Magento will be installed without sample data to a directory called magento on your web server. There are four main steps covered here:

  • Step 1 – Download Magento
  • Step 2 – Set file permissions for the Setup Wizard
  • Step 3 – Create your store database
  • Step 4 – Run the web-based Setup Wizard
  • All done!

Step 1—Download Magento

Method 1: Download Magento to your computer and FTP it up to your server

  1. Using a browser, download the latest full release archive file from MagentoCommerce.com ( http://www.magentocommerce.com/download)
  2. On your computer, extract Magento from the downloaded archive. A folder named magentocontaining all of the Magento files will be created
  3. Using an FTP client, upload the extracted magento folder and all its contents to the web root on your web server (usually public_html)

Method 2: Download Magento directly to your server (requires SSH access)

If you have SSH access to your server, using wget to download the archive directly to your server is much faster and simpler than Method 1.

  1. Using SSH, log onto your server and go to the web root directory (usually public_html)
  2. Get the full release archive using the wget command below
  3. On your server, extract Magento from the downloaded archive. A directory named magentocontaining all of the Magento files will be created under  public_html


	cd publc_html wgethttp://www.magentocommerce.com/downloads/assets/1.4.1.0/magento-1.4.1.0.tar.gz tar -zxvf magento-1.4.1.0.tar.gz
	

(Replace 1.4.1.0 in the commands above with the desired version number. Current and previous version numbers can be seen on the Download page on MagentoCommerce.com)

Step 2—Set file permissions for the Setup Wizard

On your web server, make the directories that the Setup Wizard needs writeable by the web server

Files & directories that must be writeable are:

  • – file: magento/var/.htaccess
  • – directory: magento/app/etc
  • – directory: magento/var
  • – all the directories under: magento/media

If you are using FTP, set the permissions of each to 777 or check read/write/execute for owner, user and group. If you are using SSH, use the following commands:


	chmod o+w var var/.htaccess app/etc
chmod -R o+w media

Step 3—Create your store database

  1. Create an empty MySQL database for your store 
    This step varies by hosting provider and is out of the scope of this document. Consult your System Administrator or your web host’s support/documentation for instructions on how to do this. PHPmyAdmin or the MySQL command line are the most commonly used tools/methods for creating and managing a MySQL database
  2. Create a database user with full privileges to the database
  3. Make note of the database name (dbname), db user (dbuser), db user password (dbpassword)
  4. If you want to load sample data, you must do it now, before you run the setup Wizard in the next step

Step 4—Run the web-based Setup Wizard

  1. Using a browser, run the Setup Wizard 
    Go to your website by domain or IP address http://www.yourDomain.com/magento or http://yourIP.0.0.1/magento) and the Setup Wizard will run automatically
  2. In the Setup Wizard, finish configuring your Magento installation

         a. License Agreement – Read and accept the terms and conditions

         b. Localization (settings can  be changed later via the Admin Panel)

  • Locale – default country $ language
  • Time zone – default time zone
  • Default currency

c. Configuration

Database

  • Host

     -localhostworks
    

    for most basic installations

  • Database name

    -dbnameform
    

    when you created the database

  • User name

    -dbuserfrom
    

    when you created the database

  • User Password

    -dbpassform
    
    when you created the database

Web access options (will be pre-filled based on your installation, settings can be changed later via the Admin Panel)

  • Base URL—for default installation into a magento directory, base URL should be  http://www.yourDomain.com/magento or http://www.yourIP.com/magento . (If you’re installing Magento locally on PC or Mac, this should be 127.0.0.1/magento –you cannot put “localhost” here unless you’ve previously set it up in your local hosts file.)
  • Admin path—default is “admin” (will be appended to base URL to reach Admin Panel)
  • Skip Base URL Validations Before the Next Step
  • Use Web Server (Apache) Rewrites
  • Use Secure URLs

Session Storage Options—Choose file system or database. Most installations should use “file system” because it’s faster and doesn’t cause the database to grow. But if your site will run on multiple servers, you should select “database” so that a user’s session data is available regardless of which server his/her request is served from.

Admin account

  • Name & contact info for 1st Admin user
  • Login info for 1st admin user (username & password)
  • Encryption key—Database encryption key. If you do not provide one, Magento will automatically generate one. It will be displayed to you and saved in the app/etc/local.xml file.

Magento stores this set up information in the file  app/etc/local.xml. If you’d like to run through the Setup Wizard again you do not have to download all the Magento files again. Just delete the  local.xml file and any files and directories in the var/ directory and go back to  http://www.yourDomain.com/magento&nbsp; with your browser. The Setup Wizard will run automatically again. (Why does this work? The Setup Wizard writes the values you provide during the setup process to the local.xml file and it will not run if it finds a local.xml file already. The var folder contains cached session information from the frontend and will have cached any previous settings, so deleting these files will prevent the incorrect cached content from being used.)

Success!

magento installation softaculous

After you finish the set up wizard, you will be redirected to the Magento storefront. You can access the Admin Panel and start adding categories and products.

  • Your frontend store will have the URL  http://www.yourDomain.com/magento
  • Your Admin Panel will have the URL  http://www.yourDomain.com/magento/admin
    (Log in using the username and password you created in the last step of the Setup Wizard)

Permalink.

How many database tables will Magento create when you make a new EAV module?

Magento creates 6 tables when you create new EAV module. Tables: module, module_datetime, module_decimal, module_int, module_text and module_varchar. one is the main entity table, and rest 5 tables which holds attribute’s data in different data types. So that integer values will go to module_int table, price values to module_decimal, etc.

Permalink.

What are we doing to keep our pages loading fast?

Page load time is critical! Your developer should be able to tell you which caching methods they are using. If you are on a cloud resource pool you will maximize your speed if you are using Nginx (rather than Apache) and have implemented APC caching. If you get a lot of traffic from other countries you should probably be using a Content Distribution Network

Permalink.

The­ Magento­ Trademark

  • Magento’s Trademark policy strictly forbids the use of the term “Magento” in any form within the domain name. This means you can’t use it even with some other words ( examplemagento.com, example-magento.com… )

  • You can use the word “Magento” anywhere within your sub-domain. Example: magento.example.com, magento-services.example.com…

  • You can promote your Magento related services using the term “Magento” anywhere within the text.

  • You shouldn’t use the word “Magento” within the name of your extensions. Plese note that you also may NOT use the term “Magento” within your username at magentocommerce.com, but this is more due to the Extension Guidelines than due to the Trademark Policy.

  • Your extensions will not be approved at Magento Connect. If you hold a domain name with Magento within, Magento Inc. could take that domain away from you if they wanted to since they do hold a trademark on that term.

Permalink.

How to get first item or last item from the collection?

$collection->getFirstItem() and $collection->getLastItem();

Permalink.

Are some pages more important than others?

Are some pages more important than others?

In general you want your entire site to be fast because customers tend to abandon a site more often whenever any page takes too long to load. That being said, if your checkout pages are slow, it often becomes a question of trust with the shopper which can kill a transaction. The general consensus is to keep your checkout pages clean and simple to increase their speed.

Permalink.

What can I do to speed up my site?

There is rarely one cause of slow site speed. Optimizing site speed is really a collaborative effort and often requires creativity from and collaboration between design, tech, and network resources.

When mustering troops to address the issue, you will probably have projects in three main areas:

1. Content optimization: Are the images the right size for the site? Do I have too many images on a page? Do I have large Javascript files that have to download before the page renders? These issues can usually be addressed by your front-end designers, but your server team may need to help identify the priorities.

2. Catalog size: The larger your catalog, the greater the burden on your server(s) to load pages, especially when we’re talking about SKUs tipping over 100K.

3. Your server: If Google’s Page Speed Analyzer is telling you that your server response times are a problem, your team should make sure that your server has enough resources and that they are deployed appropriately. You may have enough resources but you're not using the server effectively. Solving this issue will require collaboration between your server or network maintenance folks, and your hosting organization.

We also recommend you explore Magento Enterprise Edition. With its latest product update, the focus was on performance improvements, specifically around speed. Find out more about Magento Enterprise Edition and see how it can help with your site performance.

 

Permalink.

Magento Go (14)

Can I use My Own Domain?

Yes. Magento lets you customize your online store with your own domain name on any Magento Go plan. Once you have purchased a plan, you can add your own domain to your store through your Account Settings. Please follow the instructions in the Magento Go Knowledge Base to add your own domain to your Magento Go online store.

Permalink.

Where can I Find Add-ons Once They Have Been Integrated?

After you've installed an Add-on, it will display in your control panel when you log on to manage your site.

Permalink.

Which Payment Processors Do You Support?

Magento Go works with many different payment gateways including PayPal, Authorize.net, OGone, Sage Pay Direct, WorldPay and more. For a full list of payment gateways refer to our payment gateways page within the knowledge base or search by country on our gateways page. You can also configure your online store to accept alternative payment methods including check or money orders, cash on delivery or zero subtotal checkout. Our payment methods page lists all alternative payment methods for your reference. Magento is quickly adding many new payment processing and gateway options from around the world, so be sure to check these pages often to see what’s new with Magento Go.

Permalink.

What are Add-ons?

Add-ons are a group of marketing and business management products that you can easily integrate with your Magento Go online store. Add-ons were developed through our broad network of partners to give you the flexibility to build and maintain your store the way you want.

Permalink.

Can I Run Multiple Sites From a Single Store?

At present, you can run one website that is associated with a single base URL with each Go plan you purchase.

Permalink.

How do I Integrate Add-ons?

On the Add-ons page, simply select the Add-on you'd like to integrate and click the 'get this Add-on' link for easy to understand instructions on how to start using your new functionality.

Permalink.

Can I Customize The Design of My Store?

Yes, Magento Go gives you lots of options for designing your store. You can start with one of many professional themes and then customize them to meet your needs. You can upload your own logo and images, edit the theme's CSS or even upload your own CSS file. You can even upload JavaScript blocks into your design. Magento Go makes it very easy to achieve your desired look and feel of your store without sacrificing functionality.

Permalink.

Does Magento Sell Domain Names and SSL Certificates?

At this time, Magento Go does not directly sell domain names but we do offer a variety of industry-leading custom SSLs through VeriSign. If you would like to learn more about our SSL offerings, visit the SSL page.

Permalink.

What Are Store Views and How Many May I Use For My Store?

Store views are used to support multiple languages in Magento. They can also be used to create different areas of the website that are styled differently, all under the same base URL. The number of languages supported by a plan are the number of store views that are available with that plan. Please refer to the Plans and Pricing page for details.

Permalink.

Can I use My Own SSL certificate?

Magento Go provides all of its customers with a shared SSL by default, enabling you to offer a secure checkout to all of your customers. If you wish to use a custom SSL, you can purchase a Magento SSL, transfer an existing SSL, or purchase a new SSL from the third party provider of your choice. Simply log into your account and select one of these options under the tab, ‘My Products and Services’. Then follow the prompts to either upload your current SSL file or generate a new CSR file to use when you are purchasing an SSL from another third party provider.

Permalink.

MySQL (116)

How to count the number of rows containing APOSTROPHE in MySQL?

You are doing right but one thing is missing.  You can correct your query only to escape the apostrophe.  I will rewrite your query like below:

SELECT COUNT(*) FROM my_table WHERE field_name LIKE "%\'%"

Permalink.

How to know MySQL system variables?

MySQL allows to show its system variables as well as session variables (user level variables). To get MySQL system level variables, you may run the following query in any MySQL client tool like Query Browser or phpMyAdmin etc:

SHOW GLOBAL VARIABLES;

To know user level variabels, run the following:

SHOW SESSION VARIABLES;

Permalink.

How to manage Time Zone in MySQL?

MySQL Server allows to set the current time zone on a per-connection basis. Time zone settings are determined by the time_zone system variable. To view current Time Zone run the following query:

SHOW VARIABLES LIKE "time_zone";

Time zone settings are determined by the time_zone system variable. The server maintains a global time_zone value, as well as a session time_zone value for each client that connects to . The session value is initialized for a given client, from the current value of the global time_zone variable, when the client connects.

The default setting for the global value is SYSTEM, which thus also becomes each client's initial session time_zone value. The global and session time zone settings can be retrieved with the following statement:

SELECT @@global.time_zone, @@session.time_zone;

MySQL Server stores TIMESTAMP values internally in UTC. It converts TIMESTAMP values from the server's current time zone for storage, and converts back to the current time zone for retrieval. The standard setting for both the server and the per-client connection is to use the SYSTEM setting, which the server retrieves from the host at startup.

If the time zone setting is the same for both storage and retrieval, you will get back the same value you store. If you store a TIMESTAMP value, and then change the time zone to a different value, the returned TIMESTAMP value will be different from the one you stored.

The following examples demonstrate how to change the session time zone settings to store and retrieve TIMESTAMP data. First, we set the session time zone to UTC, that is, '+00:00':

mysql> SET time_zone = '+00:00';

mysql> SELECT @@session.time_zone;
+---------------------+ 
| @@session.time_zone | 
+---------------------+ 
| +00:00 | 
+---------------------+ 

Next, we create a simple table containing just a TIMESTAMP column named ts and insert one record that assigns the current time to ts. Then we retrieve the record:

mysql> CREATE TABLE ts_test (ts TIMESTAMP);

mysql> INSERT INTO ts_test (ts) VALUES (NULL);

mysql> SELECT * FROM ts_test; 
+---------------------+ 
| ts | 
+---------------------+ 
| 2005-01-04 20:50:18 | 
+---------------------+ 

Finally, we change the session time zone twice, each time retrieving the value after the change. This demonstrates that, even though we're retrieving the same TIMESTAMP value, the change in time zone setting causes the "localized" display value to be different each time:

mysql> SET time_zone = '+02:00';

mysql> SELECT * FROM ts_test; 
+---------------------+ 
| ts | 
+---------------------+ 
| 2005-01-04 22:50:18 | 
+---------------------+ 
mysql> SET time_zone = '-05:00';

mysql> SELECT * FROM ts_test; 
+---------------------+ 
| ts | +---------------------+ 
| 2005-01-04 15:50:18 | 
+---------------------+

The per-connection time zone settings also influence other aspects of the MySQL server that depend on the current time, most notably the function NOW().

MySQL Server also supports the CONVERT_TZ() function, which performs time zone conversions of datetime values:

mysql> SELECT CONVERT_TZ('2005-01-27 13:30:00', '+01:00', '+03:00');
+-------------------------------------------------------+ 
| CONVERT_TZ('2005-01-27 13:30:00', '+01:00', '+03:00') | 
+-------------------------------------------------------+ 
| 2005-01-27 15:30:00 | 
+-------------------------------------------------------+

CONVERT_TZ() assumes that the given datetime value has the time zone represented by the first hour/minute offset argument, and converts it to a value in the time zone represented by the second offset argument. The result is that you get the same datetime value, from the point of view of a different time zone.

Permalink.

What is difference between \g and \G characters in mysql client program?

MySQL allows several queries to be entered on a single input line and uses the terminators to distinguish where each query ends. You may use any of several terminators to end a statement. Two terminators are the semicolon character (';') and the \g sequence. They're equivalent and may be used interchangeably.

The \G sequence also terminates queries, but causes mysql to display query results in a vertical style that shows each output row with each column value on a separate line.

The \G terminator is especially useful if a query produces very wide output lines because vertical format can make the result much easier to read. Take an example below.

mysql>  SELECT * FROM user\G

Permalink.

What does NULL value mean in MySQL?

NULL is unusual because it doesn't represent a specific value the way that numeric, string, or temporal values do. Instead, NULL stands for the absence of a known value. The special nature of NULL means that it often is handled differently than other values. This section describes how MySQL processes NULL values in various contexts.

Syntactically, NULL values are written in SQL statements without quotes. Writing NULL is different from writing 'NULL' or "NULL". The latter two values are actually strings that contain the word "NULL". Also, because it is an SQL keyword, NULL is not case sensitive. NULL and null both mean "a NULL value," whereas the string values 'NULL' and 'null' may be different or the same depending on whether they are non-binary or binary strings.

Note that some database systems treat the empty string and NULL as the same value. In MySQL, the two values are different.

Use of NULL values in arithmetic or comparison operations normally produces NULL results:

mysql> SELECT NULL + 1, NULL < 1;
+----------+----------+
| NULL + 1 | NULL < 1 |
+----------+----------+
|     NULL |     NULL |
+----------+----------+

Even comparing NULL to itself results in NULL, because you cannot tell whether one unknown value is the same as another:

mysql> SELECT NULL = 1, NULL != NULL;
+----------+--------------+
| NULL = 1 | NULL != NULL |
+----------+--------------+
|     NULL |         NULL |
+----------+--------------+

LIKE evaluates to NULL if either operand is NULL:

mysql> SELECT NULL LIKE '%', 'abc' LIKE NULL;
+---------------+-----------------+
| NULL LIKE '%' | 'abc' LIKE NULL |
+---------------+-----------------+
|          NULL |            NULL |
+---------------+-----------------+

The proper way to determine whether a value is NULL is to use the IS NULL or IS NOT NULL operators, which produce a true (non-zero) or false (zero) result:

mysql> SELECT NULL IS NULL, NULL IS NOT NULL;
+--------------+------------------+
| NULL IS NULL | NULL IS NOT NULL |
+--------------+------------------+
|            1 |                0 |
+--------------+------------------+

You can also use the MySQL-specific <=> operator, which is like = except that it works with NULL operands by treating them as any other value:

mysql> SELECT 1 <=> NULL, 0 <=> NULL, NULL <=> NULL;
+------------+------------+---------------+
| 1 <=> NULL | 0 <=> NULL | NULL <=> NULL |
+------------+------------+---------------+
|          0 |          0 |             1 |
+------------+------------+---------------+

ORDER BY, GROUP BY, and DISTINCT all perform comparisons implicitly. For purposes of these operations, NULL values are considered identical. That is, NULL values sort together, group together, and are not distinct.

Expressions that cannot be evaluated (such as 1/0) produce NULL as a result. However, in the context of inserting data into tables, division by zero can be treated as an error to prevent invalid data from being entered. This behavior is controlled by setting the SQL mode to enable strict mode in conjunction with the ERROR_FOR_DIVISION_BY_ZERO mode.

Permalink.

What are MySQL connectors or client interfaces?

MySQL AB provides several application programming interfaces (APIs) for accessing the MySQL server. The interface included with distributions of MySQL itself is libmysqlclient, the C client library. This API may be used for writing MySQL-based C programs. It is also the basis for most higher-level APIs written for other languages (the Java and .NET interfaces are notable exceptions).

MySQL AB also provides drivers that aren't programs in themselves, but act as bridges to the MySQL server for client programs that communicate using a particular protocol. These drivers comprise the family of MySQL Connectors. They are available as separate packages.

  • MySQL Connector/ODBC provides a MySQL-specific driver for ODBC. It allows ODBC-compliant programs to access MySQL..
  • MySQL Connector/J is a JDBC driver for use in Java programs. It allows JDBC-compliant programs to access MySQL.
  • MySQL Connector/NET is a driver written in C# that supports the ADO.NET interfaces required to run .NET applications that access MySQL.

The MySQL connectors are available for Windows and Unix. To use a connector, you must install it on the client host. It isn't necessary for the server to be running on the same machine or for the server to be running the same operating system as the client. This means that MySQL connectors are very useful for providing MySQL connectivity in heterogeneous environments. For example, people who use Windows machines can run client applications that access MySQL databases located on a Linux server host.

Each of the preceding APIs is officially supported by MySQL AB. In addition, many third-party client interfaces are available. Most of them are based on the C client library and provide a binding for some other language. These include the mysql and mysqli extensions for PHP, the DBD::mysql driver for the Perl DBI module, and interfaces for other languages such as Python, Ruby, Pascal, and Tcl. Although you can download these client APIs from the MySQL Web site and members of the MySQL AB development team often work closely with the developers of these products, the APIs do not receive official support from MySQL AB.

MySQL Connector/ODBC

MySQL Connector/ODBC acts as a bridge between the MySQL server and client programs that use the ODBC standard. It provides a MySQL-specific driver for ODBC so that ODBC-based clients can access MySQL databases.

MySQL Connector/ODBC uses the C client library to implement the client/server communication protocol. It converts ODBC calls made by the client program into C API operations that communicate with the server. Connections can be established using TCP/IP, Unix socket files, or named pipes.

MySQL Connector/ODBC is available for Windows and Unix.

MySQL Connector/J

MySQL Connector/J is similar in spirit to Connector/ODBC, but is used by JDBC-based Java programs. It is not based on the C client library. Instead, it is written in Java and implements the client/server communication protocol directly. Connections can be established using TCP/IP or named pipes. MySQL Connector/J converts JDBC calls made by the client program into the appropriate protocol operations.

MySQL Connector/J is a Type 4 (pure Java) driver that implements version 3.0 of the JDBC specification.

MySQL Connector/J includes support for MySQL capabilities such as server-side prepared statements, stored routines, and Unicode.

MySQL Connector/J is available for Windows and Unix.

MySQL Connector/NET

MySQL Connector/NET enables .NET applications to use MySQL. It is not based on the C client library. Instead, it is written in C# and implements the client/server communication protocol directly. Connections can be established using TCP/IP, Unix socket files, named pipes, or shared memory.

MySQL Connector/NET includes support for MySQL capabilities such as server-side prepared statements, stored routines, and Unicode.

MySQL Connector/NET is available for Windows. If you use Mono, the Open Source implementation of .NET developed by Novell, it is also available on Linux.

Permalink.

How to use comments in SQL statements?

MySQL supports three forms of comment syntax. One of those forms has variants that allow special instructions to be passed through to the MySQL server.

  • A '#' character begins a comment that extends to the end of the line. This commenting style is like that used by several other programs, such as Perl, Awk, and several Unix shells.
  • A /* sequence begins a comment that ends with a */ sequence. This style is the same as that used for writing comments in the C programming language. A C-style comment may occur on a single line or span multiple lines:

    /* this is a comment */
    
    /*
      this
      is a
      comment,
      too
    */
    
  • A — (double dash) sequence followed by a space (or control character) begins a comment that extends to the end of the line. This syntax requires a space and thus differs from standard SQL syntax, which allows comments to be introduced by — without the space. MySQL disallows a double dash without a space as a comment because it's ambiguous. (For example, does 1–3 mean "one minus negative three" or "one followed by a comment"?)

C-style comments can contain embedded SQL text that's treated specially by the MySQL server, but ignored by other database engines. This is an aid to writing more portable SQL because it enables you to write comments that are treated as part of the surrounding statement if executed by MySQL and ignored if executed by other database servers. There are two ways to write embedded SQL in a C-style comment:

  • If the comment begins with /*! rather than with /*, MySQL executes the body of the comment as part of the surrounding query. The following statement creates a table named t, but for MySQL creates it specifically as a MEMORY table:

    CREATE TABLE t (i INT) /*! ENGINE = MEMORY */;
  • If the comment begins with /*! followed by a version number, the embedded SQL is version specific. The server executes the

Permalink.

What is sql mode in MySQL and how can we set it?

SQL mode (sql_mode) is a MySQL system variable. By means of this varriable the MySQL Server SQL mode is controlled. Many operational characteristics of MySQL Server can be configured by setting the SQL mode. By setting the SQL mode appropriately, a client program can instruct the server how strict or forgiving to be about accepting input data, enable or disable behaviors relating to standard SQL conformance, or provide better compatibility with other database systems. By default, the server uses a sql_mode value of ' ' (the empty string), which enables no restrictions. Thus, the server operates in forgiving mode (non-strict mode) by default. In non-strict mode, the MySQL server converts erroneous input values to the closest legal values (as determined from column definitions) and continues on its way. For example, if you attempt to store a negative value into an UNSIGNED column, MySQL converts it to zero, which is the nearest legal value for the column.

The SQL mode is controlled by means of the sql_mode system variable. To assign a value to this variable, SET statement is used. The value should be an empty string, or one or more mode names separated by commas. If the value is empty or contains more than one mode name, it must be quoted. If the value contains a single mode name, quoting is optional. SQL mode values are not case sensitive.

Here are some examples:

To clear the SQL mode or to set non-strict mode:

SET sql_mode = '';

The most general means of enabling input value restrictions is by using the STRICT_TRANS_TABLES or STRICT_ALL_TABLES modes:

SET sql_mode = STRICT_TRANS_TABLES;
SET sql_mode = STRICT_ALL_TABLES;

The term "strict mode" refers collectively to both of these modes. They prevent entry of invalid values such as those that are out of range, or NULL specified for NOT NULL columns.

To set the SQL mode using a single mode value:

SET sql_mode = ANSI_QUOTES;
SET sql_mode = TRADITIONAL;

The TRADITIONAL mode, enables strict mode plus other restrictions on date checking and division by zero. Setting the sql_mode system variable to TRADITIONAL causes MySQL to act like more traditional database servers in its input data handling. If you want your MySQL server to be as restrictive as possible about input data checking, the simplest way to achieve this is to enable TRADITIONAL mode rather than a list of individual more-specific modes.

To set the SQL mode using multiple mode names:

SET sql_mode = 'IGNORE_SPACE, ANSI_QUOTES';
SET sql_mode = 'STRICT_ALL_TABLES, ERROR_FOR_DIVISION_BY_ZERO';

To check the current sql_mode setting, select its value like this:

SELECT @@sql_mode;

Some SQL mode values are composite modes that actually enable a set of modes. Values in this category include ANSI and TRADITIONAL. To see which mode values a composite mode consists of, retrieve the value after setting it:

SET sql_mode=TRADITIONAL;
SELECT @@sql_mode;

If you want relaxed date checking that requires only that month and day values be in the respective ranges of 1 to 12 and 1 to 31, enable the ALLOW_INVALID_DATES SQL mode value:

SET sql_mode = ALLOW_INVALID_DATES;

You can use ALLOW_INVALID_DATES for relaxed date checking even in strict mode:

SET sql_mode = 'STRICT_ALL_TABLES,ALLOW_INVALID_DATES';

The following list briefly describes some of the values:

  • ANSI_QUOTES

    This mode causes the double quote character (‘”‘) to be interpreted as an identifier-quoting character rather than as a string-quoting character.

  • IGNORE_SPACE

    By default, functions must be written with no space between the function name and the following parenthesis. Enabling this mode causes the server to ignore spaces after function names. This allows spaces to appear between the name and the parenthesis, but also causes function names to be reserved words.

  • ERROR_FOR_DIVISION_BY_ZERO

    By default, division by zero produces a result of NULL and is not treated specially. Enabling this mode causes division by zero in the context of inserting data into tables to produce a warning, or an error in strict mode.

  • STRICT_TRANS_TABLES, STRICT_ALL_TABLES

    These values enable “strict mode” which imposes certain restrictions on what values are acceptable as database input. By default, MySQL is forgiving about accepting values that are missing, out of range, or malformed. Enabling strict mode causes bad values to be treated as erroneous. STRICT_TRANS_TABLES enables strict mode for transactional tables, and STRICT_ALL_TABLES enables strict mode for all tables.

  • TRADITIONAL

    This is a composite mode that enables both strict modes plus several additional restrictions on acceptance of input data.

  • ANSI

    This is a composite mode that causes MySQL Server to be more “ANSI-like.” That is, it enables behaviors that are more like standard SQL, such as ANSI_QUOTES (described earlier) and PIPES_AS_CONCAT, which causes || to be treated as the string concatenation operator rather than as logical OR.

Permalink.

How to set conditions on query data with CASE construct?

Control flow functions enable you to choose between different values based on the result of an expression. The CASE construct is not a function, but it too provides flow control. It has two forms of syntax. The first looks like this:

CASE case_expr
  WHEN when_expr THEN result
  [WHEN when_expr THEN result] ...
  [ELSE result]
END

The expression case_expr is evaluated and used to determine which of the following clauses in the rest of the CASE to execute. The when_expr in the initial WHEN clause is evaluated and compared to case_expr. If the two are equal, the expression following THEN is the result of the CASE. If when_expr is not equal to case_expr, and there are any following WHEN clauses, they are handled similarly in turn. If no WHEN clause has a when_expr equal to case_expr, and there is an ELSE clause, the expression in the ELSE clause becomes the CASE result. If there is no ELSE clause the result is NULL. In the following example, CASE expression returns a string that indicates full name of language against each language_id available in the table:

mysql> SELECT CASE languageId
    ->        	WHEN 1 THEN 'English'
    ->         	WHEN 2 THEN 'French'
    ->         	WHEN 3 THEN 'Arabic'
    ->         	WHEN 4 THEN 'dutch'
    ->        ELSE 'Urdu'
    ->        END AS Language
    -> FROM language;
+----------+
| Language |
+----------+
| English  |
| French   |
| Arabic   |
| dutch    |
+----------+
4 rows in set (0.02 sec)

The second CASE syntax looks like this:

CASE
  WHEN when_expr THEN result
  [WHEN when_expr THEN result] ...
  [ELSE result]
END

For this syntax, the conditional expression in each WHEN clause is executed until one is found to be true, and then its corresponding THEN expression becomes the result of the CASE. If none of them are true and there is an ELSE clause, its expression becomes the CASE result. If there is no ELSE clause the result is NULL.  The following CASE expression tests whether the value of the @val user variable is NULL or less than, greater than, or equal to 0:

mysql> SET @val = NULL;
mysql> SELECT CASE
    ->   WHEN @val IS NULL THEN '@val is NULL'
    ->   WHEN @val < 0 THEN '@val is less than 0'
    ->   WHEN @val > 0 THEN '@val is greater than 0'
    ->   ELSE '@val is 0'
    -> END AS result;
+--------------+
| result       |
+--------------+
| @val is NULL |
+--------------+

Permalink.

What does alias means in MySQL?

When you join tables, it's often the case that the tables contain columns with the same names. If you refer to such a column in the query, it's ambiguous which table the column reference applies to. This ambiguity usually can be addressed by qualifying column names with table names. However, if you join a table to itself, even the table name is ambiguous and it's necessary to use aliases to disambiguate table references.

In SELECT query, output column names, by default, are the same as the column or expression selected. To rename a column, provide an alias following the column in the output list:

mysql> SELECT 1 AS One, 2+3 'Three Times Two';
+-----+-----------------+
| One | Three Times Two |
+-----+-----------------+
|   1 |               5 |
+-----+-----------------+
1 row in set (0.05 sec)

Here is another example:

mysql> SELECT Country.Name AS CountryName, City.Name AS CityName FROM Country, City
       WHERE Country.Code = CountryCode;

Columns aliases are used as follows:

  • The keyword AS is optional.
  • An alias may be quoted. If it consists of multiple words, it must be quoted.
  • You can refer to a column alias elsewhere in the query, in the GROUP BY, HAVING, or ORDER BY clause. However, you cannot refer to aliases in the WHERE clause.

Permalink.

OsCommerce (22)

How to configure osCommerce to work with a new domain?

In order to configure osCommerce to work properly with another domain, you should modify the two configure.php files in includes/ and admin/includes/ folders to reflect the new domain.

The settings that should be changed in includes/configure.php are:

HTTP_SERVER – you should change this to your new domain name, e.g. http://newdomain.com :

	define(‘HTTP_SERVER’, ‘http://newdomain.com’);

HTTP_COOKIE_DOMAIN – again, this should be changed to reflect your new domain name:

	define(‘HTTP_COOKIE_DOMAIN’, ‘newdomain.com’);

If you are using SSL you should also modify:

HTTPS_SERVER – for example:

	define(‘HTTPS_SERVER’, ‘https://newdomain.com’);

HTTPS_COOKIE_DOMAIN – set this to:

	define(‘HTTPS_COOKIE_DOMAIN’, ‘newdomain.com’);
 

In admin/includes/configure.php you should modify:
 

HTTP_SERVER – you should change this to your new domain name, e.g. http://newdomain.com :

	define(‘HTTP_SERVER’, ‘http://newdomain.com’);

HTTP_CATALOG_SERVER – again, this should be changed to your new domain name:

	define(‘HTTP_CATALOG_SERVER’, ‘http://newdomain.com’);

If you are using SSL, you should also change HTTPS_CATALOG_SERVER to:

	define(‘HTTPS_CATALOG_SERVER’, ‘https://newdomain.com’);

Permalink.

Customizing OsCommerce Catalog

The next step is to add categories that will contain the products you will be selling in your store. To do that, please open the Catalog category from the administrator's index page and click on Categories/Products. You will be taken to a page where the default categories are being displayed. You will be able to edit or delete an existing category, or add a brand new one.

After clicking the New category button the page will refresh and a box for the new category name will appear in the right column.


Since osCommerce is a multi-language shopping cart you can add category names for the installed languages. You can also select an image to represent the specific category (images are optional and you can ignore warnings for a missing image). It can be uploaded from your local computer. The last thing to do before clicking the Save button is to select the order number for the category. The lower the number – the higher in the list your new category will appear (zero will represent the top of the list).

Next you should add a product to your new category. Open it and click on New Product.

Select whether you have the product in stock or not. Then pick the availability date and the manufacturer. Type in the name of the product on the languages you have installed and decide whether the item is taxable or not; select the Net and the Gross prices.


Enter the product description, the quantity of the product and its model. Images can also be uploaded from your local computer – osCommerce automatically creates a thumbnail. If you are linking to an external product page, please enter the address without the http:// part for the specific languages. Last thing to add is the product weight, since this will help in determining the shipping costs. When done, hit the Save button to keep the product or Cancel to skip this entry.


When you insert the product, you will be taken to the category/product list. If you wish to move the product in another category, click on Move, select the desired category from the drop-down list and click the Move button again.


You will be able to see the new addition at the top of your product list when you visit the store. The new item will also increase the count of items in the chosen category.

Permalink.

How do I change Top in the breadcrumb?

The normal installation of osCOmmerce has Top -> Catalog displayed in the breadcrumb trail The suggested way to change this is to make just state Home. The following instructions will accomplish this: -Open the includes/languages/english.php file in your editor. -Find the line that contains HEADER_TITLE_CATALOG -Change that line so it looks like this: define('HEADER_TITLE_CATALOG', 'Home'); -Open the includes/application_top.php file in your editor, find the code $breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER); and remove it.

Permalink.

How to add a banner in osCommerce?

You can easily add a custom banner to your osCommerce shop from the application’s admin area > Tools > Banner Manager

Permalink.

I keep getting “There has been an error processing your credit card”.

This error can be caused by two things.

  1. Port 1129 may be blocked. Contact your web host and make sure port 1129 is not blocked.

  2. The PEM file is missing. Make sure you uploaded the PEM file into the following directory:
    catalog/includes/modules/payment/linkpoint_api

    You can download the PEM file from LinkPoint Central.

  3. After you login, click on Support at the top, then click on Download Center.

  4. Click on Download next to PEM and make sure to save the file to the desktop.

Permalink.

I am­ not­ getting­ an­ email­ from­ oscommerce!

In the admin panel it should be
 
Email Address:–    example@yourdomain.com
Email From:–    YourSite <example@yourdomain.com>
Send Extra Order Emails To:–    example@yourdomain.com
 
or

your domain on a real time blacklist.
 

Permalink.

How do I change the title in my shop?

The shops title is contained in the includes/languages/english.php file. Open that file and search for this string

	define('TITLE', 'osCommerce');

To change the title, you edit the word osCommerce. Be sure to leave everything else in place.

A better method of changing titles is to install the Header Tags Controller contribution. This will allow you to have unique titles and meta tags for all pages in your shop, which is very important for getting better search engine rankings.

Permalink.

The requested URL /account.php was not found on this server.

This issue is most commonly caused by incorrectly configured SSL settings for your OS Commerce. If you don not have private SSL and your OS Commerce is enabled you will receive this error.

Enabling/disabling SSL in osCommerce is quite straightforward. You have to edit /includes/configure.php to disable SSL and the code takes care of the rest. This is an example of SSL enabled configuration:

		// Define the webserver and path parameters
// * DIR_FS_* = Filesystem directories (local/physical)
// * DIR_WS_* = Webserver directories (virtual/URL)
define(‘HTTP_SERVER’, ‘http://www.yourdomain.com’); // eg, http://localhost – should not be empty for productive servers
define(‘HTTPS_SERVER’, ‘https://yourdomain.com’); // eg, https://localhost – should not be empty for productive servers
define(‘ENABLE_SSL’, true); // secure webserver for checkout procedure?
define(‘HTTP_COOKIE_DOMAIN’, ‘www.yourdomain.com’);
define(‘HTTPS_COOKIE_DOMAIN’, ‘yourdomain.com’);
define(‘HTTP_COOKIE_PATH’, ‘/catalog/’);
define(‘HTTPS_COOKIE_PATH’, ‘/catalog/’);
define(‘DIR_WS_HTTP_CATALOG’, ‘/catalog/’);
define(‘DIR_WS_HTTPS_CATALOG’, ‘/catalog/’);

In order to disable the SSL you will have to replace

		define(‘ENABLE_SSL’, true);
	

with

		define(‘ENABLE_SSL’, false);
	

Permalink.

Why am I getting Fatal error: Unknown function: curl_init()?


This error is a result of cURL not being enabled in PHP. If you are using a Windows server make sure uncomment the cURL extension in the php.ini file which is located in the following directory:
/usr/local/php5/lib/php.ini
Edit php.ini, look for the following code, and remove the semicolon at the beginning:

;extension=php_curl.dll

Permalink.

OsCommerce Admin Login Problems

If you cannot log into your OsCommerce admin area try the following:

1. Open your OsCommerce database through PhpMyAdmin. If you are not sure which it is check the file includes/configure.php and look for a constant called ‘DB_DATABASE’ .

2. Run the following two queries:

	CREATE TABLE IF NOT EXISTS `administrators` (
  `id` int(11) NOT NULL auto_increment,
  `user_name` varchar(32) NOT NULL,
  `user_password` varchar(40) NOT NULL,
  PRIMARY KEY  (`id`)
) ; INSERT INTO `administrators` (`id`, `user_name`, `user_password`) VALUES
(1, ‘adm’, ’2272bd2219e0bbc353e33f1e774c9d1e:11′);

3. The above will create a new administrator with login ‘adm’ and password ‘pass11′ .

Usually problems with admin login in OsCommerce are caused after an upgrade, contributions installation or security issues. In some cases the above steps might not help you resolve the problem and it is recommended to seek professional assistance.

Permalink.

PHP (126)

E-mail With PHP.

PHP supports sending email through a form. First enter the to address, from address, subject, message fields from a simple html form. In the html file use the <form> tag with action attribute assigned with the php file, which handles sending email. For example:

<form method="post" action="mailContact.php">

Ensure that proper validation is done for mail form.

The script should take the data posted from the form- to mail id, from mail id, subject, message etc into corresponding variables, using $_REQUEST.

Use the function mail() as follows to send the mail to the destination address.

mail($to, $subject, $body, $headers);

Permalink.

Can I run several versions of PHP at the same time?

Yes. See the INSTALL file that is included in the PHP source distribution.

Permalink.

I hear PHP 5 has an entirely new OOP model, will my existing OOP code work? Where do I find information on these new OOP features?

The main change in PHP 5 is to the OOP model as PHP 5 now uses the Zend Engine 2.0. The zend.ze1_compatibility_mode directive enables compatability with the Zend Engine 1.0 (PHP 4).

Permalink.

Unix/Windows: I have installed PHP, but when I try to access a PHP script file via my browser, I get a blank screen.

Do a 'view source' in the web browser and you will probably find that you can see the source code of your PHP script. This means that the web server did not send the script to PHP for interpretation. Something is wrong with the server configuration – double check the server configuration against the PHP installation instructions.

Permalink.

How do I create arrays in a HTML ?

To get your <form> result sent as an array to your PHP script you name the <input>, <select> or <textarea> elements like this:

<input name="MyArray[]" />
<input name="MyArray[]" />
<input name="MyArray[]" />
<input name="MyArray[]" />

Notice the square brackets after the variable name, that's what makes it an array. You can group the elements into different arrays by assigning the same name to different elements:

<input name="MyArray[]" />
<input name="MyArray[]" />
<input name="MyOtherArray[]" />
<input name="MyOtherArray[]" />

This produces two arrays, MyArray and MyOtherArray, that gets sent to the PHP script. It's also possible to assign specific keys to your arrays:

<input name="AnotherArray[]" />
<input name="AnotherArray[]" />
<input name="AnotherArray[email]" />
<input name="AnotherArray[phone]" />

The AnotherArray array will now contain the keys 0, 1, email and phone.

 

Note:

Specifying an arrays key is optional in HTML. If you do not specify the keys, the array gets filled in the order the elements appear in the form. Our first example will contain keys 0, 1, 2 and 3.

Permalink.

I have built a DLL to calculate something. Is there any way to run this DLL under PHP ?

If this is a simple DLL there is no way yet to run it from PHP. If the DLL contains a COM server you may be able to access it if it implements the IDispatch interface.

Permalink.

What does thread safety mean when downloading PHP?

Thread Safety means that binary can work in a multithreaded webserver context, such as Apache 2 on Windows. Thread Safety works by creating a local storage copy in each thread, so that the data won't collide with another thread.

So what do I choose? If you choose to run PHP as a CGI binary, then you won't need thread safety, because the binary is invoked at each request. For multithreaded webservers, such as IIS5 and IIS6, you should use the threaded version of PHP.

Permalink.

Windows: I’ve followed all the instructions, but still can’t get PHP and IIS to work together!

Make sure any user who needs to run a PHP script has the rights to run php.exe! IIS uses an anonymous user which is added at the time IIS is installed. This user needs rights to php.exe. Also, any authenticated user will also need rights to execute php.exe. And for IIS4 you need to tell it that PHP is a script engine.

Permalink.

Explain about Type Juggling in php with an example.

In php, data type of a variable need to be explicitly specified. The data type is assigned depending on the context.

Example:
$x = 1;
Automatically assigns “INTEGER” data type.
The data type can be overirideen by explicaitally specifying the type:
$y = (float) $x;
Settype() function can also be used.

Permalink.

PhpMyAdmin (120)

How can I backup my database or table?

Click on a database or table name in the navigation panel, the properties will be displayed. Then on the menu, click “Export”, you can dump the structure, the data, or both. This will generate standard SQL statements that can be used to recreate your database/table. You will need to choose “Save as file”, so that phpMyAdmin can transmit the resulting dump to your station. Depending on your PHP configuration, you will see options to compress the dump. See also the $cfg['ExecTimeLimit'] configuration variable. For additional help on this subject, look for the word “dump” in this document.

Permalink.

How can I protect phpMyAdmin against brute force attacks?

If you use Apache web server, phpMyAdmin exports information about authentication to the Apache environment and it can be used in Apache logs. Currently there are two variables available:

userID
User name of currently active user (he does not have to be logged in).
userStatus
Status of currently active user, one of ok (user is logged in), mysql-denied (MySQL denied user login), allow-denied (user denied by allow/deny rules), root-denied (root is denied in configuration), empty-denied(empty password is denied).

LogFormat directive for Apache can look like following:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %{userID}n %{userStatus}n"   pma_combined

You can then use any log analyzing tools to detect possible break-in attempts.

Permalink.

When accessing phpMyAdmin via an Apache reverse proxy, cookie login does not work.

To be able to use cookie auth Apache must know that it has to rewrite the set-cookie headers. Example from the Apache 2.2 documentation:

ProxyPass /mirror/foo/ http://backend.example.com/
ProxyPassReverse /mirror/foo/ http://backend.example.com/
ProxyPassReverseCookieDomain backend.example.com public.example.com
ProxyPassReverseCookiePath / /mirror/foo/

Note: if the backend url looks like http://host/~user/phpmyadmin, the tilde (~) must be url encoded as %7E in the ProxyPassReverse* lines. This is not specific to phpmyadmin, it’s just the behavior of Apache.

ProxyPass /mirror/foo/ http://backend.example.com/~user/phpmyadmin
ProxyPassReverse /mirror/foo/ http://backend.example.com/%7Euser/phpmyadmin
ProxyPassReverseCookiePath /%7Euser/phpmyadmin /mirror/foo

Permalink.

I get JavaScript errors in my browser.

Issues have been reported with some combinations of browser extensions. To troubleshoot, disable all extensions then clear your browser cache to see if the problem goes away.

Permalink.

I have display problems with Safari.

Please upgrade to at least version 1.2.3.

Permalink.

When creating a privilege, what happens with underscores in the database name?

If you do not put a backslash before the underscore, this is a wildcard grant, and the underscore means “any character”. So, if the database name is “john_db”, the user would get rights to john1db, john2db … If you put a backslash before the underscore, it means that the database name will have a real underscore.

Permalink.

Using and creating themes

Themes are configured with $cfg['ThemePath'], $cfg['ThemeManager'] and $cfg['ThemeDefault']. Under $cfg['ThemePath'], you should not delete the directory pmahomme or its underlying structure, because this is the system theme used by phpMyAdmin. pmahomme contains all images and styles, for backwards compatibility and for all themes that would not include images or css-files. If $cfg['ThemeManager'] is enabled, you can select your favorite theme on the main page. Your selected theme will be stored in a cookie.

To create a theme:

  • make a new subdirectory (for example “your_theme_name”) under $cfg['ThemePath'] (by default themes)
  • copy the files and directories from pmahomme to “your_theme_name”
  • edit the css-files in “your_theme_name/css”
  • put your new images in “your_theme_name/img”
  • edit layout.inc.php in “your_theme_name”
  • edit info.inc.php in “your_theme_name” to contain your chosen theme name, that will be visible in user interface
  • make a new screenshot of your theme and save it under “your_theme_name/screen.png”

In theme directory there is file info.inc.php which contains theme verbose name, theme generation and theme version. These versions and generations are enumerated from 1 and do not have any direct dependence on phpMyAdmin version. Themes within same generation should be backwards compatible – theme with version 2 should work in phpMyAdmin requiring version 1. Themes with different generation are incompatible.

If you do not want to use your own symbols and buttons, remove the directory “img” in “your_theme_name”. phpMyAdmin will use the default icons and buttons (from the system-theme pmahomme).

Permalink.

I get errors about not being able to include a file in /lang or in /libraries.

Check php.ini, or ask your sysadmin to check it. The include_path must contain ”.” somewhere in it, and open_basedir, if used, must contain ”.” and ”./lang” to allow normal operation of phpMyAdmin.

Permalink.

Import: How can I import ESRI Shapefiles?

An ESRI Shapefile is actually a set of several files, where .shp file contains geometry data and .dbf file contains data related to those geometry data. To read data from .dbf file you need to have PHP compiled with the dBase extension (–enable-dbase). Otherwise only geometry data will be imported.

To upload these set of files you can use either of the following methods:

Configure upload directory with $cfg['UploadDir'], upload both .shpand .dbf files with the same filename and chose the .shp file from the import page.

Create a Zip archive with .shp and .dbf files and import it. For this to work, you need to set $cfg['TempDir'] to a place where the web server user can write (for example './tmp').

To create the temporary directory on a UNIX-based system, you can do:

cd phpMyAdmin
mkdir tmp
chmod o+rwx tmp

Permalink.

Prestashop (10)

How to clear the cache in Prestashop

When making changes in Prestashop they will often not appear right away due to old cached information. The solution is to clear the cache of the application.

Prestashop version 1.4 and above caches data using Smarty. Cached data is stored in the following folders:

/tools/smarty/cache

/tools/smarty/compile

/tools/smarty_v2/cache

/tools/smarty_v2/compile

all of which are located in your Prestashop’s installation folder. For example, if your Prestashop store has been installed in the public_html folder of your hosting account, cached information can be found in:

public_html/tools/smarty/cache

public_html/tools/smarty/compile

public_html/tools/smarty_v2/cache

public_html/tools/smarty_v2/compile

To clear Prestashop’s cached data, delete the content of these folders and reload your website in your browser to take a look at the changes you have made.

You can also disable or manage how Prestashop caches information from the application ’s back office -> Preferences -> Performance.

Permalink.

How To Fix Prestashop 1.5. * Ajax Cart Bug In Internet Explorer

In the first versions of Prestashop 1.5.* there is a bug which is reproduced in old versions for all browsers as well as in all Internet Explorer versions. This bug does not allow to save cookies when adding a product to the cart if the Block Cart module is enabled, thus your shopping cart remains empty. To fix this you need to modify the js-file /modules/blockcart/ajax-cart.js:

Comment out the following condition in the method аjаxCаrt.add(): //if($('#cart_block #cart_block_list').hasClass('collapsed'))

//this.expand();

Place an аjаx-request in the method аjаxCаrt.expand() before slideUp is invoked.

Then set the same аjаx request for a synchronous execution, i.e.set the async option as false, instead of true.

After that clear your browser cookies.

Permalink.

Problem­ of­ memory­ allocation­ with­ 1and1.

Due to resource limits on our Shared Hosting machines, it is not possible to allocate more memory to PHP than the maximum for your package. Using a php.ini file or the memory_limit directive to increase memory for PHP may result in the phpinfo() output reflecting the change however the server will not allocate more memory than the limit imposed by 1&1.

Older packages were limited to a maximum of 30MB for PHP memory regardless of package. Starting with the Dual Hosting packages, the limits have increased. You can view the PHP Memory Limit for each Dual Hosting package on our order site.
 

Permalink.

How to install a PrestaShop module on my online store?

The installation of PrestaShop modules can be completed in just a few clicks!

From your Addons account click on the “Order” page then download the module’s zip file that you just purchased. Be sure to choose the file that fits your running version of PrestaShop. 

If you are using PrestaShop version 1.6:

1. From your PrestaShop back office, click on the “Modules” tab.

2. In the sign in window, enter your Addons ID and password then click on “Connect”. Once this step is completed, every purchase you make on PrestaShop Addons will automatically appear in your back office modules.

If you are using PrestaShop version 1.4 or 1.5:

1. From your PrestaShop back office, click on the “Modules” tab.

2. On the top right you’ll find “Add a New Module”, click on it and download the module file that you previously purchased and saved.

3. Finally, click “Install” to begin configuring it.

PrestaShop Addons does not provide support on Community developed modules. We ask that you contact the seller directly for any type of support regarding the module(s).

For further information, please read the official documentation.

Permalink.

Process ­to­ follow­ to­ update­ prestashop?

The steps of the upgrade process are:

  1. Save and Backup Your Current Store:

    • Deactivate your store ("Maintenance" page of the "Preferences" menu).
    • Back up your files to your desktop, using your FTP client in a new "prestashop-prod" folder. This will be a complete copy of your production site.
    • Back up your database ("Advanced Parameters/DB Backup" page, or using phpMyAdmin).
    • Back up your customized translation ("Export a language" section in "Tools/Translations" tab).
  2. Getting ready for the new version:
    • Download and unzip the latest version of PrestaShop: http://www.prestashop.com/en/download, and unpack it in a new "prestashop-prep" folder.
    • Copy your personal files (images, logos, photos, translations, modules, etc.) from "prestashop-prod" to "prestashop-prep" on your computer. A detailed list is available further down in this guide.
    • Copy the "prestashop-prep" folder to the web folder on your local server (/htdocs/www, or any other name used by the server package you chose). This is the folder where you will first try to upgrade your PrestaShop, keeping your original backed-up files (prestashop-prod) and the files you prepared (prestashop-prep).
    • Recreate the production database on your local server: using phpMyAdmin, create a local database in which you will put the data from your production shop, using the SQL files that were backed-up at the start of the process.
  3. Starting the Local Update:
    • Launch the update script on your local server by accessing it with your browser. In version 1.5, that script is located at/install/upgrade/upgrade.php.
    • Verification of all parameters before the update: follow the instructions on screen and make sure your server conforms to the new version technical requirements.
    • Finishing the update: once the updater has finished, delete the /install folder and access both your front and back-office to make sure it works.
  4. QA and Testing:
    • Import your translations ("Import a language pack manually" section in "Localization/Translations" page).
    • Check that your theme is still working as expected. If this is not the case, you will have to edit its files.
    • Test your shop thoroughly: create accounts, buy products, cancel orders, check the invoices, etc.
  5. Start the update on your production web server:
    • Using your FTP client, replace the files for your online shop with those from your "prestashop-prep" folder.
    • Launch the update script on your production server by accessing it with your browser. In version 1.5, that script is located at/install/upgrade/upgrade.php.
    • Verification of all parameters before the update: follow the instructions on screen and make sure your server conforms to the new version technical requirements.
    • Finishing the update: once the updater has finished, delete the /install folder and access both your front and back-office to make sure it works.
    • Import your translations ("Import a language pack manually" section in "Localization/Translations" page).
    • Check that the main domain name is correct ("Preferences / SEO & URLs" page, "Shop URL" section).
    • Regenerate your robots.txt files ("Preferences / SEO & URLs" page, "Generate robots.txt" section).
    • Check that your theme still works as expected. If not, you will have to edit its files.
    • Test your store thoroughly: create accounts, buy products, cancel orders, check invoices, etc.
  6. Going live with your up-to-date store
    • Activate your store ("Maintenance" page under the "Preferences" menu).

Permalink.

How to configure Prestashop to work with another domain

Prestashop, like many other applications out there, works based on a domain name. In case you wish to use your Prestashop application with a different domain you should change the PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL options in your Prestashop’s database. To edit these options you can use the phpMyAdmin tool available in cPanel.

Log into cPanel and access phpMyAdmin, after which select your Prestashop database and browse the table ps_configuration where the PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL records are located. Change their value to match your new domain name.

You should also make sure that your Prestashop’s base directory is correctly set in the application’s configuration file – settings.inc.php . You can find the configuration file in the config folder, located in the root of your Prestashop installation. You can edit the configuration file via FTP or by using cPanel’s File Manager tool.

Once you have opened the file for editing look for the line:

define(‘__PS_BASE_URI__’, ‘/‘);

In case your Prestashop installation is located in the web root folder of your domain name, this line should remain as above. If the installation is located into a sub folder, the line should be changed to reflect its location:

define(‘__PS_BASE_URI__’, ‘/subfolder/‘);

Where “subfolder” is the actual name of the folder where Prestashop has been installed.

Permalink.

Generate­ the­ htaccess­ with­ prestashop.

1·Create an empty file on your desktop with a simple text-editor, such as Windows’s Notepad (not Word!) or OS X’s TextEdit.

2·Save the file as htaccess.txt, in a folder where you can easily find it. If possible, save it as an purely ASCII or ANSI file.

3·Upload it to your server using an FTP client, such as FileZilla. Put the file at the root of your shop’s directory.

4·Change its permissions to read and write everyone (CHMOD 666 in Unix), with your FTP client for instance.

5·Go to the PrestaShop back-office, and under the Preferences tab and “SEO & URLs” sub-tab, enable “Friendly URL” (bottom of the page).

6·Go to the “Tools” tab, then the “Generators” sub-tab, and click the “Generate the .htaccess file” button.

Permalink.

How to import product features by csv import­?

Index
(Importing for PS 1.3x go here)
Import Products – You are here
 
Prestashop version : 1.4.x
 
Before posting questions/issues with importing make sure you use the latest Prestashop version!
 

Google Docs
With google docs you can create nice 'excel' like sheets that are also UTF-8. If you have an gmail account you can use Google Docs. I have included some sample files below for you to use.
 
Some important notes:
* Date fields have a fixed format that is not compatible with the date field in Prestashop
Google uses this : 2010/03/26
Presta uses this : 2010-03-26
If you want to use the prestashop format, be sure to use a ' in front of the date. Otherwise google docs will convert the date to its own format
* Multiple Field Seperator is , and cannot be changed
 
HTML or multiple lines in your Product Description field
Finally html support is available in 1.4.4.0. These codes will work:
<br>
<p></p>
 
New fields in 1.4.4
This version adds 3 new fields compared to 1.4.3. These fields are :
 

  1. Available for order – Checkbox in BO. Needs to be set to 1, otherwise order button is disabled
  2. Date Add Product – Still vague
  3. Show Price – Checkbox in BO. Needs to be 1, otherwise order button is disabled.

Permalink.

How to install a PrestaShop theme on my ecommerce website?

The installation of PrestaShop themes is simple and can be completed in a matter of clicks. 

From your Addons account click on “Order” page, download the zip file of the theme that you just purchased. Choose the file that fits the version of PrestaShop you are using.

If you use PrestaShop version 1.6:

1. From your PrestaShop back office, click on the “Modules” tab.

2. In the sign in window, enter your Addons ID and password then click on “Connect.”

If you are using PrestaShop version 1.4 or 1.5:

1. From your PrestaShop back office, click on the “Modules” tab.

2. Search for the Import/export a theme module and install it. The configuration of this module will help you install the theme you just purchased.

PrestaShop Addons does not provide support on Community developed themes. We ask that you contact the seller directly for any type of support regarding the theme(s).

Permalink.

Prestashop Quick Access – fix “Invalid security token”

PrestaShop admin panel has quick menu to your favorites pages, at the right-top of every page of the PrestaShop back-office. The “Quick Access” menu administration page enables you to create customized shortcuts, and make your navigation within the administration area much more comfortable and faster. You can open page in a new web browser tab or in new window.

How Adding a new link

Please got to Prestashop admin panel: Administration > Quick Access, click on “Add new”.
Name – enter shortcut unique name
URL – page address:

Copy page address from the browser’s address bar. Example:
http://www.iprestashop.com/adminXX/index.php?controller=AdminCustomers&token=f326b0415646545645649147
You need remove token and Prestashop admin panel base directory, so final result looks like this:  index.php?controller=AdminCustomers

But is one problem when you want a short reference to the module.
If you’ve done as required by Prestashop, you get token security error:

Invalid security token
I understand the risks and I really want to display this page
Take me out of here!

Module address:

http://www.iprestashop.com/adminXX/index.php?controller=adminmodules&configure=bankwire&token=a02e81d236feb1caf24880225c063dfb

This url we need refactoring to link like this:
index.php?controller= AdminModules &configure=bankwire

With controller=AdminModules small fix you avoid this annoying “Invalid security token” page.

Permalink.

Responsive Website Design (22)

Why should you use Responsive Design?

Think about your typical desktop browser. Even if it is not maximized, it almost certainly has a width of at least 960 pixels — that is a lot of space to place lots of columns of text and images. If you compare that with a smartphone in portrait mode, you are looking at a device with about 480 pixels of width. That is half the screen space. And a feature phone has even less space, 320 pixels or less in many cases.

If you create a page with a fixed-width layout 960 pixels wide, it will look great on your desktop monitor. But the first time you view it in a tablet, it’s going to look small. And then on a smartphone it will look even more cramped or the customer will have to scroll sideways to see the entire thing. And on a feature phone, the page might not display correctly at all.

Instead, with responsive design you create a design that works for the devices that visit your site. But unlike previous methods for handling mobile designs, you don’t create a separate site for every type of mobile browser that you want to support. You would use a detection script that might or might not work to send the mobile devices to another website that you had to maintain. Responsive design simply looks at the features of the device viewing the page, and delivers the styles appropriate for that device.

Permalink.

What are some screen sizes that a responsive website adapts to?

Examples of some common screen sizes are as follows:
  • 320px
  • 480px
  • 600px
  • 768px
  • 960px
  • 1024px
  • 2048px

Permalink.

Can I add images and videos to my responsive website?

Yes you can! With the help of media queries, you can also add flexible image sizes and embed flexible video displays on your responsive website.

Permalink.

What is px?

Px stands for pixels, which represent the width of a particular device.

Permalink.

Why do I need to have a responsive website?

Besides desktops, web browsing on tablets and mobile phones is on the rise, helped by their greater capabilities and lower prices. Therefore, if you don’t have a responsive, mobile-friendly website in the technically advanced environment today, you risk losing valuable traffic.

Permalink.

What is Responsive Web Design?

Responsive design is a style of web design that responds to the user as they arrive at the web page. Rather than forcing a mobile user to see a desktop site, a laptop user with a small screen to scroll horizontally to see a wide-screen monitor site, or a wide-screen monitor to view a site as a mobile customer might like, instead the design looks at each of these scenarios and adapts to display the content most effectively.

Web Pages Must Be Flexible and Adapt

I've said it many times, the web is not print. And with more and more different types and sizes of devices coming online, the sooner you accept that your pages will look different, no they must look different depending upon what is displaying them, the happier you will be.

The best web designs are the ones that make things easy. But not just easy for the website customers. The best web designs make things easy for the client as well. And responsive web design does that, but the down side is that it's not exactly easy for the web designers.

Creating a Whole Separate Website is a Bad Idea

It can be tempting, and I admit I've done it myself, to create a “mobile” site with a separate sub-domain or site location. Then you just slap up all the mobile friendly site features like single-columns, limited content, and reduced navigation in that one location and point mobile users there.

In the short term, this can work, as it gets up a mobile site quickly. But eventually it will start to cause problems. The first pain point comes when the site owner realizes that he has to post every article twice—once to the main site and once to the mobile site. This realization usually comes months after you trained them in how to maintain their new mobile site, and they have forgotten what they need to do to make the articles mobile friendly and they probably have dozens of articles that need to be ported.

Many web developers, at this point, start thinking of ways to programmatically copy files posted to the “real” website (the one for desktop browsers) into the mobile site. This can result in very complicated scripts and programs and ultimately the mobile user is still treated like an afterthought.

Responsive Design Treats Mobile and Desktop the Same

A responsive web design uses the exact same content to create a page that works whether you are viewing it at 1800 pixels wide or 320 pixels wide. But the pages that are created may look vastly different, while containing the same content. This means that whether you come to the site on an iPhone or a 27-inch iMac, you will get the same content, in fact you will go to the same URL. But on the iPhone you might see the page with only one column while the iMac gets five. But they are both considered equally important when delivering the content.

Permalink.

Which devices do we talk about in relation to responsive websites?

When we speak of multi-screens, we’re talking about different devices such as ultrabooks, iPads, iPhones, and even HDTVs and assorted android phones and tablets.

Permalink.

What about older browsers?

For older versions of browsers, such as those of IE JavaScript based solutions – such as respond.js and modernizr – are available.

Permalink.

What about SEO and responsive websites?

Making your website responsive is actually great from an SEO point of view because you’ll have just one URL. Besides, you won’t have to worry about some sites linking to your mobile website and some to the desktop version.

Permalink.

How long will it take to launch my responsive website after the initial meeting?

While time frames vary depending on the scope of the project, on average it takes about 3-4 weeks to create a responsive website.

Permalink.

SEO (7)

What is a Keyword?

A commonly known term, keyword is a word within a specific webpage that dictates the nature of the content. Multiple keywords provide a summary or semantic meaning for search engine pages. In fact, keyword phrases may even influence whether a user desires to view the content portrayed on a web page by search engine descriptions. Without a doubt, keywords are perhaps the most important inclusion in web pages and SEO.

Permalink.

What is a Title Tag?

One of the most important factors for search engine optimization, title tags include specific keywords, names, and phrases that are unique to individual web pages. Though often overlooked, title tags appear in the clickable link on search engine result pages.

Permalink.

What is PageRank?

Pagerank is a commonly understood concept of a page’s rank based on others that serve a similar purpose or contain linear content. Web pages with the highest relevance are displayed at the top of a search engine list. Undoubtedly, these positions are highly sought-after. Once reached, they are also challenging to maintain, as well.

Permalink.

What is SERP?

A shortened form of Search Engine Results Page, SERP is a webpage that is returned when a search engine comprises a list of matching search results from a specific term or question. This page includes website html, titles, and a brief description of the matching content.

Permalink.

What is SEO?

Search Engine Optimization, or SEO, is the process of increasing website visibility via a search engine’s natural or organic results. The more frequently a site appears in a search results list, the more visitors that frequent the webpage. SEO targets various search genres, such as news, industry-specific, and image searches.

Permalink.

What is a Backlink?

Search engines rank websites based on the number of backlinks it utilizes. Simply speaking, a backlink is a link from one website to another. These links increase visibility to audiences researching specific topics, because they lead users to other websites that feature desired information and content in a linear manner.

Permalink.

AdSense Banned My Sites, What to Do?

A reinstating procedure is more like proving the AdSense team that it wasn’t you who made the fraud and you have nothing to do with any type of terms and policies breaking actions.

  1. Always write your e-mails in a perfect grammar.
  2. Write the letters addressing yourself to a 3rd person, without taking the manner personally.
  3. Be corporate, be understanding and nice.
  4. Try to offer every little bit of help possible, so that the AdSense team can check all the possible variables.
  5. If you are a fairly known figure, for it’s whitehat techniques or just for it’s truly honest behavior.
  6. Try not to spam the AdSense team with repeated e-mails sent to multiple e-mail addresses, telling them the exact same thing. If you sent it once (maximum twice) that’s all you can do. ALL the e-mails are read.
  7. Do not reply to the first horrifying e-mail telling you your AdSense account has been disabled.

    Why not reply ? Because the first Google AdSense Account Disabled e-mail comes from the e-mail address adsense-adclicks@google.com (which is NOT ticket based) , and because the e-mails that come to you after you use the appeal form, come from adsense-adclicks-appeal@google.com (which IS ticket based).

    Use the AdSense invalid clicks appeal form. After you will get your first reply from the message sent to the appeal form, from a Google representative (they have a ticket system), you can then reply to that.

  8. Try to offer them server logs, tracking and analytics logs, and any other useful information, that they can use to determine if your account got click-bombed or not.
  9. Whenever you write e-mails, please try to sign your full name, telephone, mobile telephone, e-mail address, website, and so on, in the e-mail (please see the template below).
  10. In the AdSense appeal form, at the e-mail part (Email Address:), always write your AdSense publisher e-mail, and not another e-mail.
  11. One again, write in a polite manner, always. Polite + corporate + helpful + not spamming = success.

Permalink.

Sugar CRM (41)

What is the GPL v3?

The GNU General Public License v3 (GPL) is the latest iteration of the most widely used free and open source software (FOSS) license in the world. The GPL was created and sponsored by the Free Software Foundation (FSF). Read the full license here. http://www.gnu.org/licenses/gpl.html

Permalink.

Why did SugarCRM change from the SPL to GPL v3?

SugarCRM believes the GPL v3 will become the standard for all open source licenses, and wanted to get a head start on adopting that standard.

Permalink.

What versions of SugarCRM do you support?

Currently we support SugarCRM 6.5 or higher, including Pro+ and Community Edition.

Permalink.

What are the advantages of the GPL v3?

Since GPL v3 is based on the most popular license in the open source universe, the community is able to adopt and develop on what is sure to be the de facto standard license. This will insure greater interoperability and enhanced community collaboration as GPL v3 becomes widely adopted in the same manner as earlier versions of the GPL.

Permalink.

What are the main benefits of using SugarCRM ?

SugarCRM offers the following benefits:

  • Focus attention on the most profitable deals
  • Bring new sales representatives up to speed
  • Captures leads directly into the CRM system
  • Measures return on investment of campaigns Facebook: read your friends’
  • news feeds in the Activity Streams dashlet LinkedIn;
  • See who you know or who can provide you with an introduction at a company Twitter: read tweets of all the people you follow in the Activity Streams dashlet and add the Twitter name to a contact or lead and read their tweets directly in the contact or lead record

Permalink.

How do I change the company logo displayed on the top-left of the screen?

Replace the company_logo.png file, found in the include/images/ directory, and in each theme's images/ directory. Each theme has its own directory in themes/, such as themes/Sugar/.

*company_logo.png is a 212×40 transparent image.

Permalink.

Error 1251: Client does not support authentication protocol requested by server

Database admin user name and/or password is invalid (Error 1251: Client does not support authentication protocol requested by server; consider upgrading MySQL client).
MySQL 4.1 introduced a new password hashing algorithm that older versions of Apache (1.x) and PHP (3.x and 4.x) don't support. For more information about the new password hashing algorithm in MySQL, see http://dev.mysql.com/doc/mysql/en/old-client.html.

There are multiple ways to workaround the error that you're seeing, including upgrading pieces of the architecture, or modifying MySQL to utilize the old password hashing algorithm.

One quick workaround is to issue the following MySQL query:
SET PASSWORD FOR 'username'@'localhost' = OLD_PASSWORD('new_password_here');
 

Permalink.

How do I change the default theme?

To change the default theme, follow these steps. In this example, we will be changing the default theme to Retro:

1) Open your config.php file, located in the main Sugar directory
2) Locate this line:
      'default_theme' => 'Sugar',
3) Change the line to:
      'default_theme' => 'Retro',
4) Save the file

Note: This setting will affect all users.

Permalink.

What URL is needed for the Outlook Plug-in?

The server URL to use will be similar to the URL that you use to login to the Sugar application. However, you will replace the index.php filename at the end of the URL and replace it with soap.php. For example, change http://host.domain.com/sugarcrm/index.php to http://host.domain.com/sugarcrm/soap.php .

Permalink.

How do I change my webserver’s Memory Limit?

Locate your php.ini file, which is commonly found in C:\WINDOWS\ on Windows machines or /etc/ on Linux machines. In this file, search for this line:

      memory_limit = 8M

Change the "8M" value to reflect the memory limit you'd like to use, such as:

      memory_limit = 20M

After making this change, save your php.ini file and restart your webserver.

Permalink.

Vtiger (1)

What­ is ­vtiger ­crm­ licensing­ policy?

Vtiger CRM software is built over the following open source software:

  • Apache web server software, under the Apache License

  • MySQL database software, used under the GPL

  • PHP software, under the PHP License, version 3.0

  • SugarCRM software used under the SugarCRM Public License (SPL 1.1.2) (SPL – a copy of Version 1.1.2 is found here)

  • gdwin32 (graphic library) from http://www.boutell.com/gd/

  • PHPMailer software used under the LGPL

  • ADOdb software used under the BSD

  • phpSysinfo software used the GPL

  • Vtiger's modifications to the SugarCRM code are under vtiger Public License 1.1 based on Mozilla Public License (MPL). Additional components written by vtiger, not coming under the purview of the SPL, are provided under MPL.

Permalink.

Web Design and Applications (87)

What is Rhythm in Design?

Rhythm in design is also called repetition. Rhythm allows your designs to develop an internal consistency that makes it easier for your customers to understand. Once the brain recognizes the pattern in the rhythm it can relax and understand the whole design. Repetition rarely occurs on its own and so it embues a sense of order onto the design. And because of this, repetition attracts attention and prompts customers to investigate further.

Permalink.

What is MathML?

MathML is a formal language for expressing mathematics. It is based on XML to be compatible with a large range of software products.

W3C published the first version of MathML in 1998. MathML was updated and expanded in 2003. The third version, which adds, among other things, support for right-to-left languages, elementary (“school”) math, and integration of the OpenMath content dictionaries, is expected in 2009/2010.

Permalink.

Once you’ve decided the placement, learn the basics of how to Lay Out Web Pages

When you create a Web design, one of the more overlooked aspects of the design is the layout. Now, many people think about how to do a layout (CSS, tables, frames, etc.), but the basics of Web layout are often completely ignored.

Space and Whitespace

Use the whole space, but don't be specific in your use. In other words, use relatively sized layout sections on your Web pages, so that they expand and contract to fit the browser window.

Keep screen resolution in mind. While the majority of computer users have moved away from 640×480 resolution, keep that in mind when you're designing. Having customers leave because all they can see is a logo on their monitor is not good customer service.

Use color to define spaces. If you want to have a page that's a specific width, why not center it on the browser screen and make the background color of the page a different color? This will help the page appear to resize for different browsers; larger browsers will just have more background color showing, while smaller browsers will have less or none showing.

Images and Graphics

Align your images. One of the most common newbie layout mistakes is to slap images into a page willy-nilly without thought to layout. If you just use an img tag and then write text to follow it, you'll have the image and then one line of text to the right of it. Using the align attribute will help make your images part of the layout.

Balance the graphics and text on a page. It's easy to get carried away with lots of images and animations, but they can make a page very hard to read. When you're considering your layout, remember that images are a major part of the design, not just afterthoughts.

Text Width

Think about text width. This is often called the "scan length", and refers to how many words are displayed on one line. Most people can comfortably read about 7 to 11 words on a line. Longer than that, and the text is hard to read, shorter than that and it's disjointed and distracting. When designing your layouts make sure that the major text area displays the text in a readable width.

Centering text is inadvisable. One of the first layout techniques that a new designer learns is the center tag, and they center everything on their pages. However, centering is very difficult to do well and it's often hard to read.

Permalink.

How to include Unity in Web Designs?

Unity in Web design can be implemented in many ways:

  • Adjust the layout of elements to place them close or far away.
  • Change the spacing around text.
  • Play with the box properties to affect margins and padding.

Permalink.

Solving problems in Web Design

Sometimes figuring out what is wrong with your Web design can be very frustrating. Some things can be very difficult or impossible to fix, but if you are systematic about your analysis, you can find the problem and fix it more quickly.

Validate Your HTML

When I have a problem with my Web page, the first thing I do is validate the HTML. There are many reasons to validate HTML, but when you have a problem that should be the first thing you do. There are already many people who validate every page automatically. But even if you're in the habit, it's a good idea to check the validity of your HTML when you have a problem. That will ensure that it's not a simple error that causes your problem.

  • HTML Validator

Validate Your CSS

The next most likely place where you'll have problems is with your CSS. Validating your CSS serves the same function as validating your HTML. If there are errors, that will ensure that your CSS is correct and that is not the cause of your problems.

  • CSS Validator

Validate Your JavaScript or Other Dynamic Elements

As with HTML and CSS if your page uses JavaScript, PHP, JSP, or some other dyanmic elements, you should make sure that they are valid as well.

Test in Multiple Browsers

It may be that the problem you're seeing is a result of the Web browser you're viewing it in. If the problem occurs in every browser you can test, that tells you something about what you have to do to fix it. For example, if you know that the problem only happens in IE 6 or 5, you can create a style sheet or alternate page for that browser, in the event that you can't fix the problem.

Simplify the Page

If validating the HTML and CSS doesn't help, then you should narrow down the page to find the problem. The easiest way to do this is to delete portions of the page until all that is left is the portion with the problem. You should also cut the CSS down in a similar fashion.

The idea behind simplifying is not that you'll leave the page with only the fixed element, but rather that you'll determine what is causing the problem and then fix it.

Subtract and then Add Back

Once you have narrowed down the problem area of your site, begin subtracting elements out of the design until the problem goes away. For example, if you've narrowed down the problem to a specific <div> and the CSS that styles it, begin by removing one line of CSS at a time.

Test after every removal. If what you've removed fixes or completely removes the problem, then you know what you need to fix.

Once you know exactly what is causing the problem begin adding it back with items changed. Be sure to test after every change. When you're doing Web design, it's surprising how often little things can make a difference. But if you don't test how the page looks after every change, even seemingly minor ones, you may not determine where the problem is.

Design for Standards Compliant Browsers First

The most common problems that Web designers face revolve around getting pages looking the same in most browsers. While we've discussed that it can be very difficult, if not impossible, to get Web pages to look the same in all browsers, it is still a goal of most designers. So you should start by designing for browsers like Firefox, which are standards compliant. Once you have them working, you can play with the other browsers to get them working.

Keep Your Code Simple

Once you've found and fixed your problems, you should stay vigilant to keep them from cropping up again later. The easiest way to avoid problems is to keep your HTML and CSS as simple as possible. Note that I'm not saying you should avoid doing something like creating rounded corners simply because the HTML or CSS is complicated. Only that you should avoid doing complex things when a simpler solution presents itself.

Permalink.

How to include Contrast in Web Designs

Contrast in Web design can be implemented in many ways:

  • Change the fonts. The font size, font weight, or font family can all provide contrast to your text. Headlines provide a lot of contrast to surrounding text.
  • Links provide great contrast in text. The color change and the addition of an underline work well to contrast from the surrounding text.
  • Use different sized images and elements. If you have a section of text that is the primary focus of a page, you might make it large and all the surrounding elements and images small.
  • Use contrasting colors or change the darkness and lightness of your colors.

Permalink.

What is Timed Text?

Timed Text is an XML-based language to timed text media for the purpose of interchange among authoring systems. It may also be used directly as a distribution format, thus suitable for captioning or video description.

Permalink.

What are Graphics?

Web graphics are visual representations used on a Web site to enhance or enable the representation of an idea or feeling, in order to reach the Web site user. Graphics may entertain, educate, or emotionally impact the user, and are crucial to strength of branding, clarity of illustration, and ease of use for interfaces.

Examples of graphics include maps, photographs, designs and patterns, family trees, diagrams, architectural or engineering blueprints, bar charts and pie charts, typography, schematics, line art, flowcharts, and many other image forms.

Graphic designers have many tools and technologies at their disposal for everything from print to Web development, and W3C provides many of the underlying formats that can be used for the creation of content on the open Web platform.

Permalink.

How to Test Web Page Designs

How to Test

Take your testing seriously enough to make some simple test cases (a software design concept). You should also document them at least to some moderate degree. For example, you could list your expected results, save screenshots for every “browser and test subject” pair, and add a note stating what is problematic and what needs to be fixed. You should also indicate the date of the test and maybe the revision id of the version control system your tested design is residing on. By the way, I am strongly for using a version control system. It could be SVN, Git, or something else, but the little extra effort it might take to use it will save you tons of problems if you accidentally delete something, overwrite the wrong code, or when (not if) your work machine breaks down irreparably.

If your test concludes that something needs to be fixed, once you have made the modifications, you should perform a second test, exclusively for the parts which are affected by your changes. Remember to note the reason for the modification along with your documentation, and possibly also in the code. You should repeat this step until, hopefully, your design looks sufficiently well in all of your tested browsers, and no more changes are needed.

Lastly, you should also test for cases when a certain feature in your design, like Adobe Flash or JavaScript, is not available or not switched on in the viewer’s browser. This is another place to use the principles of graceful degradation and progressive enhancement.

But what if due to various factors you end up repeatedly making changes to fix a problem in one browser, just to find that your fixes cause another problem in the same browser or in a different one?

Problems While Testing

Sometimes a testing session gets stuck, or starts to go in circles. This could be due to the complexity of the design, the strictness of the requirements, the variety of browsers chosen to test against or a combination of all these. If the problematic browser is in the IE family, you could use conditional comments to load a custom style-sheet for the troublemaker. Otherwise, if your server software lets you sniff for different browsers and serve separate styles based on that, this could aid in solving your problem. You should also research the issue—someone may have already come up with a solution, or there may be a tool out there for the job. In some cases, you might need to use a different technology—like Adobe Flash or a JavaScript library, when something is not achievable across browsers. You may just use it as a fallback or decide to switch to it entirely.

If you cannot fix the problem with the above methods, you should make a compromise. In order to remedy it, you could either choose to revisit the design, use a different approach if possible, ease the requirements, or maybe as a last resort, pick out an unfortunate browser to take the fall. Of course, this is something the customer must agree to as well. If it is the case, there is no shame in admitting that something is not possible in the current circumstances.

Testing Additional Changes

The key is to estimate what the changes will affect and to concentrate your testing on these parts. This estimation should draw on your knowledge of HTML and CSS and on the previous history of changes you had with this project. If you know that a change is not supported well in a certain browser, or you know that it will appear differently, test it. If it involves a new technology, also test it. If it is in an area of the design which took a large amount of corrections in order to get it, then test it as well.

In general, the more structured and organized you are with your testing the less time you will waste hunting down issues during the initial implementation and further changes and maintenance. A real test case procedure might appear too tedious, but it is time well spent, as it increases the quality of your work. If you follow through with it properly, you will have a design that looks good across all your target browsers and to all your target audience, while future alterations will be easier to perform.

Permalink.

What scripting interfaces are available ?

The most basic scripting interface developed at W3C is the DOM, the Document Object Model which allows programs and scripts to dynamically access and update the content, structure and style of documents. DOM specifications form the core of DHTML.

Modifications of the content using the DOM by the user and by scripts trigger events that developers can make use of to build rich user interfaces.

A number of more advanced interfaces are being standardized, for instance:

  • XMLHttpRequest makes it possible to load additional content from the Web without loading a new document, a core component of AJAX,
  • the Geolocation API makes the user’s current location available to browser-based applications,
  • several APIs make the integration of Web applications with the local file system and storage seamless.

WAI ARIA offers mechanisms to ensure that this additional interactivity remains usable independent of devices and disabilities. Additional considerations apply to the development of Web applications for mobile devices.

Permalink.

Wordpress (145)

The spinning arrow icon shows up once I submit a form, but then nothing happens.

This is most probably due to a conflict between plugins/theme. Try deactivating all other plugins and switching to the default theme.

Permalink.

How do I change the Config file?

You will need to update your WordPress configuration file if your database has moved or changed in certain ways.

  1. You will only need to modify the config file if:

     

    1. your database has moved to another server and is not running on your localhost

    2. you have renamed your database

    3. you have changed the database user name

  2. "'Make a backup copy of your wp-config.php file.'"

  3. Open the >wp-config.php file in a text editor.

  4. Review its contents. In particular, you are looking for the database host entry.

  5. Save the file.

At this point, your WordPress blog should be working.

Permalink.

Why can’t I see the Widgets menu?

The Widgets menu item will only appear if your site has a widgetized sidebar.

Permalink.

Can I install WordPress in my computer?

Yes, you can install WordPress in your computer for testing purposes. However, if you want other people to see your WordPress site, then you must have web hosting.

Permalink.

How can I specify a subject for the email?

Simply edit the Subject field in the Mail section (not in the Form section).

Permalink.

How much work and time will this take?

If your web host provides the alternative, moving from PHP 4 to PHP 5 should be painless and fast. If there are problems with WordPress Themes, Plugins, and other scripts and PHP code, it could be more work, though most are updated by now. In most cases, though, it is as simple as clicking a button or two and waiting for it to happen.

Permalink.

What is WordPress?

WordPress, or more specifically WordPress MU (Multi-User), is a Web editing platform used at Lafayette to make the creation and management of Web sites a relatively simple task. WordPress is an open-source blogging platform that has evolved over the last few years to include the option to host sites with individual pages and not just blog entries.

Permalink.

Why are the Quote Marks escaped or not escaped?

If you write plugins, or use a plugin like RunPHP, or make advanced custom templates, you may eventually find yourself dealing with data in the database. WordPress usually manages this data for you in such a way that it is immediately usable. There are circumstances though (especially if you are dealing directly with the database without using WordPress) where you will experience weirdness.

For example, quote marks cannot be stored directly in the MySQL database. MySQL uses quote marks in its SQL language. When a quote mark is used, for example, in a post, When the post is saved to the database, every quote mark gets escaped. That means a backslash character is prepended, which signifies that the next character should be taken as part of the input, and not as part of the SQL command.

For example, if you are adding the following in your post:

...an article about "Happiness" is at 
<a href="http://example.com/happy" title="Happiness">Happiness</a>
if you would like to read it...

Is actually imported into the database looking like this:

...an article about \"Happiness\" is at 
<a href=\"http://example.com/happy\" title=\"Happiness\">Happiness</a>
if you would like to read it...

When pulling data out of the database, the backslashes may not always be automatically removed. If this becomes an issue, you can use the stripslashes() PHP function on the text.

Permalink.

How do you repair a MySQL database table?

Every once in a while, it may be necessary to repair one or more MySQL database tables. According to the How to Repair Tables article at dev.mysql.com there are a number of reasons to repair a table including errors such as "tbl_name.frm is locked against change", "Can't find file tbl_name.MYI (Errcode: nnn)", "Unexpected end of file", "Record file is crashed", or "Got error nnn from table handler".

Here are the steps to repair a table in a MySQL database using phpMyAdmin:

  1. Login to hosting account.
  2. Login to phpMyAdmin.
  3. Choose the affected database. If you only have one database, it should choose it by default so you don't need to do anything.
  4. In the main panel, you should see a list of your database tables. Check the boxes by the tables that need repair.
  5. At the bottom of the window just below the list of tables, there is a drop down menu. Choose "Repair Table"

Remember, that it is advisable to have a current backup of your database at all times.

Permalink.

Yii (36)

Stop browsers from auto-completing registration form fields

Firefox can autocompleting the username and password fields on registration forms, and change password forms. To disable this, you can set the FORM attribute autocomplete to off. On your CActiveForm options, you can set this in htmlOptions:

'htmlOptions'=>array('class'=>'reg-form', 'autocomplete'=>'off'),

Permalink.

Property ClassName.xxx is not defined , what is the problem?

First of all, the error message says all that you need to know!

This is a very common error in component configuration, and widget configuration. This is not a framework issue!

To solve it, you should make sure that the ClassName has a field with the name you are trying to use. This can be a capital letter issue, or just the property a.k.a. field not exists in the class.

Read the class reference to see if there is a property that you want to use, or if this is an extension or widget – open the class file, and see if there is a property and if you spelled it correctly.

For example, if this is the class:

class Foo {
   public $bar = 123;
}

and if you are trying to access Foo.bor , then it does not exist there!

Permalink.

How to change site/page?id=123 to site/page/id

For this you should use urlManager

It is actually very-well documented… URL Manager

The direct answer to the question is – using that rule:

array(
    'site/action/<id:\d+>' => 'site/actionm '
)

In your example you can set How to change site/page?id=123 to site/page/id$id like this: actionPage($id)

Or you can get it via Yii::app()->request->getQuery('id');

Permalink.

Can I render multiple points to the same map?

Yes, as of version 1.0.4 it is now possible to render multiple points to the same map. This can be accomplished in two ways:

  1. by rendering multiple results to the same container;
  2. by manually specifying the lat/lon where the marker is to be placed.

Example:

$result is an array of GeoCode_Result objects from a Google Driver.

$result[0]->renderMap('map_canvas', array(
    'mapTypeId' => 'ROADMAP',
    'zoom' => 13
));

Render the second result to the same map; note that any options passed to the function will be ignored since this canvas has already been initialized

$result[1]->renderMap('map_canvas');

Render a point manually to that same canvas; note that the arguments are in this order because if no canvas is specified, it defaults to using the last one created

$result[0]->renderPoint($my_lat, $my_lon, 'map_canvas');

Permalink.

What are the various Helper classes provided by the Yii ?

There are several classes provided by framework:

  • ArrayHelper
  • Console
  • FileHelper
  • Html
  • HtmlPurifier
  • Image
  • Inflector
  • Json
  • Markdown
  • Security
  • StringHelper
  • Url
  • VarDumper
  • Permalink.

How does Yii compare with other frameworks?

Like most PHP frameworks, Yii is an MVC framework.

Yii excels other PHP frameworks at being efficient, feature-rich and clearly-documented. Yii is carefully designed from the ground up to be fit for serious Web application development. It is neither a byproduct of some project nor a conglomerate of third-party work. It is the result of the authors' rich experience with Web application development and their investigation of the most popular Web programming frameworks and applications.

Permalink.

What is difference between Component and and Object?

Classes of the Yii framework usually extend from one of the two base classes: yii\base\Object or yii\base\Component. These classes provide useful features that are added automatically to all classes extending from them.

The Object class provides the configuration and property feature. The Component class extends from Object and adds event handling and behaviors. Object is usually used for classes that represent basic data structures while Component is used for application components and other classes that implement higher logic.

Permalink.

How do I install and use YiiGeo?

INSTALLATION

Extract the contents of the archive to 'protected/extensions/' . Rename the default directory (eg: 'yiigeo-1.0.1/' ) to whatever you want the component named in your application. This directory will be referred to as '<extdir>' in this tutorial.

USAGE

Register for an API Key with a support GeoCoder provider
Google registration: http://code.google.com/apis/maps/signup.html
Yahoo registration: http://developer.yahoo.com/maps/rest/V1/geocode.html

There are two ways to use the Yii GeoCoder Extension. The first is as an imported standalone object, the second is as an application component.

*Standalone*

<?php
Yii::import('application.extensions.<extdir>.GeoCoder');
$geocode = new GeoCoder;
$geocode->init();
$geocode->setApiKey('<your API key>'); // As of 1.0.2
$geocode->setDriver('<your driver>'); // 'google' or 'yahoo'
$result = $geocode->query('Las Vegas, NV 89103'); ?>

*Application Component*

STEP 1: Update your application config

<?php 'components' => array(
  …
    'geocoder' => array(
       'class' => 'application.extensions.<extdir>.GeoCoder',
       'api_key' => '<your API key>',
       'api_driver' => '<your driver>', // 'google' or 'yahoo'
     ),
  …

) ?>

STEP 2: Using the component

<?php
$result = Yii::app()->geocoder->query('Las Vegas, NV 89103'); ?>

Permalink.

How to connect to database in controller

The best approach is to set db connection in your main.php config.

The second one would be just using the CDbConnection::__construct

Permalink.

What is Yii best for?

Yii is a generic Web programming framework that can be used for developing virtually any type of Web application. Because it is light-weight and equipped with sophisticated caching mechanisms, it is especially suited to high-traffic applications, such as portals, forums, content management systems (CMS), e-commerce systems, etc.

Permalink.

Zend (57)

What is ‘Zend_filter’?

Zend_filter is used to filter the data as well as to remove the tags, trailing the spaces and remove all except digits.

Permalink.

How do you protect your site from sql injection in zend when using select query?

You have to quote the strings:

$this->getAdapter()->quote(<variable name> );
$select->where( ” <field name>= “,<variable name>);
OR (If you are using the question mark after equal to sign)
$select->where( ”<field name>= ? “,<variable name>);

Permalink.

Where is Zend Framework’s ORM implementation?

Object Relational Maps (ORMs) are practically frameworks on their own, and consist of data access, repositories, identity maps, and many more components. We feel it makes sense to let ORM experts write such software, and allow integrating these solutions in Zend Framework. Popular projects include Doctrine and Propel.

Permalink.

What is zend framework?

It is opensource framework created by zend.com (PHP company). It is object oriented and follow the MVC. Zend Framework is focused on building more secure, reliable and fast development.

Permalink.

What is Front Controller?

It is used for Front Controller pattern. Zend also uses singleton pattern.
Below are the functions specific to Zend_Controller_Front:

  • ‘routeStartup’: This function is called before Zend_Controller_Front calls on the router to evaluate the request.
  • ‘routeShutdown’: This function is called after the router finishes routing the request.
  • ‘dispatchLoopStartup’: This is called before Zend_Controller_Front enters its dispatch loop.
  • ‘preDispatch’: called before an action is dispatched by the dispatcher.
  • ‘postDispatch’: is called after an action is dispatched by the dispatcher.

Permalink.

What is use of Zend front controller?

Routing and dispatching is managed in the front controller. It collects all the request from the server and handles it.

Permalink.

Which operating systems does Zend Server support?

Zend Server can be installed on a variety of OS: Windows, Linux distributions, Mac OS X and IBM i.

Permalink.

Where is the model in ZF’s MVC implementation?

The model component can vary dramatically in responsibilities and data store from one MVC application to the next. The ZF community has not defined a model interface, class, or other formalism simply because we wanted to avoid introducing limitations without significant added value.

Permalink.

Can I upgrade to Zend Server 7.0 from a previous version of Zend Server?

Yes. For more details, see the installation and upgrade guide for your operating system:

Permalink.

Where can I make a configuration in Zend Framework? (Where can I find the application.ini file?)

Configuration can be done in application.ini file in Zend framework. This file in the path application/configs/application.ini.

Permalink.

Marius Ion ANGEL HOT SOFT LLC (800) 316-7677