Coder1
Aricles and Screencasts by Mike Milano
Today is: 1 July, 2009
Check todays hot topics or new pictures
Aricles and Screencasts by Mike Milano
Today is: 1 July, 2009
Check todays hot topics or new pictures
Subscribe All Users to a Simplenews NewsletterThere'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.
Drupal do_search limit is hard coded to 10 - Here's a work-aroundRecently I had to implement a custom search function using Drupal's do_search() function. I needed to display many more results than 10, which is hard coded in the function. The simple solution was this: 1. Go to http://api.drupal.org/api/function/do_search/6 (make sure you get the function for the correct version of Drupal you are using) 2. Copy the function and rename it to something like do_search_custom. 3. Add a parameter called $limit and make it default to 10. ( $limit=10 ) 4. Replace pager_query argument at the bottom of the function with $limit. Disable TinyMCE in Node Body Based on Node TypeThere'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. Entertaining Youtube Videos by Appcelerator from ZendCon 08Yes, I read the Zend Newsletter because usually I find something new in it. This issue was no disappointment as they featured some videos put together by Appcelerator, a sponsor at ZendCon 08. They interviewed attendees in a series of 4 topics: Developers LOVE PHP, PHP Developer Gripes, Developers HATE PHP, and The Best PHP Applications. Drupal Search : Index All Fields of a CCK NodeThe Drupal Search API is powerful and pretty intuitive, but finding details on how to do something as simple as enabling searching on fields other than title and body could be a little daunting. It's actually quite a simple concept. Anything exposed to your node view will be indexed. You can easily accomplish this by editing your content type and setting the Display Fields setting to Plain Text. Drupal ParaChat Module:: 2008-09-25 update: i've fixed a lot of things since the .0 releases, so make sure you're using the nightly snapshots for the latest code :: The ParaChat Drupal module embeds a ParaChat applet in your site and automatically logs in users with their Drupal username. There is access control so you can setup which roles you would like to be able to join the chat room. For added security, you can configure ParaChat to validate users from the ParaChat server before allowing them to join. PHP APC Performance Tests with Apache abToday I ran some quick tests with PHP APC using Apache's ab benchmarking tool. The goal was to see how much of a performance gain I could see between PHP APC disabled, then enabled. Pro Drupal Development for Drupal 6 is Released
While I haven't gone through the second edition yet, the book written for Drupal have has been an incredible resource. It is very well organized, easy to follow along with, and has plenty of code samples to help you on your way. How to: Namespace in PHPNamespacing has been long awaited to enhance PHP OO development, and it looks like it's finally here. At first, I thought it was going to become available in PHP6, but it has been ported to PHP 5.3. What is a Namespace? Namespacing provides you the freedom to name your classes what you want without worrying about any other classes, native to PHP or otherwise, interfering with your names. PHP foreach value by reference
The best way to demonstrate this is to establish an objective. |
|||
|
Copyright © 2008, Mike Milano
|