What does the "format_functions" plugin do?

Created by sebikul
Keywords:
Last updated by:
sebikul

The "format_functions" plugin can perform 2 very simple and common tasks. The first one is a very useful helper to build mailto links, it supports a large variety of parameters that extends its usability much further than a simple link.

Example:

================================================
<?php

include "init.php";

$params['address'] = 'my@email.com';

$params['subject'] = 'hi sam';

$params['cc'] = 'other_friend@email.com';

$params['encode'] = 'javascript';//to avoid spam, hex is also supported (with no parameters but address)

$mailto_link = mailto_format($stemp, $params)

?>

================================================

"$mailto_link" has now a full formatted mailto link, ready to be echoed

full list of parameters can be seen in the plugins file

The second function is used to define the google analytics in a custom var (a variable that is automatically passed to the template to be used internally). The only thing you need to use it is to configure your Analytics UID in the admin panel and then just call the function with the following command:

google_analytics($stemp);

The tracking code will be automatically stored in the "$stemp->customvars ['googleanalytics']" variable

Note that you can choose to use either the standard code or the asynchronous code