mktime errors after 4.2.2 upgrade php 5.4.17

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kushal
    Member
    • May 2006
    • 33
    • 4.2.X

    [Forum] mktime errors after 4.2.2 upgrade php 5.4.17

    Dear all,


    Apart from errors for vbseo following errors appear over after our upgrade. The host advice to use time function instead of mktime. Any suggestion how we can get it corrected?

    Warning: mktime(): You should be using the time() function instead in ..../includes/class_core.php(4715) : eval()'d code on line 1

    Professional Community Setup Solutions
    vBaid.com: vBulletin Users
    Invisionaid.com: IPB Users
  • Zachery
    Former vBulletin Support
    • Jul 2002
    • 59097

    #2
    What happens when you disable your third party addons?

    Comment

    • kushal
      Member
      • May 2006
      • 33
      • 4.2.X

      #3
      No change.. Only the message from vbseo errors dissapear. This error remains the same. I tried uploading the files in ASCII mode too but no use.
      Professional Community Setup Solutions
      vBaid.com: vBulletin Users
      Invisionaid.com: IPB Users

      Comment

      • Pogo
        Senior Member
        • May 2001
        • 569

        #4
        Disable all your in vBulletin configured ads and notices and try again.
        this is my sig

        Comment

        • kushal
          Member
          • May 2006
          • 33
          • 4.2.X

          #5
          Yes the issue with time goes away. What is the work around? Will we have to disable the ads completely? Also our vbseo errors don't go away. Warning: Non-static method vBSEO_Storage:ath() should not be called statically in ..../vbseo/includes/functions_vbseo_pre.php on line 387 Warning: Non-static method vBSEO_Storage:ath() should not be called statically in ..../vbseo/includes/functions_vbseo_pre.php on line 387
          Professional Community Setup Solutions
          vBaid.com: vBulletin Users
          Invisionaid.com: IPB Users

          Comment

          • Pogo
            Senior Member
            • May 2001
            • 569

            #6
            You can try to change mktime() and gmmktime() to time() in includes/functions_ad.php and includes/functions_notice.php.

            mktime() and gmmktime() are both used once in each file. So all in all you need to make 4 changes.
            this is my sig

            Comment

            • kushal
              Member
              • May 2006
              • 33
              • 4.2.X

              #7
              Ok thanks shall do. Also any help in vbseo issue why it got broke in 4.2.2?
              Professional Community Setup Solutions
              vBaid.com: vBulletin Users
              Invisionaid.com: IPB Users

              Comment

              • Mark.B
                vBulletin Support
                • Feb 2004
                • 24286
                • 6.0.X

                #8
                Originally posted by kushal
                Ok thanks shall do. Also any help in vbseo issue why it got broke in 4.2.2?
                We can't provide for support for vBSEO, it's not our code. Sorry.
                Last edited by Mark.B; Wed 9 Oct '13, 4:39am.
                MARK.B
                vBulletin Support
                ------------
                My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
                My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

                Comment

                • kushal
                  Member
                  • May 2006
                  • 33
                  • 4.2.X

                  #9
                  Yes I know, if there is something you can point me to as to what us the fundamental change that happened from 4.1 to 4.2 that broke vbseo existing code, I shall be better able to isolate the issue Thanks
                  Professional Community Setup Solutions
                  vBaid.com: vBulletin Users
                  Invisionaid.com: IPB Users

                  Comment

                  • kushal
                    Member
                    • May 2006
                    • 33
                    • 4.2.X

                    #10
                    Changing the value in both the file didn't work. I changed the gmmtime and mtime to to simply time(). Same errors persist.
                    Professional Community Setup Solutions
                    vBaid.com: vBulletin Users
                    Invisionaid.com: IPB Users

                    Comment

                    • demios
                      New Member
                      • Sep 2006
                      • 7
                      • 3.5.x

                      #11
                      To fix the error with VBSEO you need to:

                      1) edit /vbseo/includes/functions_vbseo-pre.php
                      2) on line 181 find: function path($type = '')
                      3) replace with: public static function path($type = '')
                      4) save file.

                      Done

                      Comment

                      • kushal
                        Member
                        • May 2006
                        • 33
                        • 4.2.X

                        #12
                        The vbseo errors resolved with update to 3.6.1 from 3.6.0

                        Thanks for the help
                        Professional Community Setup Solutions
                        vBaid.com: vBulletin Users
                        Invisionaid.com: IPB Users

                        Comment

                        • eam
                          Senior Member
                          • Sep 2004
                          • 133

                          #13
                          Originally posted by Pogo
                          You can try to change mktime() and gmmktime() to time() in includes/functions_ad.php and includes/functions_notice.php.

                          mktime() and gmmktime() are both used once in each file. So all in all you need to make 4 changes.
                          I also made the prescribed changes and it did not clear up the problem. I noticed there are more than one of each in each file.

                          In functions_ad.php:

                          Code:
                          {
                                                      if ($criteria['condition3'])
                                                      {
                                                          $conditional_prefix .= '<vb:if condition="$now = gmmktime()"></vb:if>';
                                                          $conditional_prefix .= '<vb:if condition="$end = gmmktime(' . $end_time[1] . ',' . $end_time[2] . ')"></vb:if>';
                                                          $conditional_prefix .= '<vb:if condition="$start = gmmktime(' . $start_time[1] . ',' . $start_time[2] . ')"></vb:if>';
                                                      }
                                                      else
                                                      {
                                                          $conditional_prefix .= '<vb:if condition="$now = mktime()"></vb:if>';
                                                          $conditional_prefix .= '<vb:if condition="$end = mktime(' . $end_time[1] . ',' . $end_time[2] . ') + $vboptions[\'hourdiff\']"></vb:if>';
                                                          $conditional_prefix .= '<vb:if condition="$start = mktime(' . $start_time[1] . ',' . $start_time[2] . ') + $vboptions[\'hourdiff\']"></vb:if>';
                                                      }
                                                      $conditional_prefix .= '<vb:if condition="$now >= $start AND $now <= $end">';
                                                      $conditional_postfix .= '</vb:if>';
                                                  }
                          in functions_notice.php:

                          Code:
                                                  {
                                                      $start = mktime($start_time[1], $start_time[2]) + $vbulletin->options['hourdiff'];
                                                      $end   = mktime($end_time[1], $end_time[2]) + $vbulletin->options['hourdiff'];
                                                      $now   = mktime() + $vbulletin->options['hourdiff'];
                                                  }
                                                  else // utc
                                                  {
                                                      $start = gmmktime($start_time[1], $start_time[2]);
                                                      $end   = gmmktime($end_time[1], $end_time[2]);
                                                      $now   = gmmktime();
                                                  }
                          Would it help to change *all* references of mktime and gmmktime to time? I don't want to just do it without checking.

                          Otherwise, what else can be done here?

                          Comment

                          • eam
                            Senior Member
                            • Sep 2004
                            • 133

                            #14
                            I had my ads set to display at certain times and I turned that off and changed it to display always if no criteria are set and that seems to have cleared the errors. I decided that I didn't really need to have them display only at certain times, but if anyone has a time-based criteria specified for an ad and it's active they will probably get this error until there is a fix.

                            Comment

                            widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                            Working...