Пример #1
0
/**
 * Prints the Shutterfly logo and links to print an image.
 *
 */
function printShutterfly()
{
    echo '<script type="text/javascript">' . "\n";
    echo '<!--/* Code from http://www.netlobo.com/div_hiding.html */-->' . "\n";
    echo '	function toggleLayer(whichLayer) {' . "\n";
    echo '		if (document.getElementById) {' . "\n";
    echo '// this is the way the standards work' . "\n";
    echo '			var style2 = document.getElementById(whichLayer).style;' . "\n";
    echo '			style2.display = style2.display? "":"block";' . "\n";
    echo '		} else if (document.all) {' . "\n";
    echo '// this is the way old msie versions work' . "\n";
    echo '			var style2 = document.all[whichLayer].style;' . "\n";
    echo '			style2.display = style2.display? "":"block";' . "\n";
    echo '		} else if (document.layers) {' . "\n";
    echo '// this is the way nn4 works' . "\n";
    echo '			var style2 = document.layers[whichLayer].style;' . "\n";
    echo '			style2.display = style2.display? "":"block";' . "\n";
    echo '		}' . "\n";
    echo '	}' . "\n";
    echo '</script>' . "\n";
    echo "<div id=\"zp-shutterfly\" onClick=\"toggleLayer('extended')\">\n";
    echo '	<div id="extended">' . "\n";
    echo '		<form action="http://www.shutterfly.com/c4p/UpdateCart.jsp" method="post">' . "\n";
    echo '			<input type="hidden" name="addim" value="1" />' . "\n";
    echo '			<input type="hidden" name="protocol" value="SFP,100" />' . "\n";
    echo '			<input type="hidden" name="pid" value="C4P" />' . "\n";
    echo '			<input type="hidden" name="psid" value="AFFL" />' . "\n";
    echo '			<input type="hidden" name="puid" value="visitor" />' . "\n";
    echo '			<input type="hidden" name="imnum" value="1" />' . "\n";
    echo '			<input type="hidden" name="imraw-1" value="http://' . $_SERVER['HTTP_HOST'] . htmlspecialchars(getUnprotectedImageURL()) . '" />' . "\n";
    echo '			<input type="hidden" name="imrawwidth-1" value="' . getFullWidth() . '" />' . "\n";
    echo '			<input type="hidden" name="imrawheight-1" value="' . getFullHeight() . '" />' . "\n";
    echo '			<input type="hidden" name="imthumb-1" value="http://' . $_SERVER['HTTP_HOST'] . getImageThumb() . '" />' . "\n";
    echo '			<input type="hidden" name="imthumbheight-1" value="' . getOption('thumb_crop_height') . '" />' . "\n";
    echo '			<input type="hidden" name="imthumbwidth-1" value="' . getOption('thumb_crop_width') . '" />' . "\n";
    echo '			<input type="hidden" name="returl" value="http://' . $_SERVER['HTTP_HOST'] . htmlspecialchars(getImageLinkURL()) . '" />' . "\n";
    echo '			<input type="submit" value="Add to Shutterfly Cart &raquo;" />' . "\n";
    echo '		</form>' . "\n";
    echo '	</div>' . "\n";
    echo '</div>' . "\n";
}
Пример #2
0
<?php 
} else {
    header('Content-Type: application/xml');
    $path = '..';
    echo '<?xml version="1.0" encoding="UTF-8"?>
<simpleviewerGallery title=""  maxImageWidth="' . $maxImageWidth . '" maxImageHeight="' . $maxImageHeight . '" textColor="' . $textColor . '" frameColor="' . $frameColor . '" frameWidth="' . $frameWidth . '" stagePadding="' . $stagePadding . '" thumbnailColumns="' . $thumbnailColumns . '" thumbnailows="' . $thumbnailRows . '" navPosition="' . $navPosition . '" enableRightClickOpen="' . $enableRightClickOpen . '" backgroundImagePath="' . $backgroundImagePath . '" imagePath="' . $path . '" thumbPath="' . $path . '">';
    ?>

<?php 
    while (next_image(true)) {
        ?>
<image><filename><?php 
        echo htmlspecialchars(getFullImageURL());
        ?>
</filename><caption><![CDATA[<a href="<?php 
        echo htmlspecialchars(getImageLinkURL());
        ?>
" title="<?php 
        echo gettext('Open in a new window');
        ?>
">
<font face="Times"><u><b><em><?php 
        echo getImageTitle();
        ?>
</font></em></b></u></a></u>
<br></font><?php 
        echo getImageDesc();
        ?>
]]></caption></image><?php 
    }
    ?>
Пример #3
0
        echo getBareAlbumTitle();
        ?>
"><?php 
        printAlbumTitle();
        ?>
</a>
 				<?php 
        printAlbumDate("");
        echo truncate_string(getAlbumDesc(), 45);
    }
}
if (getNumImages() > 0) {
    while (next_image()) {
        ?>
				<a href="<?php 
        echo html_encode(getImageLinkURL());
        ?>
" title="<?php 
        echo getBareImageTitle();
        ?>
"><?php 
        printImageThumb(getBareImageTitle());
        ?>
</a>
				<?php 
    }
}
if ($total == 0) {
    echo "<p>" . gettext("Sorry, no matches found. Try refining your search.") . "</p>";
}
printPageListWithNav("&laquo; " . gettext("prev"), gettext("next") . " &raquo;");
Пример #4
0
/**
 * Places a Paypal button on your form
 * 
 * @param array $pricelist optional array of specific pricing for the image.
 * @param bool $pricelistlink set to true to include link for exposing pricelist
 * @param string $text The text to place for the link (defaults to "Price List")
 * @param string $textTag HTML tag for the link text. E.g. h3, ...  
 * @param string $idtag the division ID for the price list. (NB: a div named $id appended with "_data" is
 */
function zenPaypal($pricelist = NULL, $pricelistlink = false, $text = NULL, $textTag = "l1", $idtag = "zenPaypalPricelist")
{
    if (!is_array($pricelist)) {
        $pricelist = zenPaypalPricelistFromString(getOption('zenPaypal_pricelist'));
    }
    ?>
<script language="javascript">

function paypalCalculateOrder(myform) {
	<?php 
    $sizes = array();
    $media = array();
    foreach ($pricelist as $key => $price) {
        $itemparts = explode(':', $key);
        $media[] = $itemparts[1];
        $sizes[] = $itemparts[0];
        echo 'if (myform.os0.value == "' . $itemparts[0] . '" && myform.os1.value == "' . $itemparts[1] . '") {' . "\n";
        echo 'myform.amount.value = ' . $price . ';' . "\n";
        echo 'myform.item_name.value = "' . getImageTitle() . ' - Photo Size ' . $itemparts[0] . ' - ' . $itemparts[1] . '";' . "\n";
        echo '}' . "\n";
    }
    ?>
        
}
</script>

<?php 
    $locale = getOption('locale');
    if (empty($locale)) {
        $locale = 'en_US';
    }
    ?>

<div id="BuyNow">
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" name="myform">
<input type="hidden" name="on0"	value="Size"> <label>Size</label> 
	<select name="os0">
	<?php 
    $media = array_unique($media);
    $sizes = array_unique($sizes);
    foreach ($sizes as $size) {
        echo '<option value="' . $size . '" selected>' . $size . "\n";
    }
    ?>
</select> 
<input type="hidden" name="on1" value="Color"> <label><?php 
    echo gettext("Stock");
    ?>
</label>
<select name="os1">
	<?php 
    foreach ($media as $paper) {
        echo '<option value="' . $paper . '" selected>' . $paper . "\n";
    }
    ?>
</select> 
<input type="image" src="https://www.paypal.com/<?php 
    echo $locale;
    ?>
/i/btn/x-click-butcc.gif" border="0"
	name="submit" onClick="paypalCalculateOrder(this.form)"
	alt=<?php 
    gettext("Make payments with PayPal - it's fast, free and secure!");
    ?>
	class="buynow_button"> 
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="<?php 
    echo getOption('zenPaypal_userid');
    ?>
">
<input type="hidden" name="item_name" value="Options Change Amount"> 
<input type="hidden" name="amount" value="1.00"> 
<input type="hidden" name="shipping" value="<?php 
    echo getOption('zenPaypal_ship_cost');
    ?>
"> 
<input type="hidden" name="no_note" value="1"> 
<input type="hidden" name="currency_code" value="<?php 
    echo getOption('zenPaypal_currency');
    ?>
"> 
<input type="hidden" name="return" value="<?php 
    echo 'http://' . $_SERVER['SERVER_NAME'] . htmlspecialchars(getNextImageURL());
    ?>
">
<input type="hidden" name="cancel_return" value="<?php 
    echo 'http://' . $_SERVER['SERVER_NAME'] . htmlspecialchars(getImageLinkURL());
    ?>
">
</form>
<?php 
    if ($pricelistlink) {
        zenPaypalPrintPricelist($pricelistlink, $text, $textTag, $idtag);
    }
    ?>
</div>
<?php 
}
Пример #5
0
        $firstImage = $lastImage;
    } else {
        $lastImage++;
    }
    if (isLandscape()) {
        $iw = 89;
        $ih = NULL;
        $cw = 89;
        $ch = 67;
    } else {
        $iw = NULL;
        $ih = 89;
        $ch = 89;
        $cw = 67;
    }
    echo "\n<li class=\"thumb\"><span><em style=\"background-image:url(" . htmlspecialchars($_zp_current_image->getCustomImage(NULL, $iw, $ih, $cw, $ch, NULL, NULL, true)) . '); "><a href="' . htmlspecialchars(getImageLinkURL()) . '" title="' . getAnnotatedImageTitle() . '" style="background:#fff;">"' . getImageTitle() . '"</a></em></span></li>';
}
if (!is_null($lastImage) && $lastImage < getNumImages()) {
    $np = getCurrentPage() + 1;
    ?>
			<li class="thumb"><span class="forward"><em style="background-image:url('<?php 
    echo $_zp_themeroot;
    ?>
/images/moreslide_next.gif');">
			<a href="<?php 
    echo htmlspecialchars(getPageURL($np, $np));
    ?>
" style="background:#fff;"><?php 
    echo gettext('Next page');
    ?>
</a></em></span></li>
Пример #6
0
 			<div id="content">
 				<div id="main">
 					<div id="images">
 			<?php 
        $firstImage = null;
        $lastImage = null;
        while (next_image()) {
            if (is_null($firstImage)) {
                $lastImage = imageNumber();
                $firstImage = $lastImage;
            } else {
                $lastImage++;
            }
            echo '<div class="image">' . "\n";
            echo '<div class="imagethumb">' . "\n";
            echo '<a href="' . html_encode(getImageLinkURL()) . '" title="' . GetBareImageTitle() . '">' . "\n";
            echo printImageThumb(annotateImage()) . "</a>\n";
            echo "</div>\n";
            echo "</div>\n";
        }
        ?>
 					</div>
 					</div> <!-- main -->
		 			<div class="clearage"></div>
 					<?php 
        if (function_exists('printSlideShowLink')) {
            printSlideShowLink(gettext('View Slideshow'), 'text-align:center;');
        }
        printNofM('Photo', $firstImage, $lastImage, getNumImages());
        ?>
 					</div> <!-- content -->
/**
 * 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 = new Album($_zp_gallery, $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(getAlbumLinkURL($album)) . '"   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(getImageLinkURL($image)) . '" 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 
    }
}
Пример #8
0
/**
 * Causes a Google map to be printed based on the gps data in all the images in the album
 * @param  string $zoomlevel the zoom in for the map. NULL will use the default
 * @param string $defaultmaptype the starting display of the map valid values are G_NORMAL_MAP | G_SATELLITE_MAP | G_HYBRID_MAP | G_PHYSICAL_MAP | G_SATELLITE_3D_MAP
 * @param int $width is the image width of the map. NULL will use the default
 * @param int $height is the image height of the map. NULL will use the default
 * @param string $text text for the pop-up link
 * @param bool $toggle set to true to hide initially
 * @param string $id DIV id
 * @param int $firstPageImages the number of images on transition pages.
 * @param array $mapselections array of the maps to be used.
 * @param bool $addphysical Adds physical map.
 * @param bool $addwiki Adds wikipedia georeferenced data on your maps
 * @param string $background the background color for the map
 * @param string $mapcontrol values None | Small | Large
 * @param string $maptypecontrol values Buttons | List
 * @param string $customJS the extra javascript needed by the theme
 */
function printAlbumMap($zoomlevel = NULL, $defaultmaptype = NULL, $width = NULL, $height = NULL, $text = '', $toggle = true, $id = 'googlemap', $firstPageImages = 0, $mapselections = NULL, $addwiki = NULL, $background = NULL, $mapcontrol = NULL, $maptypecontrol = NULL, $customJS = NULL)
{
    global $_zp_phoogle, $_zp_images, $_zp_current_album, $_zp_current_image;
    if (getOption('gmaps_apikey') != '') {
        $foundLocation = false;
        $defaultmaptype = setupAllowedMaps($defaultmaptype, $mapselections);
        if ($zoomlevel) {
            $_zp_phoogle->zoomLevel = $zoomlevel;
        }
        if (!is_null($width)) {
            $_zp_phoogle->setWidth($width);
        } else {
            $_zp_phoogle->setWidth(getOption('gmaps_width'));
        }
        if (!is_null($height)) {
            $_zp_phoogle->setHeight($height);
        } else {
            $_zp_phoogle->setHeight(getOption('gmaps_height'));
        }
        if (!is_null($mapcontrol)) {
            $_zp_phoogle->setControlMap($mapcontrol);
        } else {
            $_zp_phoogle->setControlMap(getOption('gmaps_control'));
        }
        if (!is_null($maptypecontrol)) {
            $_zp_phoogle->setControlMapType($maptypecontrol);
        } else {
            $_zp_phoogle->setControlMapType(getOption('gmaps_control_maptype'));
        }
        if (!is_null($background)) {
            $_zp_phoogle->setBackGround($background);
        } else {
            $_zp_phoogle->setBackGround(getOption('gmaps_background'));
        }
        if (!is_null($customJS)) {
            $_zp_phoogle->customJS = $customJS;
        }
        resetCurrentAlbum();
        // start from scratch
        while (next_image(getOption('gmaps_show_all_album_points'), $firstPageImages)) {
            $exif = getImageEXIFData();
            if (!empty($exif['EXIFGPSLatitude']) && !empty($exif['EXIFGPSLongitude'])) {
                $foundLocation = true;
                $lat = $exif['EXIFGPSLatitude'];
                $long = $exif['EXIFGPSLongitude'];
                if ($exif['EXIFGPSLatitudeRef'] == 'S') {
                    $lat = '-' . $lat;
                }
                if ($exif['EXIFGPSLongitudeRef'] == 'W') {
                    $long = '-' . $long;
                }
                $infoHTML = '<a href="' . pathurlencode(getImageLinkURL()) . '"><img src="' . pathurlencode(getImageThumb()) . '" alt="' . getImageDesc() . '" ' . 'style=" margin-left: 30%; margin-right: 10%; border: 0px; "/></a>' . '<p>' . getImageDesc() . '</p>';
                addPoint($lat, $long, js_encode($infoHTML));
            }
        }
        resetCurrentAlbum();
        // clear out any 'damage'
        if ($foundLocation) {
            $dataid = $id . '_data';
            //to avoid problems with google earth and the toggle options, the toggle option is removed from here when GE is activated
            //it is possible to have both functionnality work but the toogle option should then be integrated in the phoogle map class dirctly within the script
            //that calls the map and should alos trigger a map type change. check Sobre theme or  have alook at www.kaugite.com for an example
            $toggle = $toggle && $defaultmaptype != 'G_SATELLITE_3D_MAP';
            if (is_null($text)) {
                $text = gettext('Google Map');
            }
            echo "<a href=\"javascript: vtoggle('{$dataid}');\" title=\"" . gettext('Display or hide the Google Map.') . "\">";
            echo $text;
            echo "</a>\n";
            echo "  <div id=\"{$dataid}\"" . ($toggle ? " style=\"color:black; visibility: hidden;position:absolute;left: -3000px;top: -3000px\"" : '') . ">\n";
            $_zp_phoogle->showMap(is_null($zoomlevel));
            echo "  </div>\n";
        }
    }
}
Пример #9
0
        $firstImage = $lastImage;
    } else {
        $lastImage++;
    }
    if (isLandscape()) {
        $iw = 89;
        $ih = NULL;
        $cw = 89;
        $ch = 67;
    } else {
        $iw = NULL;
        $ih = 89;
        $ch = 89;
        $cw = 67;
    }
    echo '<li class="thumb"><span><em style="background-image:url(' . html_encode($_zp_current_image->getCustomImage(NULL, $iw, $ih, $cw, $ch, NULL, NULL, true)) . '); "><a href="' . html_encode(getImageLinkURL()) . '" title="' . getAnnotatedImageTitle() . '" style="background:#fff;">"' . getImageTitle() . '"</a></em></span></li>';
}
if (!is_null($lastImage) && $lastImage < getNumImages()) {
    $np = getCurrentPage() + 1;
    ?>
			<li class="thumb"><span class="forward"><em style="background-image:url('<?php 
    echo $_zp_themeroot;
    ?>
/images/moreslide_next.gif');">
			<a href="<?php 
    echo html_encode(getPageURL($np, $np));
    ?>
" style="background:#fff;"><?php 
    echo gettext('Next page');
    ?>
</a></em></span></li>
Пример #10
0
/**
 * Print the entire <div> for a thumbnail. If we are in sorting mode, then only
 * the image is inserted, if not, then the hyperlink to the image is also added.
 *
 * @author Todd Papaioannou (lucky@luckyspin.org)
 * @since  1.0.0
 */
function printImageDiv()
{
    if (!isset($_GET['sortable'])) {
        echo '<a href="' . html_encode(getImageLinkURL()) . '" title="' . html_encode(getImageTitle()) . '">';
    }
    printImageThumb(getImageTitle());
    if (!isset($_GET['sortable'])) {
        echo '</a>';
    }
}