You are here

function birthdays_get_starsign_image in Birthdays 5

Same name and namespace in other branches
  1. 6 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

2 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.
theme_birthdays_page in ./birthdays.module
@desc Theme a birthdays page

File

./birthdays.module, line 1375
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(ucfirst($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(ucfirst($starsign)) . '">' . $output . '</a>';
    }
  }

  // Return HTML
  return $output;
}