Firefox PHP

System for embedding Phorum in other applications (early preview)

Posted by Maurice Makaay 
Re: System for embedding Phorum in other applications (early preview)
February 14, 2006 12:00PM
valiant, are you saying about having a dedicated place to discuss about integration of most major open source application, such as phorum, gallery2, and etc?
Re: System for embedding Phorum in other applications (early preview)
February 14, 2006 12:03PM
Don't run too fast people :)

First let this stuff mature a bit and let us play some more with it, so we get a firm grasp of what this way of integrating applications is really about. Once we have some rock-solid straight-forward [insert ton of buzzwords here] solution, we can try to get others to support it as well. It doesn't hurt to already do documentation and to think about problems and solutions, but it's way to early to already consider the things that are developed so far a generic solution that deserves its own project space.

Also keep in mind that lots of CMS-builders will probably see their CMS as a base system to start with, which already has a well-defined API for embedding applications in there. I guess it will be quite some mission to convince them to start supporting whatever we come up with. Remember that we're taking a reverse approach here. We're not writing a new application to fit into an existing CMS. We're giving an application an interface which makes the application embeddable in any system, as long as some glue code (the connector in the embed_phorum mod) is being written to couple the master and client.

The last thing about this: it's also not a magic solution. What I've built so far for Phorum does do the magic for Phorum, but it's no all-singing-and-dancing-trickbox-for-any-application. If we really want to push out a standard for this kind of integration, then be prepared to write code for other people's applications to make this possible. Just like I am now writing a Mambo connector, although I never used Mambo for my own site (I do this to see if my concepts work for other CMS'es than my own site framework).


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: System for embedding Phorum in other applications (early preview)
February 14, 2006 12:09PM
if i have time to launch this standardization initiative then it would require RFC like documents / specifications, examples, a board of projects / members that join the initiative and probably also a forum to discuss the specs and a forum to support people that want to follow the specs.

@Maurice:
We (Gallery) have "a firm grasp" abour this way of integration. it's not like it's new. it's in use and we made our experiences, saw its problems etc.

i'll stop hijacking your topic here. i just came here because i wondered about a few details and you answered my questions.

i let you continue to discuss phorum.org related matters / this embed module in this topic.

i keep you posted if there are any developments on my side in the direction of a standardization initiative.



Edited 1 time(s). Last edit at 02/18/2006 02:20PM by valiant.
Re: System for embedding Phorum in other applications (early preview)
February 15, 2006 08:39PM
Thanks valiant. I think what Gallery has done so far is a good beginning for a serious project. All I tried to do is bring in some realism to keep such a nice project from burning down because of over-enthousiasm ;-) I've seen too many projects start out like this on my forums (including a cool project name, project members, a buzz-word compatible website, repositories, wiki, the works), but stop right after the first setup because the actual subject that the project was about got neglected and forgotten. You only have to browse through Sourceforge too to see all those great ideas not being finished. I'm sure that Gallery and Phorum (and probably others too) can setup and maintain a serious project for this, simply because it's an actual problem that has to be solved.

Simply said: keep up the good work and please keep me posted! :-)

Back to the embed_phorum mod

I have done a lot of work on building a template that can hold up in tight spots. I did this, because lots of CMS'es provide a common 3-column layout with fixed width space where Phorum would have to fit. The default Phorum templates don't hold up when squeezed. The template I have now fits well in the 520 pixel wide space that is availble in the demo Mambo template. Next to that I did try out a lot of new stuff in the templates to see how some interface ideas that I had worked and to make them easier to work with (from a templatebuilder view). If you want to try out the template, then login using phorum/phorum on [mambo.gitaar.net] (using this login you have moderation rights too, so you can check out all available features). Also see the screenshots attached to this message.

New package

A new package can be found in the start of this thread. Here's the full changelog for the new 0.0.8 release:
- Created a completely new templateset, for which the target was to
  make it fit withing small spaces. When embedding Phorum into a
  site, this might often be the case, so it's good to have an
  adapted template for that. A demo of the template can currently
  be viewed at [mambo.gitaar.net]
  Login with username "phorum" and password "phorum" to see all
  features (including moderation).

- Added new method fix_content() to the connector class. This method
  can be used to apply last-second fixes to the content, before it
  is send to the connector.

- Implemented fix_content() in the base class to fix src="..." and
  href="..." occurances that use relative links. It's a rather
  crude fix for now, because it does not look if those strings are
  inside some html tag. If you are using a base href that points
  to the real Phorum install, you do not have to run the fixing code.
  In that case, you can override fix_content() in your connector to
  return NULL.

- Fixes a variable namespace collision in run_phorum.php (for $page)
  which caused threaded read not to display properly.

- Added head_data page element to the page handling code in the
  Mambo connector.

- Handling the email address setting in the control panel is now
  working correctly.

- Added a get_template() method to the connector so it's now easier to
  set the template to use, by having this method return the (directory)
  name of the template to use. This method can return NULL in case
  Phorum is allowed to decide what template to use.

- Added loading includes/cache.php in the on-the-fly synchronization
  code of the gitaar.net and Mambo connectors, so user caching can
  be enabled in the Phorum settings.

- Did a fix in the Phorum core to make the "Edit message" link work.
  If you need this, you can download a snapshot package or a Phorum
  version higher than 5.1.8-RC2. If you can't install a newer
  version, you can probably fix the problem by adding
  global $post_fields;
  to the start of the phorum_process_page() function in run_phorum.php
  (untested, but I'm pretty confident that this will work).

- If the user is logged in, the module redirects the user to the index
  page when accessing the login or registration page. This is needed
  for example to get out of the login page (only a simple message in
  embedded mode, because Phorum does not handle logins) when a user
  follows path:
  - login into the master application
  - go to a private page, like private messages
  - logout from the master application
  - phorum will now show the login page
  - login into the master application
  - module redirects the user to the index page instead of
    still displaying the login page


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce


Re: System for embedding Phorum in other applications (early preview)
February 16, 2006 12:26AM
Very nice! I will download the latest and test.

Thanks

[opensourceCMS.com]
[ongetc.com]
Chanh Ong
Re: System for embedding Phorum in other applications (early preview)
February 16, 2006 07:51AM
I released a new version 0.0.9. You really should use this one, because the 0.0.8 had a development statement in footer.tpl, which took care of dumping all /tmp/tpl-* files after each page. As always, the package can be downloaded from the first message in this thread. Here's an overview of the changes in this release:
0.0.9 2006-02-16

- IMPORTANT: In the 0.0.8 release, the footer.tpl contained 
  a statement to remove all /tmp/tpl-* files. This was done
  to make development easier. If you have the cache directory
  set to /tmp and are running UNIX, this will give a performance
  hit, because all compiled templates are cleaned up after
  each page.

- Changed the template for the PM system:
  The outgoing folder is now separated a little bit from the 
  incoming folders, in case the user has created custom folders. 
  The folder manager is now split into three separate folders. 
  This way <enter> instead of clicking the submit button will
  work for both the new folder and the rename folder form.

- Updated the README file to match some of the latest changes.

- Added an embedded version of the default Phorum template and
  put both currently available templates in a subdir "templates"
  in the package.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: System for embedding Phorum in other applications (early preview)
February 16, 2006 09:25AM
You are too fast!

I have not had a chance to download 0.8 yet!

I will get the latest.

Thanks for the mods.

[opensourceCMS.com]
[ongetc.com]
Chanh Ong
Re: System for embedding Phorum in other applications (early preview)
February 16, 2006 11:00PM
Maurice,

Just donwload and install and it works!

But when I click on "control center" I got this:

Notice: Undefined index: user in f:\wamp\www\phorum\include\users.php on line 336
'; // Marker for regular messages. $PHORUM["DATA"]["LANG"]["mod_message_icons"]["message"] = ''; // Marker for announcements. $PHORUM["DATA"]["LANG"]["mod_message_icons"]["announcement"] = ''; // Marker for sticky posts. $PHORUM["DATA"]["LANG"]["mod_message_icons"]["sticky"] = ''; // Marker for closed topics. $PHORUM["DATA"]["LANG"]["mod_message_icons"]["closed"] = ''; ?> [element style] [element base_href] [element http_path] [localhost] [element rss_link] [element rss_url] [element redirect_meta] [element redirect_url] [element redirect_time] [element lang_meta] [element title] Phorum :: Test Forum [element head_data] [element body_onload] [element body_data]

Thanks

[opensourceCMS.com]
[ongetc.com]
Chanh Ong



Edited 1 time(s). Last edit at 02/16/2006 11:02PM by chanh.
Re: System for embedding Phorum in other applications (early preview)
February 17, 2006 04:07AM
You have weird stuff going on. If you see "Marker for regular messages" on your screen, then probably you're using the message_icons module in which there's an error in the language file. It looks like the problem is in the single/multi definition string. You probably end the PHP-block there using ?>.

The undefined index warning is one I do not understand. Line 336 is the start of this codeblock:
    if ( isset($GLOBALS["PHORUM"]["user"]) && $GLOBALS["PHORUM"]["user"]["user_id"] == $user["user_id"] ) {
        $GLOBALS["PHORUM"]["user"] = phorum_user_get( $user["user_id"] );
    }
The index "user" shouldn't give problems here, because there is a check to see if $GLOBALS["PHORUM"]["user"] is set. Maybe I'm not yet wake enough :) If someone else sees where this is coming from, please let us know.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: System for embedding Phorum in other applications (early preview)
February 17, 2006 06:50AM
And here's version 0.0.10 of the embed_phorum mod. Download it from the first post in this thread.
0.0.10 2006-02-16

- Fixed a bug in the query parsing in the base connector. Phorum
  pages with numbers in them were not recognized. Phorum does not
  have them in the distribution, but we found this out because
  the addon "newest11.php" did not get loaded. Now, the query 
  parsing code accepts more page names.

- Made the displaying of moderator options when clicking the
  "Moderator Functions" link a lot faster in the "embed_phorum"
  template. 

- Fixed some displaying issues in the posting editor files of
  the "embed_phorum" template.

- Unexpected output from Phorum (output before the first 
  [element] in the header.tpl) is not captured and put in 
  $elements["unexpected_output"]. The connector can decide what
  to do with this output. In the provided connectors, the output
  is printed before the body.

- The trick with the cookie_image script did not work. The cookie
  was printed outside the template [element]s and the URL to the
  cookie was not generated using phorum_get_url(), so it pointed
  to the real Phorum installation. Next to that, I can only generate
  a URL to a main level Phorum script. Generating a URL to
  mods/embed_phorum/cookie_image.php did not work. So now the 
  cookie image code is pulled in the embed_phorum.php script.
  These changes make the cookie image trick work in embedded Phorum,
  so now the session id is only generated once per session.

- Fixed an undefined index warning in header.tpl.

- Fixed a little typo in the embed_phorum template's css.global.tpl.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Sorry, only registered users may post in this forum.

Click here to login