Thursday, January 29, 2009

Magento a hope that will change the world....

Magento is a feature-rich eCommerce platform offering complete flexibility and control over the look, content and functionality
of an online store.

Key Features :-

Site Management
Control multiple websites and stores from one Administration Panel with ability to share as much or as little information as needed
Web Services API for easy integration between Magento and any third-party application

Marketing Promotions and Tools
Flexible Coupons (pricing rules) with ability to restrict to stores, customer groups, time period, products, and categories.

International Support
Multi-Lingual
Support for Multiple Currencies

Shipping
Shipping to multiple addresses in one order

Customer Accounts
Re-orders from account

Catalog Management
Batch Import and Export of catalog

Catalog Browsing

Layered / Faceted Navigation for filtering of products
Product comparisons

Wednesday, January 28, 2009

About symfony 1.3

Two years ago, it was about to release symfony 1.0. Since then, released symfony 1.1 in June 2008 and symfony 1.2 just two months ago. The 1.1 version of the framework was a major upgrade with a lot of changes to the internals. The 1.2 version finished the transition from the old form system to the new one with the new admin generator, and of course also came with its batch of other goodies.

Some time ago, Tim Ariyeh wrote a tweet about what he thinks about the latest releases:

"I think it's time we all admitted that symfony 1.2 should have been 2.0, and 1.1 should never have happened."

He is quite right, sometimes, we make mistakes. But this is now history and I'm quite happy with the state of symfony 1.2. The internals of symfony are rock solid, well decoupled, and easy to extend. It Now even support Doctrine natively. The documentation has also been updated accordingly with a new book, and a lot of new cookbook tutorials.
What?

First, don't expect big revolutions for symfony 1.3. The 1.3 release will be an evolution of the actual code base, made of polish, small enhancements, and optimisations. That means that one of the most important goal for symfony 1.3 is compatibility with 1.2. The tries are being done to ease the process of upgrading as much as possible. According to the symfony website statistics, symfony 1.2 is already, and by far, the most downloaded symfony version. And the Jobeet tutorial, which is based on symfony 1.2, has generated more than one million page views in less than two months.

You can now add your own ideas and vote for the ones you want to see implemented on a user voice page.

OUTDATED: Display user submitted images in their profile page

description

This snippet will display the thumbnail images of the most N most recently submitted images by the user. You can also optionally limit the images selected based on taxonomy term id's (see snippet for details)

instructions

  1. In a text editor paste the following snippet into your user_profile.tpl.php file
    (For instructions on how to get started with your own custom user profile layout click through to the Customising the user profile layout handbook page.)
  2. Upload your edited user_profile.tpl.php to your active theme folder
// Display N most recent thumbnails of images submitted by the user
// Each thumbnail is linked back to it's image node
// Can optional limit the photos shown by specififying one or taxonomy term id's

// The number of thumbnail images to show
$nlimit = 3;
$taxo_id = array();
// Add one line for each taxonomy term id you want to limit the thumbnails to
// As an example, the following two lines would select images associated with taxonomy terms 36 OR 37
// $taxo_id[] = 36;
// $taxo_id[] = 37;
// Note, if not taxonomy term ids are specified, the selection is from all the user submitted images

$userid=$user->uid;

if (
count($taxo_id) > 0 ) {
// Limit images based on taxonomy term id's
$taxo_str = implode(',', $taxo_id);
$sql = "SELECT n.created, n.title, n.nid, n.changed FROM node n INNER JOIN term_node ON n.nid = term_node.nid AND term_node.tid IN ($taxo_str) WHERE n.type = 'image' AND n.uid = $userid AND n.status = 1 ORDER BY n.changed DESC";
}
else {
$sql = "SELECT n.created, n.title, n.nid, n.changed FROM node n WHERE n.type = 'image' AND n.uid = $userid AND n.status = 1 ORDER BY n.changed DESC";
}

$result = db_query_range($sql, 0, $nlimit);
$output = '';
while (
$info = db_fetch_object($result) ) {
$node = node_load(array('nid' => $info->nid));
$img_tag = image_display($node, 'thumbnail');
$link = 'node/' . $node->nid;
$output .= l($img_tag, $link, array(), NULL, NULL, FALSE, TRUE);
}
print
$output;
?>

Tuesday, January 27, 2009

Who Wants a Free Web Application?

Looking for something to do with all that brain power? We're happy to announce an upcoming community event that will harness the power of the symfony community toward a variety of social causes. Help us get the word out!

This event will take on the basic structure of other 48 hour web application development competitions, such as Rails Rumble, but with a special twist unique to symfony. The applications we create during the course of the competition will be gifted to different socially-minded organizations around the world. Once the fun is over, our work will live on and hopefully do a lot of good.

A Call for Causes

The first thing we need is to determine who we're working for. If you are or know of a socially-minded organization that could benefit from an interactive web application, we want to hear from you.

Please submit a brief proposal for the application you would like built that includes the following:

  • A description of your organization (200 words or less)
  • A description of the application you would like built (400 words or less)

Please keep in mind these applications will be built in 48 hours or less by small development teams. If you're not sure how to gauge the effort involved in you proposal, just send in your idea and we'll help refine a reasonable scope.

Display recent nodes (titles & teasers) snippet

Description

This php snippet displays the 10 most recent nodes submitted by the user, restricting certain node types. In this example, pages, stories, and forum posts are excluded from the list.

Usage

• For use in a user profile page override
• Using a text editor like NOTEPAD.EXE or an equivalent, copy and paste the code into your user_profile.tpl.php file
• To increase/decrease the number of posts listed change the $nlimit value to suit. The default setting is 10.
• Tested and works with Drupal 4.6
• Change the div class names or the prefix text to suit.

= 10; ?>
=$user->uid; ?>
= pager_query(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.status = 1 AND n.uid = $userid AND n.type != 'page' AND n.type != 'poll' AND n.type != 'forum' AND n.type != 'story' ORDER BY n.created DESC"), variable_get('default_nodes_main', $nlimit)); ?>
while ($node = db_fetch_object($result1)) {$output2 .= node_view(node_load(array('nid' => $node->nid)), 1);}; ?>
print $output2; ?>

Friday, January 23, 2009

Customising the user profile layout

(Thanks to Dublin Drupaller for starting this section of the handbook)

The PHP Snippets below are intended for use within a customised USER PROFILE page that simply enables you to “pull” specific content from your drupal database specific to a particular user and display it in the way you want.

They are intended for use with a phptemplate based theme and for Drupal site developers who do not have php programming knowledge but want to push out the boundaries of user profile pages and control precisely how they look.

See also Advanced Profile Kit for an alternate method of sprucing up your user profile pages.

Simple step-by-step instructions are provided.
The concept

Drupal is an extremely powerful tool for building online communities, in particular, allowing users to submit their own content to a community hub. A good illustration of this working well online might be the World famous myspace.com site, where bands/artists are able to submit content into their own page.

Drupal has all the tools available to create your own myspace.com style community hub.

These snippets are intended as a mini-repository and as an aid for site designers without php programming skills to create sophisticated User Profile Pages for members of their community.

Customised User Profile Pages maybe applied to many applications. myspace.com is primarily a site for artists & bands, but, similar techniques could be used for other applications such as a rzye.com (Drupal powered community hub) style professional networking hub or terminus1525 (Drupal powered community hub) for studios.
Getting Started - (Drupal 4.x and Drupal 5.x)

Step 1 - is to override the default User Profile page layout by uploading the special template.php file to your active theme folder.

$account, ‘fields’ => $fields));
}
?>

If you already have a template.php file in your active theme folder, simply add the above to the existing template.php file and upload it.

Step 2 - (Drupal 4.x and 5.x) is to create your customised user_profile.tpl.php file and upload that to your active theme folder.

If you’re starting from scratch, simply open notepad.exe or a similar text editor and paste in the snippets linked below to build your custom user profile page. Save it with the user_profile.tpl.php filename and upload it to your theme folder along with the template.php file.

Once you have got started with your first user_profile.tpl.php file, you can experiment with adding in more snippets or including HTML layout controls to get a feel for the flexibility this allows.
Getting Started - (Drupal 6.x)

Step 1 - is to override the default User Profile page layout by uploading a custom user-profile.tpl.php* file to your active theme folder.

Drupal will automatically detect the presence of your custom user-profile.tpl.php and override the default user profile layout. To make this happen, you need to rebuild the theme registry, which you can do by clearing the caches (for example using the button on the admin/settings/performance page), or simply by visiting the admin/build/modules page.

* note that in Drupal 6.x, your custom user profile layout file name uses a hyphen, instead of an underscore.

Step 2 - is to customise your user-profile.tpl.php layout file.

By default, all user profile data is printed out with the $user_profile variable. If there is a need to break it up you can use $profile instead.

As an example, the following snippet inserted in your custom user-profile.tpl.php will display the default user profile layout.

Available variables:

* $user_profile: All user profile data. Ready for print.
* $profile: Keyed array of profile categories and their items or other data provided by modules.

To check for all available data within $profile, insert the following snippet at the bottom of your custom user-profile.tpl.php.

Available variables

The following is a list of variables that is available to your custom user-profile.tpl.php.

'. check_plain(print_r($profile, 1)) .'

‘; ?>

How to use these snippets

Simply copy and paste these snippets into your custom user profile layout file and upload it to your active theme folder. Check to make sure that the snippet you are using is compatible for the version of Drupal you are using.

It’s recommended that you test your customised user_profile.tpl.php(Drupal 4.x or Drupal 5.x) or user-profile.tpl.php file (Drupal 6.x) on a test installation before adding to a live site.
Adding new snippets

Simply click on the ADD NEW CHILD PAGE link below and create a new handbook page. Include any dependencies, such as which version of Drupal you have tested the snippet with or extra modules that need to be enabled for the snippet to work.

PLEASE NOTE! The following snippets are user submitted. Use at your own risk! For users who have setup drupal using an alternate database to the default (MYSQL), please note that the snippets may contain some database queries specific to MYSQL.

* A basic User Profile Page to help get you started
* Customising the user profile pages (a “before” and “after” example with screenshots)
* User Profile avatar/picture Snippet
* Handling single-line profile fields
* Handling multi-line profile fields
* Handling checkbox profile fields
* Handling freeform profile fields
* Handling URL profile fields
* Recent weblog entries (titles) snippet
* Recent weblog entries (titles & teasers) snippet
* Add/delete to/from buddylist snippet
* Display a list of buddies snippet
* Display list of (x) recent posts (titles) snippet
* User “history” or “member for: (time)” snippet
* Adding layout and content to the default user profile theme
* allow users to choose whether certain profile fields are visible or hidden
* Allowing users to customize their profile
* Custom User Blocks and User Tables PHP Snippets
* Customising the user profile layout per role
* Display link to user’s embedded gallery (or not if it does not exist)
* Display a customisable “this user is [online/offline]” status message in the User Profile page
* Display a user friendly text message when profile fields are left blank
* Display a user’s points value from the userpoints.module
* Display recent nodes (titles & teasers) snippet
* Displaying counts from the Invite module
* Drupal V5.x warning: Cannot add header information
* Handling date profile fields
* Howto: Make the user profile layout compact (with css only)
* Insert Subscribed Organic Groups List
* Messages for unpublished profiles
* My Comments Block for Profiles
* Outputting full civiCRM profile to custom profile
* Outputting individual CiviCRM profile fields into custom Drupal profile
* User Profile Page
* User referral module
* Weight sorting for input fields (when the user fill the form) doesn’t apply - fix
* Insert user friendly “click here to add your..” links when user profile fields are left blank
* Display a date related notice or countdown snippet
* Send private message snippet
* Display a Skype “Call me” or “leave a voicemail” button depending on Users’ online/offline status
* Display users age based on a date-of-birth field
* insert a “view your order history” and “view [username]s store” link
* Show/hide certain profile fields depending on user role or user permissions

Thursday, January 22, 2009

Remove unwanted tabs from pages

Description

Some modules add tabs to pages that are not needed for general users, or not needed at all. You may wish to link to the page in a different way, as some users don't understand that they can click on the tab above a node.

There is currently no way to alter the hook_menu() generated tabs from code, so this function will find and strip out a tab based on its name.

Step 1 of 2

Locate your theme's template.php file. If one doesn't exist create an empty one. This is where you can place customisation PHP code.

Step 2 of 2

Custom functions placed in the themes template.php file should begin with the theme name. In the code snippet below replace "yourthemename" with the actual name of your theme, such as "bluemarine".

You may already have a '_phptemplate_variables' function defined depending on what theme you are using, if so do not include the function again from the snippet below.

function _phptemplate_variables($hook, $vars = array()) {

if(
$hook == 'page') {
yourthemename_removetab('address book', $vars);
// add additional lines here to remove other tabs
}

return
$vars;
}

function
yourthemename_removetab($label, &$vars) {
$tabs = explode("\n", $vars['tabs']);
$vars['tabs'] = '';

foreach(
$tabs as $tab) {
if(
strpos($tab, '>' . $label . '<') === FALSE) {
$vars['tabs'] .= $tab . "\n";
}
}
}
?>

The tab removal work is done in the yourthemename_removetab() function, pass in a plain text tab label, along with the PHPTemplate variables, and the function will remove the tab.

In the above example snippet the 'address book' tab added by the eCommerce package is removed from the users profile page.

Notes

  • Call yourthemename_removetab('tab name', $vars); for each tab you wish to remove.
  • No other modules need to be installed to use this.