You are here

function birthdays_get_starsign_image in Birthdays 6

Same name and namespace in other branches
  1. 5 birthdays.module \birthdays_get_starsign_image()

Return the picture of a starsign, given the name. Links to Yahoo! when option is selected.

Parameters

string starsign: name of the starsign to show (not translated)

int $show: Show starsigns for values > 0

Return value

string HTML of a picture link to Yahoo horoscopes

3 calls to birthdays_get_starsign_image()
birthdays_profile_alter in ./birthdays.module
Alter the way the birthday is shown. This is fired after every module has filled the profile.
template_preprocess_birthdays_block in ./birthdays.module
Preprocess variables to format the birthdays block.
template_preprocess_birthdays_page in ./birthdays.page.inc
Preprocess variables to format the birthdays page.

File

./birthdays.module, line 920
The Birthdays module allows users to add their birthday to their profile. It lists birthdays on a seperate page and in different blocks. Users can receive an e-mail on their birthday automatically, and the administrator can receive daily reminders of…

Code

function birthdays_get_starsign_image($starsign, $show = BIRTHDAYS_STARSIGN_OFF) {
  $output = '';

  // Only show starsign when enabled
  if ($show > BIRTHDAYS_STARSIGN_OFF && !empty($starsign)) {

    // Image based on thme path.
    $output = '<img src="' . base_path() . drupal_get_path('module', 'birthdays') . '/starsigns/' . $starsign . '.gif" alt="' . t($starsign) . '" />';

    // If link should be shown: update $output
    if ($show == BIRTHDAYS_STARSIGN_LINK) {
      $output = '<a href="http://astrology.yahoo.com/astrology/general/dailyoverview/' . $starsign . '" target="_blank" title="' . t($starsign) . '">' . $output . '</a>';
    }
  }

  // Return HTML
  return $output;
}