Announcement

Collapse
No announcement yet.

mktime errors after 4.2.2 upgrade php 5.4.17

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [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

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

    Comment


    • #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


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

        Comment


        • #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


          • #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


            • #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


              • #8
                Originally posted by kushal View Post
                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 9th Oct '13, 4:39am.
                MARK.B | vBULLETIN SUPPORT

                TalkNewsUK - My vBulletin 5.5.2 Demo
                AdminAmmo - My Cloud Demo

                Comment


                • #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


                  • #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


                    • #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


                      • #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


                        • #13
                          Originally posted by Pogo View Post
                          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


                          • #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...
                            X