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

Couple of module hacks (Applefritter)

My website, Applefritter, has recently moved to drupal. We made some changes to a couple of the modules. I'm not sure if it's anything significant enough to interest anybody, so I figured I'd list the changes here, and if there are any requests, we can post the code or maybe even look at getting it integrated with the real modules.

Tracker:
We added the ability to display only nodes of a certain content type. The top of each tracker page has a list of links to display, for example, only new stories, new forum topics, or new blog entries.
http://www.applefritter.com/?q=recent/story

BBCode:
We've added support for a few more tags and included the texturize and autop functions. Most of this has already been done by codemonkeyx. We've also added a BBCode button bar to the submit page.

Image Manager:
On the Submit Story page, there's a link to the "image manager", which brings up a list of all the images in your photo gallery in a sub-window. Click on the links "thumb" or "image" links to insert the code for either a thumbnail or the full size image.
http://www.applefritter.com/?q=node/add/story

Category:
This is a combination of tracker and taxonomy that lists all entries of a particular taxonomy. The category page displays all the items of a particular category, sorted by title, author, or date. The teaser is not shown. I really want to modify this one to display the node image.

problems with embeded Class in a Module

I'm building a new module. I wanted to reuse some code that I picked up within my module. THe code is built with two class instances. But, if I try and use a "require_once()" statement to include them, when I execute a member function in the class, I get:

   Fatal error: Call to a member function on a non-object in 
   /drupal/modules/cloak/antispam/anti-spam.class.php on line 74

If I copy the classes into my .module file, and then instantiate and call them, I get an error, very similar, like:

   Fatal error: Call to a member function on a non-object in 
   /drupal/modules/cloak/cloak.module on line 521

In both cases, the "offending" code is:

   $crypt->HTML_Crypt($this->antispamemail, 1);

The HTML_Crypt class is included and works. If I call all of this outside of drupal from a separate PHP code file, it all works fine.

Are there any issues I'm running into with calling Class functions, etc. from within Drupal? If so, is there some way around this so I can utilize these classes?

TIA.

Security module?

I've been fooling around with header inspection, DNSBL lookups, attempted exploits, user agent tracking (bad bots), and access/ban lists.

If this experimentation were to ever make it into a drupal module, what features would be the most helpful/desired? In addition to what I've listed, what other features can you think of?

Thanks for the feedback.

Tool for importing / mass-adding users to Drupal?

I was wondering if anyone has developed a tool / script capable of "importing / updating" users from either a CSV or database? I need to migrate about 350 users to a new Drupal based site and a tool like this would be great for users & myself!


Radi Shourbaji

http://radi-shourbaji.blogspot.com

Filter help for module dev. and question

I'm working on a cloaking module which hides email addresses (as per my conversation and layout in Privacy/security of a website).

I've run into a small road block, since I'm not the greatest coder. I've got the basic structure in place, and associated functions burned in. However, I'm having a hard time modifying the eregi_replace() call (as ripped from the HTML filters) to call a function to act on the filtered/replaced text. Here's what I'm looking at:

$text = eregi_replace("([ \n\r\t])([A-Za-z0-9._]+@[A-Za-z0-9._]+\.[A-Za-z]{2,4})([.,]?)([ \n\r\t])", '\2', $text)&#59;

What I need to do is have the "\2" matched text passed through a function. So I tried something like:

$text = eregi_replace("([ \n\r\t])([A-Za-z0-9._]+@[A-Za-z0-9._]+\.[A-Za-z]{2,4})([.,]?)([ \n\r\t])", cloak_address('\2'), $text)&#59;

Customizing the "teaser"

One of the custom node modules I am developing for my site requires the ability to customize the "teaser". Rather than take the first "x" bytes as specified in the parameters for the node module - this module needs to provide the user with the ability to write their own teaser. Is there a hook or other method that would allow a module to set the content of the teaser and override the default behavior?

Pages

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