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 Cross-Post Add-on Copyright 2015 by Dion Designs. All Rights Res..
Decoded Output download
<?php
/*
BridgeDD Cross-Post Add-on
Copyright 2015 by Dion Designs.
All Rights Reserved.
*/
if (!defined('BRIDGEDD')) { exit; } define('BRIDGEDD_XPOST', true); function bridgedd_xpost_delete($post_id) { global $dddb; $sql = "DELETE FROM bridgedd_xpost WHERE wp_id = $post_id"; $dddb->sql_query($sql); } function bridgedd_xpost_publish($new, $old, $post) { include_once(dirname(__FILE__) . '/xpost_driver' . BDD_MIN . '.dd'); } function bridgedd_xpost_message($post) { global $xpost_config, $phpbb_path, $phpbb_url, $phpbb_root_path, $user_forums, $dddb, $phpEx; if ($post->post_type == 'post') { $sql = 'SELECT xp.forum_id, xp.topic_id, f.forum_name FROM bridgedd_xpost xp, ' . FORUMS_TABLE . ' f WHERE xp.wp_id = ' . $post->ID . ' AND f.forum_id = xp.forum_id'; $result = $dddb->sql_query($sql); $row = $dddb->sql_fetchrow($result); $dddb->sql_freeresult($result); if ($row) { $xpname = $row['forum_name']; $topic_url = "{$phpbb_url}viewtopic.$phpEx?f={$row['forum_id']}&t={$row['topic_id']}"; echo '<div class="menu-item-handle" style="display:inline-block;margin:1em 0;padding:5px 10px;text-align:center">' . __('Cross-posted to forum:', 'bridgedd') . '<strong> ' . $xpname . '</strong><br />'; if ($row['topic_id']) { echo '<a class="button-primary" style="margin:10px 0 5px" href="' . $topic_url . '" target="_blank">' . __('View Post') . '</a> '; } echo '<a class="button-primary" style="margin:10px 0 5px" href="' . $_SERVER['REQUEST_URI'] . '&xpdelete=yes">' . __('Remove') . '</a> <input type="hidden" name="xpost_forum" value="' . $row['forum_id'] . '" /></div>'; } else if ($xpost_config['xpost_forum'] == '0') { echo '<input type="hidden" name="xpost_forum" value="0" />'; } else { echo '<div class="menu-item-handle" style="cursor:default;display:inline-block;margin:1em 0;padding:10px;font-size:1.1em;text-align:center">' . __('Cross-post to forum:', 'bridgedd') . ' <select name="xpost_forum"> <option value="0">' . __('Cross-Posting Disabled', 'bridgedd') . '</option>'; $sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id FROM ' . FORUMS_TABLE . ' WHERE ' . $dddb->sql_in_set('forum_id', $user_forums) . ' ORDER BY left_id ASC'; $result = $dddb->sql_query($sql); while ($row = $dddb->sql_fetchrow($result)) { if ($row['forum_type'] == FORUM_CAT) { continue; } $selected = ($xpost_config['xpost_forum'] == $row['forum_id'] && $post->post_status != 'publish') ? ' style="font-weight:bold" selected="selected"' : ''; echo '<option value="' . $row['forum_id'] . '"' . $selected . '>' . $row['forum_name'] . '</option>'; } $dddb->sql_freeresult($result); echo '</select></div>'; } } } function bridgedd_xpost_config() { if (!isset($_REQUEST['tab']) || $_REQUEST['tab'] != 'xpost') { return; } global $xpost_config, $dddb; if (!$xpost_config) { $xpost_config = array( 'xpost_title' => __('The following is an excerpt of a blog article.', 'bridgedd'), 'xpost_forum' => '0', 'xpost_class' => '', 'xcomment_class' => '', ); } echo '<div class="bdd-box"> <h3 class="bdd-title">' . __('Default forum for cross-posted articles:', 'bridgedd') . '</h3> <select class="bdd-select" name="xpost_config[xpost_forum]"> <option style="font-weight:bold" value="0"' . (($xpost_config['xpost_forum'] == '0') ? ' selected="selected"' : '') . '>' . __('Cross-Posting Disabled', 'bridgedd') . '</option>'; $sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id FROM ' . FORUMS_TABLE . ' ORDER BY left_id ASC'; $result = $dddb->sql_query($sql); while ($row = $dddb->sql_fetchrow($result)) { if ($row['forum_type'] == FORUM_CAT) { continue; } $selected = ($xpost_config['xpost_forum'] == $row['forum_id']) ? ' selected="selected"' : ''; echo '<option value="' . $row['forum_id'] . '"' . $selected . '>' . $row['forum_name'] . '</option>'; } $dddb->sql_freeresult($result); echo '</select></div>'; echo '<div class="bdd-box"> <h3 class="bdd-title">' . __('Excerpt title for cross-posted articles:', 'bridgedd') . '</h3> <input type="text" name="xpost_config[xpost_title]" value="' . esc_attr($xpost_config['xpost_title']) . '" maxlength="80" size="60" style="font-weight:normal" /> </div> <div class="bdd-box"> <h3 class="bdd-title">' . __('Class name for Read Full Article button in phpBB:', 'bridgedd') . '</h3> <input type="text" name="xpost_config[xpost_class]" value="' . esc_attr($xpost_config['xpost_class']) . '" maxlength="32" style="font-weight:normal" /> </div> <div class="bdd-box"> <h3 class="bdd-title">' . __('Class name for View the Discussion button in WordPress:', 'bridgedd') . '</h3> <input type="text" name="xpost_config[xcomment_class]" value="' . esc_attr($xpost_config['xcomment_class']) . '" maxlength="32" style="font-weight:normal" /> </div>'; settings_fields('xpost_config'); } function bridgedd_xpost_link($content) { global $phpbb_url, $xpost_config, $dddb; if (!is_single()) { return $content; } $wp_id = get_the_ID(); if(empty($wp_id)) { return $content; } $sql = 'SELECT t.topic_id, t.forum_id FROM ' . TOPICS_TABLE . " t, bridgedd_xpost xp WHERE xp.wp_id = $wp_id AND t.topic_id = xp.topic_id"; $result = $dddb->sql_query($sql); $row = $dddb->sql_fetchrow($result); $dddb->sql_freeresult($result); if ($row) { $class = ($xpost_config[xcomment_class]) ? " class=\"{$xpost_config[xcomment_class]}\"" : ''; $content .= '<div' . $class . ' style="margin-bottom:1em"><a class="bridgedd-xpost-link" href="' . $phpbb_url . 'viewtopic.php?f=' . $row['forum_id'] . '&t=' . $row['topic_id'] . '"><strong>' . __('View the Discussion', 'bridgedd') . '</strong></a></div>'; } return $content; } function bridgedd_xpost_remove() { if (isset($_REQUEST['xpdelete']) && $_REQUEST['xpdelete'] == 'yes') { bridgedd_xpost_delete($_REQUEST['post']); header('Location: ' . str_replace('&xpdelete=yes', '', $_SERVER['REQUEST_URI'])); exit; } } global $xpost_config; $xpost_config = get_option('xpost_config'); add_action('transition_post_status', 'bridgedd_xpost_publish', 10, 3 ); add_action('delete_post', 'bridgedd_xpost_delete'); add_action('edit_form_top', 'bridgedd_xpost_message', 10, 1); add_action('bridgedd_addons_config', 'bridgedd_xpost_config'); add_action('admin_init', 'bridgedd_xpost_remove'); add_filter('the_content', 'bridgedd_xpost_link'); ?>
Did this file decode correctly?
Original Code
<?php
/*
BridgeDD Cross-Post Add-on
Copyright 2015 by Dion Designs.
All Rights Reserved.
*/
if (!defined('BRIDGEDD')) { exit; } define('BRIDGEDD_XPOST', true); function bridgedd_xpost_delete($post_id) { global $dddb; $sql = "DELETE FROM bridgedd_xpost WHERE wp_id = $post_id"; $dddb->sql_query($sql); } function bridgedd_xpost_publish($new, $old, $post) { include_once(dirname(__FILE__) . '/xpost_driver' . BDD_MIN . '.dd'); } function bridgedd_xpost_message($post) { global $xpost_config, $phpbb_path, $phpbb_url, $phpbb_root_path, $user_forums, $dddb, $phpEx; if ($post->post_type == 'post') { $sql = 'SELECT xp.forum_id, xp.topic_id, f.forum_name FROM bridgedd_xpost xp, ' . FORUMS_TABLE . ' f WHERE xp.wp_id = ' . $post->ID . ' AND f.forum_id = xp.forum_id'; $result = $dddb->sql_query($sql); $row = $dddb->sql_fetchrow($result); $dddb->sql_freeresult($result); if ($row) { $xpname = $row['forum_name']; $topic_url = "{$phpbb_url}viewtopic.$phpEx?f={$row['forum_id']}&t={$row['topic_id']}"; echo '<div class="menu-item-handle" style="display:inline-block;margin:1em 0;padding:5px 10px;text-align:center">' . __('Cross-posted to forum:', 'bridgedd') . '<strong> ' . $xpname . '</strong><br />'; if ($row['topic_id']) { echo '<a class="button-primary" style="margin:10px 0 5px" href="' . $topic_url . '" target="_blank">' . __('View Post') . '</a> '; } echo '<a class="button-primary" style="margin:10px 0 5px" href="' . $_SERVER['REQUEST_URI'] . '&xpdelete=yes">' . __('Remove') . '</a> <input type="hidden" name="xpost_forum" value="' . $row['forum_id'] . '" /></div>'; } else if ($xpost_config['xpost_forum'] == '0') { echo '<input type="hidden" name="xpost_forum" value="0" />'; } else { echo '<div class="menu-item-handle" style="cursor:default;display:inline-block;margin:1em 0;padding:10px;font-size:1.1em;text-align:center">' . __('Cross-post to forum:', 'bridgedd') . ' <select name="xpost_forum"> <option value="0">' . __('Cross-Posting Disabled', 'bridgedd') . '</option>'; $sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id FROM ' . FORUMS_TABLE . ' WHERE ' . $dddb->sql_in_set('forum_id', $user_forums) . ' ORDER BY left_id ASC'; $result = $dddb->sql_query($sql); while ($row = $dddb->sql_fetchrow($result)) { if ($row['forum_type'] == FORUM_CAT) { continue; } $selected = ($xpost_config['xpost_forum'] == $row['forum_id'] && $post->post_status != 'publish') ? ' style="font-weight:bold" selected="selected"' : ''; echo '<option value="' . $row['forum_id'] . '"' . $selected . '>' . $row['forum_name'] . '</option>'; } $dddb->sql_freeresult($result); echo '</select></div>'; } } } function bridgedd_xpost_config() { if (!isset($_REQUEST['tab']) || $_REQUEST['tab'] != 'xpost') { return; } global $xpost_config, $dddb; if (!$xpost_config) { $xpost_config = array( 'xpost_title' => __('The following is an excerpt of a blog article.', 'bridgedd'), 'xpost_forum' => '0', 'xpost_class' => '', 'xcomment_class' => '', ); } echo '<div class="bdd-box"> <h3 class="bdd-title">' . __('Default forum for cross-posted articles:', 'bridgedd') . '</h3> <select class="bdd-select" name="xpost_config[xpost_forum]"> <option style="font-weight:bold" value="0"' . (($xpost_config['xpost_forum'] == '0') ? ' selected="selected"' : '') . '>' . __('Cross-Posting Disabled', 'bridgedd') . '</option>'; $sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id FROM ' . FORUMS_TABLE . ' ORDER BY left_id ASC'; $result = $dddb->sql_query($sql); while ($row = $dddb->sql_fetchrow($result)) { if ($row['forum_type'] == FORUM_CAT) { continue; } $selected = ($xpost_config['xpost_forum'] == $row['forum_id']) ? ' selected="selected"' : ''; echo '<option value="' . $row['forum_id'] . '"' . $selected . '>' . $row['forum_name'] . '</option>'; } $dddb->sql_freeresult($result); echo '</select></div>'; echo '<div class="bdd-box"> <h3 class="bdd-title">' . __('Excerpt title for cross-posted articles:', 'bridgedd') . '</h3> <input type="text" name="xpost_config[xpost_title]" value="' . esc_attr($xpost_config['xpost_title']) . '" maxlength="80" size="60" style="font-weight:normal" /> </div> <div class="bdd-box"> <h3 class="bdd-title">' . __('Class name for Read Full Article button in phpBB:', 'bridgedd') . '</h3> <input type="text" name="xpost_config[xpost_class]" value="' . esc_attr($xpost_config['xpost_class']) . '" maxlength="32" style="font-weight:normal" /> </div> <div class="bdd-box"> <h3 class="bdd-title">' . __('Class name for View the Discussion button in WordPress:', 'bridgedd') . '</h3> <input type="text" name="xpost_config[xcomment_class]" value="' . esc_attr($xpost_config['xcomment_class']) . '" maxlength="32" style="font-weight:normal" /> </div>'; settings_fields('xpost_config'); } function bridgedd_xpost_link($content) { global $phpbb_url, $xpost_config, $dddb; if (!is_single()) { return $content; } $wp_id = get_the_ID(); if(empty($wp_id)) { return $content; } $sql = 'SELECT t.topic_id, t.forum_id FROM ' . TOPICS_TABLE . " t, bridgedd_xpost xp WHERE xp.wp_id = $wp_id AND t.topic_id = xp.topic_id"; $result = $dddb->sql_query($sql); $row = $dddb->sql_fetchrow($result); $dddb->sql_freeresult($result); if ($row) { $class = ($xpost_config[xcomment_class]) ? " class=\"{$xpost_config[xcomment_class]}\"" : ''; $content .= '<div' . $class . ' style="margin-bottom:1em"><a class="bridgedd-xpost-link" href="' . $phpbb_url . 'viewtopic.php?f=' . $row['forum_id'] . '&t=' . $row['topic_id'] . '"><strong>' . __('View the Discussion', 'bridgedd') . '</strong></a></div>'; } return $content; } function bridgedd_xpost_remove() { if (isset($_REQUEST['xpdelete']) && $_REQUEST['xpdelete'] == 'yes') { bridgedd_xpost_delete($_REQUEST['post']); header('Location: ' . str_replace('&xpdelete=yes', '', $_SERVER['REQUEST_URI'])); exit; } } global $xpost_config; $xpost_config = get_option('xpost_config'); add_action('transition_post_status', 'bridgedd_xpost_publish', 10, 3 ); add_action('delete_post', 'bridgedd_xpost_delete'); add_action('edit_form_top', 'bridgedd_xpost_message', 10, 1); add_action('bridgedd_addons_config', 'bridgedd_xpost_config'); add_action('admin_init', 'bridgedd_xpost_remove'); add_filter('the_content', 'bridgedd_xpost_link');
Function Calls
| defined | 1 |
Stats
| MD5 | 1f9c83b3924e8b016cf57321ba029e5c |
| Eval Count | 0 |
| Decode Time | 118 ms |