Exemple #1
0
$request_uri = substr($request_uri, 1, -1);
$request_file = determineRequestFile($request_uri);
if (!file_exists($request_file)) {
    header('HTTP/1.1 404 Not Found');
    include '404.php';
    die;
}
$fcontents = file($request_file);
$page_header = trim(@$fcontents[0]);
$fcontents = join('', $fcontents);
if (@$_GET['view'] == 'text') {
    header('Content-type: text/plain');
    echo $fcontents;
} else {
    $breadcrumbs = createBreadcrumbs($request_uri, $page_header);
    $title = createTitle($breadcrumbs, $page_header);
    render(array('title' => $title, 'content' => Markdown($fcontents), 'breadcrumbs' => $breadcrumbs, 'links' => array('view_source' => "{$_SERVER['REQUEST_URI']}?view=text")));
}
######################################################
function determineRequestFile($uri)
{
    return "doc/{$uri}.text";
}
function render($__vars)
{
    extract($__vars);
    require 'inc/template.php';
}
function createBreadcrumbs($request_uri, $title)
{
    $breadcrumbs = array();
Exemple #2
0
function e3_showSlider($data, $id, $nav = FALSE)
{
    if ($nav) {
        ?>
		<!-- Indicators -->
		  <ol class="carousel-indicators">
		    <?php 
        $i = 0;
        foreach ($data as $indicator) {
            ?>
		        <li data-target="#product_slider" data-slide-to="<?php 
            echo $i;
            ?>
" <?php 
            if ($indicator === reset($data)) {
                echo 'class="active"';
            }
            ?>
></li>
			<?php 
            $i++;
        }
        ?>
		  </ol>
	<?php 
    }
    ?>
	<div id="<?php 
    echo $id . "_slider";
    ?>
" class="carousel slide" data-ride="carousel">
		<?php 
    createTitle(get_field($id . "_title"), "h2");
    ?>
      <div class="carousel-inner">
      	<?php 
    foreach ($data as $slide) {
        ?>
      		<div class="item <?php 
        if ($slide === reset($data)) {
            echo "active";
        }
        ?>
">
	          <img src="<?php 
        echo $slide["sizes"]["slider"];
        ?>
" alt="<?php 
        echo $slide["alt"];
        ?>
">
	        </div>
		<?php 
    }
    ?>
      </div>
      <?php 
    if ($nav) {
        ?>
			<a class="left carousel-control" href="#<?php 
        echo $id . "_slider";
        ?>
" data-slide="prev"><i class="fa fa-minus"></i></a>
     		<a class="right carousel-control" href="#<?php 
        echo $id . "_slider";
        ?>
" data-slide="next"><i class="fa fa-plus"></i></a>
      <?php 
    }
    ?>
    </div><!-- /.carousel --> <?php 
}
    $headers .= "Return-Path: {$from}\r\n";
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: text/html; charset=\"utf-8\"\r\n";
    if (empty($message)) {
        $message = 'There is no message';
    }
    $subject = cleanerString($subject);
    if (empty($subject)) {
        $subject = 'There is no subject';
    }
    return mail($to, $subject, $message, $headers);
}
// START
// I'm ignoring the $_GET data, instead I post a custom key called 'application' from the app
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isSupportedAgent($_SERVER['HTTP_USER_AGENT']) && isSupportedApp($_POST['application'])) {
    $title = createTitle($_POST['application'], $_POST['type'], $_POST['email']);
    $report = beginningOfReportWithTitle($title) . bodyOfReport($_POST) . endOfReport();
    if (!sendReport($title, $report)) {
        // don't send detailed error reports on the production server
        //echo 'error with sendReport';
        sendReport('Failed sending crash report', 'sendReport() failed');
    }
    // this is to cause the app to not close the feedback report window (good for testing, make sure to comment this out when copying to the production server)
    //echo 'Testing';
} else {
    // not a proper feedback request
    // always send a message of some sort so you can see what a bot is up to
    if (count($_REQUEST)) {
        foreach ($_REQUEST as $key => $value) {
            $keyValues[] = "{$key} = {$value}";
        }
Exemple #4
0
 function createTitle3($text)
 {
     return createTitle("3", "Heading_20_3", $text);
 }