| 1 |
<?php |
<?php |
| 2 |
|
|
| 3 |
//$Id: stock.module,v 1.17.2.3.2.1 2007/02/05 15:30:54 oadaeh Exp $ |
//$Id: stock.module,v 1.17.2.3.2.2 2008/07/18 23:47:24 kbahey Exp $ |
| 4 |
|
|
| 5 |
// Copyright 2004-2005 Khalid Baheyeldin http://2bits.com |
// Copyright 2004-2005 Khalid Baheyeldin http://2bits.com |
| 6 |
|
|
| 45 |
'#description' => t('The text in the navigation link which points to the stock quote page.'), |
'#description' => t('The text in the navigation link which points to the stock quote page.'), |
| 46 |
); |
); |
| 47 |
|
|
| 48 |
|
$form['stock_block_default_symbols'] = array( |
| 49 |
|
'#type' => 'textfield', |
| 50 |
|
'#title' => t('Block default symbols'), |
| 51 |
|
'#default_value' => variable_get('stock_block_default_symbols', ''), |
| 52 |
|
'#size' => 40, |
| 53 |
|
'#maxlength' => 255, |
| 54 |
|
'#description' => t('Default stock symbols to display in the block when the user has no stocks defined. Separate each stock symbol with a space.'), |
| 55 |
|
); |
| 56 |
|
|
| 57 |
return system_settings_form($form); |
return system_settings_form($form); |
| 58 |
} |
} |
| 59 |
|
|
| 189 |
if ( $user->uid ) { |
if ( $user->uid ) { |
| 190 |
// get the stored tickers |
// get the stored tickers |
| 191 |
$symbols = stock_get_user_quotes(); |
$symbols = stock_get_user_quotes(); |
| 192 |
|
if (!isset($symbols) || strlen($symbols) == 0) { |
| 193 |
|
$symbols = variable_get('stock_block_default_symbols', ''); |
| 194 |
|
} |
| 195 |
|
|
| 196 |
// get the quotes |
// get the quotes |
| 197 |
$output = stock_do_quote('short', $symbols); |
$output = stock_do_quote('short', $symbols); |
| 198 |
} |
} |
| 199 |
else { |
else { |
| 200 |
$output = l('Login', 'user/login') .' or '. l('register', 'user/register') .' for portfolio.'; |
$symbols = variable_get('stock_block_default_symbols', ''); |
| 201 |
|
if (strlen($symbols) > 0) { |
| 202 |
|
$output = stock_do_quote('short', $symbols); |
| 203 |
|
} |
| 204 |
|
else { |
| 205 |
|
$output = l('Login', 'user/login') .' or '. l('register', 'user/register') .' for portfolio.'; |
| 206 |
|
} |
| 207 |
} |
} |
| 208 |
break; |
break; |
| 209 |
|
|