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

PHP getSearchSql函数代码示例

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

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



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

示例1: sprintf

$accountQue = $account ? 'site=' . $account . ' and ' : '';
$_WHERE = $accountQue . 'd_regis > ' . $year1 . sprintf('%02d', $month1) . sprintf('%02d', $day1) . '000000 and d_regis < ' . $year2 . sprintf('%02d', $month2) . sprintf('%02d', $day2) . '240000';
if ($bid) {
    $_WHERE .= ' and bbs=' . $bid;
}
if ($notice) {
    $_WHERE .= ' and notice=1';
}
if ($hidden) {
    $_WHERE .= ' and hidden=1';
}
if ($where && $keyw) {
    if (strstr('[name][nic][id][ip]', $where)) {
        $_WHERE .= " and " . $where . "='" . $keyw . "'";
    } else {
        $_WHERE .= getSearchSql($where, $keyw, $ikeyword, 'or');
    }
}
$RCD = getDbArray($table[$module . 'data'], $_WHERE, '*', $sort, $orderby, $recnum, $p);
$NUM = getDbRows($table[$module . 'data'], $_WHERE);
$TPG = getTotalPage($NUM, $recnum);
?>

<div id="bbslist">



	<div class="sbox">
		<form name="procForm" action="<?php 
echo $g['s'];
?>
开发者ID:hoya0704,项目名称:trevia.co.kr,代码行数:31,代码来源:post.php


示例2: substr

include_once $g['dir_module_skin'] . '_menu.php';
$year1 = $year1 ? $year1 : substr($date['today'], 0, 4);
$month1 = $month1 ? $month1 : substr($date['today'], 4, 2);
$day1 = $day1 ? $day1 : 1;
//substr($date['today'],6,2);
$year2 = $year2 ? $year2 : substr($date['today'], 0, 4);
$month2 = $month2 ? $month2 : substr($date['today'], 4, 2);
$day2 = $day2 ? $day2 : substr($date['today'], 6, 2);
$sort = $sort ? $sort : 'uid';
$orderby = $orderby ? $orderby : 'desc';
$recnum = $recnum && $recnum < 200 ? $recnum : 20;
$sqlque = 'mbruid=' . $my['uid'] . ' and site=' . $s;
$sqlque = $sqlque . ' and d_regis > ' . $year1 . sprintf('%02d', $month1) . sprintf('%02d', $day1) . '000000 and d_regis < ' . $year2 . sprintf('%02d', $month2) . sprintf('%02d', $day2) . '240000';
if ($where && $keyword) {
    $sqlque .= getSearchSql($where, $keyword, $ikeyword, 'or');
}
$RCD = getDbArray($table['s_referer'], $sqlque, '*', $sort, $orderby, $recnum, $p);
$NUM = getDbRows($table['s_referer'], $sqlque);
$TPG = getTotalPage($NUM, $recnum);
?>



<div id="loglist">

	<form name="bbssearchf" action="<?php 
echo $g['s'];
?>
/">
	<input type="hidden" name="r" value="<?php 
开发者ID:hoya0704,项目名称:trevia.co.kr,代码行数:30,代码来源:log.php


示例3: queryFeedHeadlines

function queryFeedHeadlines($link, $feed, $limit, $view_mode, $cat_view, $search, $search_mode, $match_on, $override_order = false, $offset = 0, $owner_uid = 0)
{
    if (!$owner_uid) {
        $owner_uid = $_SESSION["uid"];
    }
    if ($search) {
        $search_query_part = getSearchSql($search, $match_on);
        $search_query_part .= " AND ";
    } else {
        $search_query_part = "";
    }
    $view_query_part = "";
    if ($view_mode == "adaptive" || $view_query_part == "noscores") {
        if ($search) {
            $view_query_part = " ";
        } else {
            if ($feed != -1) {
                $unread = getFeedUnread($link, $feed, $cat_view);
                if ($unread > 0) {
                    $view_query_part = " unread = true AND ";
                }
            }
        }
    }
    if ($view_mode == "marked") {
        $view_query_part = " marked = true AND ";
    }
    if ($view_mode == "unread") {
        $view_query_part = " unread = true AND ";
    }
    if ($view_mode == "updated") {
        $view_query_part = " (last_read is null and unread = false) AND ";
    }
    if ($limit > 0) {
        $limit_query_part = "LIMIT " . $limit;
    }
    $vfeed_query_part = "";
    // override query strategy and enable feed display when searching globally
    if ($search && $search_mode == "all_feeds") {
        $query_strategy_part = "ttrss_entries.id > 0";
        $vfeed_query_part = "ttrss_feeds.title AS feed_title,";
        /* tags */
    } else {
        if (preg_match("/^-?[0-9][0-9]*\$/", $feed) == false) {
            $query_strategy_part = "ttrss_entries.id > 0";
            $vfeed_query_part = "(SELECT title FROM ttrss_feeds WHERE\n\t\t\t\t\tid = feed_id) as feed_title,";
        } else {
            if ($feed > 0 && $search && $search_mode == "this_cat") {
                $vfeed_query_part = "ttrss_feeds.title AS feed_title,";
                $tmp_result = false;
                if ($cat_view) {
                    $tmp_result = db_query($link, "SELECT id \n\t\t\t\t\t\tFROM ttrss_feeds WHERE cat_id = '{$feed}'");
                } else {
                    $tmp_result = db_query($link, "SELECT id\n\t\t\t\t\t\tFROM ttrss_feeds WHERE cat_id = (SELECT cat_id FROM ttrss_feeds \n\t\t\t\t\t\t\tWHERE id = '{$feed}') AND id != '{$feed}'");
                }
                $cat_siblings = array();
                if (db_num_rows($tmp_result) > 0) {
                    while ($p = db_fetch_assoc($tmp_result)) {
                        array_push($cat_siblings, "feed_id = " . $p["id"]);
                    }
                    $query_strategy_part = sprintf("(feed_id = %d OR %s)", $feed, implode(" OR ", $cat_siblings));
                } else {
                    $query_strategy_part = "ttrss_entries.id > 0";
                }
            } else {
                if ($feed > 0) {
                    if ($cat_view) {
                        if ($feed > 0) {
                            $query_strategy_part = "cat_id = '{$feed}'";
                        } else {
                            $query_strategy_part = "cat_id IS NULL";
                        }
                        $vfeed_query_part = "ttrss_feeds.title AS feed_title,";
                    } else {
                        $tmp_result = db_query($link, "SELECT id \n\t\t\t\t\t\tFROM ttrss_feeds WHERE parent_feed = '{$feed}'\n\t\t\t\t\t\tORDER BY cat_id,title");
                        $parent_ids = array();
                        if (db_num_rows($tmp_result) > 0) {
                            while ($p = db_fetch_assoc($tmp_result)) {
                                array_push($parent_ids, "feed_id = " . $p["id"]);
                            }
                            $query_strategy_part = sprintf("(feed_id = %d OR %s)", $feed, implode(" OR ", $parent_ids));
                            $vfeed_query_part = "ttrss_feeds.title AS feed_title,";
                        } else {
                            $query_strategy_part = "feed_id = '{$feed}'";
                        }
                    }
                } else {
                    if ($feed == 0) {
                        // starred virtual feed
                        $query_strategy_part = "feed_id IS NULL";
                    } else {
                        if ($feed == -1) {
                            // starred virtual feed
                            $query_strategy_part = "marked = true";
                            $vfeed_query_part = "ttrss_feeds.title AS feed_title,";
                        } else {
                            if ($feed == -2) {
                                // published virtual feed OR labels category
                                if (!$cat_view) {
                                    $query_strategy_part = "published = true";
//.........这里部分代码省略.........
开发者ID:wangroot,项目名称:Tiny-Tiny-RSS,代码行数:101,代码来源:functions.php


示例4: getSearchSql

<?php

include_once $g['dir_module_skin'] . '_menu.php';
$sort = $sort ? $sort : 'gid';
$orderby = $orderby ? $orderby : 'asc';
$recnum = $recnum && $recnum < 200 ? $recnum : $d['search']['s_num2'];
$bbsque = 'site=' . $s . " and type=2 and ext='jpg' and d_regis > " . $d['search']['date'];
$bbsque .= getSearchSql('name|caption', $keyword, $ikeyword, 'or');
$RCD = getDbArray($table['s_upload'], $bbsque, '*', $sort, $orderby, $recnum, $p);
$NUM = getDbRows($table['s_upload'], $bbsque);
$TPG = getTotalPage($NUM, $recnum);
?>



<?php 
if ($NUM) {
    ?>
<div id="s_image">

	<div class="subtitle">
		<div class="xleft">이미지(검색결과 <?php 
    echo number_format($NUM);
    ?>
개)</div>
		<div class="xright"><a href="<?php 
    echo $g['url_reset'];
    ?>
">통합검색</a></div>
		<div class="clear"></div>
	</div>
开发者ID:hoya0704,项目名称:trevia.co.kr,代码行数:31,代码来源:image.php


示例5: getSearchSql

<?php

include $g['path_module'] . $module . '/var/var.php';
$bbs_time = $d['bbs']['time'];
// 아래 $d 배열과 충돌을 피하기 위해서 별도로 지정
$sort = $sort ? $sort : 'gid';
$orderby = $orderby ? $orderby : 'asc';
$recnum = $recnum && $recnum < 301 ? $recnum : 30;
$bbsque = 'uid';
if ($where && $keyw) {
    if (strstr('[id]', $where)) {
        $bbsque .= " and " . $where . "='" . $keyw . "'";
    } else {
        $bbsque .= getSearchSql($where, $keyw, $ikeyword, 'or');
    }
}
$RCD = getDbArray($table[$module . 'list'], $bbsque, '*', $sort, $orderby, $recnum, $p);
$NUM = getDbRows($table[$module . 'list'], $bbsque);
$TPG = getTotalPage($NUM, $recnum);
$_LEVELNAME = array('l0' => '전체허용');
$_LEVELDATA = getDbArray($table['s_mbrlevel'], '', '*', 'uid', 'asc', 0, 1);
while ($_L = db_fetch_array($_LEVELDATA)) {
    $_LEVELNAME['l' . $_L['uid']] = $_L['name'] . ' 이상';
}
?>



<div class="page-header">
 <h4>게시판 전체현황 
       <a href="<?php 
开发者ID:kiminmug,项目名称:rb_module_bbs,代码行数:31,代码来源:main.php


示例6: getSearchSql

<?php

include_once $g['dir_module_skin'] . '_menu.php';
$sort = $sort ? $sort : 'gid';
$orderby = $orderby ? $orderby : 'asc';
$recnum = $recnum && $recnum < 200 ? $recnum : $d['search']['s_num2'];
$bbsque = 'site=' . $s . ' and display=1 and d_regis > ' . $d['search']['date'];
if ($bbsuid) {
    $bbsque .= ' and bbs=' . $bbsuid;
}
$bbsque .= getSearchSql('subject|tag', $keyword, $ikeyword, 'or');
$RCD = getDbArray($table['bbsdata'], $bbsque, '*', $sort, $orderby, $recnum, $p);
$NUM = getDbRows($table['bbsdata'], $bbsque);
$TPG = getTotalPage($NUM, $recnum);
?>

<div id="s_post">

	<div class="subtitle">
		<div class="xleft">
		
			<select onchange="goHref('<?php 
echo $g['url_reset'];
?>
post&bbsuid='+this.value);">
			<option value="">&nbsp;+ 게시판(전체)</option>
			<option value="">---------------------</option>
			<?php 
echo $_BBS = getDbArray($table['bbslist'], '', '*', 'gid', 'asc', 0, 1);
?>
			<?php 
开发者ID:hoya0704,项目名称:trevia.co.kr,代码行数:31,代码来源:post.php


示例7: while

    while ($_R = db_fetch_array($TCD)) {
        $RCD[] = getDbData($table[$m . 'data'], 'gid=' . $_R['gid'], '*');
    }
} else {
    if ($cat) {
        $bbsque2 .= " and category='" . $cat . "'";
    }
    if ($where && $keyword) {
        if (strpos('[name][nic][id][ip]', $where)) {
            $bbsque2 .= " and " . $where . "='" . $keyword . "'";
        } else {
            if ($where == 'term') {
                $bbsque2 .= " and d_regis like '" . $keyword . "%'";
            } else {
                $keyword = str_replace('_', '#_', $keyword);
                $bbsque2 .= getSearchSql($where, $keyword, $ikeyword, "escape '#' or");
            }
        }
    }
    $NUM = getDbRows($table[$m . 'data'], $bbsque2);
    $recnum = 15;
    $TCD = getDbArray($table[$m . 'data'], $bbsque2, '*', $sort, $orderby, $recnum, $p);
    //	echo $table[$m.'data'] . '-' . $bbsque2;
    $today = date('Y-m-d');
    $todayArray = explode("-", $today);
    $bbsque2 .= "and reservation_date >= " . date("Y-m-d", mktime(0, 0, 0, $todayArray[1], $todayArray[2] - 1, $todayArray[0]));
    $TCD2 = getDbArray($table[$m . 'data'], $bbsque2, '*', $sort, $orderby, 1000, 1);
    //	echo $table[$m.'data'] . '-' . $bbsque2;
    while ($_R = db_fetch_array($TCD)) {
        $RCD[] = $_R;
    }
开发者ID:hoya0704,项目名称:trevia.co.kr,代码行数:31,代码来源:_list.php


示例8: getSearchSql

 
		<div class="clear"></div>
	</div>

</div>
<?php 
    }
}
?>
<!-- //이미지 -->


<!-- 첨부파일 -->
<?php 
if ($d['search']['s_upload']) {
    $_searchsql = getSearchSql('name|caption', $keyword, $ikeyword, 'or');
    $RCD = getDbArray($table['s_upload'], 'site=' . $s . " and type<>2 and hidden=0 and d_regis > " . $d['search']['date'] . $_searchsql, '*', 'gid', 'asc', $recnum, $p);
    $NUM = getDbRows($table['s_upload'], 'site=' . $s . " and type<>2 and hidden=0 and d_regis > " . $d['search']['date'] . $_searchsql);
    if ($NUM) {
        $result = true;
        ?>
<div id="s_upload">

	<div class="subtitle">
		<div class="xleft">첨부파일(검색결과 <?php 
        echo number_format($NUM);
        ?>
개)</div>
		<div class="xright"><?php 
        if ($NUM > $recnum) {
            ?>
开发者ID:hoya0704,项目名称:trevia.co.kr,代码行数:30,代码来源:main.php


示例9: getSearchSql

<?php

include_once $g['dir_module_skin'] . '_menu.php';
$sort = $sort ? $sort : 'uid';
$orderby = $orderby ? $orderby : 'asc';
$recnum = $recnum && $recnum < 200 ? $recnum : $d['search']['s_num2'];
$bbsque = 'site=' . $s . ' and display=1 and d_regis > ' . $d['search']['date'];
$bbsque .= getSearchSql('subject|content', $keyword, $ikeyword, 'or');
$RCD = getDbArray($table['s_comment'], $bbsque, '*', $sort, $orderby, $recnum, $p);
$NUM = getDbRows($table['s_comment'], $bbsque);
$TPG = getTotalPage($NUM, $recnum);
?>

<?php 
if ($NUM) {
    ?>
<div id="s_comment">

	<div class="subtitle">
		<div class="xleft">댓글(검색결과 <?php 
    echo number_format($NUM);
    ?>
개)</div>
		<div class="xright"><a href="<?php 
    echo $g['url_reset'];
    ?>
">통합검색</a></div>
		<div class="clear"></div>
	</div>

开发者ID:hoya0704,项目名称:trevia.co.kr,代码行数:29,代码来源:comment.php


示例10: LIB_getSearchSql

function LIB_getSearchSql($w, $k, $ik, $h)
{
    if ($k == ',' || !$k && $h == 'not') {
        return '';
    }
    $k = $k ? urldecode($k) : '';
    $ik = $ik ? urldecode($ik) : '';
    $h = $h ? $h : 'or';
    $k = str_replace(' ', ',', $k);
    $karr = explode(',', $k);
    $knm = count($karr);
    $result = ' and (';
    if ($h == 'not') {
        $h = 'and';
        if (strstr($w, '|')) {
            $warr = explode('|', $w);
            $wnm = count($warr);
            for ($j = 0; $j < $knm; $j++) {
                if (!$karr[$j]) {
                    continue;
                }
                for ($i = 0; $i < $wnm; $i++) {
                    if (strlen($karr[$j]) > 2) {
                        $result .= $warr[$i] . "<>'" . $karr[$j] . "' " . $h . ' ';
                    }
                }
            }
        } else {
            for ($i = 0; $i < $knm; $i++) {
                if (strlen($karr[$i]) > 2) {
                    $result .= $w . "<>'" . $karr[$i] . "' " . $h . ' ';
                }
            }
        }
    } else {
        if (strstr($w, '|')) {
            $warr = explode('|', $w);
            $wnm = count($warr);
            for ($j = 0; $j < $knm; $j++) {
                if (!$karr[$j]) {
                    continue;
                }
                for ($i = 0; $i < $wnm; $i++) {
                    if (strlen($karr[$j]) > 2) {
                        $result .= $warr[$i] . " like '%" . $karr[$j] . "%' " . $h . ' ';
                    }
                }
            }
        } else {
            for ($i = 0; $i < $knm; $i++) {
                if (strlen($karr[$i]) > 2) {
                    $result .= $w . " like '%" . $karr[$i] . "%' " . $h . ' ';
                }
            }
        }
    }
    $result = substr($result, 0, strlen($result) - 4) . ')';
    if ($ik) {
        $result .= getSearchSql($w, $ik, '', $h);
    }
    return $result;
}
开发者ID:eosliebe,项目名称:rb,代码行数:62,代码来源:searchsql.lib.php


示例11: getSearchSql

**************************************************************

아래의 예제는 실제로 페이지를 검색하는 샘플입니다.
페이징,더보기,검색결과 없을경우 안내등은 모두 자동으로 처리되니 결과 리스트만 출력해 주시면 됩니다.
최초 설치시 "이용약관" 이나 "개인정보" 로 검색하시면 결과값을 얻으실 수 있습니다.

**************************************************************/
?>




<?php 
$sqlque = 'uid';
$sqlque .= getSearchSql('id|name', $keyword, '', 'or');
// 페이지코드와 페이지명 검색
if ($_iscallpage) {
    $RCD = getDbArray($table['s_page'], $sqlque, '*', 'uid', $orderby, $d['search']['num' . ($swhere == 'all' ? 1 : 2)], $p);
    ?>


<div id="rb-search-search-example1">
	<ol>
		<?php 
    while ($_R = db_fetch_array($RCD)) {
        ?>
		<li><a href="<?php 
        echo $g['s'];
        ?>
/?r=<?php 
开发者ID:hanacody,项目名称:rb2,代码行数:30,代码来源:example1.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP getSearchURL函数代码示例发布时间:2022-05-15
下一篇:
PHP getSearchListHeaderValues函数代码示例发布时间: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