Beispiel #1
0
if ($docView == 'image' && isset($imageList) && count($imageList) > 0) {
    $colspan = 3;
    // Get requested image name
    if (isset($_REQUEST['file']) && !isset($_REQUEST['viewMode'])) {
        $file = $_REQUEST['file'];
        $fileName = basename($_REQUEST['file']);
    } else {
        $file = $fileList['path'][$imageList[0]];
        $fileName = basename($file);
    }
    $searchCmdUrl = "";
    if (isset($_REQUEST['searchPattern'])) {
        $searchCmdUrl = "&cmd=exSearch&searchPattern=" . rawurlencode($_REQUEST['searchPattern']);
    }
    // Get requested image key in fileList
    $imgKey = image_search($file, $fileList);
    $current = get_current_index($imageList, $imgKey);
    $offset = "&offset=" . $current;
    // Compute absolute path to requested image
    $doc_url = claro_get_file_download_url($file);
    // View Mode Bar
    if ($cmd == 'exSearch') {
        $curDirLine = get_lang('Search result');
    } elseif ($curDirName) {
        $curDirLine = '<img src="' . get_icon_url('opendir') . '" alt="" />' . "\n" . $dspCurDirName . "\n";
    } else {
        $curDirLine = '&nbsp;';
    }
    $docViewToolbar[] = '<a class="claroCmd" href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?docView=files&cmd=exChDir&file=' . base64_encode($curDirPath) . $searchCmdUrl)) . '">' . '<img src="' . get_icon_url('document') . '" alt="" /> ' . get_lang('File list') . '</a>';
    $docViewToolbar[] = '<a class="claroCmd" href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?docView=thumbnails&cwd=' . rawurlencode($curDirPath) . $searchCmdUrl)) . '">' . '<img src="' . get_icon_url('image') . '" alt="" /> ' . get_lang('Thumbnails') . '</a>';
    // Image description table
Beispiel #2
0
/**
 *
 * @global WPDB $wpdb
 */
function assign_images()
{
    global $wpdb;
    global $db_table;
    global $local_images_dir;
    $wpdb->show_errors();
    $listings = $wpdb->get_results("SELECT listing_id FROM {$db_table}");
    $count = 0;
    foreach ($listings as $listing) {
        // Grab all images associated with listing id.
        $images = image_search($local_images_dir, $listing->listing_id);
        if (!empty($images)) {
            natsort($images);
            // insert image data into database.
            $img_string = "";
            foreach ($images as $image) {
                $img_string .= $image . "\t";
            }
            $img_string = trim($img_string);
            $affected = $wpdb->query("UPDATE {$db_table} SET images='{$img_string}' WHERE listing_id={$listing->listing_id}");
            $count++;
        }
    }
    echo '<div class="updated fade"><p>' . $count . ' listings updated with images.</p></div>';
}