--- stock.module 2008-08-22 17:21:15.000000000 -0500 +++ stock_new.module 2008-08-22 17:23:01.000000000 -0500 @@ -45,6 +45,15 @@ function stock_admin_settings() { '#description' => t('The text in the navigation link which points to the stock quote page.'), ); + $form['stock_block_default_symbols'] = array( + '#type' => 'textfield', + '#title' => t('Block default symbols'), + '#default_value' => variable_get('stock_block_default_symbols', ''), + '#size' => 40, + '#maxlength' => 255, + '#description' => t('Default stock symbols to display in the block when the user has no stocks defined. Separate each stock symbol with a space.'), + ); + return system_settings_form($form); } @@ -180,12 +189,21 @@ function stock_contents($format = 'block if ( $user->uid ) { // get the stored tickers $symbols = stock_get_user_quotes(); + if (!isset($symbols) || strlen($symbols) == 0) { + $symbols = variable_get('stock_block_default_symbols', ''); + } // get the quotes $output = stock_do_quote('short', $symbols); } else { - $output = l('Login', 'user/login') .' or '. l('register', 'user/register') .' for portfolio.'; + $symbols = variable_get('stock_block_default_symbols', ''); + if (strlen($symbols) > 0) { + $output = stock_do_quote('short', $symbols); + } + else { + $output = l('Login', 'user/login') .' or '. l('register', 'user/register') .' for portfolio.'; + } } break;