Closed (won't fix)
Project:
Image
Version:
5.x-1.x-dev
Component:
image_attach
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 Jan 2009 at 21:54 UTC
Updated:
29 Jan 2009 at 18:36 UTC
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
Comment #1
sunSorry, Image 5.x-1.x will not see any new major features. Consider upgrading to 6.x, please.
Comment #2
afagiolisure, thanks