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

Changing displayed content at the last minute

Using 4.6...

I have a node type which is basically a hacked version of page. It's pretty simple stuff. What I was is an opportunity to change the content of the node (that is, the displayed text). 9 times out of 10 the node content will be displayed as normal, but just occasionally, when the right conditions are met, I want to replace the displayed node content with some hard coded text. I don't want to permanently change the text in the node - next time it gets displayed if should show the node's text as normal (unless my conditions are met again).

Looking through the API I found hook_view(), which appears to do what I want. I hacked together an implementation of this function that just changes the $node->body value, and that looks like the answer:

function mod_view(&$node, $teaser = FALSE, $page = FALSE) {
  if( condition ) {
    $node->body = "Changed content";
  }
  $node = node_prepare($node, $teaser);
}

However, I'm very new to this, and I'm not sure of the knock on effects of this. Have I found a decent solution, or is there a better way to doing this?

Is there a module to set a password for some directory using .htaccess files?

Ha All,

Is there a module to set a password for some directory using .htaccess files? i mean a module which by using a button set a password for a directory inside home of a user? For Example i have picktures on gallery and wish not share all the Images. Then i put a .htaccess file in image directory and get picktures hidden?

I want a craigslist-like classified section for my site. Any ideas?

I know that Drupal doesn't have any classifieds modules, but it seems like classifieds modules generally have ads in categories. Instead of categories, I want my ads to be tag-based like craigslist is. Anyone have any ideas on where to start?

TinyMCE, ImageManager, and Per-user image directories

Everything works great, but I'd like to have everything set up so that when a user uses the ImageManager, they have their own directory.

Has one done this or knows how feasible this is?

Digg-style Voting Module

I very much like what frjo has done with the vote up/down module.

It utilizes the voting api, actions, voting actions, and links modules, along with some cool AJAX. Well done frjo.

Vote up/down mimics the reddit.com style of voting, rather than digg.com. I, and I'm sure many others, would like to see a Digg Voting module created as well. I'd like to do this myself, and actually have started experimenting based of the vote up/down module, but I am not very good at php yet, let alone AJAX.

image cvs with drupal 4.7x after post, it displays "page not found"

I'm expericing problem with image cvs with any drupal 4.7x or above.

After i post my image file somehow it looks got lost in translation.
and end up with a "page not found"

does anybody experiencing the same problem?

Pages

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