Example #1
0
     echo '
         <div class="challenge-description relies-on">', lang_get('challenge_relies_on', array('relies_on_link' => '<a href="challenge?id=' . htmlspecialchars($relies_on['id']) . '">' . htmlspecialchars($relies_on['title']) . '</a>', 'relies_on_category_link' => '<a href="challenges?category=' . htmlspecialchars($relies_on['category_id']) . '">' . htmlspecialchars($relies_on['category_title']) . '</a>')), '</div>
     ';
 } else {
     // write out challenge description
     if ($challenge['description']) {
         echo '
         <div class="challenge-description">
             ', $bbc->parse($challenge['description']), '
         </div> <!-- / challenge-description -->';
     }
     // write out hints
     if (cache_start(CONST_CACHE_NAME_CHALLENGE_HINTS . $challenge['id'], CONFIG_CACHE_TIME_HINTS)) {
         $hints = db_select_all('hints', array('body'), array('visible' => 1, 'challenge' => $challenge['id']));
         foreach ($hints as $hint) {
             message_inline_yellow('<strong>Hint!</strong> ' . $bbc->parse($hint['body']), false);
         }
         cache_end(CONST_CACHE_NAME_CHALLENGE_HINTS . $challenge['id']);
     }
     // write out files
     $files = cache_array_get(CONST_CACHE_NAME_FILES . $challenge['id'], CONFIG_CACHE_TIME_FILES);
     if (!is_array($files)) {
         $files = db_select_all('files', array('id', 'title', 'size', 'md5', 'download_key'), array('challenge' => $challenge['id']));
         cache_array_save($files, CONST_CACHE_NAME_FILES . $challenge['id']);
     }
     if (count($files)) {
         print_attachments($files);
     }
     // only show the hints and flag submission form if we're not already correct and if the challenge hasn't expired
     if (!$challenge['correct_submission_added'] && $time < $challenge['available_until']) {
         if ($remaining_submissions) {
Example #2
0
enforce_authentication(CONST_USER_CLASS_MODERATOR);
head('Site management');
menu_management();
if (array_get($_GET, 'bcc') == 'all') {
    $users = db_select_all('users', array('email'));
    $bcc = '';
    foreach ($users as $user) {
        $bcc .= $user['email'] . ",\n";
    }
    $bcc = trim($bcc);
}
section_subhead('New email');
message_inline_blue('Separate receiver emails with a comma and optional whitespace. You can use BBCode. If you do, you must send as HTML email.');
form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/new_email');
if (isset($bcc)) {
    form_input_text('To', CONFIG_EMAIL_FROM_EMAIL);
    form_input_text('CC');
    form_textarea('BCC', $bcc);
} else {
    form_input_text('To', isset($_GET['to']) ? $_GET['to'] : '');
    form_input_text('CC');
    form_input_text('BCC');
}
form_input_text('Subject');
form_textarea('Body');
form_input_checkbox('HTML email');
form_hidden('action', 'new');
message_inline_yellow('Important email? Remember to Ctrl+C before attempting to send!');
form_button_submit('Send email');
form_end();
foot();