

To install:

The demo code is based on my practice installation which is loaded into 
	.../pmwiki/pmwiki.php?n=Portcullis.Login
or as I see it:  .../pmwiki/pmwiki.php/Portcullis/Login 
Adjust your code according to your installation.

Read the files with their comments first.
Make sure you change all of the files to match your Domain and paths.

Download from the pmwiki cookbook pages the
includeSite.php and httpvariables.php  copy them into your /cookbook folder
(you will edit your /local/config.php as well, but see the instructions below for that.)

Download the IFrameLogin.zip, unzip to your computer, edit the files and load to your server Thus:

framehost.js and frameguest.js simply need to have your Domain inserted.  (stripped down to just mydomain.org)

The postMessageTarget.php file includes demo login information, you will need to edit that before using it.

The wiki.d.Portcullis file has demo code for your pmwiki page, the address of the includeSite code 
needs to be changed to match your installation.  If you don't want to use the (:html:) markup I included then
you will need to edit your skin's template file e.g. /pub/skins/Skin.tmpl to include the needed elements.

Then:

Copy framehost.js, frameguest.js and postMessageTarget.php into a folder OUTSIDE of your pmwiki folder.  
	for example:
	pmwiki is in 		https://www.mydomain.org/pmwiki  and
	iframe files are in https://www.mydomain.org/iframe/demo

In your pmwiki site make a new Group and Page to host your Demo, for example:
	create:  [[Portcullis.Login]] 
	Copy the code from wiki.d.Portcullis and paste it into the new page
!!! -- Be sure to edit the URL to match where you put the framehost.js file

Copy the Portcullis.Login.php file to your /local folder 
while you are there, edit your config.php file to include the sample code in 
my ~config.php file.  As a learning demo, this should include all that you need
to get it working, including the includeSite and httpVariables recipes.

!!!! -- Again, edit to match your URL. 

----

"Cleaner" Options
* Edit your Skin.tmpl file to include then needed html instead of using 
  the (:html:) tags
* To be really cool, look into Group customization and add:
	<!--IncludeTemplate: {$Group}.tmpl-->  
	to your skin.tmpl file and then add the corresponding Group.tmpl 
	file to your /pub/Skins/YourSkin directory.

* Eliminate the httpvariables.php code after you prove your install works.
* I get odd blank-space around my includeSite-iframe due to 
  how the includeSite.php is written.  I have edited the code in includeSite.php to get a tighter install:


	  $Output .= "<!-- X-include -->" ;

	  if ($id=="") {  
	      $Output .= "<iframe class=\"ISframe\" src=\"" . Keep($m[1]). "\"></iframe>" ;   
	      #  [modified for PHP5.5 and younger]
	  }else{
	      $Output .= "<iframe class=\"ISframe\" id=\"$id\" src=\"" . Keep($m[1]). "\"></iframe>" ;   
	      #  [modified for PHP5.5 and younger]
	  }

	  $Output .= "<!-- /X-include -->" ;

	  return $Output ;


Mostly here, I have removed the <pre> tags and the "\n" new-lines.  I have also edited my Skin.css file 
to display the ISframe how I want.  You will want to play with that for your version.

  .ISframe  {
      width:          99% ; 
      height:        100% ;
      min-height:   840px ;
      overflow:      auto ;
      margin:         4px ; 
  }  
