Why do we show in "Attach Existing" image list every image on website, instead of only pictures by same user?

this is a simple hack of the image_attach function providing that list:

/**
 * Fetch an array of all candidate referenced nodes, for use in presenting the selection form to the user.
 */
function _image_attach_get_image_nodes() {
 
  global $user;

  $result = db_query(db_rewrite_sql("SELECT n.nid, n.title FROM {node} n WHERE n.status=1 AND type='image' AND uid = '".$user->uid."' ORDER BY n.sticky DESC, n.title ASC"));
  if (db_num_rows($result) == 0) {
    return array();
  }

  $rows = array(0 => t('None'));
  while ($node = db_fetch_object($result)) {
    $rows[$node->nid] = $node->title;
  }
  return $rows;
}

where I've only added a filter by user

Also, suppose would be handy to have a admin/settings/image_attach setting form with a checkbox like
"only show user images in attach list"

Comments

sun’s picture

Status: Active » Closed (won't fix)

Sorry, Image 5.x-1.x will not see any new major features. Consider upgrading to 6.x, please.

afagioli’s picture

sure, thanks