Here's the code you need to support AF 2.x. Just add it to your .module file:

function advanced_forum_more_styles_ctools_plugin_directory($module, $plugin) {
  if ($module == 'advanced_forum') {
    return 'styles';
  }
}

If you decide you want to put 2.x styles in a different directory, just change the return 'styles'; line to have the name of the new directory.

You can mix 1.x and 2.x styles in the same directory and it will work. 2.x will just pick up the ones with .info files. But it may be confusing to your users to have files in there that don't show up in the list.

Michelle

Comments

xarbot’s picture

Hello:
This code must be in the advanced_forum_more_styles.module ? I'm using advanced_forum 6.x-2.0-alpha1

Thanks in advanced

michelle’s picture

That's what it's intended for, yes. AFAIK, he hasn't committed it yet.

Michelle

Netbuddy’s picture

So what exactly should be in the module file?

I cant get minimal to come up in the dropdown box. This is what was in the module file:

<?php
// $Id: advanced_forum_more_styles.module,v 1.1 2009/07/15 00:55:48 eigentor Exp $

function advanced_forum_more_styles_advforum_styles() {
$items = array();
$items['minimal'] = array(
'directory' => 'styles/minimal',
);

return $items;
}

Do I (add)

function advanced_forum_more_styles_ctools_plugin_directory($module, $plugin) {
if ($module == 'advanced_forum') {
return 'styles';
}
}

or do I replace the original code?

Either way doesnt seem to work.

michelle’s picture

It needs to be added to the module file, not replace what's there, or 1.x styles will no longer work.

This code is to make AFMS work with 2.x styles. It's not going to magically turn a 1.x style into a 2.x style. :)

Michelle

eigentor’s picture

Well the upgrade to 2.x takes a bit more than changing the hook. The template files need to be renamed and some other stuff. I got my style working in the 2.x version, but in the end did not like the design anymore...

@Netbuddy: it is not that hard to do. Just look into a 2.x style and see all the changes, apply them to your 1.x theme, read the manual... http://drupal.org/node/512116
It is about an hour work if you are used to this kind of stuff.

eigentor’s picture

Status: Active » Fixed

Finally a release compatible with Advanced Forum 2.x is available.

http://drupal.org/node/840932

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.