total = $this->time = (float)microtime(true); $this->reset(); } public function clock() { return -$this->time + ($this->time = (microtime(true))); } public function elapsed() { return (microtime(true)) - $this->total; } public function reset() { $this->total=$this->time=(microtime(true)); } } class D { protected static $handle; protected static $growlr; protected static $config = array( 'debug' => true, 'warnings' => true, 'logfile' => 'logs/main.log', 'logmode' => 'w+', 'growl' => array( 'host' => 'localhost', 'password' => '' ) ); protected static $timers; static function initialize($config=array()) { self::$config = array_merge(self::$config, (array)$config); self::$handle = fopen(self::$config['logfile'], self::$config['logmode'], true); if(self::$config['debug']) { //"God Mode" //error_reporting(E_ALL | E_DEPRECATED | E_STRICT); error_reporting(E_ALL | E_DEPRECATED); ini_set('display_errors', 1); } else { error_reporting(0); ini_set('display_errors', 0); } } static function log($var=null, $label=null) { if(self::$config['debug']) { if(!self::$handle) { trigger_error('Failed writing to the log. ' . print_r(self::$config, true), E_USER_WARNING); return $var; } fwrite(self::$handle, self::getLogMessage($var, $label)); } return $var; } static function time($timer, $label='') { if(!isset(self::$timers)) { self::$timers = array(); } if(!isset(self::$timers[$timer])) { self::$timers[$timer] = new Timer(); return D::log(0, $label . ' | ' . $timer . ' Started '); } self::$timers[$timer]->clock(); return $label . ' | ' . self::log(round(self::$timers[$timer]->elapsed(), 4) . 's', $timer . ' | ' . $label); } static function growl($var, $label=null) { if(self::$config['debug']) { if(!isset(self::$growlr)) { try { require_once('growl.php'); self::$growlr = new Growl(self::$config['growl']['host'], self::$config['growl']['password']); self::$growlr->addNotification('log'); self::$growlr->register(); self::log(self::$growlr); } catch (Exception $e) { self::warn($a, 'growl failed'); self::$growlr = false; } } self::log($var, $label); if(self::$growlr) { try { self::$growlr->notify('log', $label, print_r($var, true)); } catch (Exception $e) { self::warn($a, 'growl failed'); self::$growlr = false; } } } return $var; } static function copy($var) { /* if(self::$config['debug']) { if(!is_string($var)) { $copy = var_export($var, true); } else { $copy = $var; } D::growl(exec('whoami')); //exec('env '); //escapeshellarg( //$cmd = 'echo "do shell script' . addslashes('echo \"' . escapeshellarg($copy) . '\" | pbcopy') . '" | osascript'; $copy = 'thing to put on your clipboard'; $apple = 'do shell script "' . addcslashes('echo ' . escapeshellarg($copy) . ' | pbcopy', '"') . '"'; $cmd = 'echo ' . escapeshellarg($apple) . ' | osascript'; echo "\n\n" . $cmd . "\n\n" . $apple . "\n\n"; exec($cmd); //exec("echo 'hmmmmmm' | /usr/bin/pbcopy"); } return self::log($var, 'Copied'); */ } static function show($var, $label='') { if(self::$config['debug']) { echo self::getDisplayMessage($var, $label); } return self::log($var, $label); } static function export($var, $label='') { if(self::$config['debug']) { echo self::getDisplayMessage(var_export($var, true), $label); } return $var; } static function getLogMessage($var, $label=null) { return "\n" . (!empty($label) ? '# ' . $label . ': ' : '') . stripcslashes(print_r($var, true)) . "\n\n -~-"; } static function getDisplayMessage($var, $label=null) { return '
' . "\n" . (!empty($label) ? '

' . $label . "

\n" : '') . '
' . htmlentities(print_r($var, true)) . '
' . "\n
"; } static function report($context, $error) { //$temp = "\n There has been an error. Context: " . $context . "\n " . "Error: " . $error . "\n Back trace:" . print_r(stacktrace(), true); //self::log($temp, 'Fatal and kinda expected error'); throw new Exception($context . ' In… ' . $error); exit($temp); } static function error($error='There has been an error') { throw new Exception($error); //exit(self::log("\n There has been an error. Message: \n" . $error . "\n Back trace:" . print_r(stacktrace(), true), 'Fatal and expected error')); } static function warn($warning='Warning') { //D::show('WHAT'); if(self::$config['warnings']) { if(!extension_loaded('xdebug')) { D::show(D::stack(), $warning); } trigger_error($warning, E_USER_WARNING); } } static function stackTrace() { return self::log(stacktrace(), 'Stack Trace'); } static function stack($label='Label') { return self::log( "\n" . join( "\n", array_reverse(array_map( function($v) { //) return ' ' . $v['function'] . '();' . "\n →" . substr(substr(@$v['file'], strlen(realpath(LOC))), 1, -4) . ' | line:' . @$v['line']; }, debug_backtrace() )) ), $label . ' - Stack Trace' ); } static function debug() { self::log(debug_backtrace()); } static function close() { if(self::$config['debug']) { fclose(self::$handle); } } } D::initialize(); A.J. Cates - Contact Form Plugin For Frog CMS includeSnippet('includes'); ?>

Contact Form Plugin For Frog CMS

This simple contact form supplies three fields: name, email, and message. The form is checked to ensure all fields are filled in; if any are missing, the form must be reloaded. As of 1.0.3, an additional field has been added to inhibit spambots. See changelog.txt for a complete update listing.

It is currently hosted on google code where it can downloaded. It uses a MIT style license, please see the ReadMe for more info.

Download Contact Form Plugin

Instructions:

  1. Unzip (if you're reading this, you have!) and move the contents of the "contact_form" folder to your /frog/plugins/ directory.

  2. Go to the "Administration" > "Plugins" tab in Frog's backend, and tick the Contact Form box in the "Enabled" column. Click on the "Settings" tab, go to the bottom of the page and click on the "Save" button.

  3. Create your "contact" page (or using an appropriate current page), insert this code into the "Body" portion:

    <?php makeForm('yourEmail@yourSite.com'); ?>

    with the email you wish the message to be sent to replacing the "dummy" email address above.

    (Note that the TinyMCE and Textile filters do not like raw PHP! So for this page, use either the Markdown filter, or none at all.)

  4. Add the following code to your site's CSS file:

    .contactForm { width:308px; } .contactForm p { padding:10px; } .contactForm input { width:240px; } .contactForm textarea { width:281px; height:120px; } .submit { width:45px!important; } .hide { display:none; }
  5. Test it out and your done!
includeSnippet('copyright')?>