CVS edit link for Ivan Simonov
I successfully use Drupal for a long time and I would like to make contribution to the community.Some time I wrote "randomimage" module for Drupal 5. Then I adapt it for Drupal 6.
I use this module on my site to show faces of our employees and their names and titles in block.
Friends ask me about this module and I decide rewrite it and publish.
I change conception of this module to use more standard Drupal functions.
For example "randomimage" depends of "upload" module for uploading pictures.
I recommend to install also http://drupal.org/project/upload_preview module.
Module adds 1 block, 1 page and 1 permission (viewing this page).
If you need more blocks (and pages), you can add them from the administrative interface of 1st block.
Also you can select node with uploaded images to be shown in the block.
If permissions is set users can click to block image and go to the page represents all pictures shown in this block.
In my case it useful when I want to show all staff photos with names and titles. They sorted randomly.
I know about http://drupal.org/project/random_images module
But It has not needed functionality.
This module exist only for Drupal 5 and not updated since 2007-Nov-28.
It is possible to use my module like next version of "random_images" module. Why not? :)
Actually it was start from PHP snippet:
// Depends on upload module
$nid= 2; // Node ID with pictures uploaded
$width = 200; // Desirable picture width
global $base_path;
$node = node_load($nid);
if (count($node->files)>0):
$index = array_rand ($node->files);
$filename = ($node->files[$index]->filename);
$filepath = ($base_path . $node->files[$index]->filepath);
$description = ($node->files[$index]->description);
print "<center>";
print "<img src='$filepath' width ='$width' alt='$filename'><br>";
print filter_xss($description, $allowed_tags = array('a', 'em', 'strong', 'cite', 'code', 'ul', 'ol', 'li', 'dl', 'dt', 'dd', 'img', 'br', 'hr' ));
print "</center>";
endif;
And something like this for page with all uploaded images.
Snippet good for some people, but to manage it you must have at least Use PHP filter permission.
To increase flexibility and automatize it I decide to make this module and share it.
I have another one module which uses actions mechanism and send to desired account alerts via Jabber protocol.
But I am not ready yet to send it.
Have a nice day,
Ivan.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | randomimage.zip | 2.77 KB | Ivan Simonov |
Comments
Comment #1
Ivan Simonov commentedModule attached.
Comment #2
Ivan Simonov commentedComment #3
avpadernoAre there any reasons you didn't open a feature request for all the features not existing in Random Images, or you didn't offer to become a co-maintainer of the existing module?
Comment #4
Ivan Simonov commentedI just look on the Random Images Issues Page
http://drupal.org/project/issues/random_images?categories=All
and decide this project is abandoned.
Last feature request was open 7 month ago and have no answer.
This request about version for Drupal 6.x
Advise me next steps please.
What better to do now? :)
Comment #5
avpadernoThe fact a project seems abandoned is not a reason to create a different project with the same purpose, or with very similar purpose.
You should offer to become co-maintainer of the project already in Drupal.org CVS.
Comment #6
Ivan Simonov commentedOK. You right.
I am agree to become co-maintainer.
Where I have to offer it?
Here or in random_images thread?
Comment #7
avpadernoThe support request to offer to become co-maintainer must be opened in the project issue queue.
Comment #8
Ivan Simonov commentedDone. http://drupal.org/node/694114
Comment #9
Ivan Simonov commentedUnfortunately no answer from current maintainer.
Any suggestions?
Comment #10
avpadernoThe current maintainer replied. I am going to add you as co-maintainer of Random Images.
Comment #14
avpaderno