/** * 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 »" />' . "\n"; echo ' </form>' . "\n"; echo ' </div>' . "\n"; echo '</div>' . "\n"; }
function loadAlbum($album) { global $gallery, $_zp_current_album, $_zp_current_image; $subalbums = $album->getSubAlbums(); $count = 0; foreach ($subalbums as $folder) { $subalbum = new Album($gallery, $folder); $count = $count + loadAlbum($subalbum); } $_zp_current_album = $album; if (getNumImages() > 0) { echo "<br />" . $album->name . "{"; while (next_image(true)) { if (isImagePhoto($_zp_current_image)) { echo '<img src="' . getImageThumb() . '" height="8" width="8" /> | <img src="' . getDefaultSizedImage() . '" height="20" width="20" />' . "\n"; } else { echo '<img src="' . getImageThumb() . '" height="8" width="8" /> | '; } $count++; } echo "}<br/>\n"; } return $count; }
/** * 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"; } } }
/** * @param string $alt Alt text * @param string $class optional class tag * @param string $id optional id tag */ function printImageThumb($alt, $class = NULL, $id = NULL) { global $_zp_current_image; if (is_null($_zp_current_image)) { return; } if (!$_zp_current_image->getShow()) { $class .= " not_visible"; } $album = $_zp_current_image->getAlbum(); $pwd = $album->getPassword(); if (zp_loggedin() && !empty($pwd)) { $class .= " password_protected"; } if (getOption('thumb_crop') && !is_null($cy = $_zp_current_image->get('thumbY'))) { $ts = getOption('thumb_size'); $sw = getOption('thumb_crop_width'); $sh = getOption('thumb_crop_height'); $cx = $_zp_current_image->get('thumbX'); $cw = $_zp_current_image->get('thumbW'); $ch = $_zp_current_image->get('thumbH'); // upscale to thumb_size proportions if ($sw == $sh) { // square crop, set the size/width to thumbsize $sw = $sh = $ts; } else { if ($sw > $sh) { $r = $ts / $sw; $sw = $ts; $sh = $sh * $r; } else { $r = $ts / $sh; $sh = $ts; $sh = $r * $sh; } } $url = getCustomImageURL(NULL, $sw, $sh, $cw, $ch, $cx, $cy, true); } else { $url = getImageThumb(); } $h = getOption('thumb_crop_height'); if (!empty($h)) { $h = " height=\"{$h}\""; } $w = getOption('thumb_crop_width'); if (!empty($w)) { $w = " width=\"{$w}\""; } $class = trim($class); echo "<img src=\"" . htmlspecialchars($url) . "\" alt=\"" . html_encode($alt) . "\"" . (getOption('thumb_crop') ? $w . $h : "") . ($class ? " class=\"{$class}\"" : "") . ($id ? " id=\"{$id}\"" : "") . " />"; }
$desc = $a->getDesc(); $customThumb = $thumb->getCustomImage(NULL, 202, 56, 202, 56, NULL, NULL, false); $url = getAlbumURL(); echo "\t<div class='thumb' index='{$u}' title='{$title}' location='{$customThumb}' url='{$url}'><description>{$desc}</description></div>\n"; $u++; } } else { $u = 0; while (next_image()) { $title = getImageTitle(); $size = getSizeCustomImage(NULL, 383); $desc = getImageDesc(); if (!empty($desc)) { $desc = theme_clean($desc); } else { $desc = ''; } $thumb = getImageThumb(); $small = getCustomImageURL(NULL, 383); $full = getFullImageURL(); $width = $size[0]; $height = $size[1]; $rating = $_zp_current_image->get('rating'); echo "\t<div class='thumb' index='{$u}' title='{$title}' \n\t\twidth='{$width}' " . "\n\t\theight='{$height}' \n\t\turl='{$full}' \n\t\tpreviewUrl='{$small}'" . "\n\t\tlocation='{$thumb}' \n\t\trating='{$rating}' \n\t\tobject_id='" . $_zp_current_image->id . "'>" . "\n\t\t<description>\n\t\t\t{$desc}\n\t\t</description>\n\t</div>\n"; $u++; } } ?> </div>
/** * @param string $alt Alt text * @param string $class optional class tag * @param string $id optional id tag */ function printImageThumb($alt, $class = NULL, $id = NULL) { global $_zp_current_image; if (is_null($_zp_current_image)) { return; } if (!$_zp_current_image->getShow()) { $class .= " not_visible"; } $album = $_zp_current_image->getAlbum(); $pwd = $album->getPassword(); if (!empty($pwd)) { $class .= " password_protected"; } $url = getImageThumb(); $sizes = getSizeDefaultThumb(); $size = ' width="' . $sizes[0] . '" height="' . $sizes[1] . '"'; $class = trim($class); if ($class) { $class = ' class="' . $class . '"'; } if ($id) { $id = ' id="' . $id . '"'; } $html = '<img src="' . html_encode(pathurlencode($url)) . '"' . $size . ' alt="' . html_encode($alt) . '"' . $class . $id . " />"; $html = zp_apply_filter('standard_image_thumb_html', $html); echo $html; }
function loadAlbum($album) { global $gallery, $_zp_current_album, $_zp_current_image; $subalbums = $album->getAlbums(); $started = false; $tcount = $count = 0; foreach ($subalbums as $folder) { $subalbum = new Album($gallery, $folder); if (!$subalbum->isDynamic()) { $tcount = $tcount + loadAlbum($subalbum); } } $theme = $gallery->getCurrentTheme(); $id = 0; $parent = getUrAlbum($album); $albumtheme = $parent->getAlbumTheme(); if (!empty($albumtheme)) { $theme = $albumtheme; $id = $parent->id; } loadLocalOptions($id, $theme); $_zp_current_album = $album; if ($album->getNumImages() > 0) { echo "<br />" . $album->name . ' '; while (next_image(true)) { $thumb = getImageThumb(); if (strpos($thumb, 'i.php?') === false) { $thumb = NULL; } if (isImagePhoto($_zp_current_image)) { $image = getDefaultSizedImage(); if (strpos($image, 'i.php?') === false) { $image = NULL; } } else { $image = NULL; if ($_zp_current_image->objectsThumb == NULL) { $thumb = NULL; } } if (!empty($thumb) || !empty($image)) { if (!$count) { $started = true; echo "{ "; } else { echo ' | '; } } if (!empty($thumb)) { echo '<img src="' . $thumb . '" height="8" width="8" /> '; } if (!empty($image)) { echo ' <img src="' . $image . '" height="20" width="20" />'; } if (!empty($thumb) || !empty($image)) { echo "\n"; } $count++; } if ($started) { echo ' } '; } printf(ngettext('[%u image]', '[%u images]', $count), $count); echo "<br />\n"; } return $count + $tcount; }
/** * Places Google Checkout Options on your page. * * @param array $pricelist optional array of specific pricing for the image. */ function googleCheckout($pricelist = NULL) { if (!is_array($pricelist)) { $pricelist = GoogleCheckoutPricelistFromString(getOption('GoogleCheckout_pricelist')); } ?> <div id="GoogleCheckout" class="product"> <input type="hidden" class="product-image" value="<?php echo getImageThumb(); ?> " /> <input type="hidden" class="product-title" value="Album: <?php echo getAlbumTitle(); ?> Photo: <?php echo getImageTitle(); ?> " /> <input type="hidden" class="product-shipping" value="<?php echo getOption('googleCheckout_ship_cost'); ?> " /> Size/Finish: <select class="product-attr-sizefinish"> <option googlecart-set-product-price=""></option> <?php foreach ($pricelist as $key => $price) { ?> <option googlecart-set-product-price="<?php echo $price; ?> "><?php echo $key; ?> </option> <?php } ?> </select><br /> Price: <span class="product-price">Choose Size/Finish</span><br /> How Many: <input type="text" class="googlecart-quantity" value="1" style="width:20px;" /> <span class="googlecart-add-button"></span> </div> <?php }
$desc2 = str_replace("\r", '<br />', $desc2); $desc = $desc1 . $desc2; echo 'description: \'' . js_encode($desc) . '\',' . "\n"; echo 'link: \'' . html_encode(getAlbumURL()) . '\'' . "\n"; echo '}' . "\n"; $c++; } } while (next_image(true)) { 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++; } } ?>
?> <div class="layoutlm"> <div class="layout-main"> <!-- 密码修改--> <div class="user_right_layout"> <ul class="user_right_menu"> <li class="current"><a href="">编辑资料</a></li> </ul> <div class="user_right_content user_right_content_form"> <div class="module_form ucenter"> <div class="ucenter_edit_box"> <div class="edit_btn">编辑<span class="icon icon_edit_down"></span></div> <div class="input_wrap"> <span class="input_head">用户头像:</span> <img class="lazy face_img user_head" src="<?php echo getImageThumb($loginUser[head], '106x106'); ?> " alt="<?php echo $loginUser[username]; ?> "/> <span class="tips" style="display:inline-block; width: 300px;">提示:上传图片时,双击裁剪框可以对图片进行裁剪</span> </div> <form class="edit_form" action="" id="update_head_form" autocomplete="off"> <div class="input_wrap" style="zoom: 1; overflow: hidden;"> <div> <input type="hidden" name="data[head]" id="header" tip-text="logo" required/> <input type="file" id="user_logo"/> <input type="hidden" id="x" name="x" /> <input type="hidden" id="y" name="y" />
/** * 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_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'); } $type = 'article'; switch ($_zp_gallery_page) { case 'index.php': $desc = getBareGalleryDesc(); $canonicalurl = $host . getGalleryIndexURL(); $type = 'website'; break; case 'album.php': $pagetitle = getBareAlbumTitle() . " - "; $date = getAlbumDate(); $desc = getBareAlbumDesc(); $canonicalurl = $host . getAlbumURL(); if (getOption('htmlmeta_og-image') || getOption('htmlmeta_twittercard')) { $thumb = $host . getAlbumThumb(); } break; case 'image.php': $pagetitle = getBareImageTitle() . " (" . getBareAlbumTitle() . ") - "; $date = getImageDate(); $desc = getBareImageDesc(); $canonicalurl = $host . getImageURL(); if (getOption('htmlmeta_og-image') || getOption('htmlmeta_twittercard')) { $thumb = $host . getImageThumb(); } 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'; } } } 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); 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': 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 .= '/' . $_zp_conf_vars['special_pages']['archive']['rewrite'] . '/'; break; case 'search.php': $altlink .= '/' . $_zp_conf_vars['special_pages']['search']['rewrite'] . '/'; break; case 'contact.php': $altlink .= '/' . _PAGE_ . '/contact'; break; default: // for all other possible none standard custom pages $altlink .= '/' . _PAGE_ . '/' . html_encode($pagetitle); break; } // switch $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; }
<div class="list"> <?php foreach ($editorRec as $value) { ?> <dl class="item"> <!-- 66x58--> <dd class="img"> <a href="<?php echo url("/article_article_detail/?id={$value['id']}"); ?> "> <img class="lazy" src="<?php echo $appConfigs[image_block]; ?> " data-original="<?php echo getImageThumb($value[thumb], '66x58'); ?> " alt="<?php echo $value[title]; ?> "/> </a> </dd> <dt class="head"> <a href="<?php echo url("/article_article_detail/?id={$value['id']}"); ?> "><?php echo $value[title]; ?> </a>
function theme_content($map) { global $_zp_current_image, $_zp_current_album, $points; if (isImagePage()) { ?> <!-- Gallery section --> <div id="content"> <div id="main"> <div id="images"> <?php $points = array(); $firstImage = null; $lastImage = null; if (getNumImages() > 0) { ?> <div id="gallery" class="ad-gallery"> <div class="ad-image-wrapper"></div> <div class="ad-controls"></div> <div class="ad-nav"> <div class="ad-thumbs"> <ul class="ad-thumb-list"> <?php while (next_image(true)) { if ($map) { $coord = getGeoCoord($_zp_current_image); if ($coord) { $points[] = $coord; } } if (isImagePhoto()) { // does not do video if (is_null($firstImage)) { $lastImage = imageNumber(); $firstImage = $lastImage; } else { $lastImage++; } ?> <li> <a href="<?php echo html_encode(getDefaultSizedImage()); ?> "> <img src="<?php echo html_encode(pathurlencode(getImageThumb())); ?> " class="image<?php echo $lastImage; ?> " alt="<?php echo html_encode(getImageDesc()); ?> "> </a> </li> <?php } } ?> </ul> </div> </div> </div> <?php } ?> <div id="caption"<?php if (getOption('effervescence_caption_location') == 'none') { echo ' style="display:none"'; } ?> > </div> <div class="clearage"></div> <?php 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 } ?> </div><!-- images --> <?php if (function_exists('printAddToFavorites')) { printAddToFavorites($_zp_current_album); } ?> <?php @call_user_func('printRating'); ?> </div><!-- main --> <div class="clearage"></div> </div><!-- content --> <?php } }
<ul class="list"> <?php foreach ($items as $value) { ?> <li class="item"> <div class="img_box"> <a href="<?php echo url("/article_article_detail/?id={$value['id']}"); ?> "> <img class="lazy" src="<?php echo $appConfigs[image_block]; ?> " data-original="<?php echo getImageThumb($value[thumb], '180x126'); ?> " alt="<?php echo $value[title]; ?> "/> </a> </div> <div class="text_box"> <h1 class="head"><a href="<?php echo $value[url]; ?> "><?php echo $value[title]; ?> </a></h1>
/** * @param string $alt Alt text * @param string $class optional class tag * @param string $id optional id tag */ function printImageThumb($alt, $class = NULL, $id = NULL) { global $_zp_current_image; if (is_null($_zp_current_image)) { return; } if (!$_zp_current_image->getShow()) { $class .= " not_visible"; } $album = $_zp_current_image->getAlbum(); $pwd = $album->getPassword(); if (!empty($pwd)) { $class .= " password_protected"; } $url = getImageThumb(); $s = getOption('thumb_size'); if (getOption('thumb_crop')) { $w = getOption('thumb_crop_width'); $h = getOption('thumb_crop_height'); if ($w > $h) { $h = round($h * $s / $w); $w = $s; } else { $w = round($w * $s / $w); $h = $s; } } else { $w = $h = $s; getMaxSpaceContainer($w, $h, $_zp_current_image, true); } $size = ' width="' . $w . '" height="' . $h . '"'; $class = trim($class); if ($class) { $class = ' class="' . $class . '"'; } if ($id) { $id = ' id="' . $id . '"'; } $html = '<img src="' . html_encode($url) . '"' . $size . ' alt="' . html_encode($alt) . '"' . $class . $id . " />"; $html = zp_apply_filter('standard_image_thumb_html', $html); echo $html; }
function printBaseSlideShow() { global $_zp_gallery, $_zp_gallery_page, $_myFavorites, $_zp_conf_vars, $_zp_themeroot, $isMobile, $isTablet; if (!isset($_POST['albumid'])) { return '<div class="errorbox" id="message"><h2>' . gettext('Invalid linking to the slideshow page.') . '</h2></div>'; } //getting the image to start with if (!empty($_POST['imagenumber'])) { $imagenumber = sanitize_numeric($_POST['imagenumber']) - 1; // slideshows starts with 0, but zp with 1. } else { $imagenumber = 0; } // set pagenumber to 0 if not called via POST link if (isset($_POST['pagenr'])) { $pagenumber = sanitize_numeric($_POST['pagenr']); } else { $pagenumber = 1; } // getting the number of images if (!empty($_POST['numberofimages'])) { $numberofimages = sanitize_numeric($_POST['numberofimages']); } else { $numberofimages = 0; } //if ($imagenumber < 2 || $imagenumber > $numberofimages) { // $imagenumber = 0; //} //getting the album to show if (!empty($_POST['albumid'])) { $albumid = sanitize_numeric($_POST['albumid']); } else { $albumid = 0; } if (isset($_POST['preserve_search_params'])) { // search page $search = new SearchEngine(); $params = sanitize($_POST['preserve_search_params']); $search->setSearchParams($params); $searchwords = $search->getSearchWords(); $searchdate = $search->getSearchDate(); $searchfields = $search->getSearchFields(true); $page = $search->page; $returnpath = getSearchURL($searchwords, $searchdate, $searchfields, $page); $albumobj = new AlbumBase(NULL, false); $albumobj->setTitle(gettext('Search')); $albumobj->images = $search->getImages(0); $albumtitle = gettext('Search'); } else { if (isset($_POST['favorites_page'])) { $albumobj = $_myFavorites; $returnpath = rewrite_path($_myFavorites->getLink() . '/' . $pagenumber, FULLWEBPATH . '/index.php?p=favorites' . '&page=' . $pagenumber); $albumtitle = gettext('Favorites'); } else { $albumq = query_single_row("SELECT title, folder FROM " . prefix('albums') . " WHERE id = " . $albumid); $albumobj = newAlbum($albumq['folder']); $albumtitle = $albumobj->getTitle(); if (empty($_POST['imagenumber'])) { $returnpath = $albumobj->getLink($pagenumber); } else { $image = newImage($albumobj, sanitize($_POST['imagefile'])); $returnpath = $image->getLink(); } } } if (!$albumobj->isMyItem(LIST_RIGHTS) && !checkAlbumPassword($albumobj)) { return '<div class="errorbox" id="message"><h2>' . gettext('This album is password protected!') . '</h2></div>'; } $slideshow = ''; $numberofimages = $albumobj->getNumImages(); if ($numberofimages == 0) { return '<div class="errorbox" id="message"><h2>' . gettext('No images for the slideshow!') . '</h2></div>'; } $images = $albumobj->getImages(0); // slideshow generate data for galleria ?> <script> var data = [ <?php for ($c = 0, $idx = 0; $c < $numberofimages; $c++, $idx++) { if (is_array($images[$idx])) { $filename = $images[$idx]['filename']; $album = newAlbum($images[$idx]['folder']); $image = newImage($album, $filename); } else { $filename = $images[$idx]; $image = newImage($albumobj, $filename); } if (isImagePhoto($image)) { makeImageCurrent($image); echo '{' . "\n"; echo 'thumb: \'' . getImageThumb() . '\',' . "\n"; echo 'image: \'' . getDefaultSizedImage() . '\',' . "\n"; echo 'big: \'' . getCustomImageURL(getOption('zpbase_galbigsize')) . '\',' . "\n"; echo 'title: \'' . js_encode($image->getTitle()) . '\',' . "\n"; $desc = $image->getDesc(); $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($image->getLink()) . '\'' . "\n"; } if ($c == $numberofimages - 1) { echo '}' . "\n"; } else { echo '},' . "\n"; } } else { if ($imagenumber > 0 && $imagenumber > $c) { $imagenumber--; } } } echo "\n"; ?> ]; </script> <?php $sspage = true; require_once 'inc/galleria-jscall.php'; }
function theme_content($map) { global $_zp_current_image, $points; if (isImagePage()) { ?> <!-- Gallery section --> <div id="images"> <?php $points = array(); $firstImage = null; $lastImage = null; if (getNumImages() > 0) { ?> <div id="gallery" class="ad-gallery"> <div class="ad-image-wrapper"></div> <div class="ad-controls"></div> <div class="ad-nav"> <div class="ad-thumbs"> <ul class="ad-thumb-list"> <?php while (next_image(true)) { if ($map) { $coord = getGeoCoord($_zp_current_image); if ($coord) { $points[] = $coord; } } if (isImagePhoto()) { // does not do video if (is_null($firstImage)) { $lastImage = imageNumber(); $firstImage = $lastImage; } else { $lastImage++; } ?> <li> <a href="<?php echo html_encode(getDefaultSizedImage()); ?> "> <img src="<?php echo html_encode(pathurlencode(getImageThumb())); ?> " class="image<?php echo $lastImage; ?> " alt="<?php echo html_encode(getImageDesc()); ?> "> </a> </li> <?php } } ?> </ul> </div> </div> </div> <?php } ?> <div id="caption"<?php if (getOption('garland_caption_location') == 'none') { echo ' style="display:none"'; } ?> > </div> <div class="clearage"></div> </div><!-- images --> <br class="clearall" /> <?php } }
?> " class="module_more">更多</a>驼牛联盟</div> <div class="justify_wrap"> <!-- 8个 偶数 --> <!--union133x59---> <?php foreach ($tnlm as $value) { ?> <a href="<?php echo url("/article_media_detail/?id={$value['id']}"); ?> " class="item"> <img class="lazy" src="<?php echo $appConfigs[image_block]; ?> " data-original="<?php echo getImageThumb($value[logo], '133x78'); ?> " alt="<?php echo $value[name]; ?> "/> </a> <?php } ?> <span class="justify_span"></span> </div> </div> <!--aside_union end-->
<!--max 4--> <?php foreach ($alikeArticles as $value) { ?> <dl class="item"> <!-- 142x118 --> <dd class="img"> <a href="<?php echo url("/article_article_detail/?id={$value['id']}"); ?> "><img class="lazy" src="<?php echo $appConfigs[image_block]; ?> " data-original="<?php echo getImageThumb($value[thumb], '142x118'); ?> " alt="<?php echo $value[title]; ?> "/></a></dd> <dt class="title"><a href="<?php echo url("/article_article_detail/?id={$value['id']}"); ?> "><?php echo $value[title]; ?> </a></dt> </dl> <?php }
/** * 获取推荐位文章 * @param string $position 文章推荐位key */ public function getArticlePosition($position = null) { if (!$position) { page404(); } $articlePositionService = Beans::get('article.rec.service'); $conditions['position'] = $position; $articlePosition = $articlePositionService->getItem($conditions); $articleService = Beans::get('article.article.service'); if (!empty($articlePosition['aids'])) { $articleConditions = array('id' => "#IN {$articlePosition['aids']}"); $indexPosition = $articleService->getItems($articleConditions, 'id,title,thumb', 'id desc', 1, 1); $indexPosition = $indexPosition[0]; $indexPosition['url'] = url("/mobile_index_detail/?id={$indexPosition['id']}"); $indexPosition['thumb'] = getImageThumb($indexPosition['thumb'], '653x366'); $this->assign('indexPosition', $indexPosition); } }
/** * 获取图片列表 * @param HttpRequest $request * @param array $configs * @return array */ public function getImageList(HttpRequest $request, array $configs) { //参数处理 $pagesize = $request->getParameter('size', 'intval'); if ($pagesize <= 0) { $pagesize = isset($configs['fileManagerListSize']) ? $configs['fileManagerListSize'] : 20; } $start = $request->getParameter('start', 'intval'); if ($start <= 0) { $page = 1; } else { $page = ceil($start / $pagesize) + 1; } //获取数据 $service = Beans::get('image.image.service'); $userid = intval($this->loginUser['id']); //如果是通过后台修改用户的数据,则将注前台册用户的id if (!$userid) { Session::start(); $userid = intval($_SESSION['front_userid']); } $conditions = "userid={$userid} AND type='image'"; $items = $service->getItems($conditions, "url", "id desc", $page, $pagesize); $total = $service->count($conditions); if (!$items) { return json_encode(array("state" => "no match file", "list" => array(), "start" => $start, "total" => $total)); } //填充缩略图 foreach ($items as $key => $value) { $items[$key]['thumb'] = getImageThumb($value['url'], '113x113'); } //返回数据 return json_encode(array("state" => "SUCCESS", "list" => $items, "start" => $start, "total" => $total)); }
?> <div class="aside_module <?php echo $circleClass; ?> aside_publish"> <div class="<?php echo $imageClass; ?> "> <!--215x126--> <img class="lazy" src="<?php echo $appConfigs[image_block]; ?> " data-original="<?php echo getImageThumb($mediaInfo[logo], '126x126'); ?> " alt="<?php echo $mediaInfo[name]; ?> "/> </div> <div class="title"><?php echo $mediaInfo[name]; ?> </div> <div class="info"> <?php echo $mediaInfo[intro]; ?> </div>
public function detail(HttpRequest $request) { $id = $request->getParameter('id', 'intval'); $service = Beans::get("article.article.service"); $conditions = array('id' => $id); $item = $service->getItem($conditions, 'id,title,bcontent,add_time,media_id'); if ($item) { $condi = array('media_id' => $this->mediaId); $alikeArticle = $service->getItems($condi, 'id,title,thumb,add_time,media_id', 'id DESC', 1, 6); foreach ($alikeArticle as $value) { $mediaIds[] = $value['media_id']; } //获取来源 $mediaService = Beans::get('media.media.service'); $medias = $mediaService->getItems($mediaIds, 'id,name'); $medias = ArrayUtils::changeArrayKey($medias, 'id'); foreach ($alikeArticle as $key => $value) { if ($value['media_id'] != 0) { $alikeArticle[$key]['media'] = $medias[$value['media_id']]['name']; } else { $alikeArticle[$key]['media'] = '驼牛网'; } $alikeArticle[$key]['url'] = url("/mobile_site_detail/?mediaId={$this->mediaId}&id={$value['id']}"); $alikeArticle[$key]['thumb'] = getImageThumb($value['thumb'], '90x63'); } $mediainfo = $mediaService->getItem($item['media_id'], 'name'); $item['media'] = $mediainfo['name']; $item['time'] = date('m-d H:i', $item['add_time']); $this->assign('article', $item); $this->assign('alikeArticle', $alikeArticle); $this->setView('site/detail'); } else { page404(); } }
?> <div class="image-thumb left opa60 <?php echo $u % 2 == 0 ? 'even' : 'odd'; ?> "> <img index="<?php echo $u; ?> " id="img-<?php echo $u; ?> " src="<?php echo getImageThumb(); ?> " width="95" height="95" /> </div> <?php $u++; } AlbumUtil::setMaxImageIndex($u > 0 ? $u : 0); ?> <?php //if ( $imageCount > 0 ) : while ($u < getOption('images_per_page')) {
" class="module_more">更多</a>牛企</div> <div class="justify_wrap"> <!-- 4个 偶数 --> <!--oxer124x112--> <?php foreach ($niulanMedia as $value) { ?> <a href="<?php echo url("/article_media_detail/?id={$value['id']}"); ?> " class="item"> <img class="lazy" src="<?php echo $appConfigs[image_block]; ?> " data-original="<?php echo getImageThumb($value[logo], '124x124'); ?> " alt="<?php echo $value[name]; ?> "/> </a> <?php } ?> <span class="justify_span"></span> </div> </div> <!-- aside_oxer end-->
<div class="item_btn_box"> <div class="btn_bg"></div> <div class="operation"> <div class="icon icon_wminus_big"></div> </div> </div> </div> <?php if ($showLogo) { ?> <div class="face_box"> <img class="face lazy" src="<?php echo $appConfigs[image_block]; ?> " data-original="<?php echo getImageThumb($value[logo], '218x128'); ?> " alt="<?php echo $value[name]; ?> "/> </div> <?php } ?> <div class="text"> <div class="name"><a href="<?php echo $value[url]; ?> "><?php echo $value[name];
<div class="media_list_top"> <div class="item_box"> <?php foreach ($medias[recommends] as $value) { ?> <dl class="item"> <dd class="face"> <a href="<?php echo url("/article_media_detail/?id={$value['id']}"); ?> "> <img class="lazy" src="<?php echo $appConfigs[image_block]; ?> " data-original="<?php echo getImageThumb($value[logo], '137x137'); ?> " alt="<?php echo $value[name]; ?> "/> </a> </dd> <dt class="name"><a href="<?php echo url("/article_media_detail/?id={$value['id']}"); ?> "><?php echo $value[name]; ?> </a></dt> <dd class="des"><?php