coder1.com

  • home
  • drupal articles
  • contact
Home

Newsletter

Subscribe All Users to a Simplenews Newsletter

Mike Milano — April 29, 2009 - 10:51am

There's been a couple times where I've had to subscribe all users to a new newsletter.

I started out with a snippet I found which cleans up the subscriptions, but I lost the link or I would have referenced it here.

Here's the code that will subscribe all users to newsletter node id 16. Note I'm using mysql_insert_id() as a quick fix so you will need to use another method if you're not using mysql.

  1. $result = db_query("SELECT uid, mail FROM {users} WHERE uid>0");
  2.  
  3. while ($row = db_fetch_object($result)) {

  • Drupal
  • Newsletter
  • Simplenews
  • Subscribe
  • Add new comment
  • Read more

Disable TinyMCE in Node Body Based on Node Type

Mike Milano — December 5, 2008 - 12:11pm

There's been a few sites I've used WYSIWYG editors on recently where I've run into the issue of needing to disable it on certain text areas. TinyMCE supports this with a theme override just fine, however, it's not so simple when you have multiple text areas with the same name.

Take the node edit form. For every node type, the body uses the same name.

A practical example of when you would need to disable a WYSIWYG editor would be when filling a node body with previously designed HTML like when you design an HTML Newsletter.

  • Drupal
  • Newsletter
  • Nodes
  • Theme
  • TinyMCE
  • Add new comment
  • Read more
Syndicate content

Poll

Have you used any NoSQL Databases?:

User login

  • Request new password

Navigation

  • Recent posts

  • home
  • drupal articles
  • contact