Closed (fixed)
Project:
Advanced Forum
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
29 Feb 2008 at 21:50 UTC
Updated:
14 Jul 2012 at 19:30 UTC
Jump to comment: Most recent file
At the moment advanced_forum_extravars collects information from a number of hardcoded modules. When this function would invoke a hook (eg hook_advanced_forum_extra_vars) modules that you don't know about can support advanced forum. It also makes it easy to implement advanced forum support in custom modules without resorting to changing the theme.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | advanced_forums_extra_variables_d6_228557.patch | 3.8 KB | neclimdul |
| #11 | advanced_forum.module.txt | 33.42 KB | michelle |
| #6 | preprocessor.patch | 13.57 KB | neclimdul |
| #4 | preprocessor.patch | 13.81 KB | neclimdul |
| #4 | advanced_forum_includes.tar_.gz | 1.76 KB | neclimdul |
Comments
Comment #1
neclimdulI came across a similar problem of extending advanced forum for a site. Also, the code base is alpha and quickly changing so its hard to commit too. So, I got some coffee and started hacking along the same lines with the hook.
What I quickly realized was that we where just adding additional preprocessors along the same lines as MODULE_preprocess_hook work in Drupal 6. So... I ended up ripping code out of the theme registry and the views module include system and ended up with the following patch.
Did I mention there was a lot of coffee involved? Also... it was 3am. Please give it a close eye but I think its a pretty cool solution to the problem that allows for a lot of code reuse in Drupal 6 as well as allowing for optimizations in that environment(use of the native theme registry).
I couldn't figure out how to create a directory for files in a patch so there is a zip with some includes.
Comment #2
neclimdulthe real modules directory.
Comment #3
neclimdulOk, sorry, here's a real patch that's review worthy. Not much has changed but there are no whitespace cleanups, extra docs, etc.
A run down of how this actually works.
Part 1) Internal calling, I think theme_forum_user is an easy example and the only place really taking advantage of this functionality. At the begining of this theme function we where manually calling the preprocessor function directly.
Instead, we now call this:
This enters the the code in the preprocessor.inc that very much emulates the theme registry in Drupal 6. So following our example, if we have privatemsg installed it looks for privatemsg_preprocess_forum_user. If I have a module name foobar it we be looking for foobar_preprocess_forum_user. This list is built for each function we call advanced_forum_call_preprocess and then the list is pushed into cache.
Then the functions are called and they add their variables are all merged together.
Part 2) Pluginness. So, how does privatemsg_preprocess_forum_user get added in. Well this is handled in advanced_forum_include. The code is stolen from views and interates through our modules and includes files from certain locations. Views uses this mymodule.views.inc and I've got it setup for advanced forums to use mymodule.forums.inc at the moment but this could be easily changed.
Comment #4
neclimdulFinally got around to updating this.
Run down of changes:
Comment #5
neclimdulremoved "is drupal 5" check from d6_compat file and merged with recent commit.
Comment #6
neclimdulpatch...
Comment #7
neclimdulwhitespace cleanup caused us to go out of sync.
rerolled.
Comment #8
neclimdulI think the patch got lost in a server hiccup or something. repost.
Comment #9
neclimdultrying again
Comment #10
michelleComitted to 5.x. Need to port to 6.x.
Michelle
Comment #11
michelleI got part way thru porting this a week ago and haven't had time to deal with it since. Here's what I did so far.
Michelle
Comment #12
neclimdulFinally got around to getting this updated. The only difference between this and michelle's posted code is the cache functions have been updated to the drupal 6 api and the advanced_forum_load_preprocessors function call has been moved earlier in the drupal initialization process to the registry builder will pickup the functions in the includes.
You can see my changes in the second attached patch.
Comment #13
neclimduldang upload problems! trying again...
Comment #14
michelleMight as well continue using this issue. We've decided to use the new plugin system for the styles to handle this as well rather than port the patch.
Michelle
Comment #15
neclimdulFinally an updated patch for 6.
And I'm claiming my issue back.
Comment #16
michelleCommitted, yay!
Thanks!
Michelle
Comment #17
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.