Saying goodbye to an old friend !

Today we say goodbye to mambodocman.com. Launched in March 2004 it has served the DOCman project for over 4 years. Last November we moved the forums over and today we are letting the curtain fall over the old site.

Saying Thanks!

This is an excellent opportunity to say thanks. First of all a big round of applause goes to Vasco Nunes, founder and original developer of DOCman. Vasco started development of DOCman in the summer of 2003 and worked on the project from versions 1.0 to 1.3.

Vasco is also the one who invited me to join the DOCman project in early 2004 to help out with DOCman 1.2. My work on DOCman later caught the eye of the Mambo core team which I joined in April 2004.

I would also like to thank all the previous contributors for the efforts they have put into the DOCman project over the past years (in random order):

  • Charles Gentry (developer)
  • Timothy Beutels (developer)
  • Mathias Verraes (developer)
  • Shayne Bartlett (doc writer)
  • Peek (graphic designer)
  • Alexander Krestinin (tester)
  • Mark Semczyszyn (tester)
  • Marko Milenovic (tester)
  • Krisstoffer & Harri (forum moderators)

These are the people that have made DOCman one of the most popular extensions for Mambo and Joomla!.

Looking into the future

DOCman development has been a little slow of late, because we’re working on Nooku all the time. Mathias, current lead developer for DOCman, already answered this question in a comment on one of his recent blog posts:

We’ll make an announcement on the future of DOCman soon. Don’t worry, DOCman is not dead — it’s not even sleeping, just taking a quick nap!

We have big plans for DOCman future, keep a close eye on this blog in the coming weeks…</p>

From today forward all information about DOCman can be found on our extensions page.

Read more

Hidden feature: Joomla’s media folder

Traditionally, Joomla extensions stored all their assets (images, javascript, css, flash files…) inside the extension’s folder. However, because these files are supposed to be publicly accessible, and all other files should stay hidden, that doesn’t really make sense. Fortunately, this was fixed in Joomla 1.5.4. Extensions can now use the /media folder.

How does it work?

Very easy: simply add a media tag in your extension’s manifest file.

Before:

<files folder="site">
 <folder>some_folders</folder>
 <folder>css</folder>
 <folder>images</folder>
 <folder>js</folder>
 <file>index.html</file>
 <file>mycomp.php</file>
</files>

After:

<files folder="site">
 <folder>some_folders</folder>
 <file>mycomp.php</file>
</files> 

<media destination="com_mycomp" folder="media">
 <folder>css</folder>
 <folder>images</folder>
 <folder>js</folder>  
 <file>index.html</file>
</media>

Inside your installable package, you should now have the folders /site and /media. During the extension’s installation, the files from /media will be copied to /media/com_mycomp (or plg_myplugin or mod_mymodule).

Benefits

Separating publicly accessible assets from the rest of the system like this has some security advantages. Ideally, you’d move all other files below the document root, increasing security. Joomla doesn’t support this yet. What you can do however, is add a htaccess file in /com_mycomp with ‘deny from all‘. This way you don’t need to litter your component with index.html files and defined(‘_JEXEC’) or die(); statements. Of course, this assumes that the end user’s host has AllowOverride turned on.

Read more

Using Joomla! as an intranet

If you’re using Joomla! for an intranet, or any site that is closed down completely for all non-registered, there’s a simple trick: put your site in offline mode. Out of the box this will lock down everything for everyone who hasn’t got backend permissions, but there’s a way to change that.

Offline mode

Step one is to put the site offline. There’s an option for that in the Global Configuration. You’d normally use that when making significant changes to your site, to keep users out, but allow managers and administrators in. In our case, we want to allow all registered users. I suppose that with the new ACL in Joomla! 1.6, there will be a place where you can change this. For now, we’ll just make a small hack to /includes/application.php

// Find this line:
if ($this->getCfg('offline') &#038;&#038; $user->get('gid') &lt; '23' ) {

//Change it to: 
if ($this->getCfg('offline') &#038;&#038; $user->get('gid') &lt; '18' ) {

The template

You might also want to adapt the look of the login page to your site. Here we don’t need to hack a thing, as we can use template overrides. Copy the file /templates/system/offline.php to /templates/[YOUR_TEMPLATE]/offline.php. It’s plain HTML with some PHP tags, so you should have no problem editing it to your liking. Changing the graphics and some text will be sufficient for most people.

Read more

Easier debugging in Joomla!

If you’re a template designer or extension developer (or if you just like to hack existing extensions), you might want to take a look at J!Dump. I started the project more than a year and a half ago, in the dark ages when Joomla! 1.5 was still in beta. I didn’t have the time to maintain it, but luckily Jens-Christian Skibakk (aka jenscki) stepped up and took over development. This month, a brand new version 1.1 was released.

What is J!Dump?

J!Dump solves some often recurring problems during development. When you want to know what a variable contains, you can use var_dump() or print_r(), wrapped in <pre> tags for readability. With large complex objects, this quickly turns into a mess. Furthermore, the output is mixed in with regular Joomla! output, which makes it even messier. And if you’re var_dump() statement is followed at some point by a redirect, you never even get to see the output.

J!Dump does it differently. When you dump($foo);, the contents of $foo are stored in the session data. At runtime, J!Dump opens a popup window, and shows the dumped variables, using a nice javascript tree. This allows you to dig into the variable a much nicer way than reading hundreds of lines of print_r output.

The best way to get a feel of how J!Dump can make your life easier, is to try it. Simply install both the plugin and the component on your test system and put a dump($some_object); statement in your code somewhere. Check the readme for more info.

Of course there are better ways to debug your applications. The nice thing about J!Dump is that it’s very easy to setup and get started, especially if all you need is a quick insight in the code instead of full-blown debugging.

By developers, for developers

J!Dump is a free GPL extension, which not only means you can use it as you wish, you’re also encouranged to contribute to it. If you want to add some features, let me know, and I’ll add you to the project.

The book “Mastering Joomla! 1.5 Extension and Framework Development” by James Kennard mentions J!Dump, as well as J!Code, as being two prominent tools for the developer. Cool!

Read more