Open Source Content Management System

pl.olga.tellafriend

  1. Usage

pl.olga.tellafriend is a MidCOM library for including "tell a friend" functionality in web pages.

Usage

You should use it from within the component style like "show-article" in net.nehmer.static. First, load and instantiate the library:

<?php
$_MIDCOM->load_library("pl.olga.tellafriend");
$taf = new pl_olga_tellafriend();
?>

Then prepare a form. You should embed the form into a page you want to notify about. I use layers:

<div style="visibility:hidden" id="taf">
<?php echo $taf->controller->display_form(); ?>
</div>
<a href="javascript:;" onclick="your_favourite_show_hide_layer_js_function()>Notify a friend</a>

In case you would like to have the form shown when submitted form was incomplete, you can detect the state and set visibility of a layer:

<?php
$taf_visible = ($taf->result=='edit' && $GLOBALS["_POST"]["_qf__pl_olga_tellafriend"])?"visible":"hidden";
?>
<div style="visibility:&(taf_visible);" id="taf">
<?php echo $taf->controller->display_form(); ?>
</div>
<a href="javascript:;" onclick="your_favourite_show_hide_layer_js_function()>Notify a friend</a>
Designed by Nemein, hosted by Anykey