|
From: Andrew N. \(MHobbit\) <men...@us...> - 2005-10-24 00:56:07
|
Update of /cvsroot/mxbb/core/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1091/admin Modified Files: index.php Log Message: Added/implemented the mxBB version check... commented the beginning and end of the phpBB version check and mxBB version check code blocks... Index: index.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/index.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** index.php 23 Oct 2005 02:17:29 -0000 1.15 --- index.php 24 Oct 2005 00:55:40 -0000 1.16 *************** *** 762,766 **** } ! // Check for new phpBB version $current_phpbb_version = explode('.', '2' . $board_config['version']); $minor_phpbb_revision = (int) $current_phpbb_version[2]; --- 762,766 ---- } ! /* Begin phpBB version check code block */ $current_phpbb_version = explode('.', '2' . $board_config['version']); $minor_phpbb_revision = (int) $current_phpbb_version[2]; *************** *** 821,828 **** $phpbb_version_info .= '<p>' . $lang['Mailing_list_subscribe_reminder'] . '</p>'; ! // done with the phpBB version check for now $template->assign_vars(array( 'PHPBB_VERSION_INFO' => $phpbb_version_info, 'L_VERSION_INFORMATION' => $lang['Version_information']) --- 821,891 ---- $phpbb_version_info .= '<p>' . $lang['Mailing_list_subscribe_reminder'] . '</p>'; ! /* End phpBB version check code block */ ! ! ! /* Begin mxBB version check code block */ ! $current_mxbb_version = explode('.', $portal_config['portal_version']); ! $minor_mxbb_revision = (int) $current_mxbb_version[2]; ! ! $errno = 0; ! $errstr = $mxbb_version_info = ''; ! ! if ($fsock = @fsockopen('www.mx-system.com', 80, $errno, $errstr)) ! { ! @fputs($fsock, "GET /updatecheck/28x.txt HTTP/1.1\r\n"); ! @fputs($fsock, "HOST: www.mx-system.com\r\n"); ! @fputs($fsock, "Connection: close\r\n\r\n"); ! ! $get_info = false; ! while (!@feof($fsock)) ! { ! if ($get_info) ! { ! $mxbb_version_info .= @fread($fsock, 1024); ! } ! else ! { ! if (@fgets($fsock, 1024) == "\r\n") ! { ! $get_info = true; ! } ! } ! } ! @fclose($fsock); ! ! $mxbb_version_info = explode("\n", $mxbb_version_info); ! $latest_mxbb_head_revision = (int) $mxbb_version_info[0]; ! $latest_mxbb_minor_revision = (int) $mxbb_version_info[2]; ! $latest_mxbb_version = (int) $mxbb_version_info[0] . '.' . (int) $mxbb_version_info[1] . '.' . (int) $mxbb_version_info[2]; ! ! if ($minor_mxbb_revision == $latest_mxbb_minor_revision) ! { ! $mxbb_version_info = '<p style="color:green">' . $lang['mxBB_Version_up_to_date'] . '</p>'; ! } ! else ! { ! $mxbb_version_info = '<p style="color:red">' . $lang['mxBB_Version_outdated']; ! $mxbb_version_info .= '<br />' . sprintf($lang['mxBB_Latest_version_info'], $latest_mxbb_version) . sprintf($lang['mxBB_Current_version_info'], $portal_config['portal_version']) . '</p>'; ! } ! } ! else ! { ! if ($errstr) ! { ! $mxbb_version_info = '<p style="color:red">' . sprintf($lang['Connect_socket_error'], $errstr) . '</p>'; ! } ! else ! { ! $mxbb_version_info = '<p>' . $lang['Socket_functions_disabled'] . '</p>'; ! } ! } ! ! $mxbb_version_info .= '<p>' . $lang['mxBB_Mailing_list_subscribe_reminder'] . '</p>'; ! ! /* End mxBB version check code block */ $template->assign_vars(array( + 'MXBB_VERSION_INFO' => $mxbb_version_info, 'PHPBB_VERSION_INFO' => $phpbb_version_info, 'L_VERSION_INFORMATION' => $lang['Version_information']) |