Ejemplo n.º 1
0
/**
 * Handle the track-listing short code.
 */
function ti_course_listing()
{
    $parentId = get_the_ID();
    $pages = get_pages(array("parent" => $parentId));
    $out = "";
    foreach ($pages as $page) {
        if ($page->ID != $parentId) {
            $out .= render_tpl(__DIR__ . "/tpl/courselisting.php", array("page" => $page));
        }
    }
    return $out;
}
Ejemplo n.º 2
0
        array_push($errors, 'feedback');
    }
    if (!empty($errors)) {
        return;
    }
    session_start();
    if (empty($_SESSION['authenticity_token']) || $_GET['authenticity_token'] !== $_SESSION['authenticity_token']) {
        return;
    }
    send_form($name, $email, $feedback);
    unset($_SESSION['authenticity_token']);
}
disable_magic_quotes();
render_headers();
$errors = array();
$name = $email = $feedback = '';
if ($_SERVER['REQUEST_METHOD'] === 'POST' && !empty($_GET['authenticity_token'])) {
    process_feedback($errors, $name, $email, $feedback);
}
if (session_id() === '') {
    session_start();
}
$authenticity_token = md5(uniqid(__FILE__, TRUE));
$_SESSION['authenticity_token'] = $authenticity_token;
$form_url = $_SERVER['SCRIPT_NAME'] . '?' . http_build_query(array('authenticity_token' => $authenticity_token));
$vars = array('name' => $name, 'email' => $email, 'feedback' => $feedback, 'form_url' => $form_url);
foreach ($errors as $error) {
    $vars['class_' . $error] = 'error';
}
render_tpl('feedback.tpl', $vars + $errors);