Пример #1
0
<?php

ini_set('max_execution_time', 0);
include_once dirname($_SERVER['SCRIPT_FILENAME']) . '/_reporter.php';
chdir(dirname(__FILE__));
ob_start();
include_once $path = str_replace('scripts', '', dirname(__FILE__)) . 'init_constants.php';
include_once PATH_DOCROOT . '/init_database.php';
include_once PATH_CLASS . '/CCitizenImage.php';
$time = strtotime('-1 day');
$startTime = mktime(0, 0, 0, date('m', $time), date('d', $time), date('Y', $time));
$endTime = mktime(23, 59, 59, date('m', $time), date('d', $time), date('Y', $time));
$ci =& CCitizenImage::getInstance();
$cii =& CCIImage::getInstance();
$photos = $ci->search(array('TIMESTART' => $startTime, 'TIMEEND' => $endTime, 'STATUS' => 'pending'));
echo "Processing photos for " . date(FF_FORMAT_DATE_LONG, $time) . "\n";
foreach ($photos as $v) {
    //UCI_USERNAME
    echo "Processing photo ({$v['UCI_ID']})...";
    $license = $v['UCI_CATEGORY'] == 'editorial' ? 'Rights Managed' : 'Royalty Free';
    $cii->setImagedata(PATH_FOTOROOT . $v['UCI_IMAGE']);
    $cii->setTitle($v['UCI_TITLE']);
    $cii->setDescription($v['UCI_DESCRIPTION']);
    $cii->setCategory($v['UCI_CATEGORY']);
    $cii->setSubcategory($v['UCI_SUBCATEGORY']);
    $cii->setDatetime($v['UCI_TIMESTAMP']);
    $cii->setLicensetype($license);
    $cii->setLocation(new CCitizenImageLocation($v['UCI_COUNTRY'], $v['UCI_STATE'], $v['UCI_CITY']));
    $cii->setKeywords((array) explode(',', $v['UCI_KEYWORDS']));
    $cii->setTimezone($v['UCI_TIMEZONE']);
    $result = $cii->save($v['UCI_USERNAME'], $v['UCI_PASSWORD']);
Пример #2
0
        echo '<form name="_ciRegistration" id="_ciRegistration" method="POST" action="/?action=ci.register">';
        echo '<input type="hidden" name="login_error" value="true" />';
        foreach ($_POST as $k => $v) {
            echo '<input type="hidden" name="' . $k . '" value="' . $v . '" />';
        }
        echo '<input type="image" src="images/spacer.gif" width="1" height="1" />
            </form>';
        echo '<script>';
        echo '  document.getElementById(\'_ciRegistration\').submit();';
        echo '</script>';
        die;
    }
} else {
    // variables for each photo being uploaded
    // queue each photo
    $obj =& CCIImage::getInstance();
    $numberPhotos = $_POST['ci_number_photos'];
    for ($i = 0; $i < $numberPhotos; $i++) {
        $id = $_POST['ci_image_' . $i];
        //$image = $_POST['ci_image_' . $id];
        $title = $_POST['ci_image_' . $id . '_title'];
        $description = $_POST['ci_image_' . $id . '_description'];
        $category = $_POST['ci_image_' . $id . '_license'];
        $release = $_POST['ci_image_' . $id . '_release'];
        $subCategory = $_POST['ci_image_' . $id . '_subcategory'];
        $month = $_POST['ci_image_' . $id . '_month'];
        $year = $_POST['ci_image_' . $id . '_year'];
        $day = $_POST['ci_image_' . $id . '_day'];
        $hour = $_POST['ci_image_' . $id . '_hour'];
        $minute = $_POST['ci_image_' . $id . '_minute'];
        $ampm = $_POST['ci_image_' . $id . '_ampm'];