Skip to content
Snippets Groups Projects
Commit 036a0c29 authored by Graham Cole's avatar Graham Cole
Browse files

Add a little box for logged-in users to give us some feedback on static pages. closes #27

parent c1ee813f
No related branches found
No related tags found
No related merge requests found
......@@ -82,6 +82,11 @@ if (file_exists($secondaryfile)) {
$smarty->assign("secondary", $secondary);
}
// include a widget for leaving feedback on this page if the user is logged in
if ($session->loggedin) {
include("../lib/page-feedback.php");
}
$smarty->assign("title", $title);
// Editing static pages - does the user have permission?
......
<?php
/* mechanism for members to give us feedback about web pages */
// where do website feedback mails go?
$contact = "chckens@sucs.org";
if ($session->loggedin) {
if ($_REQUEST['action'] == "feedback") {
$feedback = $_REQUEST['feedback'];
$msgbody = "{$session->username} had this to say about the page {$_SERVER['REQUEST_URI']}:\r\n\r\n";
$msgbody .= "\"{$feedback}\"\r\n";
mail($contact, "SUCS Website Feedback", $msgbody);
$smarty->assign("feedbacked", TRUE);
}
$secondary = $smarty->fetch("feedback.tpl");
$smarty->append("secondary", $secondary);
}
?>
{* form logged-in members can fill in to give us feedback on a website page *}
<div class="cbb">
{if $feedbacked == true}
<h3>Thanks!</h3>
<p>Your comments have been sent to the SUCS admin team</p>
{else}
<h4>Something you think we should know?</h4>
<form action="{$baseurl}{$path}" method="post">
<input type="hidden" name="action" value="feedback" />
<p>Spotted a mistake on this page? Have some useful info? Let us know below:</p>
<div>
<span class="textinput"><textarea id="pagefeedback" name="feedback" cols="25" rows="6"></textarea></span>
</div>
<div>
<span class="textinput"><input type="submit" value="Feed-back!" /></span>
</div>
</form>
{/if}
</div>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment