| 1 |
Imagepicker module for Drupal 6.x
|
| 2 |
|
| 3 |
If you have any questions or suggestions please contact me at
|
| 4 |
http://drupal.org/user/52366
|
| 5 |
|
| 6 |
This module will help you to upload images and insert them into your nodes in a
|
| 7 |
very easy way. To set up it follow next 5 steps and you should be done.
|
| 8 |
|
| 9 |
1. Installation
|
| 10 |
Upload whole imagepicker directory into sites/all/modules
|
| 11 |
Login to Drupal site with a user which has an administrative rights and go to
|
| 12 |
Administer > Site building > Modules. Scroll down to Other modules section, you
|
| 13 |
should now see Imagepicker module listed there. Tick it and press the button to
|
| 14 |
save configuration. Imagepicker module will create it's directory structure in
|
| 15 |
your files directory (configurable via Administer > Site configuration > File
|
| 16 |
system) and all images will be saved in these directories depending on the name
|
| 17 |
of user who is uploading images.
|
| 18 |
You can change the default settings for imagepicker under
|
| 19 |
Administer > Site configuration > Imagepicker
|
| 20 |
|
| 21 |
NOTE: Once you install Imagepicker module, it is not recomended to change
|
| 22 |
Drupal's files directory path. But if you do so, please make sure, that you will
|
| 23 |
copy whole imagepicker directory to the new location as well.
|
| 24 |
|
| 25 |
2. Enabling imagepicker
|
| 26 |
Imagepicker uses some HTML, which will be stripped out in input formats that
|
| 27 |
use the HTML filter. If you want to enable Imagepicker module for use with such
|
| 28 |
input formats, you will have to reconfigure filters.
|
| 29 |
|
| 30 |
3. Configuring filters
|
| 31 |
Go to Administer > Site configuration > Input formats. You should see a list of
|
| 32 |
all available input formats in your site. Click the configure link next to each
|
| 33 |
input format to see if it has the HTML filter is enabled. If it has, click on the
|
| 34 |
configure tab and add <img>, <div> and <span> to the HTML filter's
|
| 35 |
"Allowed tags".
|
| 36 |
|
| 37 |
To see these changes you will need to clear Drupal's menu cache, otherwise you
|
| 38 |
will see Access denied page instead of Imagepicker.
|
| 39 |
|
| 40 |
4. Clearing menu cache
|
| 41 |
Login to your site's database and truncate cache_menu table. Of course, you can
|
| 42 |
use Drupal's set of functions to clear it's cache, so it's up to you. One more
|
| 43 |
simple way to clear menu cache: go to Administer > Site building > Menus, then
|
| 44 |
select Add menu tab and click on the Submit button without adding any menu item.
|
| 45 |
This will rebuild Drupal's menu. Strange, huh? But this is Drupal, it uses lots
|
| 46 |
of functions even if it doesn't need to... Anyway, this method doesn't work all
|
| 47 |
the time, so the best way to do it is to do it stright in your database.
|
| 48 |
|
| 49 |
5. Using Imagepicker
|
| 50 |
Login with any user, who has rights to post any type of nodes and can use Full
|
| 51 |
HTML filters. Go to a node creation page, etc. Create content > Story. Somewhere
|
| 52 |
under node body you should see expanded Imagepicker module's field. Everything
|
| 53 |
else is stright forward from this point. Browse for an image file on your local
|
| 54 |
computer, enter maximum size in pixels of bigger thumbnail side, enter maximum
|
| 55 |
size in pixels of bigger image side if you want to scale your image or leave it
|
| 56 |
empty otherwise (this means - do not scale image), enter title and description
|
| 57 |
for your image and press Upload button. If you have made any mistakes, you will
|
| 58 |
see error message, or you will be redirected to 'Insert image' page otherwise.
|
| 59 |
In 'Insert image' page just check options you want and press Insert button. You
|
| 60 |
also can edit or delete your image here. Try using the 'Browse' tab if you want
|
| 61 |
to use already uploaded image, find your image and click on it. Images are
|
| 62 |
sorted by date - latest goes into the front by default, you can change this with
|
| 63 |
the Order dropdown.
|
| 64 |
|
| 65 |
NOTE: Image title will be used as image's alternative text and a title for link.
|
| 66 |
Description will be used only in image's page (imagepicker/image/{image_id})
|
| 67 |
|
| 68 |
Compatibility with browsers
|
| 69 |
I have tested this module with Firefox, IE6.5, IE7 and Safari. For
|
| 70 |
all other browsers - try it yourself, but I think it should work with most of
|
| 71 |
them.
|
| 72 |
|
| 73 |
|
| 74 |
Compatibility with tinyMCE
|
| 75 |
I have tested this module with tinyMCE module (tinyMCE version - 2.0) and it
|
| 76 |
works fine with Firefox 1.5 and 2.0. Altough it has some problems with IE6 and
|
| 77 |
IE7. On these browsers you firstly need to select an image, check all options
|
| 78 |
you want, then click on tinyMCE wysiwyg editor window (focus it) and only then
|
| 79 |
click on the Insert image button.
|
| 80 |
After inserting an image into tinyMCE editor (doesn't matter which browser you
|
| 81 |
are using) your cursor will be before '</a></div>' HTML tags. This might cause
|
| 82 |
some problems, so be aware of it.
|
| 83 |
|
| 84 |
My Imagepicker in My Account
|
| 85 |
Imagepicker can now be accessed in My Account, this is the best place to build
|
| 86 |
up a collection of images. Here you can create Groups and add images to one or
|
| 87 |
more groups. There is also an Admin mode where your images are listed.
|