<?php require_once 'config.php'; require 'design_head.php'; echo '<h1>New issue</h1>'; if (isset($_POST['desc'])) { $issueId = addIssue($session->id, 0, $_POST['desc']); if ($issueId) { echo 'Thank you for the report!<br/>'; echo 'The issue have been stored and will be overlooked as soon as possible!<br/><br/>'; echo 'What do you want to do now?<br/><br/>'; echo '* <a href="show_issue.php?id=' . $issueId . '">Go to issue report</a><br/>'; echo '* <a href="' . $_SERVER['PHP_SELF'] . '">Report another issue</a><br/>'; } else { echo 'Error adding the issue.'; } } else { echo 'From here you can submit bug reports or feature requests regarding the game or website.<br/>'; echo 'Please leave as many details as possible.<br/><br/>'; echo xhtmlForm(); //FIXME categories dropdown echo 'Description:<br/>'; echo xhtmlTextarea('desc', '', 60, 8) . '</td></tr>'; echo '<tr><td><br>' . xhtmlSubmit('Submit issue') . '</td></tr>'; echo xhtmlFormClose(); } require 'design_foot.php';
function shareForumItem($itemId) { global $h; if (!$h->session->id || !is_numeric($itemId)) { return false; } if (!empty($_POST['fshare_mail'])) { if (is_email($_POST['fshare_mail'])) { $item = getForumItem($itemId); if (!empty($_POST['fshare_name'])) { $mail = "Hej " . $_POST['fshare_name'] . "!\n\n"; } else { $mail = "Hej!\n\n"; } $mail .= $h->session->username . " har skickat dig den här länken till dig från communityt\n"; $mail .= "på vår sajt, " . xhtmlGetUrl('/') . ".\n\n"; if ($item['authorId']) { $mail .= $item['itemSubject'] . ' av ' . $item['authorName'] . ', ' . formatTime($item['timeCreated']) . ":\n"; } else { $mail .= $item['itemSubject'] . ' av gäst, ' . formatTime($item['timeCreated']) . "\n"; } $mail .= "För att läsa inlägget i sin helhet, klicka på länken nedan:\n"; $mail .= xhtmlGetUrl('forum.php?id=' . $itemId . '#' . $itemId) . "\n\n"; if (!empty($_POST['fshare_comment'])) { $mail .= "\n"; $mail .= "Din kompis lämnade även följande hälsning:\n"; $mail .= $_POST['fshare_comment'] . "\n\n"; } $subject = 'Meddelande från communityt'; if (smtp_mail($_POST['fshare_mail'], $subject, $mail) == true) { echo 'Tipset ivägskickat<br/>'; } else { echo 'Problem med utskicket<br/>'; } } else { echo 'Ogiltig mailaddress!'; } return; } $data = getForumItem($itemId); echo showForumPost($data) . '<br/>'; echo xhtmlForm('forum_share', $_SERVER['PHP_SELF'] . '?id=' . $itemId); echo 'Din kompis namn: ' . xhtmlInput('fshare_name', '', 20, 30) . '<br/>'; echo t('E-mail') . ': ' . xhtmlInput('fshare_mail', '', 40, 50) . '<br/>'; echo '<br/>'; echo 'Hälsning:<br/>'; echo xhtmlTextarea('fshare_comment', '', 40, 6) . '<br/>'; echo xhtmlSubmit('Share'); echo xhtmlFormClose(); }