Пример #1
0
$previewHeight = 700;
#Height of the preview images on preview page.
$includeFile = "";
# Include file that may have  printheader/printfooter functions in it. Leave blank otherwise.
# http://www.ajaxload.info/ for a good starting point.
$loadingGif = "http://github.com/jedediahfrey/KISS-PHP-Gallery/raw/master/loading.gif";
# Image to show when loading previews.
$generatingGif = "http://github.com/jedediahfrey/KISS-PHP-Gallery/raw/master/generating.gif";
# Image to show when generating thumbnails
/* End Config */
/* Baseline Variables. Stuff used everywhere */
$scriptPath = fixDir(getcwd());
$baseURL = dirname("http://" . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']) . "/";
# Fails if there are 'query string' characters in the query string.
# list($dir,$file) = getArguments($_GET['dir']); # Get the directory & image file
list($dir, $file) = getArguments(end(explode("=", $_SERVER['QUERY_STRING'])));
# Verify that the thumb binary is executable.
if (!is_executable($thumbBinary)) {
    exit("Thumb executable '{$thumbBinary}' is not executable");
}
# Create htaccess file. Required for all functions. This can be commented out after first run. Adds ~1E-5s to execution time.
makeHtaccess();
# If the script is called from the command line. Set variables.
if ($argc) {
    $_GET['command'] = "thumbs";
    $dir = $argv[1];
    $_GET['recursive'] = TRUE;
}
# BBClone Setup the bbclone information. Track visits via bbclone.
define("_BBCLONE_DIR", $scriptPath . "bbclone/");
define("COUNTER", _BBCLONE_DIR . "mark_page.php");
Пример #2
0
$docRoot = $_SERVER["DOCUMENT_ROOT"];
$relPath = "";
$method = null;
$files = null;
$total = 0;
$status = 0;
$method = $_SERVER["REQUEST_METHOD"];
// Check the HTTP method first.
if (!cgiMethodAllowed($method)) {
    cgiResponse(HTTP_V_METHOD_NOT_ALLOWED, "Method Not Allowed", NULL);
    header("Allow: " . getenv("CBTREE_METHODS"));
    error_log("Invalid or unsupported method: [" . $method . "]");
    return;
}
// Validate the HTTP QUERY-STRING parameters
$args = getArguments($method, $status);
if ($args == null) {
    cgiResponse(HTTP_V_BAD_REQUEST, "Bad Request", "Malformed query arguments.");
    return;
}
if ($args->authToken) {
    // Your authentication may go here....
}
$rootDir = str_replace("\\", "/", realPath($docRoot . "/" . $args->basePath));
$fullPath = str_replace("\\", "/", realPath($rootDir . "/" . $args->path));
if ($rootDir && $fullPath) {
    // Make sure the caller isn't backtracking by specifying paths like '../../../'
    if (strncmp($rootDir, $docRoot, strlen($docRoot)) || strncmp($fullPath, $rootDir, strlen($rootDir))) {
        cgiResponse(HTTP_V_FORBIDDEN, "Forbidden", "We're not going there...");
        return;
    }
Пример #3
0
<?php

error_reporting(E_ALL);
require_once 'inc/secret.inc.php';
require_once 'inc/sanitize.inc.php';
require_once 'inc/geo.inc.php';
require_once 'inc/GooglePlacesClient.inc.php';
require_once 'inc/GooglePlaces.inc.php';
require_once 'inc/arguments.inc.php';
// Connect to database
$db = new mysqli(MYSQL_HOST, MYSQL_USERNAME, MYSQL_PASSWORD, MYSQL_DATABASE, MYSQL_PORT);
if ($db->connect_errno > 0) {
    die('Unable to connect to database: ' . $db->connect_error);
}
// Contains user-specified data
$arguments = getArguments($_REQUEST);
// If there is a zip but no coordinates, look up approximate coordinates from database
if (array_key_exists('zip', $arguments) && (!array_key_exists('latitude', $arguments) || !array_key_exists('longitude', $arguments))) {
    $queryzipcoordinate = <<<SQL
SELECT `latitude`, `longitude` FROM `zipcoordinates`
WHERE `zip` = ?
SQL;
    $stmt = $db->prepare($queryzipcoordinate);
    $stmt->bind_param('i', $arguments['zip']);
    $stmt->execute();
    $stmt->bind_result($latitude, $longitude);
    $stmt->fetch();
    $arguments['latitude'] = $latitude;
    $arguments['longitude'] = $longitude;
    $stmt->free_result();
}
Пример #4
0
<?php

/**
 *
 *
 * @author Sebastian Lagemann <*****@*****.**>
 */
require_once __DIR__ . '/argv-parser.php';
require_once __DIR__ . '/../vendor/autoload.php';
$arguments = getArguments();
$hdfs = new \org\apache\hadoop\WebHDFS($arguments->namenode_host, $arguments->namenode_port, $arguments->namenode_user, $arguments->namenode_rpc_host, $arguments->namenode_rpc_port, $arguments->debug === 'true');
var_dump($hdfs->create($arguments->target_path, $arguments->source_path));
function getNewsletterOptions($post_id = 0)
{
    global $wpdb;
    $query = "SELECT * FROM " . $wpdb->prefix . "wpr_newsletters";
    $results = $wpdb->get_results($query);
    if (count($results)) {
        ?>

<span style="font-size: 12px; line-height: 25px;">Each of the tabs below allow you to customize the email that goes out to the blog subscribers, blog category subscribers and post series subscribers of that newsletter. The blog post will be delivered ONLY to subscribers who have subscribed to receive all posts published in the blog or the posts filed under one of the blog categories in which this blog post will be published. Ordinary newsletter subscribers will not receive this blog post at all.

</span>
<input type="hidden" name="wpr-blogemailoptions-nonce" value="<?php 
        echo wp_create_nonce('wpr-blogemailoptions-nonce');
        ?>
" />
<input type="hidden" name="wpr-newsletters-count" value="<?php 
        echo count($results);
        ?>
"/>
<input type="hidden" name="wpr-newsletters" value="<?php 
        foreach ($results as $newsletter) {
            $nids[] = $newsletter->id;
        }
        echo implode(",", $nids);
        ?>
"/>
<div class="tabber">
  <?php 
        foreach ($results as $newsletter) {
            ?>
  <div class="tabbertab" id="wprtabs">
    <?php 
            //Form for customizing the mailout for a single newsletter
            $post = get_post($post_id);
            //Unpublished posts should get an id of zero.
            if ($post->post_status == 'auto-draft') {
                $post_id = 0;
            }
            $arguments = getArguments($post_id, $newsletter);
            echo getNewsletterCustomizationFormCode($arguments, "new");
            ?>
  </div>
  <?php 
        }
    } else {
        ?>
  You haven't created any newsletters. Create atleast one before
  
  setting blog post email settings.
  <?php 
    }
}