Forum Replies Created

Viewing 15 replies - 1 through 15 (of 20 total)
  • Thread Starter ballhogjoni

    (@ballhogjoni)

    Ok figured it out. It’s what I expected. I was missing the php-gd library. I had to install it by running this command

    `rpm -ivv ftp://195.220.108.108/linux/remi/enterprise/6/remi/x86_64/php-gd-5.4.27-1.el6.remi.x86_64.rpm

    Then i had to reboot

    You have to make sure you get the correct version of this rpm for your box.

    Thread Starter ballhogjoni

    (@ballhogjoni)

    Ok thanks it was the plugin EXEC-PHP for me. Just deactivated then removed it since I don’t use it anymore.

    Ok whats your github account, i will add you as a collaborator

    I got your hook up ?? Maybe someone can polish it up! You will need to add the capability, assign_pitch_posts.

    in the functions.php file add

    /* Add custom actions in the posts view
     *
     */
    function add_claim_to_pitch_posts_rows($actions, $post_id) {
      $post = get_post($post_id);
      if ( $post->post_status == "pitch" && current_user_can( 'assign_pitch_posts' ) ) {
        unset( $actions['view'] );
        $actions['assign'] = '<a href="https://domain.com/wp-admin/assign.php?post='.$post->ID.'&action=assign" title="' . esc_attr( __( 'Claim this pitch' ) ) . '">' . __( 'Claim' ) . '</a>';
      }
      return $actions;
    }
    add_filter('post_row_actions','add_claim_to_pitch_posts_rows');
    
    function add_unassign_to_posts_rows($actions, $post_id) {
      $post = get_post($post_id);
      if ( $post->post_status == "assigned" && current_user_can( 'assign_pitch_posts' ) && current_user_can( 'edit_post', $post->ID ) ) {
        $actions['assign'] = '<script>function unClaim_'.$post->ID.'()'.
    '{ var r = confirm("Are you sure you want to unclaim this post?\n You will lose all work done on the article.");'.
    'if (r==true){ window.location.href = "https://domain.com/wp-admin/assign.php?post='.$post->ID.'&action=unassign";'.
    '}}</script><a href="javascript:void(0)" onclick="unClaim_'.$post->ID.'()" title="' . esc_attr( __( 'Unclaim this post' ) ) . '">' . __( 'Unclaim' ) . '</a>';
      }
      return $actions;
    }
    add_filter('post_row_actions','add_unassign_to_posts_rows');

    Create a file called assign.php in the wp-admin folder and add this to the file:

    <?php
    /**
     * Assign post to writer.
     *
     */
    
    /** WordPress Administration Bootstrap */
    require_once('./admin.php');
    
    if ( isset( $_GET['post'] ) )
     	$post_id = $post_ID = (int) $_GET['post'];
    elseif ( isset( $_POST['post_ID'] ) )
     	$post_id = $post_ID = (int) $_POST['post_ID'];
    else
     	$post_id = $post_ID = 0;
    
    $post = $post_type = $post_type_object = null;
    
    if ( $post_id )
    	$post = get_post( $post_id );
    
    if ( $post ) {
    	$post_type = $post->post_type;
    	$post_type_object = get_post_type_object( $post_type );
    }
    
    if ( empty( $post_id ) ) {
      wp_redirect( admin_url('post.php') );
      exit();
    }
    
    $p = $post_id;
    
    if ( empty($post->ID) )
      wp_die( __('You attempted to modify an item that doesn’t exist. Perhaps it was deleted?') );
    
    if ( null == $post_type_object )
      wp_die( __('Unknown post type.') );
    
    if ( 'trash' == $post->post_status )
      wp_die( __('You can’t assign this item because it is in the Trash. Please restore it and try again.') );
    
    switch($_GET['action']) {
      case 'assign':
        if ( !current_user_can('assign_pitch_posts') )
          wp_die( __('You are not allowed to assign this item.') );
    
        if ( $post->post_status == "pitch" ) {
          $wpdb->query(
    	"
    	UPDATE $wpdb->posts
    	SET post_status = 'assigned', post_author = " . wp_get_current_user()->ID . "
    	WHERE ID = $p AND post_status = 'pitch'
    	");
        }
        wp_redirect( admin_url('edit.php?post_status=pitch&post_type=post') );
        exit();
        break;
    
      case 'unassign':
        if ( !current_user_can('assign_pitch_posts') )
          wp_die( __('You are not allowed to unassign this item.') );
    
        if ( $post->post_status == "assigned" ) {
          $wpdb->query(
    	"
    	UPDATE $wpdb->posts
    	SET post_status = 'pitch', post_author = 159
    	WHERE ID = $p AND post_status = 'assigned'
    	");
        }
        wp_redirect( admin_url('post.php') );
        exit();
        break;
    
      default:
        wp_redirect( admin_url('post.php') );
        exit();
        break;
    }

    Your welcome!

    Thread Starter ballhogjoni

    (@ballhogjoni)

    Oh by the way I have 400-500 categories and adding more everyday. This may be why get_category_children($cat_id) doesn’t load very fast.

    +1 has this been added/worked on? If not has anyone found a work around?

    Thread Starter ballhogjoni

    (@ballhogjoni)

    My site is https://inethow.com but there are many more sites that this page, https://www.jewelryvillageonline.com/jewelry-for-bridesmaids/ is linking to. This is the code in the <head></head> section of the html

    <a href="https://www.bridalsalon.us/2012/08/where-to-purchase-bridesmaid-dresses-toronto/" rel="nofollow"><span style="display:none;">Where to Purchase Bridesmaid Dresses-toronto</span></a><a href="https://www.bpkcharter.com/choosing-the-right-wedding-jewellery-to-your-bridesmaid.html" rel="nofollow"><span style="display:none;">Choosing the right wedding jewellery to your bridesmaid : BPK Charter</span></a><a href="https://blog.juventusfootball.co.uk/bridesmaid-jewelry-pearl-versus-crystal/" rel="nofollow"><span style="display:none;">juventus football blog,juventus football team news</span></a><a href="https://inethow.com/diy_842_simple-ideas-to-make-cheap-wedding-flowers-look-fabulous.html" rel="nofollow"><span style="display:none;">Simple Ideas to Make Cheap Wedding Flowers Look Fabulous - i.Net.How</span></a><a href="https://blog.amoro.com/jewelry-gift-etiquette-for-bridesmaids-and-groomsmen/" rel="nofollow"><span style="display:none;">Jewelry Gift Etiquette for Bridesmaids and Groomsmen</span></a><a href="https://www.alexanderwanghandbag.com/prada-replica/mesmerize-your-women-with-rhinestone-austrian-crystal-jewelry_76.html" rel="nofollow"><span style="display:none;">mesmerize your women with rhinestone austrian crystal jewelry!_76</span></a><a href="https://www.blushingbridezilla.com/music-and-entertainment/bridesmaids-earrings-vintage-austrian-crystal-briolette-drop-earrings" rel="nofollow"><span style="display:none;">Bridesmaids Earrings ~ Vintage Austrian Crystal Briolette Drop Earrings</span></a><a href="https://bridalplacellc.com/bridal-wedding-jewelry-set-austrian-crystal-rhinestone-pearl-white" rel="nofollow"><span style="display:none;">Bridal Wedding Jewelry Set Austrian Crystal Rhinestone Pearl White</span></a><a href="https://greenweddingshoes.com/win-a-years-worth-of-jewelry-from-jewelmint/" rel="nofollow"><span style="display:none;">Win a Years Worth of Jewelry from Jewelmint!</span></a><a href="https://blog.fashionjewelryforeveryone.com/2011/12/29/fashionjewelryforeveryone-com-bridesmaids-bracelets-earrings/" rel="nofollow"><span style="display:none;">fashionjewelryforeveryone.com Blog</span></a>

    Thread Starter ballhogjoni

    (@ballhogjoni)

    How do I remove the link it’s not my site. My site is some how being link to from https://www.jewelryvillageonline.com/jewelry-for-bridesmaids/

    Thread Starter ballhogjoni

    (@ballhogjoni)

    Anybody know anything about this?

    Thread Starter ballhogjoni

    (@ballhogjoni)

    bump!

    ballhogjoni

    (@ballhogjoni)

    awesome dude, just what I was looking for ??

    Thread Starter ballhogjoni

    (@ballhogjoni)

    I ran an explain on this query and it seems that mysql isn’t using a primary key index to search so it has to do a complete table scan. I made sure that all the indices are there. This explain showed that it was scanning 52,000 records, I installed wp optimize and removed my post revisions. It seemed to speed up a little.

    Still unsure were this query is being called, but it seems to be called on every page load. If its wordpress, can you fix this query by joining the tables instead of running multiple inner queries?

    Thread Starter ballhogjoni

    (@ballhogjoni)

    Well I ended up doing a search through all the files and I found this sql in plugins only. So I guess its not part of wordpress. The plugin was the redirection plugin. Site is still slow and it still shows in the slow query log.

    Still need help/ideas.

    Thread Starter ballhogjoni

    (@ballhogjoni)

    im using wordpress seo by yoast does that count?

    edit – oops i see you were talking to the other guy

    Im using the latest 0.4.2

Viewing 15 replies - 1 through 15 (of 20 total)