Article List

Article List

How to turn off all contrib modules

Posted by Michelle on Thu, 04/17/2008 - 13:57 in

If your site is totally crashed and you suspect it's a contrib module but don't know which, here's a quick way to turn them all off in the database:

UPDATE `system` SET status=0 WHERE filename LIKE '%sites%'

This simply disables them; it doesn't uninstall them. It also assumes you are putting your contrib under sites\all or sites\sitename.

Michelle

Converting from nodeprofile to bio

Posted by Michelle on Tue, 04/01/2008 - 21:47 in

I decided to convert CRO from nodeprofile to bio. Nodeprofile is nice for really complex profiles with multiple nodes but I didn't need anything that fancy. More important to me was the ability to put individual fields on the registration page.

Managing your views in code

Posted by Michelle on Tue, 03/25/2008 - 14:26 in

Note: This is for Drupal 5.x and views 1.6.

Panels 2 comes with a nifty exporter that will dump all your panels related stuff (pages, views panes, mini panels, etc) into one export file set up to work as a module. It's a really useful feature for moving them from site to site or simply keeping them in code for outside the database backups.

Views 1, being a much older module, doesn't have quite as nice of an exporter. It does allow you to export your views one at a time but using that export in a module takes a bit more work. This article will show you one way of doing it. There are other ways, such as putting all the views in one file, but I find this method easier to maintain.

Converting from user profiles tutorial to advanced profile

Posted by Michelle on Thu, 02/21/2008 - 11:13 in

I've started converting Coulee Region ONLINE, which was the basis of the user profile tutorials, to using advanced profile. So I have some preliminary docs for converting from the tutorial:

  1. Take your site offline as this will make a temporary mess
  2. Disable nodeprofile bonus (this won't be needed anymore so can be deleted as well if you want)

hook_theme_registry_alter for advanced template control

Posted by Michelle on Sun, 02/17/2008 - 15:00 in

I'm in the process of porting Advanced Forum to Drupal 6.x and am trying to take advantage of the new theme system. One of the things I wanted to do was get rid of the requirement to copy the forum theme to the site theme directory. My goal was to make it so the whole thing could be run right out of the module directory but allow any template copied to the user's theme to override what's in the module. merlinofchaos helped me quite a bit and told me about hook_theme_registry_alter(), which isn't documented much yet. I decided to write up what I learned today in this article. Keep in mind that this is written by someone who has only really dug into the new theme system in the last few days, but merlinofchaos gave it a look over and he thought it looked ok. If you have comments on the article, I'd like to hear from you, but please no support questions. I barely understand this myself. ;)

---

The theme system in D6 does an excellent job of handling template files which will work well for most people. If you need very specific control over the theme registry, however, there is hook_theme_registry_alter(). This hook lets you get in and modify the registry directly. It has a paramater, $theme_registry, which holds the whole registry. To see what's in it, you can use something like this:

<?php
MODULENAME_theme_registry_alter
($theme_registry) {
 
// Assuming you have the devel module installed
 
dsm($theme_registry);
}
?>

This will give you a nicely formatted listing of the entire array to check out. By modifying this array, you can affect how template files are handled.

User Profiles Version 3 - Advanced Profile

Posted by Michelle on Tue, 01/08/2008 - 16:34 in

User Profiles Version 3 is no longer just a tutorial. I have taken as much as I could of version 2 and put it into the Advanced Profile module. By using Panels 2 as a base, I can provide a base to build on and a bunch of building blocks which non programmers can use to put together a customized user profile.

Directory browse page

Posted by Michelle on Fri, 01/04/2008 - 17:35 in

It's likely to be some months before I get to writing this tutorial so I decided to throw up some tidbits. These are offered as is. Please don't ask for support. I'm already behind in supporting forums & profiles and just can't add to that. Don't expect to be able to just drop this in and have it work but, if you have some idea of what you're doing, this may be helpful.

How to move the comments on node display

Posted by Michelle on Thu, 12/13/2007 - 22:44 in

Now that Fivestar has the ability to add rating to comments, I decided to switch from the way I was doing rate and review to using comments for reviews. But I have my nodes heavily themed including parcelling out bits into tabs and reviews are one of those bits. I didn't want them stuck down where the comments normally go.

Populating a forum with devel

Posted by Michelle on Sun, 11/25/2007 - 19:17 in

In working on the advanced forum module, I needed a full forum to work on. I used the devel module and ended up with forums full of "this post has been moved". It turns out that devel doesn't fill in forum.tid. So I needed to run this SQL:

update forum
inner join term_node on forum.nid = term_node.nid

Advanced Forums

Posted by Michelle on Mon, 11/12/2007 - 19:32 in

I tweaked the forums on CRO quite a bit but it's been too much of a mess of hacks to share. When I decided to copy my changes to the forums here, I realized it was time to clean it up and make it portable. Which has spawned a new module.

You can read the discussion of it here: http://groups.drupal.org/node/7064