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

MP3 field type for flexinode

I'm attempting to write an MP3 field type for the flexinode module. It is my first real forray into Drupal as a programmer, and I am already in need of guidance.

The field is an extended version of field_file.inc which does the following:
1 - accepts only a restricted set of filetypes (.mp3 and possibly other music formats)
2 - reads and stores metadata contained in the MP3
3 - creates an m3u file and tracks its location
4 - displays links to both the mp3 (for download) and the m3u (for streaming).

Filestore2 with node based file access control

Hi,

Today I made it my task to hack role based access control to uploaded files into Drupal. It turned out to be considerably easier than I originally anticipated. I'm new to drupal development, so I'm posting to ask how well my approach conforms with the "drupal way" and how secure it is.

This was done using a checkout from drupal cvs on the 15th of August. First of all, the filestore2 module makes a call to filter_tips_short which has been removed in the current version of drupal, so I changed this to filter_filter_tips(0, FI
LTER_HTML_STRIP). I don't know if this is right, but it works at least.

It is reasonable to assume that if someone has access to the node with which the file is associated, then they should have access to the file itself. Someone can only really know the url for the file itself without appropriate access permissions if they are doing something bold. Therefore, all we have to do before making a call to fscache_download is call node_access() to see if the user is allowed to read the node associated with the file. If it is, we proceed as normal by calling fscache, otherwise we do nothing and a blank document gets returned.

Comments very gratefully received.

PATCH:

91d90
<
94,97c93,98
< $node = node_load(array("nid" => arg(2)));
< if (fscache_download(array("fsid" => $node->fsid), TRUE)) {
< db_query("UPDATE {filestore2} SET downloads = downloads + 1 WHERE nid = $node->nid");

Comic strip module

I was looking for a module that would display a bunch of comic strips updated everyday, so I ended up writing one myself. You can see my implementation of it at http://forums.ahpnational.org/?q=comics. The module collection itself is at http://java.yukstah.com/~joe/comics.tar. I appreciate any sort of feedback on it. Please note that the sql is for PostGres, but it is very easy to port to MySql.

Using ping.module to notify Yahoo!

I'd like to modify ping to alert Yahoo! when my site is updated (as per their directions at http://my.yahoo.com/s/publishers.html#latepost), but I'm not especially familar with the format used. Normally I'd be happy to get in there and start messing with the code (and this looks fairly straightforward), but my site is in production, and I don't want to screw up my ping module. If anyone can shed a little light on this, I'd really appreciate it.

Thanks,
Dieter

filestore 2 nodes as forum topic?

I'm running a music site, and use Filestore 2 to upload / track the files, along with artist module. I would really like to have it so that when users upload a file, the node is created as a forum topic, which becomes part of the forums.

At the moment, I have to ask people to upload a file AND create a forum topic, which seems a bit pointless. If I use flexinode I don't get the new/top files list and I still have this forum problem. I would also like to have the 'flexinode' upload ability in comments.

Contact module run through taxonomy?

First, I'm not a developer, I'm on the service provider side, moreso for non profits. So bear with me:
I haven't used the contact.module yet, just read the readme and todo. One of the points brought up in the readme is that the contact module uses US zipcodes out of the box, or you need the US zipcode table if you're using it w/o modifications. Hypothetically, how realistic is it to customize the contact module to run w/ the taxonomy module, so that fields for area codes (like zipcodes or whatever they might be called in other parts of the world) can be created via vocabs, as well as state, or province, or region, or street address, or district, or even department, if you wanted to associate contacts and use this module not w/ people organized geographically, but by what department they are in an organization, or by what floor they live on in an apartment building, etc? So, maybe creating a few generic fields which can be for Zipcode, then a generic field for Location (street, state, province, district, departamento, distrital, whatever, but key is that it's setup to run w/ whatever function this generic holder is supposed to do, like zipcode associates w/ state, whereas you could have generic field A associate w/ generic field B, instead of narrowing in on state and zipcode right off the bat) Not sure if this point is clear, partly because not sure of advantages/disadvantages or how generic you could make the fields w/o losing their functionality.

Pages

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