• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP getSearchWords函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getSearchWords函数的典型用法代码示例。如果您正苦于以下问题:PHP getSearchWords函数的具体用法?PHP getSearchWords怎么用?PHP getSearchWords使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getSearchWords函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: getHitResults

 function getHitResults()
 {
     $results = NULL;
     $total = $this->getTotalResults();
     $searchwords = getSearchWords();
     $searchdate = getSearchDate();
     if (!empty($searchdate)) {
         if (!empty($seachwords)) {
             $searchwords .= ": ";
         }
         $searchwords .= $searchdate;
     }
     if (empty($searchwords)) {
         return NULL;
     }
     if ($total > 0) {
         if ($total > 1) {
             $results = "{$total} Hits for <em>{$searchwords}</em>";
         } else {
             $results = "1 Hit for <em>{$searchwords}</em>";
         }
     } else {
         $results = "No Hit for <em>{$searchwords}</em>";
     }
     return $results;
 }
开发者ID:Imagenomad,项目名称:Unsupported,代码行数:26,代码来源:SearchController.php


示例2: getSearchQuery

 static function getSearchQuery()
 {
     $input = $_GET['words'];
     $words = getSearchWords();
     $date = $_GET['date'];
     if (isset($date)) {
         $words = strftime('%B %Y', strtotime("{$date}-01"));
     } elseif (!isset($input) || $input == '' || $input == DEFAULT_SEARCH_TEXT) {
         $words = '&lt; ' . gettext('No search criteria') . '&gt;';
         //$words = '&lt; ' . 'No search criteria' . '&gt;';
         return $words;
     }
     if (isset($words) && strlen($words) > 25) {
         $words = substr($words, 0, 23) . " ... ";
     }
     return $words;
 }
开发者ID:Imagenomad,项目名称:Unsupported,代码行数:17,代码来源:SearchUtil.php


示例3: getSearchWords

function getSearchWords($word, array $replacements)
{
    $words = array();
    foreach ($replacements as $chars => $replacement) {
        if ($count = substr_count($word, $chars)) {
            $offset = 0;
            while (false !== ($pos = strpos($word, $chars, $offset))) {
                $newWord = substr_replace($word, $replacement, $pos, strlen($chars));
                $words[$newWord] = $newWord;
                $offset = $pos + 1;
            }
        }
    }
    foreach ($words as $newWord) {
        $words = array_merge($words, getSearchWords($newWord, $replacements));
    }
    $words = array_merge(array($word => $word), $words);
    return array_keys(array_flip($words));
}
开发者ID:greglike1001,项目名称:dictionary-backup,代码行数:19,代码来源:api.php


示例4: printGalleryIndexURL

}
?>
			</div>

			<div id="breadcrumb">
				<h2><?php 
printGalleryIndexURL(' » ');
printSearchBreadcrumb(" » ");
?>
				</h2>
			</div>

			<div id="content">
				<div id="content-left">
					<?php 
$searchwords = getSearchWords();
$searchdate = getSearchDate();
if (!empty($searchdate)) {
    if (!empty($searchwords)) {
        $searchwords .= ": ";
    }
    $searchwords .= $searchdate;
}
if ($total > 0) {
    ?>
						<h3>
							<?php 
    printf(ngettext('%1$u Hit for <em>%2$s</em>', '%1$u Hits for <em>%2$s</em>', $total), $total, html_encode($searchwords));
    ?>
						</h3>
						<?php 
开发者ID:jmruas,项目名称:zenphoto,代码行数:31,代码来源:search.php


示例5: truncate_string

     $zpmin_metadesc = truncate_string(getBareAlbumDesc(), 150, '...');
     printRSSHeaderLink('Album', getAlbumTitle());
     $galleryactive = true;
     $cbscript = true;
     break;
 case 'image.php':
     $zpmin_metatitle = getBareImageTitle() . ' | ';
     $zpmin_metadesc = truncate_string(getBareImageDesc(), 150, '...');
     $galleryactive = true;
     $cbscript = true;
     break;
 case 'archive.php':
     $zpmin_metatitle = gettext("Archive View") . ' | ';
     break;
 case 'search.php':
     $zpmin_metatitle = gettext('Search') . " | " . html_encode(getSearchWords()) . ' | ';
     $galleryactive = true;
     $cbscript = true;
     $zpmin_social = false;
     break;
 case 'pages.php':
     $zpmin_metatitle = getBarePageTitle() . ' | ';
     $zpmin_metadesc = strip_tags(truncate_string(getPageContent(), 150, '...'));
     $cbscript = true;
     break;
 case 'news.php':
     if (is_NewsArticle()) {
         $zpmin_metatitle = gettext('News') . ' | ' . getBareNewsTitle() . ' | ';
         $zpmin_metadesc = strip_tags(truncate_string(getNewsContent(), 150, '...'));
     } else {
         if ($_zp_current_category) {
开发者ID:Imagenomad,项目名称:Unsupported,代码行数:31,代码来源:inc-header.php


示例6: htmlspecialchars

        if (hasNextPage()) {
            if (hasPrevPage()) {
                echo '&nbsp;';
            }
            ?>
				<a href="<?php 
            echo htmlspecialchars(getNextPageURL());
            ?>
" accesskey="x"><?php 
            echo gettext('next page');
            ?>
 &raquo;</a>
			<?php 
        }
        echo '</p>';
        echo "<em class=\"count\">" . sprintf(gettext('Total matches for <em>%1$s</em>: %2$u'), getSearchWords(), $results);
    } else {
        echo "<p>" . gettext('Sorry, no matches. Try refining your search.') . "</p>";
    }
}
?>
	</div>
	</div>

	<p id="path">
		<?php 
printHomeLink('', ' > ');
?>
		<a href="<?php 
echo htmlspecialchars(getGalleryIndexURL());
?>
开发者ID:ItsHaden,项目名称:epicLanBootstrap,代码行数:31,代码来源:search.php


示例7: getBareImageTitle

     } else {
         $titlebreadcrumb = '';
     }
     $zpfocus_metatitle = getBareImageTitle() . ' | ' . getBareAlbumTitle() . $titlebreadcrumb . ' | ' . getBareGalleryTitle();
     $zpfocus_metadesc = shortenContent(getBareImageDesc(), 150, '...');
     $galleryactive = true;
     if (function_exists('printCommentForm') && getOption('RSS_comments')) {
         printRSSHeaderLink('Comments-image', getBareImageTitle() . ' - ' . gettext('Latest Comments'), $lang = '') . "\n";
     }
     break;
 case 'archive.php':
     $zpfocus_metatitle = gettext("Archive View") . ' | ' . getBareGalleryTitle();
     $zpfocus_metadesc = shortenContent(getBareGalleryDesc(), 150, '...');
     break;
 case 'search.php':
     $zpfocus_metatitle = gettext('Search') . ' | ' . html_encode(getSearchWords()) . ' | ' . getBareGalleryTitle();
     $zpfocus_metadesc = shortenContent(getBareGalleryDesc(), 150, '...');
     $galleryactive = true;
     break;
 case 'pages.php':
     $zpfocus_metatitle = getBarePageTitle() . ' | ' . getBareGalleryTitle();
     $zpfocus_metadesc = strip_tags(shortenContent(getPageContent(), 150, '...'));
     break;
 case 'news.php':
     if (is_NewsArticle()) {
         $zpfocus_metatitle = gettext('News') . ' | ' . getBareNewsTitle() . ' | ' . getBareGalleryTitle();
         $zpfocus_metadesc = strip_tags(shortenContent(getNewsContent(), 150, '...'));
     } else {
         if ($_zp_current_category) {
             $zpfocus_metatitle = gettext('News') . ' | ' . $_zp_current_category->getTitle() . ' | ' . getBareGalleryTitle();
             $zpfocus_metadesc = strip_tags(shortenContent(getNewsCategoryDesc(), 150, '...'));
开发者ID:kokyandrei,项目名称:Unsupported,代码行数:31,代码来源:inc-header.php


示例8: gettext

    echo " | " . gettext('Contact');
}
if ($_zp_gallery_page == 'pages.php') {
    echo " | " . getBarePageTitle();
}
if ($_zp_gallery_page == 'archive.php') {
    echo " | " . gettext('Archive View');
}
if ($_zp_gallery_page == 'password.php') {
    echo " | " . gettext('Password Required...');
}
if ($_zp_gallery_page == '404.php') {
    echo " | " . gettext('404 Not Found...');
}
if ($_zp_gallery_page == 'search.php') {
    echo " | " . gettext('Search: ') . html_encode(getSearchWords());
}
if ($_zp_gallery_page == 'news.php') {
    echo " | " . gettext('News');
}
if ($_zp_gallery_page == 'news.php' && is_NewsArticle()) {
    echo " | " . getBareNewsTitle();
}
?>
	
	</title>
	<?php 
if (getOption('zp_plugin_reCaptcha')) {
    ?>
	<script>
		var RecaptchaOptions = {
开发者ID:Imagenomad,项目名称:Unsupported,代码行数:31,代码来源:header.php


示例9: printSearchForm

/**
* Prints the search form
*
* Search works on a list of tokens entered into the search form.
*
* Tokens may be part of boolean expressions using &, |, !, and parens. (Comma is retained as a synonom of | for
* backwords compatibility.)
*
* Tokens may be enclosed in quotation marks to create exact pattern matches or to include the boolean operators and
* parens as part of the tag..
*
* @param string $prevtext text to go before the search form
* @param string $id css id for the search form, default is 'search'
* @param string $buttonSource optional path to the image for the button
* @param string $buttontext optional text for the button ("Search" will be the default text)
* @param string $iconsource optional theme based icon for the search fields toggle
* @param array $query_fields override selection for enabled fields with this list
* @param array $objects_list optional array of things to search eg. [albums]=>[list], etc.
* 														if the list is simply 0, the objects will be omitted from the search
* @param string $reseticonsource optional theme based icon for reset search icon
* @since 1.1.3
*/
function printSearchForm($prevtext = NULL, $id = 'search', $buttonSource = NULL, $buttontext = '', $iconsource = NULL, $query_fields = NULL, $object_list = NULL, $reseticonsource = NULL)
{
    global $_zp_adminJS_loaded;
    if (!is_null($object_list)) {
        if (array_key_exists(0, $object_list)) {
            // handle old form albums list
            trigger_error(gettext('printSearchForm $album_list parameter is deprecated. Pass array("albums"=>array(album, album, ...)) instead.'), E_USER_NOTICE);
            $object_list = array('albums' => $object_list);
        }
    }
    if (empty($buttontext)) {
        $buttontext = gettext("Search");
    } else {
        $buttontext = sanitize($buttontext);
    }
    $zf = WEBPATH . "/" . ZENFOLDER;
    $searchwords = getSearchWords();
    if (substr($searchwords, -1, 1) == ',') {
        $searchwords = substr($searchwords, 0, -1);
    }
    if (empty($searchwords)) {
        $hint = '%s';
    } else {
        $hint = gettext('%s within previous results');
    }
    if (empty($buttonSource)) {
        $type = 'submit';
        $button = 'value="' . $buttontext . '" title="' . sprintf($hint, $buttontext) . '"';
    } else {
        $buttonSource = 'src="' . $buttonSource . '" alt="' . $buttontext . '"';
        $button = 'title="' . sprintf($hint, $buttontext) . '"';
        $type = 'image';
    }
    if (empty($iconsource)) {
        $iconsource = WEBPATH . '/' . ZENFOLDER . '/images/searchfields_icon.png';
    }
    if (empty($reseticonsource)) {
        $reseticonsource = WEBPATH . '/' . ZENFOLDER . '/images/reset_icon.png';
    }
    if (MOD_REWRITE) {
        $searchurl = '/page/search/';
    } else {
        $searchurl = "/index.php?p=search";
    }
    $engine = new SearchEngine();
    $fields = $engine->allowedSearchFields();
    if (!$_zp_adminJS_loaded) {
        $_zp_adminJS_loaded = true;
        ?>
		<script type="text/javascript" src="<?php 
        echo WEBPATH . '/' . ZENFOLDER;
        ?>
/js/admin.js"></script>
		<?php 
    }
    ?>
	<div id="<?php 
    echo $id;
    ?>
"><!-- search form -->

		<form method="post" action="<?php 
    echo WEBPATH . $searchurl;
    ?>
" id="search_form">
			<script type="text/javascript">
				// <!-- <![CDATA[
				function reset_search() {
					lastsearch='';
					$('#reset_search').hide();
					$('#search_submit').attr('title', '<?php 
    echo $buttontext;
    ?>
');
					$('#search_input').val('');
				}
				var lastsearch = '<?php 
    echo addslashes(html_entity_decode(addslashes($searchwords)));
//.........这里部分代码省略.........
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:101,代码来源:template-functions.php



注:本文中的getSearchWords函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getSectionDetailsById函数代码示例发布时间:2022-05-15
下一篇:
PHP getSearchURL函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap