} } //Installing echo "\nHooking phpBB2...\n"; add_to_file($step++, "'T_SPAN_CLASS3' => \$theme['span_class3'],", " 'GWBBCODE_HEAD' => include('" . GWBB_ROOT . "gwbbcode/header.php'),", INCL_ROOT . 'includes/page_header.php'); add_to_file($step++, "'T_SPAN_CLASS3' => \$theme['span_class3'],", " 'GWBBCODE_BODY' => include('" . GWBB_ROOT . "gwbbcode/body.php'),", INCL_ROOT . 'includes/page_header.php'); add_to_file($step++, "// Remove our padding from the string..\n\t\$text = substr(\$text, 1);", "include('" . GWBB_ROOT . "gwbbcode/gwbbcode.php');", INCL_ROOT . 'includes/bbcode.php'); //Hook all templates $templates = defined('IS_NUKE') ? template_list('../../themes') : template_list('templates'); $templatepath = defined('IS_NUKE') ? '/forums' : ''; foreach ($templates as $template) { if (in_array($template, $not_to_hook) || !is_dir($template . $templatepath)) { continue; } echo "\nProcessing template " . basename($template) . "...\n"; sub_from_file($step++, '@<head[^>]*>@Uis', '{GWBBCODE_HEAD}', $template . $templatepath . '/overall_header.tpl', true); add_to_file($step++, '</title>', '{GWBBCODE_HEAD}', $template . $templatepath . '/overall_header.tpl'); add_to_file($step++, '@<body[^>]*>@Uis', '{GWBBCODE_BODY}', $template . $templatepath . '/overall_header.tpl', true); } echo "\nIf you add templates, please rerun install.php to hook gwbbcode on them"; //Recreate and fill the skills table if (GWBBCODE_SQL) { echo "\n\nPreparing the MySQL skill table...\n"; add_skills_to_sql(); } } else { if ($forced_software == 'vBulletin' || file_exists(GWBBCODE_ROOT . '/../index.php') && strpos(file_get_contents(GWBBCODE_ROOT . '/../index.php'), 'vBulletin') !== false) { echo "\nHooking vBulletin...\n"; add_to_file($step++, "eval('\$headinclude = \"' . fetch_template('headinclude') . '\";');", "\$headinclude .= include('gwbbcode/header.php');", GWBBCODE_ROOT . '/../global.php'); add_to_file($step++, "eval('\$header = \"' . fetch_template('header') . '\";');", "\$header .= include('gwbbcode/body.php');", GWBBCODE_ROOT . '/../global.php'); add_to_file($step++, "function parse_bbcode(\$input_text, \$do_smilies, \$do_html = false)\n\t{", "include('gwbbcode/gwbbcode.php');\n\$input_text = parse_gwbbcode(\$input_text);", GWBBCODE_ROOT . '/../includes/class_bbcode.php');
define('MYBB_ROOT', '../'); define('IN_MYBB', true); require_once MYBB_ROOT . "inc/init.php"; require_once MYBB_ROOT . "inc/class_session.php"; $session = new session(); $session->init(); echo '<html><head></head><body><pre>'; install_header(); if ($mybb->usergroup['cancp'] != "yes") { failure("\nYou need admin rights to be allowed to uninstall gwBBCode."); echo "<br/>Please login as admin <a href=\"../login.php\">here</a>."; die; } echo "\nUnhooking MyBB...\n"; sub_from_file($step++, '$message = $this->mycode_parse_quotes($message);', "\t\tinclude('gwbbcode/gwbbcode.php');\n\t\t\$message = parse_gwbbcode(\$message);", GWBBCODE_ROOT . '/../inc/class_parser.php'); sub_from_file($step++, 'eval("\\$header = \\"".$templates->get("header")."\\";");', "\$headerinclude .= include('gwbbcode/header.php');\n\$header = (include('gwbbcode/body.php')) . \$header;", GWBBCODE_ROOT . '/../global.php'); } else { echo '<html><head></head><body><pre>'; install_header(); failure('No supported software on which to uninstall gwBBCode from was found :\'('); //Propose to bypass forum software check echo 'If there is a forum software you want to force uninstallation on, click it: '; echo '<a href="?forced_software=phpBB3">phpBB3</a>, '; echo '<a href="?forced_software=phpBB2">phpBB2</a>, '; echo '<a href="?forced_software=vBulletin">vBulletin</a>, '; echo '<a href="?forced_software=PunBB">PunBB</a>, '; echo '<a href="?forced_software=MyBB">MyBB</a>.' . "\n"; } } } }