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

Forms API - date question

Hi, using the date form API the default range of selectable years is 1900-2050.
Is it possilbe to change the year range? Thanks.

Need help on caching with filter

On my site caching is generally disabled. I wrote a filter, the filtered content is cached nevertheless.
In filter code I use 'no cache' option, the filtered content is cached nevertheless.
What do I wrong!?

Hosting Companies Email filters to eliminate outgoing spam

The hosting company I am with is about to make a change that I think will cause a problem for me and the use of the contact.module. They will implement a new filter in a few weeks that will not allow formmail scripts to send any email as FROM: a domain not hosted by them. The filter will apparently continue to allow the REPLY-TO: field to pass.

I use the contact.module on a 4.7 and a 5.0 beta site. I believe this change by the hosting company will render this module useless to most of my visitors.

Quotes block should link to node

I'm using the quotes module, which produces a handy block out of the latest (or random) quote node. However, I'd like the quote displayed in the block to link to the actual node.

Is this possible?

Ajax to update a block

Hey folks,

I've got an Ajax script, using the Jquery js library, that takes an array of quotes, currently hard-wired into a randomquotes.php file (but could easily be adjusted to take the quotes from a database), and updates the page with a random quote every 5 seconds. It seems to be working relatively well, but the plan is to extend this into a module (or to adjust the existing quote module to do this).

hook_user Help???

I want to create a simple module that uses hook_user to display the 5 most recent user submitted images on a user profile page (http://drupal.org/user/1).

I don't want to go down the route of overriding the user profile page using the template.php technique - http://drupal.org/node/35728. I am actually able to pull the 5 most recent images using the template.php override technique, but I don't want to rewrite everything that interacts with the user.module. Therefore, I have recently found the module hook system drupal uses and this seems to be a much better way to do what I need.

I am not fully understanding the hook_user syntax from the api here - http://api.drupal.org/api/4.7/function/hook_user. Here is the code I have so far:


/**
* Implementation of hook_user().
*/

function userprofileimages_user($op, &$edit, &$account, $category = NULL) {
if ($op == 'view'){
// Display N most recent thumbnails of images submitted by the user
// Each thumbnail is linked back to it's image node
// The number of thumbnail images to show
$nlimit = 5;

$userid = $user->uid;

$sql = "SELECT n.created, n.title, n.nid, n.changed FROM {node} n WHERE n.type = 'image' AND n.uid = $userid AND n.status = 1 AND n.promote = 1 ORDER BY n.changed DESC";

$result = db_query_range($sql, 0, $nlimit);
$output_content = '';
while ( $info = db_fetch_object($result) ) {

Pages

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