当前位置: 首页>>代码示例>>PHP>>正文


PHP SearchEngine::parseQueryFields方法代码示例

本文整理汇总了PHP中SearchEngine::parseQueryFields方法的典型用法代码示例。如果您正苦于以下问题:PHP SearchEngine::parseQueryFields方法的具体用法?PHP SearchEngine::parseQueryFields怎么用?PHP SearchEngine::parseQueryFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SearchEngine的用法示例。


在下文中一共展示了SearchEngine::parseQueryFields方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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) {
            ?>
						<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 
开发者ID:IliyanGochev,项目名称:zenphoto,代码行数:67,代码来源:template-functions.php

示例2: 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 
}
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:101,代码来源:template-functions.php

示例3: 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 
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:67,代码来源:template-functions.php

示例4: printSearchForm


//.........这里部分代码省略.........
    global $_zp_adminJS_loaded;
    if (empty($buttontext)) {
        $buttontext = gettext("Search");
    } else {
        $buttontext = sanitize($buttontext);
    }
    if (checkforPassword(true)) {
        return;
    }
    $zf = WEBPATH . "/" . ZENFOLDER;
    $dataid = $id . '_data';
    $searchwords = isset($_POST['words']) ? html_encode(sanitize($_REQUEST['words'], 0), false) : '';
    $fields = getOption('search_fields');
    if (empty($buttonSource)) {
        $type = 'submit';
    } else {
        $buttonSource = 'src="' . $buttonSource . '" alt="' . $buttontext . '"';
        $type = 'image';
    }
    if (empty($iconsource)) {
        $iconsource = WEBPATH . '/' . ZENFOLDER . '/images/searchfields_icon.png';
    }
    if (getOption('mod_rewrite')) {
        $searchurl = '/page/search/';
    } else {
        $searchurl = "/index.php?p=search";
    }
    $engine = new SearchEngine();
    $fields = array_flip($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="search"><!-- search form -->

	<form method="post" action="<?php 
    echo WEBPATH . $searchurl;
    ?>
" id="search_form">
	<?php 
    echo $prevtext;
    ?>
	<input type="text" name="words" value="<?php 
    echo $searchwords;
    ?>
" id="search_input" size="10" />
	<?php 
    if (count($fields) > 1) {
        ?>
		<a href="javascript: toggle('searchextrashow');"><img src="<?php 
        echo $iconsource;
        ?>
" alt="<?php 
        echo gettext('select search fields');
        ?>
" id="searchfields_icon" /></a>
	<?php 
    }
    ?>
	<input type="<?php 
    echo $type;
    ?>
" value="<?php 
    echo $buttontext;
    ?>
" class="pushbutton" id="search_submit" <?php 
    echo $buttonSource;
    ?>
 />
	<br />
	<?php 
    if (count($fields) > 1) {
        natcasesort($fields);
        $fields = array_flip($fields);
        $query_fields = $engine->parseQueryFields();
        ?>
		<ul style="display:none;" id="searchextrashow">
		<?php 
        foreach ($fields as $key => $item) {
            echo '<li><label for="_SEARCH_' . $item . '"><input id="_SEARCH_' . $item . '" name="_SEARCH_' . $item . '" type="checkbox"';
            if ($item & $query_fields) {
                echo ' checked="checked" ';
            }
            echo ' value="' . $item . '"  /> ' . $key . "</label></li>" . "\n";
        }
        ?>
		</ul>
		<?php 
    }
    ?>
	</form>
	</div><!-- end of search form -->
	<?php 
}
开发者ID:ItsHaden,项目名称:epicLanBootstrap,代码行数:101,代码来源:template-functions.php


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