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

  1. mydiskdriveonline
    Posted 2 years 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



  2. mydiskdriveonline
    Posted 2 years ago #

    Just a P.S..

    I can kinda cowboy code.

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


    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


Topic Closed

This topic has been closed to new replies.

About this Plugin

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

About this Topic


No tags yet.