This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

guestbook

What's the best way to write a guestbook.module? (Like a real guestbook with nice links) Not a static page where people can add comments, now but a nice little static texts whith some links under it that say "read the guestbook" and "sign the guestbook"

FIX for random thumbnails in image.module

The random thumbnails weren't working for me -- sometimes I wouldnit get a thumbnail for an album on the gallery page.

When I looked at the code, the query didn't seem to make sense...

A patch follows, although it uses the mysql specific LIMIT clause -- Postgres has something similar, but what is the prefered way of handling this type of thing?

J


--- image/image.module	2003-08-18 12:03:14.000000000 -0700
+++ image2/image.module	2003-08-18 12:08:21.000000000 -0700
@@ -1229,10 +1229,10 @@
     $albums[$term_id]->thumb = $last_update->thumb_path;
 
     if (variable_get("image_gallery_thumb", "last") == "random") {
-      $nodes = db_fetch_object(db_query("SELECT MIN(nid) as min, MAX(nid) as max FROM {node} WHERE type = 'image'"));
-      $id = rand($nodes->min, $nodes->max);
-      $random = db_fetch_object(db_query("SELECT i.thumb_path FROM {node} n INNER JOIN {image} i ON  n.nid = i.nid INNER JOIN {term_node} t ON n.nid = t.nid WHERE t.tid IN (". implode(",", $terms) .") AND n.type = 'image' AND i.personal = 0 AND n.nid >= ". $id ." LIMIT 1"));
-      $albums[$term_id]->thumb = $random->thumb_path;
+      $id = rand (0, ($albums[$term_id]->image_count - 1));
+      $result = db_query ("SELECT i.thumb_path FROM {term_node} tn INNER JOIN {image} i ON tn.nid = i.nid WHERE tn.tid = ". $term_id ." LIMIT " . $id . ", 1" );

Module development guidelines?

Are there existing module development guidelines?

One of the things I would like to see in particular are some guidelines around content display/generation. So, no hard-coded styles, no hard-coded attributes like position etc.

Ideally, all content should be semantically tagged so that CSS styles can be applied for styling. Each module should ship with a default CSS file, which can then be modified or integrated into the main stylesheet.

Changing node_credits link

Hi!
I wanted to know, how to change the link for the user (author) name in the node title bar.
The idea is, not to display the user informations when clicking on it, but to make a user-email"
Where can I change that, or how can I get the variable for the user-email?

Please include more info in module README files

I'd like to suggest that module developers put a little bit more info into the README file so that users don't have to figure out how the module works and how to configure it. It might also be a good idea to put some contact information into the README file in case a user finds a bug or wants to add a new feature.

I say this after spending about a half hour trying to figure out how the refer module works and getting it set up properly. I probably could have saved the bulk of this time if the information had been in the README.

shouldn't revisions really be revisions?

Instead of just putting the whole shebang in the revisions field, shouldn't we put instead a diff(1) with the node's last content?

Arguably, this would force admins to have standard RCS tools available (diff, patch), unless someone knows of a PHP implementation lying around.

It's really sick to see the same data copied over and over again in the revisions field when only a few typos are being corrected in a revisionned node..

I will start working on this project soon if no-one has started this task yet.

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions