예제 #1
0
function ougc_pages_output_header()
{
    global $cache;
    $plugins = $cache->read('ougc_plugins');
    if (!$plugins) {
        $plugins = array();
    }
    $info = ougc_pages_info();
    if (!isset($plugins['pages'])) {
        $plugins['pages'] = $info['versioncode'];
    }
    if ($info['versioncode'] != $plugins['pages']) {
        global $page, $ougc_pages, $lang;
        $ougc_pages->lang_load();
        $page->extra_messages['ougc_pages'] = array('message' => $lang->ougc_pages_error_update, 'type' => 'error');
    }
}
예제 #2
0
         if (!($contents = trim(file_get_contents($_FILES['local_file']['tmp_name'])))) {
             $errors[] = $lang->error_uploadfailed_nocontents;
         }
         // Delete the temporary file if possible
         unlink($_FILES['local_file']['tmp_name']);
     }
 } else {
     // UPLOAD_ERR_NO_FILE
     $errors[] = $lang->error_uploadfailed_php4;
 }
 if (empty($errors)) {
     $xml_import = array();
     $valid_version = true;
     if ($xml_import = $PL->xml_import($contents)) {
         if (!$mybb->get_input('ignore_version', 1)) {
             $info = ougc_pages_info();
             $valid_version = (double) $xml_import['versioncode'] == $info['versioncode'];
         }
         if (!$valid_version) {
             unset($xml_import);
         }
     } else {
         // try to get this as a "Page Manager" page
         require_once MYBB_ROOT . 'inc/class_xml.php';
         $xml_parser = new XMLParser($contents);
         $tree = $xml_parser->get_tree();
         if (!$mybb->get_input('ignore_version', 1)) {
             $valid_version = (double) $tree['pagemanager']['attributes']['version'] == '1.5.2';
         }
         if (!$valid_version) {
             unset($tree);