Example #1
0
function outputRow($node)
{
    print "<tr><td><img src='../Common/Images/" . getImageURL($node->type) . "'>&nbsp;&nbsp;<a href='";
    print getURL($node);
    print "'>";
    print $node->cm_name;
    print "</a></td></tr>";
}
 function __construct(PageInfo $pageInfo, ImagickTaskQueue $taskQueue)
 {
     $activeCategory = $pageInfo->getCategory();
     $activeExample = $pageInfo->getExample();
     $this->imageBaseURL = getImageURL($activeCategory, $activeExample);
     $this->customImageBaseURL = getCustomImageURL($activeCategory, $activeExample);
     $this->imageStatusBaseURL = getImageStatusURL($activeCategory, $activeExample);
     $this->taskQueue = $taskQueue;
 }
Example #3
0
    function theme_content($map)
    {
        global $_zp_current_image, $points;
        ?>
		<!-- Colorbox section -->
		<div id="images">
			<?php 
        $points = array();
        while (next_image()) {
            if ($map) {
                $coord = getGeoCoord($_zp_current_image);
                if ($coord) {
                    $points[] = $coord;
                }
            }
            ?>
				<div class="image">
					<div class="imagethumb">
						<?php 
            if (isImagePhoto()) {
                // colorbox is only for real images
                $link = html_encode(getDefaultSizedImage()) . '" class="thickbox"';
            } else {
                $link = html_encode(getImageURL()) . '"';
            }
            ?>
						<a href="<?php 
            echo $link;
            ?>
" title="<?php 
            echo getBareImageTitle();
            ?>
">
							<?php 
            printImageThumb(getImageTitle());
            ?>
						</a></div>
				</div>
				<?php 
        }
        ?>
		</div>
		<br class="clearall" />
		<?php 
        @call_user_func('printSlideShowLink');
    }
Example #4
0
    function theme_content($map)
    {
        global $_zp_current_image, $points;
        ?>
		<!-- Image page section -->
		<div id="images">
			<?php 
        $points = array();
        while (next_image()) {
            if ($map) {
                $coord = getGeoCoord($_zp_current_image);
                if ($coord) {
                    $points[] = $coord;
                }
            }
            ?>
				<div class="image">
					<div class="imagethumb"><a href="<?php 
            echo html_encode(getImageURL());
            ?>
" title="<?php 
            echo html_encode(getBareImageTitle());
            ?>
"><?php 
            printImageThumb(getImageTitle());
            ?>
</a></div>
				</div>
				<?php 
        }
        ?>
		</div>
		<br class="clearall" />
		<?php 
        @call_user_func('printSlideShowLink');
    }
Example #5
0
    echo html_encode(getImageURL());
    ?>
" title="<?php 
    echo getBareImageTitle();
    ?>
">
								<?php 
    printImageThumb(null, 'check-flagthumb scale');
    ?>
							</a>
							<div class="caption caption-image">
								<?php 
    if (isImagePhoto()) {
        ?>
								<a class="swipebox image-zoom" title="<?php 
        echo html_encode('<a href="' . getImageURL() . '">' . getBareImageTitle() . '</a>');
        ?>
" href="<?php 
        echo html_encode(getDefaultSizedImage());
        ?>
"><i class="fa fa-search-plus fa-lg"></i></a>
								<?php 
    }
    ?>
								<?php 
    if (function_exists('getCommentCount')) {
        if ($_zp_current_image->getCommentsAllowed() && getCommentCount() > 0) {
            ?>
									<div class="image-cr"><i class="fa fa-comments"></i><span> <?php 
            echo getCommentCount();
            ?>
Example #6
0
        if (isImagePhoto($_zp_current_image)) {
            if ($c == 0) {
                echo '{' . "\n";
            } else {
                echo ',{' . "\n";
            }
            echo 'thumb: \'' . getImageThumb() . '\',' . "\n";
            echo 'image: \'' . getDefaultSizedImage() . '\',' . "\n";
            echo 'big: \'' . getCustomImageURL(getOption('zpbase_galbigsize')) . '\',' . "\n";
            echo 'title: \'' . html_encode(getBareImageTitle()) . '\',' . "\n";
            $desc = getBareImageDesc();
            $desc = str_replace("\r\n", '<br />', $desc);
            $desc = str_replace("\r", '<br />', $desc);
            echo 'description: \'' . js_encode($desc) . '\',' . "\n";
            if (!getOption('zpbase_nodetailpage')) {
                echo 'link: \'' . html_encode(getImageURL()) . '\'' . "\n";
            }
            echo '}' . "\n";
            $c++;
        }
    }
    ?>
					];
				</script>
				<?php 
    if ($c > 0) {
        ?>
				<div id="galleria"></div>
				<?php 
    } else {
        ?>
    echo "<th class='zebra-striped' colspan='2'>Name</th>";
    echo "<th class='zebra-striped'>Subject</th>";
    echo "<th class='zebra-striped'>Internals</th>";
    echo "<th class='zebra-striped'>Externals</th>";
    echo "<th class='zebra-striped'>Credits</th>";
    while ($row = mysql_fetch_array($result)) {
        $x = lookupStudent($row['srno']);
        if ($x != "false") {
            echo "<tr>";
            $name = $x['sname'];
            $sid = $x['sid'];
            $subject = $row["subname"];
            $intm = $row["intm"];
            $extm = $row["extm"];
            $cre = $row["cre"];
            $imgurl = getImageURL($x['imgid']);
            echo "<td><img src='../{$imgurl}' width='50' height='50'></img></td>";
            echo "<td>{$name}</td>";
            echo "<td>{$subject}</td>";
            echo "<td>{$intm}</td>";
            echo "<td>{$extm}</td>";
            echo "<td>{$cre}</td>";
            echo "</tr>";
        }
    }
    echo "</table>";
    echo "</form>";
}
?>
			</div>
		</center>
/**
 * support to show an image from an album
 * The imagename is optional. If absent the album thumb image will be
 * used and the link will be to the album. If present the link will be
 * to the image.
 *
 * @param string $albumname
 * @param string $imagename
 * @param int $size the size to make the image. If omitted image will be 50% of 'image_size' option.
 * @param bool $linkalbum set true to link specific image to album instead of image
 */
function zenpageAlbumImage($albumname, $imagename = NULL, $size = NULL, $linkalbum = false)
{
    global $_zp_gallery;
    echo '<br />';
    $album = newAlbum($albumname);
    if ($album->loaded) {
        if (is_null($size)) {
            $size = floor(getOption('image_size') * 0.5);
        }
        $image = NULL;
        if (is_null($imagename)) {
            $linkalbum = true;
            $image = $album->getAlbumThumbImage();
        } else {
            $image = newImage($album, $imagename);
        }
        if ($image && $image->loaded) {
            makeImageCurrent($image);
            if ($linkalbum) {
                rem_context(ZP_IMAGE);
                echo '<a href="' . html_encode($album->getLink()) . '"   title="' . sprintf(gettext('View the %s album'), $albumname) . '">';
                add_context(ZP_IMAGE);
                printCustomSizedImage(sprintf(gettext('View the album %s'), $albumname), $size);
                rem_context(ZP_IMAGE | ZP_ALBUM);
                echo '</a>';
            } else {
                echo '<a href="' . html_encode(getImageURL()) . '" title="' . sprintf(gettext('View %s'), $imagename) . '">';
                printCustomSizedImage(sprintf(gettext('View %s'), $imagename), $size);
                rem_context(ZP_IMAGE | ZP_ALBUM);
                echo '</a>';
            }
        } else {
            ?>
			<span style="background:red;color:black;">
				<?php 
            printf(gettext('<code>zenpageAlbumImage()</code> did not find the image %1$s:%2$s'), $albumname, $imagename);
            ?>
			</span>
			<?php 
        }
    } else {
        ?>
		<span style="background:red;color:black;">
			<?php 
        printf(gettext('<code>zenpageAlbumImage()</code> did not find the album %1$s'), $albumname);
        ?>
		</span>
		<?php 
    }
}
Example #9
0
    /**
     * Prints html meta data to be used in the <head> section of a page
     *
     */
    static function getHTMLMetaData()
    {
        global $_zp_gallery, $_zp_galley_page, $_zp_current_album, $_zp_current_image, $_zp_current_zenpage_news, $_zp_current_zenpage_page, $_zp_gallery_page, $_zp_current_category, $_zp_authority, $_zp_conf_vars, $_myFavorites, $htmlmetatags_need_cache, $_zp_page;
        zp_register_filter('image_processor_uri', 'htmlmetatags::ipURI');
        $host = sanitize("http://" . $_SERVER['HTTP_HOST']);
        $url = $host . getRequestURI();
        // Convert locale shorttag to allowed html meta format
        $locale = str_replace("_", "-", getUserLocale());
        $canonicalurl = '';
        // generate page title, get date
        $pagetitle = "";
        // for gallery index setup below switch
        $date = strftime(DATE_FORMAT);
        // if we don't have a item date use current date
        $desc = getBareGalleryDesc();
        $thumb = '';
        if (getOption('htmlmeta_sitelogo')) {
            $thumb = getOption('htmlmeta_sitelogo');
        }
        if (getOption('htmlmeta_og-image') || getOption('htmlmeta_twittercard')) {
            $ogimage_width = getOption('htmlmeta_ogimage_width');
            $ogimage_height = getOption('htmlmeta_ogimage_height');
            if (empty($ogimage_width)) {
                $ogimage_width = 1280;
            }
            if (empty($ogimage_height)) {
                $ogimage_height = 900;
            }
        }
        $type = 'article';
        switch ($_zp_gallery_page) {
            case 'index.php':
                $desc = getBareGalleryDesc();
                //$canonicalurl = $host . getGalleryIndexURL();
                $canonicalurl = $host . getPageNumURL($_zp_page);
                $type = 'website';
                break;
            case 'album.php':
                $pagetitle = getBareAlbumTitle() . " - ";
                $date = getAlbumDate();
                $desc = getBareAlbumDesc();
                $canonicalurl = $host . getPageNumURL($_zp_page);
                if (getOption('htmlmeta_og-image') || getOption('htmlmeta_twittercard')) {
                    $thumbimg = $_zp_current_album->getAlbumThumbImage();
                    getMaxSpaceContainer($ogimage_width, $ogimage_height, $thumbimg, false);
                    $thumb = $host . html_encode(pathurlencode($thumbimg->getCustomImage(NULL, $ogimage_width, $ogimage_height, NULL, NULL, NULL, NULL, false, NULL)));
                }
                break;
            case 'image.php':
                $pagetitle = getBareImageTitle() . " (" . getBareAlbumTitle() . ") - ";
                $date = getImageDate();
                $desc = getBareImageDesc();
                $canonicalurl = $host . getImageURL();
                if (getOption('htmlmeta_og-image') || getOption('htmlmeta_twittercard')) {
                    $thumb = $host . html_encode(pathurlencode(getCustomSizedImageMaxSpace($ogimage_width, $ogimage_height)));
                }
                break;
            case 'news.php':
                if (function_exists("is_NewsArticle")) {
                    if (is_NewsArticle()) {
                        $pagetitle = getBareNewsTitle() . " - ";
                        $date = getNewsDate();
                        $desc = trim(getBare(getNewsContent()));
                        $canonicalurl = $host . $_zp_current_zenpage_news->getLink();
                    } else {
                        if (is_NewsCategory()) {
                            $pagetitle = $_zp_current_category->getTitlelink() . " - ";
                            $date = strftime(DATE_FORMAT);
                            $desc = trim(getBare($_zp_current_category->getDesc()));
                            $canonicalurl = $host . $_zp_current_category->getLink();
                            $type = 'category';
                        } else {
                            $pagetitle = gettext('News') . " - ";
                            $desc = '';
                            $canonicalurl = $host . getNewsIndexURL();
                            $type = 'website';
                        }
                    }
                    if ($_zp_page != 1) {
                        $canonicalurl .= '/' . $_zp_page;
                    }
                }
                break;
            case 'pages.php':
                $pagetitle = getBarePageTitle() . " - ";
                $date = getPageDate();
                $desc = trim(getBare(getPageContent()));
                $canonicalurl = $host . $_zp_current_zenpage_page->getLink();
                break;
            default:
                // for all other possible static custom pages
                $custompage = stripSuffix($_zp_gallery_page);
                $standard = array('contact' => gettext('Contact'), 'register' => gettext('Register'), 'search' => gettext('Search'), 'archive' => gettext('Archive view'), 'password' => gettext('Password required'));
                if (is_object($_myFavorites)) {
                    $standard['favorites'] = gettext('My favorites');
                }
                if (array_key_exists($custompage, $standard)) {
                    $pagetitle = $standard[$custompage] . " - ";
                } else {
                    $pagetitle = $custompage . " - ";
                }
                $desc = '';
                $canonicalurl = $host . getCustomPageURL($custompage);
                if ($_zp_page != 1) {
                    $canonicalurl .= '/' . $_zp_page;
                }
                break;
        }
        // shorten desc to the allowed 200 characters if necesssary.
        $desc = html_encode(trim(substr(getBare($desc), 0, 160)));
        $pagetitle = $pagetitle . getBareGalleryTitle();
        // get master admin
        $admin = $_zp_authority->getMasterUser();
        $author = $admin->getName();
        $meta = '';
        if (getOption('htmlmeta_http-equiv-cache-control')) {
            $meta .= '<meta http-equiv="Cache-control" content="' . getOption("htmlmeta_cache_control") . '">' . "\n";
        }
        if (getOption('htmlmeta_http-equiv-pragma')) {
            $meta .= '<meta http-equiv="pragma" content="' . getOption("htmlmeta_pragma") . '">' . "\n";
        }
        if (getOption('htmlmeta_name-keywords')) {
            $meta .= '<meta name="keywords" content="' . htmlmetatags::getMetaKeywords() . '">' . "\n";
        }
        if (getOption('htmlmeta_name-description')) {
            $meta .= '<meta name="description" content="' . $desc . '">' . "\n";
        }
        if (getOption('htmlmeta_name-page-topic')) {
            $meta .= '<meta name="page-topic" content="' . $desc . '">' . "\n";
        }
        if (getOption('htmlmeta_name-robots')) {
            $meta .= '<meta name="robots" content="' . getOption("htmlmeta_robots") . '">' . "\n";
        }
        if (getOption('htmlmeta_name-publisher')) {
            $meta .= '<meta name="publisher" content="' . FULLWEBPATH . '">' . "\n";
        }
        if (getOption('htmlmeta_name-creator')) {
            $meta .= '<meta name="creator" content="' . FULLWEBPATH . '">' . "\n";
        }
        if (getOption('htmlmeta_name-author')) {
            $meta .= '<meta name="author" content="' . $author . '">' . "\n";
        }
        if (getOption('htmlmeta_name-copyright')) {
            $meta .= '<meta name="copyright" content=" (c) ' . FULLWEBPATH . ' - ' . $author . '">' . "\n";
        }
        if (getOption('htmlmeta_name-rights')) {
            $meta .= '<meta name="rights" content="' . $author . '">' . "\n";
        }
        if (getOption('htmlmeta_name-generator')) {
            $meta .= '<meta name="generator" content="Zenphoto ' . ZENPHOTO_VERSION . '">' . "\n";
        }
        if (getOption('htmlmeta_name-revisit-after')) {
            $meta .= '<meta name="revisit-after" content="' . getOption("htmlmeta_revisit_after") . '">' . "\n";
        }
        if (getOption('htmlmeta_name-expires')) {
            $expires = getOption("htmlmeta_expires");
            if ($expires == (int) $expires) {
                $expires = preg_replace('|\\s\\-\\d+|', '', date('r', time() + $expires)) . ' GMT';
            }
            $meta .= '<meta name="expires" content="' . $expires . '">' . "\n";
        }
        // OpenGraph meta
        if (getOption('htmlmeta_og-title')) {
            $meta .= '<meta property="og:title" content="' . $pagetitle . '">' . "\n";
        }
        if (getOption('htmlmeta_og-image') && !empty($thumb)) {
            $meta .= '<meta property="og:image" content="' . $thumb . '">' . "\n";
        }
        if (getOption('htmlmeta_og-description')) {
            $meta .= '<meta property="og:description" content="' . $desc . '">' . "\n";
        }
        if (getOption('htmlmeta_og-url')) {
            $meta .= '<meta property="og:url" content="' . html_encode($url) . '">' . "\n";
        }
        if (getOption('htmlmeta_og-type')) {
            $meta .= '<meta property="og:type" content="' . $type . '">' . "\n";
        }
        // Social network extras
        if (getOption('htmlmeta_name-pinterest')) {
            $meta .= '<meta name="pinterest" content="nopin">' . "\n";
        }
        // dissalow users to pin images on Pinterest
        // Twitter card
        $twittername = getOption('htmlmeta_twittername');
        if (getOption('htmlmeta_twittercard') || !empty($twittername)) {
            $meta .= '<meta property="twitter:creator" content="' . $twittername . '">' . "\n";
            $meta .= '<meta property="twitter:site" content="' . $twittername . '">' . "\n";
            $meta .= '<meta property="twitter:card" content="summary">' . "\n";
            $meta .= '<meta property="twitter:title" content="' . $pagetitle . '">' . "\n";
            $meta .= '<meta property="twitter:description" content="' . $desc . '">' . "\n";
            if (!empty($thumb)) {
                $meta .= '<meta property="twitter:image" content="' . $thumb . '">' . "\n";
            }
        }
        // Canonical url
        if (getOption('htmlmeta_canonical-url')) {
            $meta .= '<link rel="canonical" href="' . $canonicalurl . '">' . "\n";
            if (METATAG_LOCALE_TYPE) {
                $langs = generateLanguageList();
                if (count($langs) != 1) {
                    foreach ($langs as $text => $lang) {
                        $langcheck = zpFunctions::getLanguageText($lang, '-');
                        //	for hreflang we need en-US
                        if ($langcheck != $locale) {
                            switch (METATAG_LOCALE_TYPE) {
                                case 1:
                                    $altlink = seo_locale::localePath(true, $lang);
                                    break;
                                case 2:
                                    $altlink = dynamic_locale::fullHostPath($lang);
                                    break;
                            }
                            switch ($_zp_gallery_page) {
                                case 'index.php':
                                    $altlink .= '/';
                                    break;
                                case 'gallery.php':
                                    $altlink .= '/' . _PAGE_ . '/gallery';
                                    break;
                                case 'album.php':
                                    $altlink .= '/' . html_encode($_zp_current_album->name) . '/';
                                    break;
                                case 'image.php':
                                    $altlink .= '/' . html_encode($_zp_current_album->name) . '/' . html_encode($_zp_current_image->filename) . IM_SUFFIX;
                                    break;
                                case 'news.php':
                                    if (function_exists("is_NewsArticle")) {
                                        if (is_NewsArticle()) {
                                            $altlink .= '/' . _NEWS_ . '/' . html_encode($_zp_current_zenpage_news->getTitlelink());
                                        } else {
                                            if (is_NewsCategory()) {
                                                $altlink .= '/' . _NEWS_ . '/' . html_encode($_zp_current_category->getTitlelink());
                                            } else {
                                                $altlink .= '/' . _NEWS_;
                                            }
                                        }
                                    }
                                    break;
                                case 'pages.php':
                                    $altlink .= '/' . _PAGES_ . '/' . html_encode($_zp_current_zenpage_page->getTitlelink());
                                    break;
                                case 'archive.php':
                                    $altlink .= '/' . _ARCHIVE_;
                                    break;
                                case 'search.php':
                                    $altlink .= '/' . _SEARCH_ . '/';
                                    break;
                                case 'contact.php':
                                    $altlink .= '/' . _CONTACT_ . '/';
                                    break;
                                default:
                                    // for all other possible none standard custom pages
                                    $altlink .= '/' . _PAGE_ . '/' . html_encode($pagetitle);
                                    break;
                            }
                            // switch
                            //append page number if needed
                            switch ($_zp_gallery_page) {
                                case 'index.php':
                                case 'album.php':
                                    if ($_zp_page != 1) {
                                        $altlink .= _PAGE_ . '/' . $_zp_page . '/';
                                    }
                                    break;
                                case 'gallery.php':
                                case 'news.php':
                                    if ($_zp_page != 1) {
                                        $altlink .= '/' . $_zp_page;
                                    }
                                    break;
                            }
                            $meta .= '<link rel="alternate" hreflang="' . $langcheck . '" href="' . $altlink . '">' . "\n";
                        }
                        // if lang
                    }
                    // foreach
                }
                // if count
            }
            // if option
        }
        // if canonical
        if (!empty($htmlmetatags_need_cache)) {
            $meta .= '<script type="text/javascript">' . "\n";
            $meta .= 'var caches = ["' . implode('","', $htmlmetatags_need_cache) . '"];' . "\n";
            $meta .= '
					window.onload = function() {
						var index,value;
						for (index in caches) {
								value = caches[index];
								$.ajax({
									cache: false,
									type: "GET",
									url: value
								});
						}
					}
					';
            $meta .= '</script>' . "\n";
        }
        zp_remove_filter('image_processor_uri', 'htmlmetatags::ipURI');
        echo $meta;
    }
Example #10
0
		</div>
		<?php 
}
?>
	</div>

    <div id="images_tlg">
		<?php 
while (next_image()) {
    ?>

		<div class="image">
			<div id="image_box">
			<div id="image_position">
			<a href="<?php 
    echo getImageURL();
    ?>
" title="<?php 
    echo getImageTitle();
    ?>
"><?php 
    printImageThumb(getImageTitle());
    ?>
</a>
			</div>
			</div>
		</div>


		<?php 
}
Example #11
0
 public function getURL()
 {
     return getImageURL($this->activeCategory, $this->activeExample);
 }
Example #12
0
/**
 * @deprecated
 * @since 1.4.6
 *
 */
function getImageLinkURL()
{
    deprecated_functions::notify(gettext('use getImageURL()'));
    return getImageURL();
}
Example #13
0
        $k = trim(strtolower($_GET["k"]));
    }
}
if ($k == "" && $user["id"] == "") {
    $k = "kitten";
}
$images = flickrTagmatch($k, $m, 500, 0, 0, "interestingness-desc", $user["id"]);
if (count($images["photo"]) > 0) {
    $rndID = rand(0, count($images["photo"]) - 1);
    if (isset($_GET["u"])) {
        if ("" . $_GET["u"] == "d") {
            $rndID = (-1 + (-1 + date("n", time())) * date("t", time()) + date("j", time())) % (count($images["photo"]) - 1);
        }
    }
    $selectedImage = $images["photo"][$rndID];
    $selectedImage["url"] = getImageURL($selectedImage, $w, $h);
    $selectedImage["licensename"] = getImageLicense($selectedImage);
    $selectedImage["fulltitle"] = $selectedImage["title"] . " by " . $selectedImage["ownername"];
}
if (!isset($selectedImage)) {
    $selectedImage["url"] = $site["flickr"]["defaultImage"];
    $selectedImage["licensename"] = $site["flickr"]["defaultLicense"];
    $selectedImage["fulltitle"] = $site["flickr"]["defaultFullTitle"];
}
$selectedImage["md5"] = md5($selectedImage["url"]);
$selectedImage["cached"] = $site["imageCache"] . $selectedImage["md5"] . ".jpg";
$selectedImage["cachedresized"] = $site["path"] . $site["folder"] . $site["imageCache"] . $selectedImage["md5"] . "." . $w . "." . $h . ".jpg";
$selectedImage["cachedresizedpublic"] = $site["folder"] . $site["imageCache"] . $selectedImage["md5"] . "." . $w . "." . $h . ".jpg";
cacheImage($selectedImage["url"], $selectedImage["cached"]);
smart_resize_image($selectedImage["cached"], null, $w, $h, false, $selectedImage["cachedresized"], true);
//Convert image to jpg
Example #14
0
function parseImg($imgHtml)
{
    // 	$imgHtml='<IMG BORDER=2 HEIGHT=133 WIDTH=172 SRC="picts/FREAKME.jpg" alt="Ribbit">';
    preg_match_all('/(alt|width|height|src)=("[^"]*")/i', $imgHtml, $values);
    // 	print_r($values);
    // 	global $url ;
    // 	echo ($url).'<br/>';
    // 	$imgHtml = str_replace(">","/>",$imgHtml);
    // 	$imgHtml = str_replace("//>","/>",$imgHtml);
    // 	$parser = xml_parser_create();
    // 	echo $imgHtml.'\n';
    // 	xml_parse_into_struct($parser, $imgHtml, $values);
    // 	print_r($values);
    $arr = array();
    $blacklistImgs = array("ad.doubleclick.net");
    $imgSrc = "";
    $imgAlt = "";
    $height = 0;
    $width = 0;
    foreach ($values[1] as $key => $val) {
        //print_r($val);
        // 		echo $key;
        if ($val == "SRC" || $val == 'src') {
            $imgSrc = getImageURL($values[2][$key]);
        }
        if ($val == "ALT" || $val == 'alt') {
            $imgAlt = $values[2][$key];
        }
        if ($val == "HEIGHT" || $val == 'height') {
            $height = $values[2][$key];
        }
        if ($val == "WDITH" || $val == 'width') {
            $width = $values[2][$key];
        }
    }
    // 	echo $imgSrc.' '.$imgAlt.' '.$height.' '.$width;
    if ($imgSrc != "") {
        //echo "hi";
        $urlParams = parse_url($imgSrc);
        if (!in_array($urlParams["host"], $blacklistImgs)) {
            // 				print_r($val['attributes']);
            /*$width = 0; $height = 0;
            		if(isset($val['attributes']['WIDTH'])){
            			$width = $val['attributes']['WIDTH'];
            		}
            		if(isset($val['attributes']['HEIGHT'])){
            			$height = $val['attributes']['HEIGHT'];
            		}*/
            if ($width < 1 && $height < 1) {
                list($width, $height, $type, $attr) = @getimagesize($imgSrc);
            }
            if ($type == 17) {
                //If its fav ico with extn .ico
                return $arr;
            }
            $hwRatio = 0;
            if ($width > 0 && $height > 0) {
                $hwRatio = $width / $height;
            }
            // 				echo $width.' '.$height.' '.$hwRatio. ' '.$imgSrc .'<br/>';
            if ($hwRatio > 0.8 && $hwRatio < 2) {
                $minImg = 32;
                $isSmallSquare = $hwRatio == 1 ? $width > $minImg : $width > $minImg && $height > $minImg;
                if ($isSmallSquare) {
                    //To remove Background images used for UI, if square
                    $arr['src'] = $imgSrc;
                    if (isset($imgAlt)) {
                        $arr['alt'] = $imgAlt;
                    }
                    if (isset($width)) {
                        $arr['width'] = $width;
                    }
                    if (isset($height)) {
                        $arr['height'] = $height;
                    }
                }
            }
        }
    }
    // 	}
    // 	print_r($arr);
    return $arr;
}
/**
 * Prints the link to the current  image.
 *
 * @param string $text text for the link
 * @param string $title title tag for the link
 * @param string $class optional style class for the link
 * @param string $id optional style id for the link
 */
function printImageURL($text, $title, $class = NULL, $id = NULL)
{
    printLinkHTML(getImageURL(), $text, $title, $class, $id);
}
Example #16
0
                $firstImage = $lastImage;
            } else {
                $lastImage++;
            }
            ?>
									<div class="image">
										<div class="imagethumb">
											<?php 
            if ($map) {
                $coord = getGeoCoord($_zp_current_image);
                if ($coord) {
                    $points[] = $coord;
                }
            }
            $annotate = annotateImage();
            echo '<a href="' . html_encode(getImageURL()) . '"';
            echo " title=\"" . $annotate . "\">\n";
            printImageThumb($annotate);
            echo "</a>";
            printAddToFavorites($_zp_current_image, '', gettext('Remove'));
            ?>
										</div>
									</div>
									<?php 
        }
        echo '<div class="clearage"></div>';
        ?>
							</div><!-- images -->
						</div> <!-- main -->
						<div class="clearage"></div>
						<span style="text-align:center"><?php 
Example #17
0
    echo getAlbumTitle();
    ?>
</span>
					</a></li>
<?php 
}
?>

<?php 
while (next_image()) {
    if (isImagePhoto() && extensionEnabled('colorbox_js') && zp_has_filter('theme_head', 'colorbox::css')) {
        $imgURL = getFullImageURL();
        $boxclass = " class=\"fullimage\"";
        $cbRel = " data-rel=\"gallery\"";
    } else {
        $imgURL = getImageURL();
        $boxclass = "";
        $cbRel = "";
    }
    ?>
					<li id="<?php 
    echo ' image-' . $_zp_current_image->getID();
    ?>
" class="image">
						<a title="<?php 
    echo html_encode(getImageTitle());
    ?>
" href="<?php 
    echo html_encode($imgURL);
    ?>
"<?php 
Example #18
0
    function theme_content($map)
    {
        global $_zp_current_image, $points;
        ?>
		<!-- Colorbox section -->
		<div id="content">
			<div id="main">
				<div id="images">
					<?php 
        $points = array();
        $firstImage = null;
        $lastImage = null;
        while (next_image()) {
            // Colorbox does not do video
            if (is_null($firstImage)) {
                $lastImage = imageNumber();
                $firstImage = $lastImage;
            } else {
                $lastImage++;
            }
            ?>
						<div class="image">
							<div class="imagethumb">
								<?php 
            if ($map) {
                $coord = getGeoCoord($_zp_current_image);
                if ($coord) {
                    $points[] = $coord;
                }
            }
            $annotate = annotateImage();
            if (isImagePhoto()) {
                // colorbox is only for real images
                echo '<a href="' . html_encode(getDefaultSizedImage()) . '" class="thickbox"';
            } else {
                echo '<a href="' . html_encode(getImageURL()) . '"';
            }
            echo " title=\"" . $annotate . "\">\n";
            printImageThumb($annotate);
            echo "</a>";
            ?>
							</div>
						</div>
						<?php 
        }
        echo '<div class="clearage"></div>';
        if (!empty($points) && $map) {
            function map_callback($map)
            {
                global $points;
                foreach ($points as $coord) {
                    addGeoCoord($map, $coord);
                }
            }
            ?>
						<div id="map_link">
						<?php 
            printGoogleMap(NULL, NULL, NULL, 'album_page', 'map_callback');
            ?>
						</div>
						<?php 
        }
        @call_user_func('printSlideShowLink', NULL, 'text-align:center;');
        ?>
				</div><!-- images -->
			<?php 
        @call_user_func('printRating');
        ?>
			</div><!-- main -->
			<div class="clearage"></div>
		<?php 
        if (isset($firstImage)) {
            printNofM('Photo', $firstImage, $lastImage, getNumImages());
        }
        ?>
		</div><!-- content -->
		<?php 
    }
Example #19
0
function ViewText($tweets)
{
    $strList = "";
    foreach ($tweets as $tweet) {
        $items = $tweet->entities->urls;
        $medias = $tweet->entities->media;
        $one = true;
        //公式画像
        foreach ($medias as $media) {
            if ($media->media_url) {
                if ($one) {
                    $strList = $strList . viewTextList($tweet);
                    $one = false;
                }
                $strList = $strList . "<div id=\"user_image\"><a href=" . $media->media_url . ">" . "<img src= " . $media->media_url . "></a></div>";
            }
        }
        //twipic,instgramなど
        foreach ($items as $item) {
            if (isImageURL($item->expanded_url)) {
                if ($one) {
                    $strList = $strList . viewTextList($tweet);
                    $one = false;
                }
                $strList = $strList . "<div id=\"user_image\">" . getImageURL($item->expanded_url) . "</div>";
            }
        }
        if (!$one) {
            $strList = $strList . "</ul>";
        }
    }
    echo $strList;
}
Example #20
0
						<a class="album-tool" href="<?php 
                echo htmlspecialchars(getImageURL());
                ?>
" title="<?php 
                echo getCommentCount();
                ?>
 Comments"><img src="<?php 
                echo $_zp_themeroot;
                ?>
/images/shout.png" alt="Comments" /></a>
						<?php 
            }
            ?>
				</div>
				<a class="thumb" href="<?php 
            echo htmlspecialchars(getImageURL());
            ?>
" title="<?php 
            echo getBareImageTitle();
            ?>
">
					<?php 
            printCustomSizedImage(getBareImageTitle(), null, 120, 160, 120, 160, null, null, 'thumb', null, true);
            ?>
				</a>
			<?php 
        }
        ?>
			</li>
			<?php 
    }
Example #21
0
<?php

function getImageURL()
{
    //$url = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];
    $url = $_SERVER['REQUEST_URI'];
    $url = substr($url, 0, strrpos($url, '/'));
    $url .= '/test.jpg';
    return $url;
}
if ($_GET['redirect']) {
    header('Location:' . getImageURL());
} else {
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
        echo 'name=' . $_POST['name'];
    } else {
        ?>
<html><body>
  Post test : <form method="POST" action="TestServer.php"><input type="text" name="name"/></form>
</body></html>
<?php 
    }
}
Example #22
0
    }
    ?>
						</div>
					<?php 
}
?>
					<?php 
if (getNumImages() > 0) {
    ?>
						<div id="images">
							<?php 
    while (next_image()) {
        ?>
								<div class="image">
									<div class="imagethumb"><a href="<?php 
        echo html_encode(getImageURL());
        ?>
" title="<?php 
        printBareImageTitle();
        ?>
"><?php 
        printImageThumb(getBareImageTitle());
        ?>
</a></div>
								</div>
							<?php 
    }
    ?>
						</div>
						<br class="clearall" />
					<?php 
Example #23
0
File: index.php Project: asuky/hhr
function messageGet($app)
{
    $msg = selectMessages();
    $imageurl = getImageURL();
    $app->render(200, array('user_name' => 'hoge', 'message' => $msg, 'image' => $imageurl));
}