Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-10173

Move birthday list logic into templates

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.1.0-a1
    • 3.0.8
    • None
    • None

      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);
      }
      

            bantu Andreas Fischer [X] (Inactive)
            bantu Andreas Fischer [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: