| 1 |
<?php |
<?php |
| 2 |
/* $Id: wishlist.module,v 1.45 2008/01/26 23:05:37 smclewin Exp $ */ |
/* $Id: wishlist.module,v 1.45.2.1 2008/03/01 06:11:16 smclewin Exp $ */ |
| 3 |
// Wishlist management module for Drupal |
// Wishlist management module for Drupal |
| 4 |
// Written by Scott McLewin and Melanie Paul-McLewin |
// Written by Scott McLewin and Melanie Paul-McLewin |
| 5 |
// drupal AT mclewin DOT com |
// drupal AT mclewin DOT com |
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
// Random value to pass into drupal_get_token()/drupal_valid_token() to protect action oriented URLs. |
| 10 |
|
define(WISHLIST_SEC_TOKEN_VALUE, 'ajf8e7yf8723r4rhdcmfhai23746yfn,cjfy'); |
| 11 |
|
define(WISHLIST_SEC_TOKEN_NAME, 'wlatkn'); // WishListActionToKeN - just a somewhat meaningful string that is likely to be unique. |
| 12 |
|
|
| 13 |
|
|
| 14 |
/** PHP4 compatibliibility **/ |
/** PHP4 compatibliibility **/ |
| 15 |
if (!function_exists("stripos")) { |
if (!function_exists("stripos")) { |
| 16 |
function stripos($str,$needle) { |
function stripos($str,$needle) { |
| 170 |
if($node->item_quantity_purchased < $node->item_quantity_requested) { |
if($node->item_quantity_purchased < $node->item_quantity_requested) { |
| 171 |
$links['wishlist_get_this_gift'] = array( |
$links['wishlist_get_this_gift'] = array( |
| 172 |
'title' => t('Get this gift'), |
'title' => t('Get this gift'), |
| 173 |
'href' => "wishlist/item/$node->nid/purchase" |
'href' => "wishlist/item/$node->nid/purchase", |
| 174 |
|
'query' => array(WISHLIST_SEC_TOKEN_NAME => drupal_get_token(WISHLIST_SEC_TOKEN_VALUE)), |
| 175 |
); |
); |
| 176 |
} |
} |
| 177 |
} else if(!$user->uid) { |
} else if(!$user->uid) { |
| 728 |
} |
} |
| 729 |
$rows[] = array( |
$rows[] = array( |
| 730 |
array("data" => $wishlist_purch->wishlist_purch_quantity), |
array("data" => $wishlist_purch->wishlist_purch_quantity), |
| 731 |
array("data" => l($action_str, "wishlist/item/$node->nid/return/$wishlist_purch->wishlist_purch_wid")) |
array("data" => l($action_str, "wishlist/item/$node->nid/return/$wishlist_purch->wishlist_purch_wid", array('query' => array(WISHLIST_SEC_TOKEN_NAME => drupal_get_token(WISHLIST_SEC_TOKEN_VALUE))))) |
| 732 |
); |
); |
| 733 |
|
|
| 734 |
} |
} |