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

Move birthday list logic into templates

    XMLWordPrintable

Details

    • Task
    • Status: Unverified Fix (View Workflow)
    • Minor
    • Resolution: Fixed
    • 3.0.8
    • 3.1.0-a1
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: