Drupal 6 module "Ajaxcache Block" User Guide

----------------------------------
INSTALLATION
----------------------------------
1. Enable module at admin/build/modules.
2. Make sure your theme_blocks function/template is using ajaxcache_block_list($region) function.
EXAMPLE:

function phptemplate_blocks($region)
{
  $output = '';  
  if ($list = ajaxcache_block_list($region)) {
  	foreach ($list as $block)
  	  $output .= theme('block', $block);
  }
  // Add any content assigned to this region through drupal_set_content() calls.
  $output .= drupal_get_content($region);
  return $output;
}

3. Make sure theme implementation to configure blocks is printing $data->ajaxcache_check code and Ajaxcache table header.
See included block-admin-display-form.tpl.php for example.
4. Make sure that ajaxcache_block_authcache.inc is included in authcache_custom.php.
EXAMPLE:

include_once dirname(drupal_get_filename('module', 'ajaxcache_block')) . '/ajaxcache_block_authcache.inc';

After all steps are done you can go to admin/settings/ajaxcache-block for common settings, admin/build/block to select a block to be loaded via ajax and 
on a block`s configuration page for block ajax settings.

----------------------------------
USAGE EXAMPLE
----------------------------------
Let`s consider we have "Organic groups" module installed and we want og-0 block to be loaded via ajax (it cannot be cached, because it have unique
content for every user - depending on if he is a member of a group and etc.)
1. Go to admin/build/block page, check "ajaxcache" checkbox and save settings.
2. Go to admin/build/block/configure/og/0 page.
3. In the "PHP code executed before setting default layout" area insert following code:

<?php
if ($onode = og_get_group_context()) {  
  print serialize(array('output'=> '..Loading. Please wait..', 'data' =>$onode->nid));
}    
?>

This will make Ajaxcache Smartblock cache string '..Loading. Please wait..' as block output and send group nid (gid) via ajax request on server to response 
building function if group exist. If it doesn't, than whole block won`t be printed on a page.

4. In the "PHP code executed before sending response" area insert following code:

<?php
global $user;	    			    		
og_user('load', array(), $user);
og_set_group_context(node_load($data));
?>

It will setup og context for this block. Note that we have $data variable, containing group nid (gid).
5. Set 'Bootstrap loading level' select to 'Full, without calling all modules init() function'. Note, that instead of 'Full' option ajax response won't be cached.
7. If your og-0 block`s div id is not named like 'block-og-0' you can change it using 'Id for pasting response html part' textfield.

6. Save block settings. Now it`s default content will be the string '..Loading. Please wait..', which will be replaced after successfull ajax request to appropriate block
content.