From 0e8e49e592bec48f1e09e2f1cb3f367ba46ae2c8 Mon Sep 17 00:00:00 2001 From: Michael Fairchild <mfairchild365@gmail.com> Date: Fri, 1 Oct 2010 21:56:15 +0000 Subject: [PATCH] Updated proposal text, added youtube url field, added email support, minor whitespace and formating changes. --- config.inc.php | 15 +++ config.sample.php | 15 +++ lib/php/UNL/WDN/Emailer/Main.php | 7 +- www/config.inc.php | 29 ----- www/config.sample.php | 12 -- www/physics/ribbon_cutting2010/index.php | 127 ++++++++++++++------ www/physics/ribbon_cutting2010/thankyou.php | 95 +++++++++++++-- 7 files changed, 211 insertions(+), 89 deletions(-) create mode 100644 config.inc.php create mode 100644 config.sample.php delete mode 100644 www/config.inc.php delete mode 100644 www/config.sample.php diff --git a/config.inc.php b/config.inc.php new file mode 100644 index 0000000..b158cf3 --- /dev/null +++ b/config.inc.php @@ -0,0 +1,15 @@ +<?php +ini_set('display_errors',false); +// Sample configuration file for the ucomm webforms project +set_include_path(dirname(__FILE__).'/lib/php/'.PATH_SEPARATOR.get_include_path()); + +function myautoload($class) +{ + $file = str_replace('_', '/', $class).'.php'; + require_once $file; +} + +spl_autoload_register('myautoload'); + +require_once '../../../lib/php/UNL/WDN/Emailer/Main.php'; + diff --git a/config.sample.php b/config.sample.php new file mode 100644 index 0000000..b158cf3 --- /dev/null +++ b/config.sample.php @@ -0,0 +1,15 @@ +<?php +ini_set('display_errors',false); +// Sample configuration file for the ucomm webforms project +set_include_path(dirname(__FILE__).'/lib/php/'.PATH_SEPARATOR.get_include_path()); + +function myautoload($class) +{ + $file = str_replace('_', '/', $class).'.php'; + require_once $file; +} + +spl_autoload_register('myautoload'); + +require_once '../../../lib/php/UNL/WDN/Emailer/Main.php'; + diff --git a/lib/php/UNL/WDN/Emailer/Main.php b/lib/php/UNL/WDN/Emailer/Main.php index a5c0b4b..87d38e8 100644 --- a/lib/php/UNL/WDN/Emailer/Main.php +++ b/lib/php/UNL/WDN/Emailer/Main.php @@ -17,7 +17,11 @@ class UNL_WDN_Emailer_Main { $savvy = new Savvy(); - $savvy->setTemplatePath(dirname(dirname(dirname(dirname(dirname(__FILE__))))).'/data'); + $template_path = dirname(dirname(dirname(dirname(dirname(__FILE__))))).'/data'; + if (!file_exists($template_path).'/WDNEmailTemplate.tpl.php') { + $template_path = dirname(dirname(dirname(dirname(dirname(__FILE__))))).'/data/UNL_WDN_Emailer/pear.unl.edu'; + } + $savvy->setTemplatePath($template_path); $html = '<html>'. '<body style="word-wrap: break-word;" bgcolor="#ffffff">'. @@ -41,7 +45,6 @@ class UNL_WDN_Emailer_Main require_once 'Mail/mime.php'; $mime = new Mail_mime("\n"); - if (isset($this->text_body)) { $mime->setTXTBody($this->toTxt()); } diff --git a/www/config.inc.php b/www/config.inc.php deleted file mode 100644 index 3b822e5..0000000 --- a/www/config.inc.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php -// Sample configuration file for the ucomm webforms project - -set_include_path(dirname(__FILE__).'/lib/php'.PATH_SEPARATOR.get_include_path()); - -function myautoload($class) -{ - $file = str_replace('_', '/', $class).'.php'; - require_once $file; -} - -spl_autoload_register('myautoload'); - -require_once '../../../../UNL_WDN_Emailer/src/UNL/WDN/Emailer/Main.php'; - -if (!empty($_POST)) { - -$mailer = new UNL_WDN_Emailer_Main(); - -// $mailer->html_body = 'this is the body'; -// $mailer->to_address = 'kylepowers@gmail.com'; -// $mailer->from_address = 'test@test.com'; -// $mailer->subject = 'this is the subject'; -// if (!empty($_GET['submit'])) { -// echo "BEFORE SEND...<br>"; -// $mailer->send(); -// echo "IT WORKS!"; -// } -} \ No newline at end of file diff --git a/www/config.sample.php b/www/config.sample.php deleted file mode 100644 index 371ccf8..0000000 --- a/www/config.sample.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php -// Sample configuration file for the ucomm webforms project - -set_include_path(dirname(__FILE__).'/lib/php'.PATH_SEPARATOR.get_include_path()); - -function myautoload($class) -{ - $file = str_replace('_', '/', $class).'.php'; - require_once $file; -} - -spl_autoload_register('myautoload'); \ No newline at end of file diff --git a/www/physics/ribbon_cutting2010/index.php b/www/physics/ribbon_cutting2010/index.php index 99c74bc..b027439 100644 --- a/www/physics/ribbon_cutting2010/index.php +++ b/www/physics/ribbon_cutting2010/index.php @@ -1,5 +1,26 @@ <?php -require_once dirname(__FILE__).'/../../config.inc.php'; +//TODO: Make page two collums, add graphic of iPad and the new building. +//TODO: Verify input. +require_once dirname(__FILE__).'/../../../config.inc.php'; +if (!empty($_POST)) { + $mailer = new UNL_WDN_Emailer_Main(); + + $body .= "<b>Name:</b> " . $_POST['name'] . "<br/>"; + $body .= "<b>Phone Number:</b> " . $_POST['phone'] . "<br/>"; + $body .= "<b>Email Address:</b> " . $_POST['email'] . "<br/>"; + $body .= "<b>URL to video:</b> " . $_POST['video'] . "<br/>"; + $body .= "<b>Type:</b> " . $_POST['type'] . "<br/>"; + $body .= "<b>Proposal:</b><br/>" . $_POST['proposal'] . "<br/>"; + + $mailer->html_body = $body; + $mailer->to_address = 'desertstorm365@gmail.com'; + $mailer->from_address = 'test@test.com'; + $mailer->subject = 'Ribbon Cutting Proposal'; + if (!empty($_GET['submit'])) { + $mailer->send(); + header( 'Location: thankyou.php' ); + } +} ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> @@ -64,44 +85,72 @@ require_once dirname(__FILE__).'/../../config.inc.php'; <div id="maincontent"> <!--THIS IS THE MAIN CONTENT AREA; WDN: see glossary item 'main content area' --> <!-- TemplateBeginEditable name="maincontentarea" --> - <h3 class="zenform">Physics Department Extreme Ribbon-Cutting Contest</h3> - <form class='zenform' action="?submit=true" method="post" name="physics" id="physics" target="_self"> - <fieldset style="width: 96%"> - <legend>Ribbon-cutting proposal</legend> - <p>The UNL Physics Department is inviting proposals from students, faculty, staff, alumni and friends on how to add some physics-related drama to a ribbon cutting. The department will dedicate UNL's new physical sciences building, Jorgensen Hall, at a ceremony scheduled for 4 p.m. on Friday, Oct. 29.</p> - <p>Anyone interested may submit a proposal for a way to open the building, preferably using some aspect of physics , to make the celebration more interesting than is possible using only ribbon and scissors.</p> - <p>Proposals should be submitted in writing to UNL Physics Department Chair Dan Claes. A faculty committee will select the top three proposals. The top three candidates will be invited to post a video demonstration of the proposal on YouTube so that interested parties can vote for their favorite proposal. </p> - <p>The winning proposal will be used to open Jorgensen Hall. UNL Chancellor Harvey Perlman and special guest speaker Alan Heeger, a UNL alum and Nobel laureate, will be present for the ceremony. </p> - <p>Rules: </p> - <ul> - <li>No humans or animals may be harmed.</li> - <li>No harm may be caused to the building.</li> - <li>Proposals will be accepted until 5 p.m. Oct 15, 2010.</li> - </ul> - - <p>There may be minor amounts of funding to purchase supplies for the implementation of the winning proposal.</p> - - <p>The creator of the winning submission will receive an iPod as a prize.</p> - <hr/> - <ol> - <li><label for="first_name" class="element"><span class="required">*</span>Name<span class="helper">Enter Your Full Name</span></label><div class="element"><input id="name" name="name" type="text" /></div></li> - <li><label for="first_name" class="element"><span class="required">*</span>Email Address</label><div class="element"><input id="email" name="email" type="text" /></div></li> - <li><label for="first_name" class="element"><span class="required">*</span>Phone Number<span class="helper">Format: 402-123-1234</span></label><div class="element"><input id="phone" name="phone" type="text" /></div></li> - - <li><label class="element"><span class="required">*</span>You are a:</label><div class="element"> - <ol> - <li><input name="type" value="UNL student" type="radio" id="unlstudent" /><label for="unlstudent">UNL student</label></li> - <li><input name="type" value="High school student" type="radio" id="hsstudent" /><label for="hsstudent">High school student</label></li> - <li><input name="type" value="UNL faculty" type="radio" id="faculty" /><label for="faculty">UNL faculty</label></li> - <li><input name="type" value="UNL Alum" type="radio" id="alum" /><label for="alum">UNL Alum</label></li> - <li><input name="type" value="Other" type="radio" id="other" /><label for="other">Other</label></li> - </ol> - </div></li> - <li><label for="proposal" class="element"><span class="required">*</span>Describe your proposal for using physics for the official opening of Jorgensen Hall (500 word limit): </label><div class="element"><textarea id="proposal" name="proposal" rows="10"></textarea></div></li> - </ol> - </fieldset> - <input type="submit" name="submit" value="Submit" /> - </form> + <h3 class="zenform">Jorgensen Hall Extreme Ribbon-Cutting Contest</h3> + <form class='zenform' action="?submit=true" method="post" name="physics" id="physics" target="_self"> + <fieldset style="width: 96%"> + <legend>Ribbon-cutting proposal</legend> + <p>Physics Department extreme ribbon-cutting contest-your chance to win an iPad + from the UNL Computer and Phone Shop</p> + + <p>The University of Nebraska--Lincoln Physics Department is inviting proposals + from students, faculty, staff, alumni and friends on how to add some physics- + related drama to a ribbon cutting. The department will dedicate UNL's new physics + building, Jorgensen Hall, at a ceremony scheduled for 4 p.m. on Friday, Oct. 29.</p> + + <p>Anyone interested may submit a proposal for a way to open the building, preferably + using some aspect of physics, to make the celebration more interesting than is + possible using only ribbon and scissors.</p> + + <p>Proposals should be submitted in writing to UNL Physics Department Chairman + Dan Claes. Beginning Oct. 8, written submissions may be uploaded to the Physics + Web site at http://physics.unl.edu/. Entrants are encouraged to post a short + video on YouTube either explaining or demonstrating their idea. The video URL + can be submitted with the proposal. Submissions are due by noon October 15.</p> + + <p>A faculty committee will announce the top three contestants on October 18. + The top three proposals with any supporting video links will be posted on the + Physics Web site so that interested parties can vote for their favorite proposal.</p> + + <p>Voting will be open from Monday, October 18 until noon on Friday, October 22. + The committee will alert the winner late Friday afternoon, October 22.</p> + + <p>The winning idea will be used to open Jorgensen Hall. UNL Chancellor Harvey + Perlman and special guest speaker Alan Heeger, a UNL alum and Nobel laureate, will + be present for the ceremony.</p> + + <p>Rules:</p> + <ul> + <li>No humans or animals may be harmed.</li> + <li>No harm may be caused to the building.</li> + <li>Proposals will be accepted until 5 p.m. Oct. 15, 2010.</li> + </ul> + + <p>A minor amount of funding to purchase supplies for the implementation of + the winning proposal may be made available by the Physics department at + the discretion of the Physics Department chairman and contest committee.</p> + + <p>The creator of the winning submission will receive an iPad or dollar value + equivalent in merchandise from the UNL Computer and Phone Shop.</p> + <hr/> + <ol> + <li><label for="name" class="element"><span class="required">*</span>Name<span class="helper">Enter Your Full Name</span></label><div class="element"><input id="name" name="name" type="text" /></div></li> + <li><label for="email" class="element"><span class="required">*</span>Email Address</label><div class="element"><input id="email" name="email" type="text" /></div></li> + <li><label for="phone" class="element"><span class="required">*</span>Phone Number<span class="helper">Format: 402-123-1234</span></label><div class="element"><input id="phone" name="phone" type="text" /></div></li> + <li><label for="video" class="element">Youtube URL<span class="helper">Highly recommended.</span></label><div class="element"><input id="video" name="video" type="text" /></div></li> + <li><label class="element"><span class="required">*</span>You are a:</label><div class="element"> + <ol> + <li><input name="type" value="UNL student" type="radio" id="unlstudent" /><label for="unlstudent">UNL student</label></li> + <li><input name="type" value="High school student" type="radio" id="hsstudent" /><label for="hsstudent">High school student</label></li> + <li><input name="type" value="UNL faculty" type="radio" id="faculty" /><label for="faculty">UNL faculty</label></li> + <li><input name="type" value="UNL Alum" type="radio" id="alum" /><label for="alum">UNL Alum</label></li> + <li><input name="type" value="Other" type="radio" id="other" /><label for="other">Other</label></li> + </ol> + </div></li> + <li><label for="proposal" class="element"><span class="required">*</span>Describe your proposal for using physics for the official opening of Jorgensen Hall (500 word limit): </label><div class="element"><textarea id="proposal" name="proposal" rows="10"></textarea></div></li> + </ol> + </fieldset> + <input type="submit" name="submit" value="Submit" /> + </form> <!-- TemplateEndEditable --> <div class="clear"></div> <?php virtual('/wdn/templates_3.0/includes/noscript.html'); ?> diff --git a/www/physics/ribbon_cutting2010/thankyou.php b/www/physics/ribbon_cutting2010/thankyou.php index cb7cf76..cee524b 100644 --- a/www/physics/ribbon_cutting2010/thankyou.php +++ b/www/physics/ribbon_cutting2010/thankyou.php @@ -1,5 +1,22 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> -<link rel="stylesheet" type="text/css" media="screen" href="/wdn/templates_3.0/css/zenform.css" /> +<!-- + Membership and regular participation in the UNL Web Developer Network + is required to use the UNL templates. Visit the WDN site at + http://wdn.unl.edu/. Click the WDN Registry link to log in and + register your unl.edu site. + All UNL template code is the property of the UNL Web Developer Network. + The code seen in a source code view is not, and may not be used as, a + template. You may not use this code, a reverse-engineered version of + this code, or its associated visual presentation in whole or in part to + create a derivative work. + This message may not be removed from any pages based on the UNL site template. + + $Id: php.fixed.dwt.php 536 2009-07-23 15:47:30Z bbieber2 $ +--> +<link rel="stylesheet" type="text/css" media="screen" href="/wdn/templates_3.0/css/all.css" /> +<link rel="stylesheet" type="text/css" media="print" href="/wdn/templates_3.0/css/print.css" /> <script type="text/javascript" src="/wdn/templates_3.0/scripts/all.js"></script> <script type="text/javascript"> //<![CDATA[ @@ -8,11 +25,75 @@ }); //]]> </script> +<?php virtual('/wdn/templates_3.0/includes/browserspecifics.html'); ?> +<?php virtual('/wdn/templates_3.0/includes/metanfavico.html'); ?> +<!-- TemplateBeginEditable name="doctitle" --> +<title>UNL | Department of Physics and Astronomy | Ribbon Cutting Proposal</title> +<!-- TemplateEndEditable --><!-- TemplateBeginEditable name="head" --> +<!-- Place optional header elements here --> +<!-- TemplateEndEditable --> </head> -<div id="maincontent"> - <h3 class="zenform">Physics Department Extreme Ribbon-cutting Contest</h3> - <form class='zenform'> - <h1>Thank you for your proposal!</h1> - We hope to see you at the ribbon-cutting is ceremony! - </form> +<body class="fixed"> +<p class="skipnav"> <a class="skipnav" href="#maincontent">Skip Navigation</a> </p> +<div id="wdn_wrapper"> + <div id="header"> <a href="http://www.unl.edu/" title="UNL website"><img src="/wdn/templates_3.0/images/logo.png" alt="UNL graphic identifier" id="logo" /></a> + <h1>University of Nebraska–Lincoln</h1> + <?php virtual('/wdn/templates_3.0/includes/wdnTools.html'); ?> + </div> + <div id="wdn_navigation_bar"> + <div id="breadcrumbs"> + <!-- WDN: see glossary item 'breadcrumbs' --> + <!-- TemplateBeginEditable name="breadcrumbs" --> + <ul> + <li><a href="http://www.unl.edu/" title="University of Nebraska–Lincoln">UNL</a></li> + <li>Department</li> + </ul> + <!-- TemplateEndEditable --></div> + <div id="wdn_navigation_wrapper"> + <div id="navigation"><!-- TemplateBeginEditable name="navlinks" --> + <?php include '../sharedcode/navigation.html'; ?> + <!-- TemplateEndEditable --></div> + </div> + </div> + <div id="wdn_content_wrapper"> + <div id="titlegraphic"><!-- TemplateBeginEditable name="titlegraphic" --> + <!-- TemplateEndEditable --></div> + <div id="pagetitle"><!-- TemplateBeginEditable name="pagetitle" --> <!-- TemplateEndEditable --></div> + <div id="maincontent"> + <h3 class="zenform">Physics Department Extreme Ribbon-cutting Contest</h3> + <form class='zenform'> + <h1>Thank you for your proposal!</h1> + We hope to see you at the ribbon-cutting is ceremony! + </form> + </div> + <!-- TemplateEndEditable --> + <div class="clear"></div> + <?php virtual('/wdn/templates_3.0/includes/noscript.html'); ?> + <!--THIS IS THE END OF THE MAIN CONTENT AREA.--> + </div> + <div id="footer"> + <div id="footer_floater"></div> + <div class="footer_col"> + <?php virtual('/wdn/templates_3.0/includes/feedback.html'); ?> + </div> + <div class="footer_col"><!-- TemplateBeginEditable name="leftcollinks" --> + <?php include '../sharedcode/relatedLinks.html'; ?> + <!-- TemplateEndEditable --></div> + <div class="footer_col"><!-- TemplateBeginEditable name="contactinfo" --> + <?php include '../sharedcode/footerContactInfo.html'; ?> + <!-- TemplateEndEditable --></div> + <div class="footer_col"> + <?php virtual('/wdn/templates_3.0/includes/socialmediashare.html'); ?> + </div> + <!-- TemplateBeginEditable name="optionalfooter" --> <!-- TemplateEndEditable --> + <div id="wdn_copyright"><!-- TemplateBeginEditable name="footercontent" --> + <?php include '../sharedcode/footer.html'; ?> + <!-- TemplateEndEditable --> + <?php virtual('/wdn/templates_3.0/includes/wdn.html'); ?> + | <a href="http://validator.unl.edu/check/referer">W3C</a> | <a href="http://jigsaw.w3.org/css-validator/check/referer?profile=css3">CSS</a> <a href="http://www.unl.edu/" title="UNL Home" id="wdn_unl_wordmark"><img src="/wdn/templates_3.0/css/footer/images/wordmark.png" alt="UNL's wordmark" /></a> </div> + </div> + </div> + <div id="wdn_wrapper_footer"> </div> </div> +</body> +</html> -- GitLab