WordPress.org

Forums

Add From Server
Change sort order of files to newest on top (2 posts)

  1. mydiskdriveonline
    Member
    Posted 10 months ago #

    Super excellent plugin. I just escaped nggallery and wordtube with it. 1000's of files.

    Is there a way to change the default sort order from "filename" to "date modified or created" to be on top.

    Reason is I have a default folder for video. As I dump new ones in it would be easier/faster if those new files showed on the top(or bottom even, just so they are grouped) of the list and i could just check those off.

    Hope you understand

    Cheerz

    https://wordpress.org/plugins/add-from-server/

  2. mydiskdriveonline
    Member
    Posted 10 months ago #

    Just a P.S..

    I can kinda cowboy code.

    I figure its something around line #572 in class-add-from-server

    P.S.S..

    This is what I used to grab the caption from nggallery:
    start @ line #370

    $basefilen = basename($file);
    		$capsion = "";
    		global $wpdb;
    		$capsion = $wpdb->get_results( "SELECT * FROM wp_ngg_pictures WHERE filename LIKE '$basefilen'") ;
    
    		foreach ( $capsion as $capp ) {
    
    		$capttion = esc_attr( stripslashes($capp->description) );
    }
    		// Construct the attachment array
    		$attachment = array(
    			'post_mime_type' => $type,
    			'guid' => $url,
    			'post_parent' => $post_id,
    			'post_title' => $title,
    			'post_name' => $title,
    			'post_content' => $capttion,
    			'post_excerpt' => $capttion,
    			'post_date' => $post_date,
    			'post_date_gmt' => $post_date_gmt
    		);

    Cheerz

Reply

You must log in to post.

About this Plugin

  • Add From Server
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.