         ===========================================
         Multiple Content Regions Plugin for phpList
         ===========================================

Plugin Name: PBTS Extra
Plugin URI:  http://pizzabytheslice.com/phplist/pbts_xtra/
Description: Enables Templates to have multiple content regions 
             and conditional inclusion (and exclustion) of areas 
						 based on content availability.
Author:      Courts Carter
Version:     0.02 [beta]
Author URI:  http://pizzabytheslice.com/
--------------------------------------------

== Installation ==
------------------

OVERVIEW
Time to install: 10 minutes

You'll need to edit the config files, unzip the plugin into your
plugin directory, and make two modifictions to one phplist file.

STEPS
1.  open config/config.php and turn off the WSYSIWYG editors via a 
    configuration setting (~line 481):
      define("USEFCK",0); 
2.  Double check that TinyMCE is also turned off: 
      define("USETINYMCETEMPL", 0);
3.  Lastly, you'll probably want to turn off the auto-generated text 
    email. Or, turn on the manual text message option:
      define("USE_MANUAL_TEXT_PART",1);
4.  If you don't have your plugin directory defined you'll also need 
    to set this: define("PLUGIN_ROOTDIR","plugins"); or you may 
		specify some other path.
5.  unzip pbts_xtra.zip files into your plugins directory.

6.  Mofifying the SendEmail Library.
    These last two steps are the only ones requiring mods to core 
		phpList files. Open admin/sendemaillib.php. Add this line to the
		top of the file:

include_once dirname(__FILE__).'/plugins/pbts_xtra/pbts_xtra.inc.php';

    Note: if you installed the plugin in a different directory set
		this as needed.
		
7.  Next we replace the current Template tag substitution with the 
    PBTS_XTRA calls. Locate the following code (about line 180):
		
  if ($cached[$messageid]["template"])
    # template used
    $htmlmessage = eregi_replace("\[CONTENT\]",$htmlcontent,$cached[$messageid]["template"]);
  else {

    Replace (or comment-out) these lines with this:

  if ($cached[$messageid]["template"]){
    # template used
		if (!preg_match("/\[PBTS_/is", $cached[$messageid]["template"]))
			$htmlmessage = eregi_replace("\[CONTENT\]", $htmlcontent, $cached[$messageid]["template"]);
		else 
      $htmlmessage = pbts_replace_content( $htmlcontent, $cached[$messageid]["template"] );
  } else {

		
That's it. (hopefully)


== Sample Template ==
---------------------
In the zip there is a sample_Template.php. Create a Template and import 
this file as the content. It's important that the WYSIWYG editor be 
turned off, otherwise it will rewrite my custom region tags, replacing 
the & with &amp; and that will definitely break this.

The sample template is not necessarily a study in "best email layout 
practices", but serves for illustration purposes. I just had to add 
that, not that I'm ashamed of this one, but I'd definitely do it 
differently.

 

