comtersoft » Developers Lounge
Call us today at US: 703 - 349 - 1168 | India: +91 471 - 301 0690

Archive for the ‘Developers Lounge’ Category

SEO on full Flash websites

Posted on August 2nd, 2009 in Designers Lounge, Developers Lounge, Flash, Internet | No Comments »

 

 ”Does Google index your swf files?”

Seems to be the most popular question… After lots of googling we found out there are widely two methods to make a flash website well optimized for a search engine.

 

Optimizing Flash for the so-demanding search engines is not an easy task. The effort that must be done and the amount of energy and time that must be spent on SEO for Flash are far greater than for the optimization of an usual HTML site.

 

The first technique is splitting the content which has to be crawled by Google and other search engines into a different section and making the design a separate one. The second one is Designing and animating flash in such a way how Google mentions that in web masters area.

 

The best way to do the first option is by using JavaScript or a script like swf object . By using this we are loading the flash content into a div using the id of the div. Spit out the required content into this div which will be crawled by Google. Then we can use the swf object to replace the content only if the user has Javascript enabled and the required Flash plugin version.

 

You can get more description about this point here: http://blog.deconcept.com/2006/03/13/modern-approach-flash-seo/

 

 

For the second point you are supposed to design the flash file in such a way how they mention in webmaster central. At present Google can only discover and index textual contents and links inside a flash file. And also Google can not recognize or index any text that may appear in images. Similarly, they do not generate any anchor text for Flash buttons which target some URL, but which have no associated text. Another important point is they cannot index flv files as they do not contains any text elements. The improvements that Google had made to crawl swf files do not require any special action on the part of web designers or web masters.

 

 

For more details on how Google index your swf file: http://googlewebmastercentral.blogspot.com/2008/06/improved-flash-indexing.html

PHP Functions in Javascript - PHP.js

Posted on July 28th, 2009 in Developers Lounge, php | No Comments »

 

I found this wonderful site that ports commonly used, built in PHP functions into JavaScript.

Basically, just include the library and you should have all your common PHP functions like strlen, count, in_array, array_keys etc in Javascript. How cool is that!

I find the string manipulation functions most useful. The best part is you can choose to download only the functions that you need, individually, instead of the whole library.

Here is the list of functions currently ported to Javascript: http://phpjs.org/functions/index

Here is the link to the library homepage: http://phpjs.org/

Remember is this just a collection of functions built in PHP and not a framework like Jquery

Multiple display fields in find(’list’)

Posted on July 11th, 2009 in Developers Lounge, php | No Comments »

 

cakePHP’s find(’list’) function is used to generate a list of data (key=>value pairs) that can be used to populate select boxes easily.

A common requirement by most people is how to concatenate 2 fields in the display of the list (value) while still maintaining the key. For example, when displaying a list of users you may want to display the first name and last name while the key is the user id.
Currently, cakePHP’s find(’list’) function doesn’t support it. You can only specify a single field for a key and value.

I found this behaviour written by Daniel Albert (resshin) that will let you have multiple display fields http://bakery.cakephp.org/articles/view/multiple-display-field-3

I have used the customized version of this code (you can find it in the comments section of the link…written by Cosmin Cimpoi).

Just one tip: As Cosmin Cimpoi mentions you must ensure that recurive is atleast 0. In my case that didn’t work. For me recursive had to be set to atleast 1. But, I didn’t want recurive 1 to be used in other places so this is what I did:

$this->Address->find('list', array('recursive' => 1));

And it works like a charm!

Ubercart for Drupal- Know how!

Posted on July 9th, 2009 in Developers Lounge, Drupal | No Comments »

 

Ubercart is a e-commerce module suite for Drupal which consists of set of modules designed to allow you to run a store on your Drupal site. All front end modules are integrable and  configurable using drupal modules.Development has been driven by two major emphases: flexibility and usability. The various systems driving Ubercart, including the product catalog,shopping cart and checkout, order, shipping, and payment systems have all beendesigned to be extended to meet any need. Furthermore, the administrative interface, particularly relating to processing and fulfilling orders, has been designed for ease of use and efficient display of information.

It is a great solution for stores that selling physical products.

Ubercart is being sponsored and developed by the team at

http://www.ubercart.org

Sign up for site access to join the Ubercart community

and take advantage of our forums and issue tracking.

Features overview:

http://www.ubercart.org/what_is_ubercart

Screenshots:

http://www.ubercart.org/screenshots

User’s and Developer’s Guides:

http://www.ubercart.org/docs

Installation Manual (with module descriptions):

http://www.ubercart.org/docs/user/90/installing_ubercart

Support forums:

http://www.ubercart.org/forum

PHP SimpleXML CDATA Issue - Solution

Posted on July 6th, 2009 in Developers Lounge, php | No Comments »

 

After hours of searching and using complicated functions to parse XML in PHP (simplexml) with CDATA I found this link that gives you the solution simply.

Normal XML files when passed to simplexml_load_file() will return an array with the tag name and value like this:

XML:
<GradeLevel>
	<GradeLevelItem>
		<GradeID type='Number'>1</GradeID>
		<Grade type='Text'>Primary K-3</Grade>
	</GradeLevelItem>
<GradeLevel>
SimpleXML output
SimpleXMLElement Object
(
    [GradeID] => 1
    [Grade] => Primary K-3
)

But, when the value is in CDATA you will not be able to access the value directly, like this:

XML:
<GradeLevel>
	<GradeLevelItem>
		<GradeID type='Number'><![CDATA[1]]></GradeID>
		<Grade type='Text'><![CDATA[Primary K-3]]></Grade>
	</GradeLevelItem>
<GradeLevel>
SimpleXML output
SimpleXMLElement Object
(
    [GradeID] => SimpleXMLElement Object
        (
            [@attributes] => Array
                (
                    [type] => Number
                )
        )

    [Grade] => SimpleXMLElement Object
        (
            [@attributes] => Array
                (
                    [type] => Text
                )
        )
)

To get the outut in the exact same way as the first case (to access the value) all you need to do is to pass a few extra params and the built in simplexml_load_file() function will do it for you automatically like this:

simplexml_load_file($file, 'SimpleXMLElement', LIBXML_NOCDATA);

This is the link that saved me:
http://blog.evandavey.com/2008/04/how-to-fix-simplexml-cdata-problem-in-php.html

The secret of getting ahead is getting started. ComterSoft is the starting point