Monday, February 9, 2009

Hire Zencart developer

At Virtueinfo we have a talented pool of Zencart developers that are always ready to work with complete dedication on the given assignment. They all are certified from reputed Universities and colleges. We have different level of Zencart Developers as per your budget, time and requirements.

Good Communication, prompt reply and regular communication and availability are some of the highlight of the Zencart dedicated developers we provide.

You can have developer, who can update you for your Zencart project on daily basis, weekly basis as and when you want. You can communicate to developer through any IM that you are comfortable with.

All the developers are Degree Holders from a reputed University so they are having good logic as well as good IQ, good understanding of your requirements, explanation skills and English communication are some of the added advantage.

At virtue info an offshore web development company we offer Zencart Developers to hire, Zencart Development, Zencart Customization within your budget and time.

For a complete quote for Zencart Development, Zencart Customization and to hire Zencart developer requirements, contact us at info@virtueinfo.com.

We are proud of our professional proficiency and confident to meet each of your professional necessities.

Get ready to experience excellence with us!

Monday, February 2, 2009

Add/delete to/from buddylist snippet

PLEASE NOTE! These snippets are user submitted. It is impossible to check them all, so please 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.

Description

This php snippet inserts the ADD TO BUDDYLIST link

Dependencies: buddylist.module must be installed and enabled. The snippet checks to see if the user viewing the profile page has the access permission to maintain buddy list before displaying the link

Usage

  • For use in your 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
  • Change the div class name or the link text to suit.
global $user;
if (
$user->uid != $account->uid) {
if (@
in_array($account->uid, array_keys(buddylist_get_buddies($user->uid))) && user_access('maintain buddy list')) {
print
l(t('Remove !username from your buddylist',array('!username' => $account->name)), 'buddy/delete/'. $account->uid);
}
else {
if (
$account->uid != $user->uid && user_access('maintain buddy list')) {
print
l(t('Add !username to your buddylist',array('!username' => $account->name)), 'buddy/add/'. $account->uid);
}
}
}
?>

Several people I know are

pribeh - February 22, 2008 - 01:50

Several people I know are reporting that this doesn't work past 5.3. And I don't know why.

Would be nice to know how to get this to work in a block as well. Someone posted this as a starting point but I don't know php.

$uid = arg(1); // second part of the path user/1 on user profile page
Loading a user:
$account = user_load(array('uid' => $uid));
Get the name:
$name = $account->name;
?>

Any help would be uber appreciated. I currently don't have a way other than the template fix for my users to add buddies.

With the help of a few

pribeh - February 26, 2008 - 03:01

With the help of a few others the following code seems to do the trick:


if (@in_array($account->uid, array_keys(buddylist_get_buddies($user->uid))) && user_access('maintain buddy list')) {
print
".$account->uid."\">Remove " .$account->name. " from your buddylist";
}
else {
if (
$user->uid != $account->uid && user_access('maintain buddy list')) {
print
".$account->uid."\">Add " .$account->name. " to your buddylist";
}
}
?>

Make sure to specify this at the beginning of your user_profile.tpl.php:

global $user;
?>

and also make sure to specify your code in template.php to focus on $account (the profile being viewed) as opposed to $user (logged-in user viewing profile):

/**
* Catch the theme_user_profile function, and redirect through the template api
*/
function phptemplate_user_profile($account, $fields = array()) {
// Pass to phptemplate, including translating the parameters to an associative array. The element names are the names that the variables
// will be assigned within your template.
/* potential need for other code to extract field info */
return _phptemplate_callback('user_profile', array('account' => $account, 'fields' => $fields));
}
}

The above code was taken from Muslim Guy's posts and modified by Nevets.

Inserting image as link to Add or Delete from your buddylist

merto@drupal.org - July 21, 2008 - 13:59

These will override theme_user_profile and will insert image as link to Remove or Add to my buddylist below user_picture without calling _phptemplate_callback. It will also give me the flexibility to style all category name.

function phptemplate_user_profile($account, $fields) {
$output = '
';
$output .= '
';
$output .= theme('user_picture', $account);
global
$user;
if (
in_array($account->uid, array_keys(buddylist_get_buddies($user->uid))) && user_access('maintain buddy list')) {
$output .= l(theme('image', drupal_get_path('module', 'buddylist') .'/images/user_delete.png', t('Remove')), 'buddy/delete/' . $account->uid, array('title'=>t('remove from my buddylist')),drupal_get_destination(), NULL, NULL, TRUE, TRUE);
}
else {
if (
$user->uid != $account->uid && user_access('maintain buddy list')) {
$output .= l(theme('image', drupal_get_path('module', 'buddylist') .'/images/user_add.png', t('Add')),'buddy/add/' . $account->uid, array('title'=>t('add to my buddylist')),drupal_get_destination(), NULL, NULL, TRUE, TRUE);
}
}

$output .= '
'
;
$output .= '
';

foreach (
$fields as $category => $items) {
$category = str_replace(" ", "-", $category);
if (
strlen($category) > 0) {
$output .= '
. check_plain($category ). '">';
$output .= '

'. check_plain($category) .'

'
;
}

foreach (
$items as $item) {
if (isset(
$item['title'])) {
$output .= '
. $item['class'] .'">'. $item['title'].' :' .'
'
;
}
$output .= '
. $item['class'] .'">'. $item['value'] .'
'
;
}
$output .= '
'
;
}
$output .= '
'
;
$output .= '
'
;

return
$output;
}
?>

Buddylist 2

tucspl - May 28, 2008 - 18:39

In order to get this to work for buddylist 2, try this snippet (this goes in your user_profile.tpl.php):

if ($GLOBALS['user']->uid != $user->uid): ?>
//load all buddies from active user
$userbuddies = buddy_api_get_buddies($user->uid);
//buddylist links
if ($GLOBALS['user']->uid != $user->uid && user_access('maintain buddy list')) {
in_array($user->uid, array_keys($userbuddies)) ? print l(t('Remove @username from your contact list',array('@username'=>$user->name)), 'buddy/delete/'.$user->uid, array(), drupal_get_destination(), NULL, FALSE, FALSE) : print l(t('Add @username to your contact list',array('@username'=>$user->name)), 'buddy/add/'.$user->uid, array(), drupal_get_destination(), NULL, FALSE, FALSE);
}
?>

endif; ?>

Note: If used the snippet on this page (the comment above this comment) to replace $user with $account in your template.php, replace that snippet with this (this goes in template.php):

/**
* Catch the theme_user_profile function, and redirect through the template api
*/
function phptemplate_user_profile($user, $fields = array()) {
// Pass to phptemplate, including translating the parameters to an associative array. The element names are the names that the variables
// will be assigned within your template.
/* potential need for other code to extract field info */
return _phptemplate_callback('user_profile', array('user' => $user, 'fields' => $fields));
}
?>

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; ?>