Пример #1
0
            			$small_image = new GrlxImage;
            			$small_image-> src = $val['small_image_url']; // The “source” attribute.
            			$small_image-> alt = 'image '.$val['small_image_url']; // The “alternate text” attribute.
            
            			$medium_image = new GrlxImage;
            			$medium_image-> src = $val['medium_image_url']; // The “source” attribute.
            			$medium_image-> alt = 'image '.$val['medium_image_url']; // The “alternate text” attribute.
            */
            $large_image = new GrlxImage();
            $large_image->src = $val['large_image_url'];
            // The “source” attribute.
            $large_image->alt = 'image ' . $val['large_image_url'];
            // The “alternate text” attribute.
            $delete_link->query('delete_ad_id=' . $key);
            $edit_link->query('ad_id=' . $key);
            $promo_content[] = array($large_image->paint(), $url, ' ', $delete_link->icon_link() . "\n" . $edit_link->icon_link());
        }
    }
}
if ($promo_content) {
    $list->content($promo_content);
    $ad_list_output = '<form accept-charset="UTF-8" action="ad.list.php" method="get">' . "\n";
    $ad_list_output .= $list->format_headings();
    $ad_list_output .= $list->format_content();
    $ad_list_output .= '</form>' . "\n";
} else {
    $link->url('ad.promo-create.php');
    $link->tap('Create one now');
    $ad_list_output = $message->info_dialog('Huh. Looks like you haven’t uploaded any ads. ' . $link->paint() . '.');
}
$link->url('ad.promo-create.php');
}
// Got an image for this ad? Then get its size. We’ll use this
// to override anything the database claims the image is.
/*
if ( $check_these ) {
	foreach ( $check_these as $key => $val ) {
		if ( $promo_info[$key.'_image_url'] && is_file('..'.$promo_info[$key.'_image_url'])) {
			$real_size[$key] = getimagesize('..'.$promo_info[$key.'_image_url']);
		}
	}
}
*/
if ($promo_info) {
    $image_obj->src = $promo_info['small_image_url'];
    $image_obj->alt = $promo_info['small_image_url'];
    $small_img = $image_obj->paint();
    $image_obj->src = $promo_info['medium_image_url'];
    $image_obj->alt = $promo_info['medium_image_url'];
    $medium_img = $image_obj->paint();
    $image_obj->src = $promo_info['large_image_url'];
    $image_obj->alt = $promo_info['large_image_url'];
    $large_img = $image_obj->paint();
}
$alert_output .= $fileops->check_or_make_dir('..' . $image_path);
/*
$mobile_content = <<<EOL
	$small_img
	<label for="small_image_url">Replace image</label>
	<input type="file" id="small_image_url" name="small_image_url" value=""/>

EOL;
Пример #3
0
    $image->style = 'max-height:100px;max-width:468px';
    foreach ($possible_ad_list as $key => $val) {
        if ($match_list[$key]) {
            $action = '<input type="checkbox" id="change_to[' . $key . ']" name="change_to[' . $key . ']" checked="checked" value="on"/> <label for="change_to[' . $key . ']">on</label>' . "\n";
            $action .= '<input type="hidden" name="change_from[' . $key . ']" value="on"/>' . "\n";
        } else {
            $action = '<input type="checkbox" id="change_to[' . $key . ']" name="change_to[' . $key . ']" value="on"/> <label for="change_to[' . $key . ']">off</label>' . "\n";
            $action .= '<input type="hidden" name="change_from[' . $key . ']" value="off"/>' . "\n";
        }
        $title = $val['title'];
        $title ? $title : ($title = 'Untitled');
        if ($val['large_image_url']) {
            $image->src = $val['large_image_url'];
            $image->alt = $val['large_image_url'];
            $link->url('ad.promo-edit.php?ad_id=' . $key);
            $link->tap = $image->paint();
            $view_me = $link->paint();
        } elseif ($val['source_id'] == 3) {
            $view_me = '<a href="ad.adsense-edit.php?ad_id=' . $key . '">(AdSense code)</a>';
        } elseif ($val['code'] !== null) {
            $view_me = '(PW code)';
        } else {
            $view_me = '-';
        }
        $ad_list[] = array($title, $view_me, $action);
    }
}
$number_o_ads = qty('ad', count($possible_ad_list));
if ($ad_list) {
    $heading_list = array('Ad', 'Action');
    $list->headings($heading_list);