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

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?

Filter on output?

I'm working on an email cloaking module, as per the conversation thread at:

Towards the end where I commented with some specifications.

Pages

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