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

Birthdays by Niels MOD conversion issue

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Resolution: Fixed
    • Affects Version/s: 3.0.x
    • Fix Version/s: None
    • Component/s: phpBB 2.0 convertor
    • Labels:
      None
    • Environment:
      PHP Environment:
      Database:

      Description

      It looks like conversion of Birthdays by Niels MOD is not correct. Default phpBB3 birthdays values format doesn't contain leding zero, i.e.

      2- 8-1970

      meanwhile converter produces leading zeros since date() function format

      return gmdate('d-m-Y', $birthday * 86400 + 1);

      So some converted birthdays (like 02-08-1970) won't be shown on index because of select query in index.php

      WHERE user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%'

      Suggested fix (for instance):

      OPEN
      install\convertors\functions_phpbb20.php
       
      FIND
      		// The birthday mod from niels is using this code to transform to day/month/year
      		return gmdate('d-m-Y', $birthday * 86400 + 1);
       
      REPLACE WITH
      		$month =  gmdate('n', $birthday * 86400 + 1);
      		$day = gmdate('j', $birthday * 86400 + 1);
      		$year = gmdate('Y', $birthday * 86400 + 1);
      		return sprintf('%2d-%2d-%4d', $day, $month, $year);

      The fix can be simplified in some way for sure - it's just to show the thought

        Attachments

          Activity

            People

            Assignee:
            ToonArmy ToonArmy [X] (Inactive)
            Reporter:
            rxu rxu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: