本文整理汇总了PHP中SearchEngine::getSearchWords方法的典型用法代码示例。如果您正苦于以下问题:PHP SearchEngine::getSearchWords方法的具体用法?PHP SearchEngine::getSearchWords怎么用?PHP SearchEngine::getSearchWords使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SearchEngine
的用法示例。
在下文中一共展示了SearchEngine::getSearchWords方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printGalleryTitle
"><?php
printGalleryTitle();
?>
</a> |
<?php
}
printGalleryTitle();
?>
</a> |
<?php
if (is_null($_zp_current_album)) {
$search = new SearchEngine();
$params = trim(zp_getCookie('zenphoto_search_params'));
$search->setSearchParams($params);
$images = $search->getImages(0);
$searchwords = $search->getSearchWords();
$searchdate = $search->getSearchDate();
$searchfields = $search->getSearchFields(true);
$page = $search->page;
$returnpath = getSearchURL($searchwords, $searchdate, $searchfields, $page);
echo '<a href=' . html_encode($returnpath) . '><em>' . gettext('Search') . '</em></a> | ';
} else {
printParentBreadcrumb();
printAlbumBreadcrumb("", " | ");
}
?>
</span>
Slideshow
</div> <!-- navbar -->
</div> <!-- wrapnav -->
</div> <!-- galleryheader -->
示例2: printSlideShow
/**
* Prints the slideshow using the {@link http://http://www.malsup.com/jquery/cycle/ jQuery plugin Cycle}
*
* Two ways to use:
* a) Use on your theme's slideshow.php page and called via printSlideShowLink():
* If called from image.php it starts with that image, called from album.php it starts with the first image (jQuery only)
* To be used on slideshow.php only and called from album.php or image.php.
*
* b) Calling directly via printSlideShow() function (jQuery mode)
* Place the printSlideShow() function where you want the slideshow to appear and set create an album object for $albumobj and if needed an image object for $imageobj.
* The controls are disabled automatically.
*
* NOTE: The jQuery mode does not support movie and audio files anymore. If you need to show them please use the Flash mode.
* Also note that this function is not used for the Colorbox mode!
*
* @param bool $heading set to true (default) to emit the slideshow breadcrumbs in flash mode
* @param bool $speedctl controls whether an option box for controlling transition speed is displayed
* @param obj $albumobj The object of the album to show the slideshow of. If set this overrides the POST data of the printSlideShowLink()
* @param obj $imageobj The object of the image to start the slideshow with. If set this overrides the POST data of the printSlideShowLink(). If not set the slideshow starts with the first image of the album.
* @param int $width The width of the images (jQuery mode). If set this overrides the size the slideshow_width plugin option that otherwise is used.
* @param int $height The heigth of the images (jQuery mode). If set this overrides the size the slideshow_height plugin option that otherwise is used.
* @param bool $crop Set to true if you want images cropped width x height (jQuery mode only)
* @param bool $shuffle Set to true if you want random (shuffled) order
* @param bool $linkslides Set to true if you want the slides to be linked to their image pages (jQuery mode only)
* @param bool $controls Set to true (default) if you want the slideshow controls to be shown (might require theme CSS changes if calling outside the slideshow.php page) (jQuery mode only)
*
*/
function printSlideShow($heading = true, $speedctl = false, $albumobj = NULL, $imageobj = NULL, $width = NULL, $height = NULL, $crop = false, $shuffle = false, $linkslides = false, $controls = true)
{
global $_myFavorites, $_zp_conf_vars;
if (!isset($_POST['albumid']) and !is_object($albumobj)) {
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']) and !is_object($imageobj)) {
$imagenumber = sanitize_numeric($_POST['imagenumber']) - 1;
// slideshows starts with 0, but zp with 1.
} elseif (is_object($imageobj)) {
$imagenumber = $imageobj->getIndex();
} 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']);
} elseif (is_object($albumobj)) {
$numberofimages = $albumobj->getNumImages();
} else {
$numberofimages = 0;
}
if ($imagenumber < 2 || $imagenumber > $numberofimages) {
$imagenumber = 0;
}
//getting the album to show
if (!empty($_POST['albumid']) && !is_object($albumobj)) {
$albumid = sanitize_numeric($_POST['albumid']);
} elseif (is_object($albumobj)) {
$albumid = $albumobj->getID();
} 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);
} else {
if (isset($_POST['favorites_page'])) {
$albumobj = $_myFavorites;
$returnpath = $_myFavorites->getLink($pagenumber);
} else {
$albumq = query_single_row("SELECT title, folder FROM " . prefix('albums') . " WHERE id = " . $albumid);
$albumobj = newAlbum($albumq['folder']);
if (empty($_POST['imagenumber'])) {
$returnpath = $albumobj->getLink($pagenumber);
} else {
$image = newImage($albumobj, sanitize($_POST['imagefile']));
$returnpath = $image->getLink();
}
}
}
echo slideshow::getShow($heading, $speedctl, $albumobj, $imageobj, $width, $height, $crop, $shuffle, $linkslides, $controls, $returnpath, $imagenumber);
}
示例3: printBaseSlideShow
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')) {
//.........这里部分代码省略.........
示例4: printGslideshow
/**
* Prints the Galleria slideshow for albums or search results.
*
* Two ways to use (see readme/documentation):
* a) Used on the included theme slideshow.php page and called via printSlideShowLink() from the core slideshow plugin:
* b) Calling directly via printGslideshow() function in a template file or codeblock.
*
* @param obj $albumobj The object of the album to show the slideshow of. Not needed if calling slideshow from album, image, or search.
* @param obj $imageobj The object of the image to start the slideshow with. If not set the slideshow starts with the first image of the album, or current image if called from image.php. Not needed if calling slideshow from album, image, or search.
* @param bool $linkslides Set to true if you want the slides to be linked to their image pages
* @param mixed $autoplay true to autoplay slideshow with interval set in options, false to start with slideshow stopped. Set integer in milliseconds to autoplay at that interval (Ex. 4000), overriding plugin option set.
* @param bool $shuffle Set to true if you want random (shuffled) order of the slides
*
* */
function printGslideshow($albumobj = null, $imageobj = null, $linkslides = true, $autoplay = true, $forceheight = false, $shuffle = false)
{
$data = 'data';
// no POST data from slidehow link and $albumobj provided is not valid, exit
if (!isset($_POST['albumid']) and !is_object($albumobj)) {
echo "<div class=\"errorbox\" id=\"message\"><h2>" . gettext("Invalid linking to the slideshow page.") . "</h2></div>";
echo "</div></body></html>";
exitZP();
}
global $_zp_current_image, $_zp_current_album, $_zp_gallery, $_myFavorites, $_zp_conf_vars;
$imagenumber = 0;
//getting the image to start with
if (!empty($_POST['imagenumber']) and !is_object($imageobj)) {
$imagenumber = sanitize_numeric($_POST['imagenumber']) - 1;
// slideshows starts with 0, but zp with 1.
} elseif (is_object($imageobj)) {
makeImageCurrent($imageobj);
$imagenumber = imageNumber() - 1;
}
// 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']);
} elseif (is_object($albumobj)) {
$numberofimages = $albumobj->getNumImages();
} else {
$numberofimages = 0;
}
if ($imagenumber < 2 || $imagenumber > $numberofimages) {
$imagenumber = 0;
}
//getting the album to show
if (!empty($_POST['albumid']) && !is_object($albumobj)) {
$albumid = sanitize_numeric($_POST['albumid']);
$embedded = false;
} elseif (is_object($albumobj)) {
$albumid = $albumobj->getID();
$embedded = true;
} else {
$albumid = 0;
$embedded = false;
}
if ($numberofimages == 0) {
return NULL;
}
// get slideshow data
if (isset($_POST['preserve_search_params'])) {
// search page
$search = new SearchEngine();
$params = sanitize($_POST['preserve_search_params']);
$search->setSearchParams($params);
$images = $search->getImages(0);
$searchwords = $search->getSearchWords();
$searchdate = $search->getSearchDate();
$searchfields = $search->getSearchFields(true);
$page = $search->page;
$returnpath = getSearchURL($searchwords, $searchdate, $searchfields, $page);
$albumtitle = gettext('Search');
} else {
if (isset($_POST['favorites_page'])) {
$album = $_myFavorites;
$albumtitle = gettext('My Favorites');
$images = $album->getImages(0);
$returnpath = rewrite_path(favorites::getFavorites_link() . '/' . $pagenumber, FULLWEBPATH . '/index.php?p=favorites' . '&page=' . $pagenumber);
} else {
$albumq = query_single_row("SELECT title, folder FROM " . prefix('albums') . " WHERE id = " . $albumid);
$album = newAlbum($albumq['folder']);
$albumtitle = $album->getTitle();
if (!$album->isMyItem(LIST_RIGHTS) && !checkAlbumPassword($albumq['folder'])) {
echo gettext("This album is password protected!");
exitZP();
}
$dynamic = $album->isDynamic();
$images = $album->getImages(0);
// return path to get back to the page we called the slideshow from
if (empty($_POST['imagenumber'])) {
$returnpath = rewrite_path('/' . pathurlencode($album->name) . '/page/' . $pagenumber, '/index.php?album=' . urlencode($album->name) . '&page=' . $pagenumber);
} else {
$returnpath = rewrite_path('/' . pathurlencode($album->name) . '/' . rawurlencode(sanitize($_POST['imagefile'])) . getOption('mod_rewrite_image_suffix'), '/index.php?album=' . urlencode($album->name) . '&image=' . urlencode($_POST['imagefile']));
}
}
//.........这里部分代码省略.........
示例5: gettext
printLogoAndLinks();
echo "\n" . '<div id="main">';
printTabs();
echo "\n" . '<div id="content">';
zp_apply_filter('admin_note', 'albums', 'dynamic');
echo "<h1>" . gettext("Create Dynamic Album") . "</h1>\n";
if (isset($_POST['savealbum'])) {
// we fell through, some kind of error
echo "<div class=\"errorbox space\">";
echo "<h2>" . gettext("Failed to save the album file") . "</h2>";
echo "</div>\n";
}
$albumlist = array();
genAlbumList($albumlist);
$fields = $search->fieldList;
$albumname = $search->getSearchWords();
$words = $search->codifySearchString();
$images = $search->getImages(0);
foreach ($images as $image) {
$folder = $image['folder'];
$filename = $image['filename'];
$imagelist[] = '/' . $folder . '/' . $filename;
}
$subalbums = $search->getAlbums(0);
foreach ($subalbums as $folder) {
getSubalbumImages($folder);
}
$albumname = sanitize_path($albumname);
$albumname = seoFriendly($albumname);
$old = '';
while ($old != $albumname) {