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

hook_access - can't edit other users' nodes?

I'm trying to create a custom node type that supports two levels of user editing: one set of unrestricted-users can edit all of the node's contents, and another set of restricted-users can edit only a subset of the node's contents.

node + i18node solution without using aliases

What do you think about this code. This code makes possible to load different language versions of node without using path aliases.

For example:
we have node language versions:
node/10 - english (en)
node/11 - french (fr)
node/12 - german (de)

Now it will work so:
en/node/10 will load english version - node 10
fr/node/10 will load english version - node 11
de/node/10 will load english version - node 12

The code itself: [node.module]

---...---

// Retrieve the node.
$node = db_fetch_object(db_query(db_rewrite_sql('SELECT n.*, u.uid, u.name, u.picture, u.data FROM {node} n INNER JOIN {users} u ON u.uid = n.uid WHERE '. implode(' AND ', $cond))));
$node = drupal_unpack($node);

// the new part
if ( $node->language != $GLOBALS['locale'] ) // comparing active language and node language
{
$translations = db_query("SELECT trid FROM {i18n_node} WHERE nid = $conditions[nid]"); // finding translations
$trid_ids = db_fetch_array($translations);
$trid_ids['trid'];

if ( $trid_ids['trid'] )
{
$node_translation = db_query("SELECT n.nid, n.language FROM {i18n_node} iln, {node} n WHERE n.nid = iln.nid AND iln.trid = $trid_ids[trid]");

while ( $node_lang = db_fetch_array($node_translation) )
{
if ( $node_lang['language'] == $GLOBALS['locale'] ) // If we found it - then reload the node info
{
$node = db_fetch_object(db_query(db_rewrite_sql('SELECT n.*, u.uid, u.name, u.picture, u.data FROM {node} n INNER JOIN {users} u ON u.uid = n.uid WHERE n.nid = ' . $node_lang['nid'])));

Simple node module - attach a required file?

Hi,
I'm trying to make a module with a specific handling of a file, so I do not want to use upload module, thanks.
I've resumed my problem in a toto module, which is below. I've tried several things, without success. I have always a "toto file field is required.".

Flexinode and Event don't work together

Hi,

When installing Flexinode - and then the Event module - the modules page (where modules are activated) doesn't show (or doesn't load completely). It's blank in Firefox and in IE6 the server is not found... Strange by the way since other pages show.

I deleted all Event module files from my ISP and could reload the modules page successfully to activate Flexinode. I also tried deleting Flexinode and upload the Event module files instead. The modules page loaded successfully again... Only not at the same time.

New module for my Image Handling Script?

Overview

I have a script that uses mod_rewrite and GD library that allows custom views of an image based specifically on the file name. I can use it already, along side Drupal, but I am trying to guage interest in getting it into a true module with some enhancements (like AJAX support). I don't know how much functionality is already available... Interested in your views.

Drupal and Music Reviews?

Greetings Everybody,

I was wondering if there is a music review module for Drupal? I can see there is a movie- and a book reviewmodule.

I'm no shark to PHP and MySQL so I'm not to keen of trying to modify the source code of any of the modules - but I'd be grateful if there is one out there who would try to do it.

Thanks a million

JonasB

Pages

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