Community Forum

Please read the intro before joining/posting. Thank you.

If you have questions about our software, chances are this forum has the answers.

You'll need to register before you can post on the forum to ask your question or to answer another one. A reply will be posted to each and every question that is asked so there is no need to double post or bump your post. We'll do our best to answer promptly, but in some cases it may take a day or two. If you bump your post, it may be removed. Bear with us and we'll get your question answered quickly.

Here are a few tips to help you to get your questions answered more rapidly.

IMPORTANT: Posts in English only. We don't employ translators and we'll be unable to understand your message properly and will probably delete it.
SOFTWARE: Each software has it's own forum. Software here is NOT supported. Posts about this software will be deleted. Supported software questions ONLY please.
SEARCH: Use the search option to see if your question has been answered on the forum before now or if there is an answer in the documentation of your software.
PERSONAL SUPPORT: If you have purchased a commercial version of any software, using the contact option at the licence centre ensures a faster response.
AUTO DELETION: Accounts older than 5 days, with no posts or topics, are automatically deleted. Only register if you are thinking of posting.
LINKS: Any links posted are not clickable (to deter spammers) and must be copied / pasted into your browser address bar.

            

You are not logged in.

[How To] Update existing v3.3 Main Events to PHP 7.4Posts in the Maian Events forum by SayWhatAgain
SayWhatAgain
15-05-2021 17:55:04

Hi,

recently my server updated its PHP version from 7.2 to the 7.4.18 version. In my 3.3 version of Maian Events only a few errors showed up, so I'm gonna tell you how to fix them till David don't release the new version (no rush David, take all the time you need).

You only have to edit 2 files. Remember to make a backup of the files before editing them.

1st File:

/control/classes/system/class.errors.php

Find:

function msFatalErr() {
  global $MSEH;
  $error = error_get_last();
  if ($error['type'] == E_ERROR || $error['type'] == 4) {
    $string = '[Error Code: ' . $error['type'] . '] ' . $error['message'] . linending();
    $string .= '[Date/Time: ' . date('j F Y @ H:iA') . ']' . linending();
    $string .= '[Fatal error on line ' . $error['line'] . ' in file ' . $error['file'] . ']';
    if (ERR_HANDLER_DISPLAY) {
      echo '<div style="background:#ff9999"><p style="padding:10px;color:#fff">A fatal error has occurred. For more details please view "' . ERR_HANDLER_LOG_FOLDER . '/' . FILE_FATAL_ERR_LOG_FILE . '".</div>';
    }
    $MSEH->fatalErr($string);
  }
}

and replace it with:

function msFatalErr() {
  global $MSEH;
  $error = error_get_last();
  if ((isset($error['type']) && $error['type'] == E_ERROR) || (isset($error['type']) && $error['type'] == 4)) {
    $string = '[Error Code: ' . $error['type'] . '] ' . $error['message'] . linending();
    $string .= '[Date/Time: ' . date('j F Y @ H:iA') . ']' . linending();
    $string .= '[Fatal error on line ' . $error['line'] . ' in file ' . $error['file'] . ']';
    if (ERR_HANDLER_DISPLAY) {
      echo '<div style="background:#ff9999"><p style="padding:10px;color:#fff">A fatal error has occurred. For more details please view "' . ERR_HANDLER_LOG_FOLDER . '/' . FILE_FATAL_ERR_LOG_FILE . '".</div>';
    }
    $MSEH->fatalErr($string);
  }
}


2nd file:

/control/functions.php

Find:

function mswCD($data) {
  if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
    $sybase = strtolower(@ini_get('magic_quotes_sybase'));
    if (empty($sybase) || $sybase == 'off') {
      // Fixes issue of new line chars not parsing between single quotes..
      $data = str_replace('\n', '\\\n', $data);
      return stripslashes($data);
    }
  }
  return $data;
}

and replace it with:

function mswCD($data) {
  if (function_exists('get_magic_quotes_gpc')) {
    $sybase = strtolower(@ini_get('magic_quotes_sybase'));
    if (empty($sybase) || $sybase == 'off') {
      // Fixes issue of new line chars not parsing between single quotes..
      $data = str_replace('\n', '\\\n', $data);
      return stripslashes($data);
    }
  }
  return $data;
}

And find in the same file:

function mswSQL($data) {
  if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
    $sybase = strtolower(@ini_get('magic_quotes_sybase'));
    if (empty($sybase) || $sybase == 'off') {
      $data = stripslashes($data);
    } else {
      $data = mswDAP($data);
    }
  }
  $data = ((isset($GLOBALS['___mysqli_dbcon']) && is_object($GLOBALS['___mysqli_dbcon'])) ? mysqli_real_escape_string($GLOBALS['___mysqli_dbcon'], $data) : ((trigger_error("Fix the mysqli_real_escape_string() call, this code does not work.", E_USER_ERROR)) ? "" : ""));
  return $data;
}

And replace it with:

function mswSQL($data) {
  if (function_exists('get_magic_quotes_gpc')) {
    $sybase = strtolower(@ini_get('magic_quotes_sybase'));
    if (empty($sybase) || $sybase == 'off') {
      $data = stripslashes($data);
    } else {
      $data = mswDAP($data);
    }
  }
  $data = ((isset($GLOBALS['___mysqli_dbcon']) && is_object($GLOBALS['___mysqli_dbcon'])) ? mysqli_real_escape_string($GLOBALS['___mysqli_dbcon'], $data) : ((trigger_error("Fix the mysqli_real_escape_string() call, this code does not work.", E_USER_ERROR)) ? "" : ""));
  return $data;
}

Save both files, upload them and your version of Maian Events will be ready for PHP 7.4

100% Free SoftwareSoftware Versions, Development, Docs & UpgradesHostingNewsletter
Made with in the U.K & Hong Kong

Free PHP Scripts / Responsive PHP Scripts / Lightweight PHP Scripts / White Label PHP Scripts