2

I'm trying to make signature.tpl.php available to spam filters (by default it is not).

  1. Will adding a preprocess hook to template.php will do the trick?

  2. If so, what preprocess hook should I choose?

In this drupal answer post, someone has suggested the following snippet to solve this problem:

function THEME_preprocess_signature_forum(&$variables){
  $content = $variables['signature'];
  $test = spam_content_is_spam($content, 'signature_forum');
  if (!empty($test['is_spam']) && $test['is_spam']){
   $variables['signature'] = t('This signature has been removed by our spam filter, please contact the site administrator for assistance');
  }

}

But it had no effect for me. Any ideas?

6
  • Hehe, that was me. Untested, as I don't use that module, but possible. Perhaps the preprocess function is themename_preprocess_signature instead of preprocess_signature_forum. Worth a try, clear theme registry cache after modifying such functions. Add some debug code to ensure function is executed. Feb 7, 2013 at 21:53
  • Nice to see you here David :) Actually I used both variants as per your suggestion but none works.
    – alfish
    Feb 7, 2013 at 22:00
  • OK, it was really just a guess, is the function called? I'd try it out myself, but not using those modules, snippet was assuming D6. Feb 7, 2013 at 22:01
  • How should I see if the function is called?
    – alfish
    Feb 7, 2013 at 22:04
  • drupal_set_message(__FUNCTION__); or var_dump(__FUNCTION__); Feb 7, 2013 at 22:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.