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


PHP SQL::add_search_field方法代码示例

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


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

示例1: filter_antispam

		[<a href="http://b2evolution.net/about/terms.html"><?php 
    echo T_('Terms of service');
    ?>
</a>]
	</p>
	<?php 
}
/*
 * Query antispam blacklist:
 */
$keywords = param('keywords', 'string', '', true);
$SQL = new SQL();
$SQL->SELECT('aspm_ID, aspm_string, aspm_source');
$SQL->FROM('T_antispam');
if (!empty($keywords)) {
    $SQL->add_search_field('aspm_string');
    $SQL->WHERE_keywords($keywords, 'AND');
}
// Create result set:
$Results = new Results($SQL->get(), 'antispam_');
$Results->title = T_('Banned keywords blacklist');
/**
 * Callback to add filters on top of the result set
 *
 * @param Form
 */
function filter_antispam(&$Form)
{
    $Form->text('keywords', get_param('keywords'), 20, T_('Keywords'), T_('Separate with space'), 50);
}
$Results->filter_area = array('callback' => 'filter_antispam', 'url_ignore' => 'results_antispam_page,keywords', 'presets' => array('all' => array(T_('All keywords'), '?ctrl=antispam')));
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:31,代码来源:_antispam_list.view.php

示例2: param

 */
if (get_param('action') == 'filter2') {
    $keywords = param('keywords2', 'string', '', true);
    set_param('keywords1', $keywords);
} else {
    $keywords = param('keywords1', 'string', '', true);
    set_param('keywords2', $keywords);
}
$SQL = new SQL();
$SQL->SELECT('user_ID, user_login, user_level, bloguser_perm_poststatuses + 0 as perm_poststatuses, bloguser_perm_edit, bloguser_ismember,' . 'bloguser_perm_delcmts, bloguser_perm_recycle_owncmts, bloguser_perm_vote_spam_cmts, bloguser_perm_cmtstatuses + 0 as perm_cmtstatuses, bloguser_perm_edit_cmt,' . 'bloguser_perm_delpost, bloguser_perm_edit_ts, bloguser_perm_cats,' . 'bloguser_perm_properties, bloguser_perm_admin, bloguser_perm_media_upload,' . 'bloguser_perm_media_browse, bloguser_perm_media_change, bloguser_perm_page,' . 'bloguser_perm_intro, bloguser_perm_podcast, bloguser_perm_sidebar');
$SQL->FROM('T_users LEFT JOIN T_coll_user_perms ON (
				 						user_ID = bloguser_user_ID
										AND bloguser_blog_ID = ' . $edited_Blog->ID . ' )');
$SQL->ORDER_BY('bloguser_ismember DESC, *, user_login, user_ID');
if (!empty($keywords)) {
    $SQL->add_search_field('user_login');
    $SQL->add_search_field('user_firstname');
    $SQL->add_search_field('user_lastname');
    $SQL->add_search_field('user_nickname');
    $SQL->add_search_field('user_email');
    $SQL->WHERE_keywords($keywords, 'AND');
}
// Display wide layout:
?>

<div id="userlist_wide" class="clear">

<?php 
$Results = new Results($SQL->get(), 'colluser_');
// Tell the Results class that we already have a form for this page:
$Results->Form =& $Form;
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:31,代码来源:_coll_user_perm.form.php

示例3: param

 * Query user list:
 */
if (get_param('action') == 'filter2') {
    $keywords = param('keywords2', 'string', '', true);
    set_param('keywords1', $keywords);
} else {
    $keywords = param('keywords1', 'string', '', true);
    set_param('keywords2', $keywords);
}
$SQL = new SQL();
$SQL->SELECT('grp_ID, grp_name, bloggroup_perm_poststatuses + 0 as perm_poststatuses, bloggroup_perm_edit, bloggroup_ismember,' . 'bloggroup_perm_delcmts, bloggroup_perm_recycle_owncmts, bloggroup_perm_vote_spam_cmts, bloggroup_perm_cmtstatuses + 0 as perm_cmtstatuses, bloggroup_perm_edit_cmt,' . 'bloggroup_perm_delpost, bloggroup_perm_edit_ts, bloggroup_perm_cats,' . 'bloggroup_perm_properties, bloggroup_perm_admin, bloggroup_perm_media_upload,' . 'bloggroup_perm_media_browse, bloggroup_perm_media_change, bloggroup_perm_page,' . 'bloggroup_perm_intro, bloggroup_perm_podcast, bloggroup_perm_sidebar');
$SQL->FROM('T_groups LEFT JOIN T_coll_group_perms ON
			( grp_ID = bloggroup_group_ID AND bloggroup_blog_ID = ' . $edited_Blog->ID . ' )');
$SQL->ORDER_BY('bloggroup_ismember DESC, *, grp_name, grp_ID');
if (!empty($keywords)) {
    $SQL->add_search_field('grp_name');
    $SQL->WHERE_keywords($keywords, 'AND');
}
// Display wide layout:
?>

<div id="userlist_wide" class="clear">

<?php 
$Results = new Results($SQL->get(), 'collgroup_');
// Tell the Results class that we already have a form for this page:
$Results->Form =& $Form;
$Results->title = T_('Group permissions');
$Results->filter_area = array('submit' => 'actionArray[filter1]', 'callback' => 'filter_collobjectlist', 'url_ignore' => 'results_collgroup_page,keywords1,keywords2', 'presets' => array('all' => array(T_('All users'), regenerate_url('action,results_collgroup_page,keywords1,keywords2', 'action=edit'))));
/*
 * Grouping params:
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:31,代码来源:_coll_group_perm.form.php


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