Skip to content
TORNLIFE More

Forum typos

Started by CastleQueen [1735522] on in Bugs & Issues.

6 replies · 47 views · thread synced · 7 days ago · View on torn.com
About this thread

Posts archived: 7 / 7 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
7
Discussion span
→
People posting
6
Likes on archived posts
4
Posts by staff, officers and moderators
2
Authority score
58 / 100
Historical score
35 / 100
Story score
38 / 100
Engagement score
45 / 100

Most-liked replies

ebcdic [1757971]

echo 'You have bought 8 ', pluralize('Xanax', 8), ' from the bazaar.';
>> You have bought 8 Xanaxs from the bazaar.

echo 'You sent 5 ', pluralize('Pack of bonbons', 5), ' to Phoexz.';
>> You sent 5 Pack of bonbonss to Phoexz..


Pnoexz [1504330]

function pluralizeDate($text, $amount = 0) {
return $text . ((int) $amount !== 1) ? 's' : '';
}

function pluralizeItems($item, $amount) {
$name = strtolower($item->name);
$plurals = array(
'xanax' => 'xanax',
'pack of bonbons' => 'packs of bonbons',
'knife' => 'knives'
);

if ((int) $amount === 1)
return $amount . ' ' . $name;

$pluralized = (isset($plurals[$name])) ? $plurals[$name] : $name . 's';

return $amount . ' ' . $pluralized;
}