Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php /* BridgeDD Driver Copyright 2015 by Dion Designs. All Rights Reserved. */ ..
Decoded Output download
<?php
/*
BridgeDD Driver
Copyright 2015 by Dion Designs.
All Rights Reserved.
*/
if (!defined('BRIDGEDD_ADMIN')) { die('ERROR 002'); } if ($phpbb_path) { function bridgedd_footer($footer) { return $footer .= '<div style="position:absolute;bottom:0;left:0;right:0;font-size:0.9em;text-align:center"><span style="font-family:Georgia,serif">BridgeDD' . ((defined('BRIDGEDD_PRO')) ? ' PRO' : '') . '</span> Copyright © 2015 ' . __('by', 'bridgedd') . ' <a href="http://dion-designs.com">Dion Designs</a></div>'; } } function bridgedd_admin_init() { global $phpbb_path; $s = BDD_SEP; if ($phpbb_path && isset($_REQUEST['bridgedd']) && $_REQUEST['bridgedd'] == 'update' && !defined('BRIDGEDD_PRO')) { $response = wp_remote_get('http://plugins.svn.wordpress.org/bridgedd/tags/public/bridgedd-update.zip'); if (!is_wp_error($response)) { require_once(ABSPATH . 'wp-admin/includes/file.php'); $update = wp_remote_retrieve_body($response); if (!is_wp_error($update) && WP_Filesystem()) { global $wp_filesystem; $tmp_file = WP_PLUGIN_DIR . "{$s}temp.zip"; file_put_contents($tmp_file, $update); unset($update); $update = unzip_file($tmp_file, WP_PLUGIN_DIR); @unlink($tmp_file); if ($update) { $active = get_option('active_plugins'); $active[] = 'bridgedd-update/bridgedd-update.php'; update_option('active_plugins', $active); if (isset($_REQUEST['rpage'])) { header('Location: plugins.php?redirect=settings'); } else { header('Location: plugins.php'); } exit; } } } wp_die('<div style="text-align:center"><strong style="font-size:16px;font-weight:bold">' . __('Auto update failed.', 'bridgedd') . '</strong><br /><br /><br /><a class="button" href="http://plugins.svn.wordpress.org/bridgedd/tags/public/bridgedd-update.zip"><strong>' . __('Download BridgeDD Update', 'bridgedd') . '</strong></a> <a class="button" href="plugins.php">' . sprintf(__('← Back to %s'), __('Plugins')) . '</a></div>'); } register_setting('bridgedd_config', 'bridgedd_config'); register_setting('xpost_config', 'xpost_config'); register_setting('xcomment_config', 'xcomment_config'); register_setting('xtheme_config', 'xtheme_config'); } function bridgedd_setup_admin(){ add_options_page('BridgeDD', '<span style="font-family:Georgia,serif;font-size:1.15em">BridgeDD</span>', 'install_plugins', 'bridgedd.php', 'bridgedd_config_page'); } function bridgedd_config_page() { global $dddb, $xpost_config, $bridgedd_config, $config, $wp_cfg_data, $phpbb_path, $phpbb_root_path, $phpbb_url, $phpbb_user_id, $phpEx; $s = BDD_SEP; $inst_options = ''; $bdd_tab = (isset($_REQUEST['tab'])) ? $_REQUEST['tab'] : false; if ($phpbb_path && !$bdd_tab) { $connect_msg = '<div class="wp-editor-container green"><h3>' . sprintf(__('%s has established a connection to phpBB.', 'bridgedd'), '<span class="bdd-serif">BridgeDD</span>') . '<br /><br /><a href = "' . $phpbb_url . 'index.php" target="_blank">' . $phpbb_url . 'index.php</a></h3></div>'; if ($bridgedd_config['reg_app'] == 'wp') { $wpreg = ' checked="checked"'; $phpbbreg = ''; if (isset($_GET['settings-updated'])) { update_option('users_can_register', '1'); $sql = 'UPDATE ' . CONFIG_TABLE . " SET config_value = '" . USER_ACTIVATION_DISABLE . "' WHERE config_name = 'require_activation'"; $dddb->sql_query($sql); @unlink($phpbb_path . 'cache/data_global.php'); } } else if ($bridgedd_config['reg_app'] == 'phpbb') { $wpreg = ''; $phpbbreg = ' checked="checked"'; if (isset($_GET['settings-updated'])) { update_option('users_can_register', '0'); $sql = 'UPDATE ' . CONFIG_TABLE . " SET config_value = '" . $bridgedd_config['phpbb_reg'] . "' WHERE config_name = 'require_activation'"; $dddb->sql_query($sql); @unlink($phpbb_path . 'cache/data_global.php'); } } } else if ($phpbb_path) { $connect_msg = ''; } else { $connect_msg = '<div class="wp-editor-container red"><h3>' . __('BridgeDD is not connected to phpBB', 'bridgedd') . '</h3></div>'; $er = error_reporting(); error_reporting($er & ~E_WARNING & ~E_CORE_WARNING & ~E_USER_WARNING); $check_file = "{$s}includes{$s}search{$s}fulltext_native.php"; $path_ary = array(); if (file_exists(SERVER_DOCUMENT_ROOT . $check_file)) { $path_ary[] = $s; } $glob1 = glob(SERVER_DOCUMENT_ROOT . "{$s}*", GLOB_ONLYDIR); if (!empty($glob1)) { foreach ($glob1 as $firstlev) { if (file_exists($firstlev . $check_file)) { $path_ary[] = str_replace(SERVER_DOCUMENT_ROOT, '', $firstlev) . $s; } else { $glob2 = glob($firstlev . "{$s}*", GLOB_ONLYDIR); if (!empty($glob2)) { foreach($glob2 as $secondlev) { if (file_exists($secondlev . $check_file)) { $path_ary[] = str_replace(SERVER_DOCUMENT_ROOT, '', $secondlev) . $s; } else { $glob3 = glob($secondlev . "{$s}*", GLOB_ONLYDIR); if (!empty($glob3)) { foreach($glob3 as $thirdlev) { if (file_exists($thirdlev . $check_file)) { $path_ary[] = str_replace(SERVER_DOCUMENT_ROOT, '', $thirdlev) . $s; } else if (defined('BRIDGEDD_EXTRALEVEL')) { $glob4 = glob($thirdlev . "{$s}*", GLOB_ONLYDIR); if (!empty($glob4)) { foreach($glob4 as $fourthlev) { if (file_exists($fourthlev . $check_file)) { $path_ary[] = str_replace(SERVER_DOCUMENT_ROOT, '', $fourthlev) . $s; } } } } } } } } } } } } error_reporting($er); if (!empty($path_ary)) { foreach($path_ary as $path) { $result = bridgedd_check_phpbb_path($path); if (!$result) { $html_path = get_option('siteurl') . '/' . BRIDGEDD_DIR . '/bridgedd_check.php?path=' . urlencode($path); $inst_options .= '<div class="phpbb_path"><input name="bridgedd_config[phpbb_path]" type="radio" value="' . $path . '"' . $selected . ' onclick="get_phpbb_inst(this,\'' . $html_path . '\')" /> ' . substr($path, 0, -1) . '</div>'; } else { $inst_options .= '<div class="wp-editor-container red dberror">' . substr($path, 0, -1) . ' <strong>' . sprintf(__('ERROR %s', 'bridgedd'), $result) . '</strong></div><br />'; } } } echo '<script type="text/javascript"> function get_phpbb_inst(elem,path) { var jqxhr = jQuery.get(path, function(data) { if (data.indexOf("||OK") == 0) { data = data.substring(4); var x = document.getElementById("site_check"); x.innerHTML = "<h3 id=\"site_url\">" + data + "</h3><iframe id=\"phpbb_site\" src=\"" + data + "\"></iframe>"; x.style.display = "block"; } else { elem.parentNode.className = "wp-editor-container red dberror"; elem.parentNode.innerHTML = "' . __('Could not connect to phpBB installation', 'bridgedd') . ' " + data; jQuery(elem.parentNode).after("<br />"); } }); } </script>'; } echo '<style type="text/css"> .bdd-serif{font-family:Georgia,serif} .green{background-color:#f4fff4!important;border-color:#beb!important} .red{background-color:#fff4f4!important;border-color:#fcc!important} .orange{background-color:#fff8f0!important;border-color:#ecb!important} .phpbb_path,.bdd .wp-editor-container.dberror{float:left;clear:both} .bdd .wp-editor-container{display:inline-block;margin:10px 0 10px -10px;padding:0 10px} .bdd .wp-editor-container h3{line-height:1em;color:#000} .bdd .wp-editor-container.dberror{margin:3px 0 3px -10px;padding:3px 10px;color:#800;font-weight:bold} .bdd h2{margin-bottom:1em;padding:0} .bdd form{padding-top:20px;color:#000} .bdd .error,.bdd .updated{margin-left:-10px!important;padding-left:6px!important} .dberror,#site_url{font-family:Arial,Helvetica,sans-serif} .bdd-box{margin-bottom:30px;line-height:1.8em} .bdd-box input,.bdd-box select{font-weight:normal} .bdd-title{margin-bottom:0.5em;font-size:1.2em} #bridgedd_tab a{margin-left:5px;margin-right:0;padding:3px 6px;font-size:13px} #site_check{clear:both} #site_url{margin-bottom:0.5em;font-size:1.2em} #phpbb_site{width:100%;height:320px;border:none} .bdd-box .rtl-divider{padding:0 10px} .rtl .bdd-box select{textx-align:center} .rtl .bdd-box .rtl-divider{display:block} </style> <div class="wrap bdd">' . bridgedd_maybe_update(); $loaded_addons = $bridgedd_config['loaded_addons']; if ($phpbb_path) { $trans = array( 'widgets' => array('nav' => '', 'name' => __('Widgets')), 'xpost' => array('nav' => _x('Post', 'add new on admin bar'), 'name' => __('Cross-Posting', 'bridgedd')), ); echo '<h2>' . sprintf(__('%s Settings', 'bridgedd'), '<span class="bdd-serif">BridgeDD</span>') . '</h2><br />'; echo '<h2 id="bridgedd_tab" class="nav-tab-wrapper"> <a class="nav-tab' . (($bdd_tab) ? '' : ' nav-tab-active') . '" href="options-general.php?page=bridgedd.php">' . __('General') . '</a>'; if (!empty($loaded_addons)) { foreach ($loaded_addons as $addon) { $name = str_replace(array(dirname(__FILE__) . "{$s}bridgedd_", BDD_MIN . BDD_ADDON), '', $addon); if ($trans[$name]['nav']) { echo '<a class="nav-tab' . (($bdd_tab == $addon) ? ' nav-tab-active' : '') . '" href="options-general.php?page=bridgedd.php&tab=' . $addon . '">' . $trans[$addon]['nav'] . '</a>'; } } } echo '</h2>'; } if (!$phpbb_path && !$inst_options) { echo '<div class="wp-editor-container red"><h3>' . __('ERROR: No phpBB installations were found on your server.', 'bridgedd') . '</h3></div>'; } else { echo $connect_msg . '<form method="post" action="options.php">'; if ($phpbb_path && !$bdd_tab) { $data = ''; $addons = glob(dirname(__FILE__) . "{$s}*" . BDD_ADDON); if (!empty($addons)) { foreach ($addons as $addon) { $addon = str_replace(array(dirname(__FILE__) . "{$s}bridgedd_", BDD_MIN . BDD_ADDON), '', $addon); if ($addon != 'driver') { $loaded = (!empty($loaded_addons) && in_array($addon, $loaded_addons)) ? '" checked="checked"' : '"'; $data .= '<input type="checkbox" name="bridgedd_config[loaded_addons][]" value = "' . $addon . $loaded . ' /> ' . $trans[$addon]['name'] . '<br />'; } } } echo '<div class="bdd-box"> <h3 class="bdd-title">' . __('Available BridgeDD addons:', 'bridgedd') . '</h3>' . $data . ' </div> <div class="bdd-box"> <h3 class="bdd-title">' . __('Application that should handle user registrations:', 'bridgedd') . '</h3> <input type="radio" name="bridgedd_config[reg_app]" value = "wp"' . $wpreg . ' /> WordPress<span class="rtl-divider"></span> <input type="radio" name="bridgedd_config[reg_app]" value = "phpbb"' . $phpbbreg . ' /> phpBB </div>'; if (!empty($loaded_addons) && in_array('widgets', $loaded_addons)) { echo '<div class="bdd-box"> <h3 class="bdd-title">' . __('Avatar source for BridgeDD widgets:', 'bridgedd') . '</h3> <input type="radio" name="bridgedd_config[avatar_src]" value = "wp"' . (($bridgedd_config['avatar_src'] == 'wp') ? ' checked="checked"' : '') . ' /> WordPress<span class="rtl-divider"></span> <input type="radio" name="bridgedd_config[avatar_src]" value = "phpbb"' . (($bridgedd_config['avatar_src'] == 'phpbb') ? ' checked="checked"' : '') . ' /> phpBB </div>'; } else { echo '<input name="bridgedd_config[avatar_src]" type="hidden" value="' . $bridgedd_config['avatar_src'] . '" />'; } echo ' <input type="hidden" name="bridgedd_config[installed]" value="' . $bridgedd_config['installed'] . '" /> <input type="hidden" name="bridgedd_config[phpbb_path]" value="' . $bridgedd_config['phpbb_path'] . '" /> <input type="hidden" name="bridgedd_config[phpbb_reg]" value="' . $bridgedd_config['phpbb_reg'] . '" /> <input type="hidden" name="bridgedd_config[wp_reg]" value="' . $bridgedd_config['wp_reg'] . '" />'; settings_fields('bridgedd_config'); } else if ($phpbb_path) { do_action('bridgedd_addons_config'); } else { $phpbb_list = $inst_options . '<div id="site_check"></div>'; echo '<div class="bdd-box"> <span class="bdd-title" style="font-size:1.3em"><strong>' . __('Select a phpBB installation:', 'bridgedd') . '</strong></span> <br /><br /><tt>' . $phpbb_list . '</tt> </div> <input type="hidden" name="bridgedd_config[installed]" value="' . $bridgedd_config['installed'] . '" /> <input type="hidden" name="bridgedd_config[reg_app]" value="' . $bridgedd_config['reg_app'] . '" /> <input type="hidden" name="bridgedd_config[avatar_src]" value="' . $bridgedd_config['avatar_src'] . '" />'; if (!empty($loaded_addons)) { foreach ($loaded_addons as $addon) { echo '<input type="hidden" name="bridgedd_config[loaded_addons][]" value="' . $addon . '" />'; } } settings_fields('bridgedd_config'); } echo '<input type="submit" class="button-primary" name="submit" value="' . __('Save Changes', 'bridgedd') . '" /> </form>'; } echo '<br /><br /><div class="updated"><h3>'; echo __('For support, and free WordPress plugins and phpBB modifications, become a member of our phpBB board:', 'bridgedd') . ' <br /><br /><a href="http://bridgedd.com/support/index.php">http://bridgedd.com/support/index.php</a> </h3></div>'; echo '</div>'; } function bridgedd_check_phpbb_path($phpbb_path) { @include(SERVER_DOCUMENT_ROOT . $phpbb_path . 'config.php'); if (empty($dbms)) { return '(include)'; } else if (strpos($acm_type, 'file') === false) { return '(acm_type)'; } else if (strpos($dbms, 'mysql') === false) { return '(mysql)'; } $testfile = SERVER_DOCUMENT_ROOT . $phpbb_path . 'common.php'; $test = @file_get_contents($testfile); if (strpos($test, '<?php') === false) { return '(create)'; } else { $teststr = str_replace('<?php', '<?php' . PHP_EOL . PHP_EOL, $test); @file_put_contents($testfile, $teststr); clearstatcache(); $test2 = @file_get_contents($testfile); } if ($test2 != $teststr) { return '(modify)'; } else { @file_put_contents($testfile, $test); clearstatcache(); return false; } } function bridgedd_maybe_update($plugin_file = false, $plugin_data = false, $status = false) { global $phpbb_path; $s = BDD_SEP; if (isset($_REQUEST['bridgedd_update'])) { return '<div class="wp-editor-container green"><h3>' . sprintf(__('Updated to BridgeDD %s', 'bridgedd'), str_replace('0', '.', $_REQUEST['bridgedd_update'])) . '</h3></div>'; } else if ($phpbb_path && !is_dir(WP_PLUGIN_DIR . "{$s}bridgedd-update")) { $version = (defined('BRIDGEDD_PRO')) ? 'PRO_VERSION' : 'VERSION'; $response = wp_remote_get("http://plugins.svn.wordpress.org/bridgedd/tags/public/{$version}"); if (!is_wp_error($response)) { $version = wp_remote_retrieve_body($response); if (!is_wp_error($version) && intval($version) > BRIDGEDD) { $version = substr($version, 0 , 1) . '.' . intval(substr($version, 1 , 2)) . '.' . intval(substr($version, 3, 2)); $uname = (defined('BRIDGEDD_PRO')) ? ' PRO' : ''; $ulink = (defined('BRIDGEDD_PRO')) ? __('Click the link to download the update plugin:', 'bridgedd') . '<br /><a href="http://diondesigns.org/bridgedd/support/viewtopic.php?t=116">http://diondesigns.org/bridgedd/support/viewtopic.php?t=116</a>' : ' <a class="button-primary" href="plugins.php?bridgedd=update' . (($plugin_file) ? '' : '&rpage=settings') . '">' . __('Update') . '</a>'; $umsg = '<h3>' . sprintf(__('%s is available.', 'bridgedd'), '<span style="font-family:Georgia,serif">BridgeDD' . $uname . ' </span>' . $version) . ' ' . $ulink . '</h3>'; if ($plugin_file) { echo '<tr><td colspan="3" style="padding:0 15px;line-height:2em;background-color:#fff8e8">' . $umsg . '</td></tr>'; } else { return '<div class="wp-editor-container orange">' . $umsg . '</div>'; } } } } } function add_settings_link($links) { array_unshift($links, '<style type="text/css">#bridgedd .plugin-title strong,#bridgedd-pro .plugin-title strong{font-family:Georgia,serif;font-size:1.25em}#bridgedd .plugin-version-author-uri a,#bridgedd-pro .plugin-version-author-uri a{font-weight:bold}</style><a href="options-general.php?page=bridgedd.php">' . __('Settings', 'bridgedd') . '</a>'); return $links; } ?>
Did this file decode correctly?
Original Code
<?php
/*
BridgeDD Driver
Copyright 2015 by Dion Designs.
All Rights Reserved.
*/
if (!defined('BRIDGEDD_ADMIN')) { die('ERROR 002'); } if ($phpbb_path) { function bridgedd_footer($footer) { return $footer .= '<div style="position:absolute;bottom:0;left:0;right:0;font-size:0.9em;text-align:center"><span style="font-family:Georgia,serif">BridgeDD' . ((defined('BRIDGEDD_PRO')) ? ' PRO' : '') . '</span> Copyright © 2015 ' . __('by', 'bridgedd') . ' <a href="http://dion-designs.com">Dion Designs</a></div>'; } } function bridgedd_admin_init() { global $phpbb_path; $s = BDD_SEP; if ($phpbb_path && isset($_REQUEST['bridgedd']) && $_REQUEST['bridgedd'] == 'update' && !defined('BRIDGEDD_PRO')) { $response = wp_remote_get('http://plugins.svn.wordpress.org/bridgedd/tags/public/bridgedd-update.zip'); if (!is_wp_error($response)) { require_once(ABSPATH . 'wp-admin/includes/file.php'); $update = wp_remote_retrieve_body($response); if (!is_wp_error($update) && WP_Filesystem()) { global $wp_filesystem; $tmp_file = WP_PLUGIN_DIR . "{$s}temp.zip"; file_put_contents($tmp_file, $update); unset($update); $update = unzip_file($tmp_file, WP_PLUGIN_DIR); @unlink($tmp_file); if ($update) { $active = get_option('active_plugins'); $active[] = 'bridgedd-update/bridgedd-update.php'; update_option('active_plugins', $active); if (isset($_REQUEST['rpage'])) { header('Location: plugins.php?redirect=settings'); } else { header('Location: plugins.php'); } exit; } } } wp_die('<div style="text-align:center"><strong style="font-size:16px;font-weight:bold">' . __('Auto update failed.', 'bridgedd') . '</strong><br /><br /><br /><a class="button" href="http://plugins.svn.wordpress.org/bridgedd/tags/public/bridgedd-update.zip"><strong>' . __('Download BridgeDD Update', 'bridgedd') . '</strong></a> <a class="button" href="plugins.php">' . sprintf(__('← Back to %s'), __('Plugins')) . '</a></div>'); } register_setting('bridgedd_config', 'bridgedd_config'); register_setting('xpost_config', 'xpost_config'); register_setting('xcomment_config', 'xcomment_config'); register_setting('xtheme_config', 'xtheme_config'); } function bridgedd_setup_admin(){ add_options_page('BridgeDD', '<span style="font-family:Georgia,serif;font-size:1.15em">BridgeDD</span>', 'install_plugins', 'bridgedd.php', 'bridgedd_config_page'); } function bridgedd_config_page() { global $dddb, $xpost_config, $bridgedd_config, $config, $wp_cfg_data, $phpbb_path, $phpbb_root_path, $phpbb_url, $phpbb_user_id, $phpEx; $s = BDD_SEP; $inst_options = ''; $bdd_tab = (isset($_REQUEST['tab'])) ? $_REQUEST['tab'] : false; if ($phpbb_path && !$bdd_tab) { $connect_msg = '<div class="wp-editor-container green"><h3>' . sprintf(__('%s has established a connection to phpBB.', 'bridgedd'), '<span class="bdd-serif">BridgeDD</span>') . '<br /><br /><a href = "' . $phpbb_url . 'index.php" target="_blank">' . $phpbb_url . 'index.php</a></h3></div>'; if ($bridgedd_config['reg_app'] == 'wp') { $wpreg = ' checked="checked"'; $phpbbreg = ''; if (isset($_GET['settings-updated'])) { update_option('users_can_register', '1'); $sql = 'UPDATE ' . CONFIG_TABLE . " SET config_value = '" . USER_ACTIVATION_DISABLE . "' WHERE config_name = 'require_activation'"; $dddb->sql_query($sql); @unlink($phpbb_path . 'cache/data_global.php'); } } else if ($bridgedd_config['reg_app'] == 'phpbb') { $wpreg = ''; $phpbbreg = ' checked="checked"'; if (isset($_GET['settings-updated'])) { update_option('users_can_register', '0'); $sql = 'UPDATE ' . CONFIG_TABLE . " SET config_value = '" . $bridgedd_config['phpbb_reg'] . "' WHERE config_name = 'require_activation'"; $dddb->sql_query($sql); @unlink($phpbb_path . 'cache/data_global.php'); } } } else if ($phpbb_path) { $connect_msg = ''; } else { $connect_msg = '<div class="wp-editor-container red"><h3>' . __('BridgeDD is not connected to phpBB', 'bridgedd') . '</h3></div>'; $er = error_reporting(); error_reporting($er & ~E_WARNING & ~E_CORE_WARNING & ~E_USER_WARNING); $check_file = "{$s}includes{$s}search{$s}fulltext_native.php"; $path_ary = array(); if (file_exists(SERVER_DOCUMENT_ROOT . $check_file)) { $path_ary[] = $s; } $glob1 = glob(SERVER_DOCUMENT_ROOT . "{$s}*", GLOB_ONLYDIR); if (!empty($glob1)) { foreach ($glob1 as $firstlev) { if (file_exists($firstlev . $check_file)) { $path_ary[] = str_replace(SERVER_DOCUMENT_ROOT, '', $firstlev) . $s; } else { $glob2 = glob($firstlev . "{$s}*", GLOB_ONLYDIR); if (!empty($glob2)) { foreach($glob2 as $secondlev) { if (file_exists($secondlev . $check_file)) { $path_ary[] = str_replace(SERVER_DOCUMENT_ROOT, '', $secondlev) . $s; } else { $glob3 = glob($secondlev . "{$s}*", GLOB_ONLYDIR); if (!empty($glob3)) { foreach($glob3 as $thirdlev) { if (file_exists($thirdlev . $check_file)) { $path_ary[] = str_replace(SERVER_DOCUMENT_ROOT, '', $thirdlev) . $s; } else if (defined('BRIDGEDD_EXTRALEVEL')) { $glob4 = glob($thirdlev . "{$s}*", GLOB_ONLYDIR); if (!empty($glob4)) { foreach($glob4 as $fourthlev) { if (file_exists($fourthlev . $check_file)) { $path_ary[] = str_replace(SERVER_DOCUMENT_ROOT, '', $fourthlev) . $s; } } } } } } } } } } } } error_reporting($er); if (!empty($path_ary)) { foreach($path_ary as $path) { $result = bridgedd_check_phpbb_path($path); if (!$result) { $html_path = get_option('siteurl') . '/' . BRIDGEDD_DIR . '/bridgedd_check.php?path=' . urlencode($path); $inst_options .= '<div class="phpbb_path"><input name="bridgedd_config[phpbb_path]" type="radio" value="' . $path . '"' . $selected . ' onclick="get_phpbb_inst(this,\'' . $html_path . '\')" /> ' . substr($path, 0, -1) . '</div>'; } else { $inst_options .= '<div class="wp-editor-container red dberror">' . substr($path, 0, -1) . ' <strong>' . sprintf(__('ERROR %s', 'bridgedd'), $result) . '</strong></div><br />'; } } } echo '<script type="text/javascript"> function get_phpbb_inst(elem,path) { var jqxhr = jQuery.get(path, function(data) { if (data.indexOf("||OK") == 0) { data = data.substring(4); var x = document.getElementById("site_check"); x.innerHTML = "<h3 id=\"site_url\">" + data + "</h3><iframe id=\"phpbb_site\" src=\"" + data + "\"></iframe>"; x.style.display = "block"; } else { elem.parentNode.className = "wp-editor-container red dberror"; elem.parentNode.innerHTML = "' . __('Could not connect to phpBB installation', 'bridgedd') . ' " + data; jQuery(elem.parentNode).after("<br />"); } }); } </script>'; } echo '<style type="text/css"> .bdd-serif{font-family:Georgia,serif} .green{background-color:#f4fff4!important;border-color:#beb!important} .red{background-color:#fff4f4!important;border-color:#fcc!important} .orange{background-color:#fff8f0!important;border-color:#ecb!important} .phpbb_path,.bdd .wp-editor-container.dberror{float:left;clear:both} .bdd .wp-editor-container{display:inline-block;margin:10px 0 10px -10px;padding:0 10px} .bdd .wp-editor-container h3{line-height:1em;color:#000} .bdd .wp-editor-container.dberror{margin:3px 0 3px -10px;padding:3px 10px;color:#800;font-weight:bold} .bdd h2{margin-bottom:1em;padding:0} .bdd form{padding-top:20px;color:#000} .bdd .error,.bdd .updated{margin-left:-10px!important;padding-left:6px!important} .dberror,#site_url{font-family:Arial,Helvetica,sans-serif} .bdd-box{margin-bottom:30px;line-height:1.8em} .bdd-box input,.bdd-box select{font-weight:normal} .bdd-title{margin-bottom:0.5em;font-size:1.2em} #bridgedd_tab a{margin-left:5px;margin-right:0;padding:3px 6px;font-size:13px} #site_check{clear:both} #site_url{margin-bottom:0.5em;font-size:1.2em} #phpbb_site{width:100%;height:320px;border:none} .bdd-box .rtl-divider{padding:0 10px} .rtl .bdd-box select{textx-align:center} .rtl .bdd-box .rtl-divider{display:block} </style> <div class="wrap bdd">' . bridgedd_maybe_update(); $loaded_addons = $bridgedd_config['loaded_addons']; if ($phpbb_path) { $trans = array( 'widgets' => array('nav' => '', 'name' => __('Widgets')), 'xpost' => array('nav' => _x('Post', 'add new on admin bar'), 'name' => __('Cross-Posting', 'bridgedd')), ); echo '<h2>' . sprintf(__('%s Settings', 'bridgedd'), '<span class="bdd-serif">BridgeDD</span>') . '</h2><br />'; echo '<h2 id="bridgedd_tab" class="nav-tab-wrapper"> <a class="nav-tab' . (($bdd_tab) ? '' : ' nav-tab-active') . '" href="options-general.php?page=bridgedd.php">' . __('General') . '</a>'; if (!empty($loaded_addons)) { foreach ($loaded_addons as $addon) { $name = str_replace(array(dirname(__FILE__) . "{$s}bridgedd_", BDD_MIN . BDD_ADDON), '', $addon); if ($trans[$name]['nav']) { echo '<a class="nav-tab' . (($bdd_tab == $addon) ? ' nav-tab-active' : '') . '" href="options-general.php?page=bridgedd.php&tab=' . $addon . '">' . $trans[$addon]['nav'] . '</a>'; } } } echo '</h2>'; } if (!$phpbb_path && !$inst_options) { echo '<div class="wp-editor-container red"><h3>' . __('ERROR: No phpBB installations were found on your server.', 'bridgedd') . '</h3></div>'; } else { echo $connect_msg . '<form method="post" action="options.php">'; if ($phpbb_path && !$bdd_tab) { $data = ''; $addons = glob(dirname(__FILE__) . "{$s}*" . BDD_ADDON); if (!empty($addons)) { foreach ($addons as $addon) { $addon = str_replace(array(dirname(__FILE__) . "{$s}bridgedd_", BDD_MIN . BDD_ADDON), '', $addon); if ($addon != 'driver') { $loaded = (!empty($loaded_addons) && in_array($addon, $loaded_addons)) ? '" checked="checked"' : '"'; $data .= '<input type="checkbox" name="bridgedd_config[loaded_addons][]" value = "' . $addon . $loaded . ' /> ' . $trans[$addon]['name'] . '<br />'; } } } echo '<div class="bdd-box"> <h3 class="bdd-title">' . __('Available BridgeDD addons:', 'bridgedd') . '</h3>' . $data . ' </div> <div class="bdd-box"> <h3 class="bdd-title">' . __('Application that should handle user registrations:', 'bridgedd') . '</h3> <input type="radio" name="bridgedd_config[reg_app]" value = "wp"' . $wpreg . ' /> WordPress<span class="rtl-divider"></span> <input type="radio" name="bridgedd_config[reg_app]" value = "phpbb"' . $phpbbreg . ' /> phpBB </div>'; if (!empty($loaded_addons) && in_array('widgets', $loaded_addons)) { echo '<div class="bdd-box"> <h3 class="bdd-title">' . __('Avatar source for BridgeDD widgets:', 'bridgedd') . '</h3> <input type="radio" name="bridgedd_config[avatar_src]" value = "wp"' . (($bridgedd_config['avatar_src'] == 'wp') ? ' checked="checked"' : '') . ' /> WordPress<span class="rtl-divider"></span> <input type="radio" name="bridgedd_config[avatar_src]" value = "phpbb"' . (($bridgedd_config['avatar_src'] == 'phpbb') ? ' checked="checked"' : '') . ' /> phpBB </div>'; } else { echo '<input name="bridgedd_config[avatar_src]" type="hidden" value="' . $bridgedd_config['avatar_src'] . '" />'; } echo ' <input type="hidden" name="bridgedd_config[installed]" value="' . $bridgedd_config['installed'] . '" /> <input type="hidden" name="bridgedd_config[phpbb_path]" value="' . $bridgedd_config['phpbb_path'] . '" /> <input type="hidden" name="bridgedd_config[phpbb_reg]" value="' . $bridgedd_config['phpbb_reg'] . '" /> <input type="hidden" name="bridgedd_config[wp_reg]" value="' . $bridgedd_config['wp_reg'] . '" />'; settings_fields('bridgedd_config'); } else if ($phpbb_path) { do_action('bridgedd_addons_config'); } else { $phpbb_list = $inst_options . '<div id="site_check"></div>'; echo '<div class="bdd-box"> <span class="bdd-title" style="font-size:1.3em"><strong>' . __('Select a phpBB installation:', 'bridgedd') . '</strong></span> <br /><br /><tt>' . $phpbb_list . '</tt> </div> <input type="hidden" name="bridgedd_config[installed]" value="' . $bridgedd_config['installed'] . '" /> <input type="hidden" name="bridgedd_config[reg_app]" value="' . $bridgedd_config['reg_app'] . '" /> <input type="hidden" name="bridgedd_config[avatar_src]" value="' . $bridgedd_config['avatar_src'] . '" />'; if (!empty($loaded_addons)) { foreach ($loaded_addons as $addon) { echo '<input type="hidden" name="bridgedd_config[loaded_addons][]" value="' . $addon . '" />'; } } settings_fields('bridgedd_config'); } echo '<input type="submit" class="button-primary" name="submit" value="' . __('Save Changes', 'bridgedd') . '" /> </form>'; } echo '<br /><br /><div class="updated"><h3>'; echo __('For support, and free WordPress plugins and phpBB modifications, become a member of our phpBB board:', 'bridgedd') . ' <br /><br /><a href="http://bridgedd.com/support/index.php">http://bridgedd.com/support/index.php</a> </h3></div>'; echo '</div>'; } function bridgedd_check_phpbb_path($phpbb_path) { @include(SERVER_DOCUMENT_ROOT . $phpbb_path . 'config.php'); if (empty($dbms)) { return '(include)'; } else if (strpos($acm_type, 'file') === false) { return '(acm_type)'; } else if (strpos($dbms, 'mysql') === false) { return '(mysql)'; } $testfile = SERVER_DOCUMENT_ROOT . $phpbb_path . 'common.php'; $test = @file_get_contents($testfile); if (strpos($test, '<?php') === false) { return '(create)'; } else { $teststr = str_replace('<?php', '<?php' . PHP_EOL . PHP_EOL, $test); @file_put_contents($testfile, $teststr); clearstatcache(); $test2 = @file_get_contents($testfile); } if ($test2 != $teststr) { return '(modify)'; } else { @file_put_contents($testfile, $test); clearstatcache(); return false; } } function bridgedd_maybe_update($plugin_file = false, $plugin_data = false, $status = false) { global $phpbb_path; $s = BDD_SEP; if (isset($_REQUEST['bridgedd_update'])) { return '<div class="wp-editor-container green"><h3>' . sprintf(__('Updated to BridgeDD %s', 'bridgedd'), str_replace('0', '.', $_REQUEST['bridgedd_update'])) . '</h3></div>'; } else if ($phpbb_path && !is_dir(WP_PLUGIN_DIR . "{$s}bridgedd-update")) { $version = (defined('BRIDGEDD_PRO')) ? 'PRO_VERSION' : 'VERSION'; $response = wp_remote_get("http://plugins.svn.wordpress.org/bridgedd/tags/public/{$version}"); if (!is_wp_error($response)) { $version = wp_remote_retrieve_body($response); if (!is_wp_error($version) && intval($version) > BRIDGEDD) { $version = substr($version, 0 , 1) . '.' . intval(substr($version, 1 , 2)) . '.' . intval(substr($version, 3, 2)); $uname = (defined('BRIDGEDD_PRO')) ? ' PRO' : ''; $ulink = (defined('BRIDGEDD_PRO')) ? __('Click the link to download the update plugin:', 'bridgedd') . '<br /><a href="http://diondesigns.org/bridgedd/support/viewtopic.php?t=116">http://diondesigns.org/bridgedd/support/viewtopic.php?t=116</a>' : ' <a class="button-primary" href="plugins.php?bridgedd=update' . (($plugin_file) ? '' : '&rpage=settings') . '">' . __('Update') . '</a>'; $umsg = '<h3>' . sprintf(__('%s is available.', 'bridgedd'), '<span style="font-family:Georgia,serif">BridgeDD' . $uname . ' </span>' . $version) . ' ' . $ulink . '</h3>'; if ($plugin_file) { echo '<tr><td colspan="3" style="padding:0 15px;line-height:2em;background-color:#fff8e8">' . $umsg . '</td></tr>'; } else { return '<div class="wp-editor-container orange">' . $umsg . '</div>'; } } } } } function add_settings_link($links) { array_unshift($links, '<style type="text/css">#bridgedd .plugin-title strong,#bridgedd-pro .plugin-title strong{font-family:Georgia,serif;font-size:1.25em}#bridgedd .plugin-version-author-uri a,#bridgedd-pro .plugin-version-author-uri a{font-weight:bold}</style><a href="options-general.php?page=bridgedd.php">' . __('Settings', 'bridgedd') . '</a>'); return $links; }
Function Calls
| defined | 1 |
Stats
| MD5 | ab78dc6348f5b6f2fee2c75c9d55ddea |
| Eval Count | 0 |
| Decode Time | 142 ms |