Advanced usage of zend form

No Comments

Just some code.

        $form->addElements(array(
            new Zend_Form_Element_File('imgFile', array(
                'required'        => FALSE,
                'label'            => 'Bild uploaden',
                'destination'    => PROJECT_ROOT.'/images/userpics',
                'validators'    => array(
                    array('IsImage', TRUE),
                    array('Extension', TRUE, 'jpg,png,gif'),
                    array('ImageSize', TRUE, array('maxheight' => 80, 'maxwidth' => 80)),
                    array('Count', TRUE, 1),
                ),
                'filters'        => array(
                    array('Rename', array(
                        'target' => PROJECT_ROOT.'/images/userpics'.Zend_Auth::getInstance()->getIdentity(),
                        'overwrite' => TRUE
                    ))
                )
            )),
 
            new Zend_Form_Element_Text('imgUrl', array(
                'required'        => FALSE,
                'label'            => 'Bild-Url'
            )),
 
            new Zend_Form_Element_Submit('submit', array(
                'required'        => FALSE,
                'label'            => 'Bild speichern',
                'ignore'        => TRUE
            ))
        ));
Share and Enjoy:
  • Digg
  • Twitter
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • RSS
  • HelloTxt
  • MyShare
  • MySpace
  • Add to favorites
  • PDF
  • Print

How to make a new translation of prestashop modules & theme

4 Comments

If you create a new module or theme, will need make new translation files. Every module’s translation file in each folder of modules, the theme’s translation file in “lang” of theme’s folder.

We can see themes\prestashop\lang\nl.php, if you install dutch, will have this file.

Open this file, we can see something like this:

$_LANG['address_3908e1afa0ff22fbf112aff3c5ba55c1'] = ‘Uw adressen’;

The key of this array $_LANG have 2 parts. The first one tell you this translate will be used in page “address”, the second one is the md5 value of page “keyword”.

Something like if you create a new keyword {l s=’Your addresses’}, this value will be md5(‘Your addresses’) = 3908e1afa0ff22fbf112aff3c5ba55c1

Hope this article can help you, thanks.

Share and Enjoy:
  • Digg
  • Twitter
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • RSS
  • HelloTxt
  • MyShare
  • MySpace
  • Add to favorites
  • PDF
  • Print

How to change the order of prestashop title

1 Comment

The title of website cant control by user now, so if you want change it, must edit some core files.

At line 493, 505, 471 of classes/tools.php, Configuration::get(‘PS_SHOP_NAME’) is the name of website.
If you want put website name after product name, just make it to $row['meta_title'].’ – ‘.Configuration::get(‘PS_SHOP_NAME’)

Tested on prestashop 1.2.5

Hope this article can help you, thanks.

Share and Enjoy:
  • Digg
  • Twitter
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • RSS
  • HelloTxt
  • MyShare
  • MySpace
  • Add to favorites
  • PDF
  • Print

If you can not login backend of prestashop

2 Comments

If you buy a new server and install prestashop with temp URL (like http://99.99.99.99/~example), when you use domin name to access it, will find cant login backend and not have any error message.

Open config/settings.inc.php, edit the value after “__PS_BASE_URI__“. If you have alone domin name to access your shop, just make the value to ‘/’. If your shop URL like http://example.com/folder_name/, need keep the value to ‘/folder_name/’.

Hope this article can help you, thanks.

Share and Enjoy:
  • Digg
  • Twitter
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • RSS
  • HelloTxt
  • MyShare
  • MySpace
  • Add to favorites
  • PDF
  • Print

New Zend upload filter which can rename file by md5 value and put it in folder named by current date

No Comments

I create a new folder named “x” in one of my proj “library” folder, beside of Zend framework library folder.

We can not upload many files in one upload folder, so why create diffcult folder to manger them.

Run it in zend framework 1.7.

require_once 'Zend/Filter/Interface.php';
 
/**
 * @category   Zend
 * @package    Zend_Filter
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class X_Filter_Md5File implements Zend_Filter_Interface
{
    /**
     * Defined by Zend_Filter_Interface
     *
     * Returns realpath($value)
     *
     * @param  string $value
     * @return string
     */
    public function filter($value)
    {
		$name = strrchr($value, '.');
                $floder = date('Ymd');
		$file = $floder.DIRECTORY_SEPARATOR.md5_file(realpath($value)).$name;
		if(!is_dir($full_floder = (dirname($value).DIRECTORY_SEPARATOR.$floder)))
			mkdir($full_floder);
		if(!is_file(dirname($value).DIRECTORY_SEPARATOR.$file))	
			rename($value, dirname($value).DIRECTORY_SEPARATOR.$file);
 
		return $floder.DIRECTORY_SEPARATOR.md5_file(realpath($value)).$name;
    }
}
Share and Enjoy:
  • Digg
  • Twitter
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • RSS
  • HelloTxt
  • MyShare
  • MySpace
  • Add to favorites
  • PDF
  • Print

SEO services

No Comments

What is Search Engine Optimization?
Search Engine Optimization, also known as SEO, is the art and science of altering a website so that it does well in the organic, crawler-based listings of search engines.

Why Search Engine Optimization?
Search Engine Optimization is the process of increasing the amount of visitor to a website by ranking high in the SERP (Search Engine Results Page). Studies have proven that top placement in search engines, provides a more ROI (Return On Investment), among other forms of online marketing.

Benefits of Search Engine Optimization
Search engines generate nearly 90% of Internet traffic and are responsible for 55% of e-commerce transactions. Search Engine Promotion has shown to deliver the highest ROI, compared to any other type of marketing, both online and offline. Search engines bring motivated buyers to you and hence contribute to increased sales conversions.

Search Engine Optimization offers an affordable entry point for marketing your website and an effective way to promote your business online. SEO makes for a long-term solution, is your access to sustained free traffic and a source of building brand name and company reputation.

Types of Search Engine Optimization
Search Engine Optimization, in a nutshell, it the process to understand and leverage how search engines like Google, Yahoo! and MSN rank results for selected search terms and phrases.

Generally there are three types of search engine optimization one can perform on their site, which is as follow:

On-Page Optimization / On-Page SEO

Off-Page Optimization / Off-Page SEO

On-Page Optimization / On-Page SEO
On-Page Optimization factors are related directly to the content and structure of the website.
Search Engine spiders not only gathers information from your pages but also see your entire website as an individual entity in terms of potential relevancy to a user’s search.

Studies shows that search engines analyze over 100 on-page factors when analyzing your website. Some of the major On-Page Search Engine Optimization Factors are as follow: Keywords in Title Tag

Keywords in Heading Tags

Keywords in the Page Body

Keywords in Links

Keywords in Bold, Italic, Underline

Use of Proper alt image tag

HTML Validation

Link Structure

And more

Off-Page Optimization / Off-Page SEO
Unfortunately optimizing your WebPages is not enough; necessity for off-page optimization was born from the simple fact that trying to rank millions of similar pages based on the content of the pages alone is a very difficult concept as there are likely many pages which cover a topic well and will also be very similar in content.

Hi-Tech Export offers off-page optimization that looks beyond the on-page optimization and also known as link building. These can be reciprocal or non-reciprocal and contain important text that links your site and other sites together to improve link popularity and reputation.

Share and Enjoy:
  • Digg
  • Twitter
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • RSS
  • HelloTxt
  • MyShare
  • MySpace
  • Add to favorites
  • PDF
  • Print

Extend Zend_Db_Table -> fetchAll have join function

1 Comment

I extend Zend_Db_Table (version 1.7.1), now it’s can support join other table when u use fetchAll

it’s something like

$this->_model->setParentMap('user', 'id_user', 'id_user', array('name'))->fetchAll('id_user = "0"')

so it’s can read table “user”‘s “name” data when u get table “friend” data.

this is my code:

class X_Db_Table extends Zend_Db_Table
{
     protected $_parentMap = array();
    /**
     * set ParentMap value
     *
     * @param string $tablename
     * @param string $remote
     * @param string $local
     * @param array $fields
     * @return Zend_Db_Table
     */
 
    function setParentMap($tablename, $remote, $local, $fields)
    {
        $this->_parentMap[$tablename] =  array(
                                         'remote' => $remote,
                                          'local' => $local,
                                          'fields' => $fields + array('table_prefix' => Zend_Registry::get ('dbprefix')),
                                          );
        return $this;
    }
 
    /**
     * the parent mapping from self::_parentMap
     *
     * @param string|array $where
     * @param string|array $order
     * @param integer $count
     * @param integer $offset
     * @return array
     */
 
    public function fetchAll($where = null, $order = null, $count = null, $offset = null)
    {
        if(count($this->_parentMap) == 0)
            return parent::fetchAll($where, $order, $count, $offset);
        else{
            $select = $this->_db->select()
                    ->from($this->_name)
                    ->order($order)
                    ->limit($offset, $count);
 
            if (!is_null($where)) {
                $select->where($where);
            }
 
            foreach($this->_parentMap as $parentTable => $specs) {
                $fields = array();
                if (isset($specs['fields']['table_prefix'])) {
                    $parentTable = $specs['fields']['table_prefix'].$parentTable;
                    unset($specs['fields']['table_prefix']);
                }
                if (isset($specs['fields']['prefix'])) {
                    $prefix = $specs['fields']['prefix'];
                    unset($specs['fields']['prefix']);
                    foreach($specs['fields'] as $key => $field) {
                        if (is_int($key)) {
                            $key = $prefix.$field;
                        }
                        $fields[$key] = $field;
                    }
                } else {
                    $fields = $specs['fields'];
                }
                $select->joinLeft(
                    $parentTable,
                    sprintf('%s.%s = %s.%s',
                        $this->_db->quoteIdentifier($this->_name),
                        $this->_db->quoteIdentifier($specs['local']),
                        $this->_db->quoteIdentifier($parentTable),
                        $this->_db->quoteIdentifier($specs['remote'])
                    ),
                    $fields
                );
            }
 
            $this->_parentMap = array();
            return $this->_db->fetchAll($select);
        }
    }
}

u can use it in yr models

Share and Enjoy:
  • Digg
  • Twitter
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • RSS
  • HelloTxt
  • MyShare
  • MySpace
  • Add to favorites
  • PDF
  • Print

Prestashop Customization

2 Comments

As your know, prestaShop is an Open Source comers web application. it’s include:

  • Special deals
  • ‘Free shipping’ offers
  • Cross-selling
  • Product image zoom
  • Order out-of-stock items
  • Customer subscription & user accounts
  • Unlimited payment methods
  • Product tagging & tag cloud
  • Search
  • Merchandise return
  • Package tracking
  • PDF customer invoice
  • Shopping Cart recall
  • Sale of services & virtual goods
  • RSS feed
  • (etc…)

So if you feel something is not what you want, we can do customization just for you.

We can do something like:

  • Drop-down categories
  • A module for Google AdSense
  • Sideshow products list in homepage
  • Other payment getway
  • Automatic google analytics script
  • Automatic backup all products data and images
  • Super cache for high speed to view yr site
  • twitter widget
  • (etc…)
Share and Enjoy:
  • Digg
  • Twitter
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • RSS
  • HelloTxt
  • MyShare
  • MySpace
  • Add to favorites
  • PDF
  • Print

Technology : AJAX/JQuery

No Comments

AJAX (Asynchronous JavaScript + XML) is a rapidly emerging programming technique that attracts lots of attention nowadays. The improved interactivity of AJAX-powered interfaces bridges the traditional gap between Desktop and Web applications. Ability to mash-up services or functionality in a rich client allows building powerful new or improving existing web software. Well-applied AJAX is a definite advantage for any kind of web application ?from simple sites to complex and sophisticated business applications.

AJAX + SOA: Added Value for Enterprise Applications
Rich web interfaces add more value to next-generation enterprise applications designed on the progressive Services Oriented Architecture (SOA). AJAX is the advanced interface technology providing extended visual service, desktop interactivity and functionality. It adds value to SOA through better user interaction with both remote (internet, extranet) and local (intranet) enterprise applications. Adding RIA (Rich Internet Application) to existing enterprise IT infrastructure presents several benefits including operation cost savings, better control over document circulation and improved security.

AJAX Development

Rapid Development and Lifecycle Optimization
Our delivers professional full-cycle software development services from business analysis to solution implementation and support. Use of comprehensive development tools and agile development methodology helps speed up development and shorten time-to-market cycles. Proper architecture and modular approach ensures easy application maintainability and seamless integration of new functionality or 3d party components.

AJAX Frameworks and Related Technologies
Our specialists use different AJAX frameworks that let focus on application’s unique aspects by streamlining routing tasks. This helps increase developers?productivity and accelerate development cycles

  • jQuery
  • ExtJS

We have solid experience with various AJAX related technologies including

  • XHTML and CSS
  • Document Object Model
  • XML / XSLT / Xpath
  • XForms
  • JavaScript

Standards Compliance
While developing web user interfaces we support the leading industry standards and browser technologies.

  • Cross Browser Support:Internet Explorer 6+, Mozilla FireFox 1.0+, Opera 9+, Safari 2+ and others
  • Compatibility: Compliance with W3C standards: XHTML 1.0 or HTML 4.01., CSS 2.1
  • Accessibility: Section 508 standard and W3C WCAG compatibility
Share and Enjoy:
  • Digg
  • Twitter
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • RSS
  • HelloTxt
  • MyShare
  • MySpace
  • Add to favorites
  • PDF
  • Print

Technology : PHP

No Comments

LAMP (Linux/Apache/MySQL/PHP) platform is an effective alternative to commercial software for building and running dynamic and high performance web systems. PHP has become one of the major players on the web development market in the last few years.

Our PHP Development

We offers expert PHP / MySQL web design and programming services for various clients needs. Depending on client specific requirements pur PHP team is capable to develop a customized LAMP-based solution from considerably small website to complex internet application. We leverage the time and cost saving advantages of open source technologies to deliver full-featured, scalable and inexpensive web solutions.

PHP Solution Expertise

  • Shopping Carts
  • Product Catalogues
  • Customer Management
  • Order Tracking
  • Credit Card Processing
  • Tax / Shipping Calculations
  • Membership Management
  • File Management (Docs and Media Files)
  • Restricted Access Areas
  • Electronic Newsletters
  • Mailing Systems
  • Integrated Search
  • Advertisement and Banner Management
  • Message Boards and Forums
  • Online Chats
  • Blogs
  • Polls and Surveys
  • Ratings and Reviews
  • Event Calendars
  • Back-end Administration Panels
  • Visitor Tracking and Website Statistics
  • Feedback Forms
  • RSS Feeds
  • Web Content Management

Weather you need to build a one-time project, find a reliable partner for your long-lasting business initiative or hire a dedicated PHP development team – we Dedicated PHP Development Group is an excellent match!

Our PHP Development Services include:

  • Custom Web Application Development
  • Database-driven Website Development
  • Legacy Applications Reengineering and Enhancement
  • PHP Migration
  • Web Services Integration
  • Web Maintenance
Share and Enjoy:
  • Digg
  • Twitter
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • RSS
  • HelloTxt
  • MyShare
  • MySpace
  • Add to favorites
  • PDF
  • Print

Older Entries Newer Entries