|
Revision 75, 1.3 KB
(checked in by dez, 7 years ago)
|
|
Uses new crate images for bananas
|
| Line | |
|---|
| 1 | <?php |
|---|
| 2 | function smarty_function_bananaprint($params, &$smarty) { |
|---|
| 3 | $output = ""; |
|---|
| 4 | $score = $params['score']; |
|---|
| 5 | if ($score > 0) { |
|---|
| 6 | while ($score >= 50) { |
|---|
| 7 | $output .= " <img src=\"/images/bananas/banana-crate.png\" width=\"92\" height=\"64\" alt=\"50\" title=\"Crate of 50 Bananas\" />\n"; |
|---|
| 8 | $score -= 50; |
|---|
| 9 | } |
|---|
| 10 | while ($score >= 5) { |
|---|
| 11 | $output .= " <img src=\"/images/bananas/banana-bunch.png\" alt=\"5\" width=\"64px\" height=\"64px\" title=\"Bunch of 5 Bananas\" />\n"; |
|---|
| 12 | $score -= 5; |
|---|
| 13 | } |
|---|
| 14 | while ($score > 0) { |
|---|
| 15 | $output .= " <img src=\"/images/bananas/banana-one.png\" alt=\"1\" width=\"25px\" height=\"64px\" title=\"1 Banana\" />\n"; |
|---|
| 16 | $score -= 1; |
|---|
| 17 | } |
|---|
| 18 | }else { |
|---|
| 19 | while ($score <= -50) { |
|---|
| 20 | $output .= " <img src=\"/images/bananas/banana-g-crate.png\" width=\"92\" height=\"64\" alt=\"-50\" title=\"Crate of 50 Green Bananas\" />\n"; |
|---|
| 21 | $score += 50; |
|---|
| 22 | } |
|---|
| 23 | while ($score <= -5) { |
|---|
| 24 | $output .= " <img src=\"/images/bananas/banana-g-bunch.png\" alt=\"-5\" width=\"64px\" height=\"64px\" alt=\"5\" title=\"Bunch of 5 Green Bananas\" />\n"; |
|---|
| 25 | $score += 5; |
|---|
| 26 | } |
|---|
| 27 | while ($score < 0) { |
|---|
| 28 | $output .= " <img src=\"/images/bananas/banana-g-one.png\" alt=\"-1\" width=\"25px\" height=\"64px\" alt=\"*\" title=\"1 Green Banana\" />\n"; |
|---|
| 29 | $score += 1; |
|---|
| 30 | } |
|---|
| 31 | } |
|---|
| 32 | |
|---|
| 33 | return $output; |
|---|
| 34 | } |
|---|
| 35 | ?> |
|---|