The MU forums have moved to WordPress.org

Sitewide Tags Plugin limit ? (6 posts)

  1. kmaz
    Member
    Posted 15 years ago #

    HI,
    I just would like to know how the sitewide Tags plugin from Donncha works when you reach the limit.

    When you reach 5000 posts on the Tags blogs does it stop to show new posts or does it add the new post and remove the oldest one.
    So each time we have a new post, the oldest one is pushed out ? And we still have the 5000 "most recent posts" displayed on the tags blog ?
    Thank you.

  2. dsader
    Member
    Posted 15 years ago #

    I believe that it deletes five oldest posts when it reaches the limit. So each time it reaches 5000 it will be reduced to 4995 then save posts till it reaches 5000 again.

    It may be a year or two before my install reaches the limit, so I haven't seen it in action.

  3. kmaz
    Member
    Posted 15 years ago #

    thank you Dsader.
    What is this 4995 , where does it come from ? is there a way to change that ?

  4. dsader
    Member
    Posted 15 years ago #

    Look for line $max_to_del = 5;

  5. kmaz
    Member
    Posted 15 years ago #

    hmm I do not have this line but I believe the solution might be here :

    if( mt_rand( 0, 10 ) ) {
    		$posts = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} WHERE post_status='publish' ORDER BY ID ASC
     limit " . get_site_option( 'tags_max_posts', 5000 ) . ", 100" );
    		if( is_array( $posts ) && !empty( $posts ) ) {
    			foreach( $posts as $p_id ) {
    				wp_delete_post( $p_id );
    			}
    		}
    	}
  6. dsader
    Member
    Posted 15 years ago #

About this Topic