Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-10173

Move birthday list logic into templates

    Details

    • Type: Task
    • Status: Unverified Fix
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.8
    • Fix Version/s: 3.1.0-a1
    • Component/s: None
    • Labels:
      None

      Description

      The logic in index.php currently dictates how birthdays are delimited and also dictates that age is shown in braces. A block should rather be used to allow templates to change this behaviour.

      // Generate birthday list if required ...
      $birthday_list = '';
      if ($config['load_birthdays'] && $config['allow_birthdays'])
      {
      	$now = getdate(time() + $user->timezone + $user->dst - date('Z'));
      	[...]
      	$result = $db->sql_query($sql);
       
      	while ($row = $db->sql_fetchrow($result))
      	{
      		$birthday_list .= (($birthday_list != '') ? ', ' : '') . get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
       
      		if ($age = (int) substr($row['user_birthday'], -4))
      		{
      			$birthday_list .= ' (' . ($now['year'] - $age) . ')';
      		}
      	}
      	$db->sql_freeresult($result);
      }
      

        Attachments

          Activity

            People

            • Assignee:
              bantu Andreas Fischer
              Reporter:
              bantu Andreas Fischer
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: