本文整理汇总了PHP中SearchEngine::numericFields方法的典型用法代码示例。如果您正苦于以下问题:PHP SearchEngine::numericFields方法的具体用法?PHP SearchEngine::numericFields怎么用?PHP SearchEngine::numericFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SearchEngine
的用法示例。
在下文中一共展示了SearchEngine::numericFields方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printSearchForm
//.........这里部分代码省略.........
" <?php
echo $button;
?>
class="button buttons" id="search_submit" <?php
echo $buttonSource;
?>
data-role="none" />
<?php
if (is_array($object_list)) {
foreach ($object_list as $key => $list) {
if (is_array($list)) {
if ($key == 'albums' && count($list) == 1 && $_zp_current_album && $_zp_current_album->name == end($list)) {
// special case for current album, search its offspring
$list = array_merge($list, $_zp_current_album->getOffspring());
}
$list = implode(',', $list);
}
?>
<input type="hidden" name="in<?php
echo $key;
?>
" value="<?php
echo html_encode($list);
?>
" />
<?php
}
}
?>
<br />
<?php
if (count($fields) > 1 || $searchwords) {
if (is_null($query_fields)) {
$query_fields = $engine->parseQueryFields();
} else {
if (!is_array($query_fields)) {
$query_fields = $engine->numericFields($query_fields);
}
}
if (count($query_fields) == 0) {
$query_fields = $engine->allowedSearchFields();
}
?>
<div style="display:none;" id="searchextrashow">
<?php
if ($searchwords) {
?>
<label>
<input type="radio" name="search_within" id="search_within-1" value="1"<?php
if ($within) {
echo ' checked="checked"';
}
?>
onclick="search_(1);" />
<?php
echo gettext('Within');
?>
</label>
<label>
<input type="radio" name="search_within" id="search_within-0" value="1"<?php
if (!$within) {
echo ' checked="checked"';
}
?>
onclick="search_(0);" />
<?php
echo gettext('New');
?>
</label>
<?php
}
if (count($fields) > 1) {
?>
<ul>
<?php
echo gettext('All');
?>
<input type="checkbox" id="SEARCH_checkall" checked="checked" onclick="search_all();" />
<?php
foreach ($fields as $display => $key) {
echo '<li><label><input class="SEARCH_checkall" id="SEARCH_' . $key . '" name="SEARCH_' . $key . '" type="checkbox"';
if (in_array($key, $query_fields)) {
echo ' checked="checked" ';
}
echo ' value="' . $key . '" /> ' . trim($display, ':') . "</label></li>" . "\n";
}
?>
</ul>
<?php
}
?>
</div>
<?php
}
?>
</div>
</form>
</div><!-- end of search form -->
<?php
}
示例2: printSearchForm
//.........这里部分代码省略.........
" <?php
echo $button;
?>
class="button buttons" id="search_submit" <?php
echo $buttonSource;
?>
data-role="none" />
<?php
if (is_array($object_list)) {
foreach ($object_list as $key => $list) {
?>
<input type="hidden" name="in<?php
echo $key;
?>
" value="<?php
if (is_array($list)) {
echo html_encode(implode(',', $list));
} else {
echo html_encode($list);
}
?>
" />
<?php
}
}
?>
<br />
<?php
if (count($fields) > 1 || $searchwords) {
$fields = array_flip($fields);
natcasesort($fields);
$fields = array_flip($fields);
if (is_null($query_fields)) {
$query_fields = $engine->parseQueryFields();
} else {
if (!is_array($query_fields)) {
$query_fields = $engine->numericFields($query_fields);
}
}
if (count($query_fields) == 0) {
$query_fields = $engine->allowedSearchFields();
}
?>
<div style="display:none;" id="searchextrashow">
<?php
if ($searchwords) {
?>
<label>
<input type="radio" name="search_within" id="search_within-1" value="1"<?php
if ($within) {
echo ' checked="checked"';
}
?>
onclick="search_(1);" />
<?php
echo gettext('Within');
?>
</label>
<label>
<input type="radio" name="search_within" id="search_within-0" value="1"<?php
if (!$within) {
echo ' checked="checked"';
}
?>
onclick="search_(0);" />
<?php
echo gettext('New');
?>
</label>
<?php
}
if (count($fields) > 1) {
?>
<ul>
<li><label><input type="checkbox" name="checkall_searchfields" id="checkall_searchfields" checked="checked">* <?php
echo gettext('Check/uncheck all');
?>
*</label></li>
<?php
foreach ($fields as $display => $key) {
echo '<li><label><input id="SEARCH_' . $key . '" name="SEARCH_' . $key . '" type="checkbox"';
if (in_array($key, $query_fields)) {
echo ' checked="checked" ';
}
echo ' value="' . $key . '" /> ' . $display . "</label></li>" . "\n";
}
?>
</ul>
<?php
}
?>
</div>
<?php
}
?>
</div>
</form>
</div><!-- end of search form -->
<?php
}
示例3: printSearchForm
//.........这里部分代码省略.........
echo $prevtext;
?>
<input type="text" name="words" value="" id="search_input" size="10" />
<?php
if (count($fields) > 1) {
?>
<a href="javascript:toggle('searchextrashow');" ><img src="<?php
echo $iconsource;
?>
" title="<?php
echo gettext('select search fields');
?>
" alt="<?php
echo gettext('fields');
?>
" id="searchfields_icon" /></a>
<?php
}
?>
<span style="white-space:nowrap;display:<?php
if ($searchwords) {
echo 'inline';
} else {
echo 'none';
}
?>
" id="reset_search"><a href="javascript:reset_search();" title="<?php
echo gettext('Clear search');
?>
"><img src="<?php
echo $reseticonsource;
?>
" alt="<?php
echo gettext('Reset search');
?>
" /></a></span>
<input type="<?php
echo $type;
?>
" <?php
echo $button;
?>
class="pushbutton" id="search_submit" <?php
echo $buttonSource;
?>
/>
<?php
if (is_array($object_list)) {
foreach ($object_list as $key => $list) {
?>
<input type="hidden" name="in<?php
echo $key;
?>
" value="<?php
if (is_array($list)) {
echo html_encode(implode(',', $list));
} else {
echo html_encode($list);
}
?>
" />
<?php
}
}
?>
<br />
<?php
if (count($fields) > 1) {
$fields = array_flip($fields);
natcasesort($fields);
$fields = array_flip($fields);
if (is_null($query_fields)) {
$query_fields = $engine->parseQueryFields();
} else {
if (!is_array($query_fields)) {
$query_fields = $engine->numericFields($query_fields);
}
}
if (count($query_fields) == 0) {
$query_fields = $engine->allowedSearchFields();
}
?>
<ul style="display:none;" id="searchextrashow">
<?php
foreach ($fields as $display => $key) {
echo '<li><label><input id="SEARCH_' . $key . '" name="SEARCH_' . $key . '" type="checkbox"';
if (in_array($key, $query_fields)) {
echo ' checked="checked" ';
}
echo ' value="' . $key . '" /> ' . $display . "</label></li>" . "\n";
}
?>
</ul>
<?php
}
?>
</form>
</div><!-- end of search form -->
<?php
}