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


PHP BoldKeywordInStr函数代码示例

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


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

示例1: die

<?php

/**
 * @Project NUKEVIET 4.x
 * @Author VINADES.,JSC (contact@vinades.vn)
 * @Copyright (C) 2014 VINADES.,JSC. All rights reserved
 * @License GNU/GPL version 2 or any later version
 * @Createdate 03-05-2010
 */
if (!defined('NV_IS_MOD_SEARCH')) {
    die('Stop!!!');
}
$db_slave->sqlreset()->select('COUNT(*)')->from(NV_PREFIXLANG . '_' . $m_values['module_data'] . '_rows r')->join('INNER JOIN ' . NV_PREFIXLANG . '_' . $m_values['module_data'] . '_detail c ON (r.id=c.id)')->where('(' . nv_like_logic('r.title', $dbkeywordhtml, $logic) . ' OR ' . nv_like_logic('r.hometext', $dbkeyword, $logic) . ' OR ' . nv_like_logic('c.bodyhtml', $dbkeyword, $logic) . ')	AND r.status= 1');
$num_items = $db_slave->query($db_slave->sql())->fetchColumn();
if ($num_items) {
    $array_cat_alias = array();
    $array_cat_alias[0] = 'other';
    $sql_cat = 'SELECT catid, alias FROM ' . NV_PREFIXLANG . '_' . $m_values['module_data'] . '_cat';
    $re_cat = $db_slave->query($sql_cat);
    while (list($catid, $alias) = $re_cat->fetch(3)) {
        $array_cat_alias[$catid] = $alias;
    }
    $link = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $m_values['module_name'] . '&amp;' . NV_OP_VARIABLE . '=';
    $db_slave->select('r.id, r.title, r.alias, r.catid, r.hometext, c.bodyhtml')->order('publtime DESC')->limit($limit)->offset(($page - 1) * $limit);
    $result = $db_slave->query($db_slave->sql());
    while (list($id, $tilterow, $alias, $catid, $hometext, $bodytext) = $result->fetch(3)) {
        $content = $hometext . strip_tags($bodytext);
        $url = $link . $array_cat_alias[$catid] . '/' . $alias . '-' . $id . $global_config['rewrite_exturl'];
        $result_array[] = array('link' => $url, 'title' => BoldKeywordInStr($tilterow, $key, $logic), 'content' => BoldKeywordInStr($content, $key, $logic));
    }
}
开发者ID:nukeviet,项目名称:nukeviet,代码行数:31,代码来源:search.php

示例2: nv_sdown_cats

    function nv_sdown_cats($_mod_table)
    {
        global $db;
        $sql = 'SELECT id, title, alias, groups_view FROM ' . $_mod_table . '_categories WHERE status=1';
        $result = $db->query($sql);
        $list = array();
        while ($row = $result->fetch()) {
            if (nv_user_in_groups($row['groups_view'])) {
                $list[$row['id']] = array('id' => $row['id'], 'title' => $row['title'], 'alias' => $row['alias']);
            }
        }
        return $list;
    }
}
$_mod_table = defined('SYS_DOWNLOAD_TABLE') ? SYS_DOWNLOAD_TABLE : NV_PREFIXLANG . '_' . $m_values['module_data'];
$list_cats = nv_sdown_cats($_mod_table);
if (!empty($list_cats)) {
    $_where = 'catid IN (' . implode(',', array_keys($list_cats)) . ')
    AND (' . nv_like_logic('title', $dbkeyword, $logic) . '
    OR ' . nv_like_logic('introtext', $dbkeyword, $logic) . ')';
    $db->sqlreset()->select('COUNT(*)')->from($_mod_table)->where($_where);
    $num_items = $db->query($db->sql())->fetchColumn();
    if ($num_items) {
        $link = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $m_values['module_name'] . '&amp;' . NV_OP_VARIABLE . '=';
        $db->select('alias, title, introtext, catid')->limit($limit)->offset(($page - 1) * $limit);
        $tmp_re = $db->query($db->sql());
        while (list($alias, $tilterow, $introtext, $catid) = $tmp_re->fetch(3)) {
            $result_array[] = array('link' => $link . $list_cats[$catid]['alias'] . '/' . $alias . $global_config['rewrite_exturl'], 'title' => BoldKeywordInStr($tilterow, $key, $logic), 'content' => BoldKeywordInStr($introtext, $key, $logic));
        }
    }
}
开发者ID:htuyen1994,项目名称:module-download,代码行数:31,代码来源:search.php

示例3: search_result_theme

function search_result_theme($key, $numRecord, $per_pages, $page, $array_content, $catid)
{
    global $module_file, $module_info, $lang_module, $module_name, $global_array_cat, $module_config, $global_config;
    $xtpl = new XTemplate('search.tpl', NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $module_file);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('KEY', $key);
    $xtpl->assign('IMG_WIDTH', $module_config[$module_name]['homewidth']);
    $xtpl->assign('TITLE_MOD', $lang_module['search_modul_title']);
    if (!empty($array_content)) {
        foreach ($array_content as $value) {
            $catid_i = $value['catid'];
            $xtpl->assign('LINK', $global_array_cat[$catid_i]['link'] . '/' . $value['alias'] . "-" . $value['id'] . $global_config['rewrite_exturl']);
            $xtpl->assign('TITLEROW', strip_tags(BoldKeywordInStr($value['title'], $key)));
            $xtpl->assign('CONTENT', BoldKeywordInStr($value['hometext'], $key) . "...");
            $xtpl->assign('TIME', date('d/m/Y h:i:s A', $value['publtime']));
            $xtpl->assign('AUTHOR', BoldKeywordInStr($value['author'], $key));
            $xtpl->assign('SOURCE', BoldKeywordInStr(GetSourceNews($value['sourceid']), $key));
            if (!empty($value['homeimgfile'])) {
                $xtpl->assign('IMG_SRC', $value['homeimgfile']);
                $xtpl->parse('results.result.result_img');
            }
            $xtpl->parse('results.result');
        }
    }
    if ($numRecord == 0) {
        $xtpl->assign('KEY', $key);
        $xtpl->assign('INMOD', $lang_module['search_modul_title']);
        $xtpl->parse('results.noneresult');
    }
    if ($numRecord > $per_pages) {
        $url_link = $_SERVER['REQUEST_URI'];
        if (strpos($url_link, '&page=') > 0) {
            $url_link = substr($url_link, 0, strpos($url_link, '&page='));
        } elseif (strpos($url_link, '?page=') > 0) {
            $url_link = substr($url_link, 0, strpos($url_link, '?page='));
        }
        $_array_url = array('link' => $url_link, 'amp' => '&page=');
        $generate_page = nv_generate_page($_array_url, $numRecord, $per_pages, $page);
        $xtpl->assign('VIEW_PAGES', $generate_page);
        $xtpl->parse('results.pages_result');
    }
    $xtpl->assign('NUMRECORD', $numRecord);
    $xtpl->assign('MY_DOMAIN', NV_MY_DOMAIN);
    $xtpl->parse('results');
    return $xtpl->text('results');
}
开发者ID:hongoctrien,项目名称:module-videos,代码行数:46,代码来源:theme.php

示例4: die

<?php

/**
 * @Project NUKEVIET 3.x
 * @Author VINADES.,JSC (contact@vinades.vn)
 * @Copyright (C) 2012 VINADES.,JSC. All rights reserved
 * @Createdate  03-05-2010
 */
if (!defined('NV_IS_MOD_SEARCH')) {
    die('Stop!!!');
}
$sql = "SELECT SQL_CALC_FOUND_ROWS `id`,`catid`, `title`, `alias`, `description` \nFROM `" . NV_PREFIXLANG . "_" . $m_values['module_data'] . "_rows` \nWHERE (" . nv_like_logic('title', $dbkeyword, $logic) . " \nOR " . nv_like_logic('url', $dbkeyword, $logic) . " \nOR " . nv_like_logic('description', $dbkeyword, $logic) . ") \nLIMIT " . $pages . "," . $limit;
$tmp_re = $db->sql_query($sql);
$result = $db->sql_query("SELECT FOUND_ROWS()");
list($all_page) = $db->sql_fetchrow($result);
if ($all_page) {
    $array_cat_url = array();
    $array_cat_url[0] = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $m_values['module_name'] . "&amp;" . NV_OP_VARIABLE . "=other";
    $sql_cat = "SELECT `catid`, `alias` FROM `" . NV_PREFIXLANG . "_" . $m_values['module_data'] . "_cat`";
    $re_cat = $db->sql_query($sql_cat);
    while (list($catid, $alias) = $db->sql_fetchrow($re_cat)) {
        $array_cat_url[$catid] = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $m_values['module_name'] . "&amp;" . NV_OP_VARIABLE . "=" . $alias;
    }
    while (list($id, $catid, $tilterow, $alias, $content) = $db->sql_fetchrow($tmp_re)) {
        $result_array[] = array('link' => $array_cat_url[$catid] . '/' . $alias, 'title' => BoldKeywordInStr($tilterow, $key, $logic), 'content' => BoldKeywordInStr($content, $key, $logic));
    }
}
开发者ID:hongoctrien,项目名称:module-weblink,代码行数:27,代码来源:search.php

示例5: search_result_theme

/**
 * search_result_theme()
 *
 * @param mixed $key
 * @param mixed $numRecord
 * @param mixed $per_pages
 * @param mixed $pages
 * @param mixed $array_content
 * @param mixed $url_link
 * @param mixed $catid
 * @return
 */
function search_result_theme($key, $numRecord, $per_pages, $pages, $array_content, $url_link, $catid)
{
    global $module_file, $module_info, $lang_module, $global_array_shops_cat, $pro_config;
    $xtpl = new XTemplate("search.tpl", NV_ROOTDIR . "/themes/" . $module_info['template'] . "/modules/" . $module_file);
    $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('KEY', $key);
    $xtpl->assign('TITLE_MOD', $lang_module['search_modul_title']);
    if (!empty($array_content)) {
        foreach ($array_content as $value) {
            $listcatid = explode(",", $value['listcatid']);
            $catid_i = $catid > 0 ? $catid : end($listcatid);
            $url = $global_array_shops_cat[$catid_i]['link'] . '/' . $value['alias'] . "-" . $value['id'];
            $value['hometext'] = nv_clean60($value['hometext'], 170);
            $xtpl->assign('LINK', $url);
            $xtpl->assign('TITLEROW', BoldKeywordInStr($value['title'], $key));
            $xtpl->assign('CONTENT', BoldKeywordInStr($value['hometext'], $key) . "...");
            $xtpl->assign('height', $pro_config['homeheight']);
            $xtpl->assign('width', $pro_config['homewidth']);
            $xtpl->assign('IMG_SRC', $value['homeimgthumb']);
            $xtpl->parse('results.result.result_img');
            if (defined('NV_IS_MODADMIN')) {
                $xtpl->assign('ADMINLINK', nv_link_edit_page($value['id']) . "&nbsp;-&nbsp;" . nv_link_delete_page($value['id']));
                $xtpl->parse('results.result.adminlink');
            }
            $xtpl->parse('results.result');
        }
    }
    if ($numRecord == 0) {
        $xtpl->assign('KEY', $key);
        $xtpl->assign('INMOD', $lang_module['search_modul_title']);
        $xtpl->parse('results.noneresult');
    }
    if ($numRecord > $per_pages) {
        $url_link = $_SERVER['REQUEST_URI'];
        $in = strpos($url_link, '&page');
        if ($in != 0) {
            $url_link = substr($url_link, 0, $in);
        }
        $generate_page = nv_generate_page($url_link, $numRecord, $per_pages, $pages);
        $xtpl->assign('VIEW_PAGES', $generate_page);
        $xtpl->parse('results.pages_result');
    }
    $xtpl->assign('MY_DOMAIN', NV_MY_DOMAIN);
    $xtpl->assign('NUMRECORD', $numRecord);
    $xtpl->parse('results');
    return $xtpl->text('results');
}
开发者ID:nukeplus,项目名称:shops,代码行数:60,代码来源:theme.php

示例6: nv_faq_list_cats

/**
 * nv_faq_list_cats()
 * 
 * @param mixed $module_data
 * @return
 */
function nv_faq_list_cats($module_data)
{
    global $db;
    $sql = "SELECT id, title, alias, who_view, groups_view FROM " . NV_PREFIXLANG . "_" . $module_data . "_categories WHERE status=1";
    $result = $db->query($sql);
    $list = array();
    while ($row = $result->fetch()) {
        if (nv_faq_set_allow($row['who_view'], $row['groups_view'])) {
            $list[$row['id']] = array('id' => (int) $row['id'], 'title' => $row['title'], 'alias' => $row['alias']);
        }
    }
    return $list;
}
$list_cats = nv_faq_list_cats($m_values['module_data']);
$in = implode(",", array_keys($list_cats));
$sql = "SELECT SQL_CALC_FOUND_ROWS id,question, answer, catid \nFROM " . NV_PREFIXLANG . "_" . $m_values['module_data'] . " \nWHERE catid IN (" . $in . ") \nAND \n(" . nv_like_logic('question', $dbkeyword, $logic) . " \nOR " . nv_like_logic('answer', $dbkeyword, $logic) . ") \nLIMIT " . $pages . "," . $limit;
$tmp_re = $db->query($sql);
$result = $db->query("SELECT FOUND_ROWS()");
$all_page = $result->fetchColumn();
if ($all_page) {
    $link = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $m_values['module_name'] . '&amp;' . NV_OP_VARIABLE . '=';
    while (list($id, $question, $answer, $catid) = $tmp_re->fetch(3)) {
        $result_array[] = array('link' => $link . $list_cats[$catid]['alias'] . '#faq' . $id, 'title' => BoldKeywordInStr($question, $key, $logic), 'content' => BoldKeywordInStr($answer, $key, $logic));
    }
}
开发者ID:HoanDateh,项目名称:module-faq,代码行数:31,代码来源:search.php

示例7: search_result_theme

function search_result_theme($key, $numRecord, $per_pages, $page, $array_content, $catid)
{
    global $module_file, $module_info, $lang_module, $module_name, $module_upload, $global_photo_cat, $module_config, $global_config;
    $xtpl = new XTemplate('search.tpl', NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $module_file);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('KEY', $key);
    $xtpl->assign('TITLE_MOD', $lang_module['search_module_title']);
    if (!empty($array_content)) {
        foreach ($array_content as $value) {
            $xtpl->assign('LINK', $global_photo_cat[$value['category_id']]['link'] . '/' . $value['alias'] . "-" . $value['album_id'] . $global_config['rewrite_exturl']);
            $xtpl->assign('TITLEROW', strip_tags(BoldKeywordInStr($value['name'], $key)));
            if (!empty($value['description'])) {
                $xtpl->assign('CONTENT', BoldKeywordInStr($value['description'], $key) . "...");
            }
            $xtpl->assign('TIME', nv_date('H:i d/m/Y', $value['date_added']));
            $value['src'] = photos_thumbs($value['album_id'], $value['file'], $module_upload, $module_config[$module_name]['cr_thumb_width'], $module_config[$module_name]['cr_thumb_height'], $module_config[$module_name]['cr_thumb_quality']);
            if (!empty($value['src'])) {
                $xtpl->assign('IMG_SRC', $value['src']);
                $xtpl->parse('results.result.result_img');
            }
            $xtpl->parse('results.result');
        }
    }
    if ($numRecord == 0) {
        $xtpl->assign('KEY', $key);
        $xtpl->assign('INMOD', $lang_module['search_modul_title']);
        $xtpl->parse('results.noneresult');
    }
    if ($numRecord > $per_pages) {
        $url_link = $_SERVER['REQUEST_URI'];
        if (strpos($url_link, '&page=') > 0) {
            $url_link = substr($url_link, 0, strpos($url_link, '&page='));
        } elseif (strpos($url_link, '?page=') > 0) {
            $url_link = substr($url_link, 0, strpos($url_link, '?page='));
        }
        $_array_url = array('link' => $url_link, 'amp' => '&page=');
        $generate_page = nv_generate_page($_array_url, $numRecord, $per_pages, $page);
        $xtpl->assign('VIEW_PAGES', $generate_page);
        $xtpl->parse('results.pages_result');
    }
    $xtpl->assign('NUMRECORD', $numRecord);
    $xtpl->assign('MY_DOMAIN', NV_MY_DOMAIN);
    $xtpl->parse('results');
    return $xtpl->text('results');
}
开发者ID:hoangvtien,项目名称:module-photos,代码行数:45,代码来源:theme.php

示例8: nv_like_logic

$db->sqlreset()->select('COUNT(*)')->from($db_config['prefix'] . '_' . $m_values['module_data'] . '_group')->where("(" . nv_like_logic(NV_LANG_DATA . '_title', $dbkeywordhtml, $logic) . "\n\t\tOR " . nv_like_logic(NV_LANG_DATA . '_description', $dbkeywordhtml, $logic) . ")");
$num_items = $db->query($db->sql())->fetchColumn();
$db->select('groupid, ' . NV_LANG_DATA . '_title, ' . NV_LANG_DATA . '_alias, ' . NV_LANG_DATA . '_description')->order('groupid DESC');
$tmp_re = $db->query($db->sql());
if ($num_items) {
    $link = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $m_values['module_name'] . '&amp;' . NV_OP_VARIABLE . '=group/';
    while (list($groupid, $tilterow, $alias, $description) = $tmp_re->fetch(3)) {
        $content = $description;
        $url = $link . $alias . $global_config['rewrite_exturl'];
        $result_array[] = array('link' => $url, 'title' => '[' . $lang_module['group_title'] . '] ' . BoldKeywordInStr($tilterow, $key, $logic), 'content' => BoldKeywordInStr($content, $key, $logic));
    }
}
// Fetch Limit
$db->sqlreset()->select('COUNT(*)')->from($db_config['prefix'] . '_' . $m_values['module_data'] . '_rows')->where("(" . nv_like_logic(NV_LANG_DATA . '_title', $dbkeywordhtml, $logic) . "\n\t\tOR " . nv_like_logic('product_code', $dbkeyword, $logic) . "\n\t\tOR " . nv_like_logic(NV_LANG_DATA . '_bodytext', $dbkeywordhtml, $logic) . "\n\t\tOR " . nv_like_logic(NV_LANG_DATA . '_hometext', $dbkeywordhtml, $logic) . ")\n\t\tAND ( publtime < " . NV_CURRENTTIME . " AND (exptime=0 OR exptime>" . NV_CURRENTTIME . ") )");
$num_items += $db->query($db->sql())->fetchColumn();
$db->select('id, ' . NV_LANG_DATA . '_title,' . NV_LANG_DATA . '_alias, listcatid, ' . NV_LANG_DATA . '_hometext, ' . NV_LANG_DATA . '_bodytext')->order('id DESC')->limit($limit)->offset(($page - 1) * $limit);
$tmp_re = $db->query($db->sql());
if ($num_items) {
    $array_cat_alias = array();
    $sql = 'SELECT catid, ' . NV_LANG_DATA . '_alias AS alias FROM ' . $db_config['prefix'] . '_' . $m_values['module_data'] . '_catalogs';
    $array_cat_alias = nv_db_cache($sql, 'catid', $m_values['module_name']);
    $array_cat_alias[0] = array('alias' => 'Other');
    $link = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $m_values['module_name'] . '&amp;' . NV_OP_VARIABLE . '=';
    while (list($id, $tilterow, $alias, $listcatid, $hometext, $bodytext) = $tmp_re->fetch(3)) {
        $content = $hometext . $bodytext;
        $catid = explode(',', $listcatid);
        $catid = end($catid);
        $url = $link . $array_cat_alias[$catid]['alias'] . '/' . $alias . $global_config['rewrite_exturl'];
        $result_array[] = array('link' => $url, 'title' => '[' . $lang_module['cart_products'] . '] ' . BoldKeywordInStr($tilterow, $key, $logic), 'content' => BoldKeywordInStr($content, $key, $logic));
    }
}
开发者ID:hoangvtien,项目名称:module-shops,代码行数:31,代码来源:search.php

示例9: die

<?php

/**
 * @Project PaCorp 1x
 * @Author PaCorp Co.,Ltd (contact@pacorp.vn)
 * @Copyright (C) 2014 PaCorp Co.,Ltd. All rights reserved
 * @License GNU/GPL version 2 or any later version
 * @Createdate 03-05-2010
 */
if (!defined('NV_IS_MOD_SEARCH')) {
    die('Stop!!!');
}
$db->sqlreset()->select('COUNT(*)')->from(NV_PREFIXLANG . '_' . $m_values['module_data'])->where('status=1 AND (' . nv_like_logic('title', $dbkeyword, $logic) . ' OR ' . nv_like_logic('description', $dbkeyword, $logic) . ' OR ' . nv_like_logic('bodytext', $dbkeyword, $logic) . ')');
$num_items = $db->query($db->sql())->fetchColumn();
if ($num_items) {
    $link = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $m_values['module_name'] . '&amp;' . NV_OP_VARIABLE . '=';
    $db->select('id,title, alias, description, bodytext')->limit($limit)->offset(($page - 1) * $limit);
    $result = $db->query($db->sql());
    while (list($id, $tilterow, $alias, $description, $content) = $result->fetch(3)) {
        $result_array[] = array('link' => $link . $alias . $global_config['rewrite_exturl'], 'title' => BoldKeywordInStr($tilterow, $key, $logic), 'content' => BoldKeywordInStr($description . ' ' . $content, $key, $logic));
    }
}
开发者ID:nukeplus,项目名称:support,代码行数:22,代码来源:search.php

示例10: nv_sdown_cats

     * 
     * @param mixed $module_data
     * @return
     */
    function nv_sdown_cats($module_data)
    {
        global $db;
        $sql = "SELECT `id`, `title`, `alias`, `who_view`, `groups_view` FROM `" . NV_PREFIXLANG . "_" . $module_data . "_categories` WHERE `status`=1";
        $result = $db->sql_query($sql);
        $list = array();
        while ($row = $db->sql_fetchrow($result)) {
            if (nv_set_allow($row['who_view'], $row['groups_view'])) {
                $list[$row['id']] = array('id' => (int) $row['id'], 'title' => $row['title'], 'alias' => $row['alias']);
            }
        }
        return $list;
    }
}
$list_cats = nv_sdown_cats($m_values['module_data']);
$in = implode(",", array_keys($list_cats));
$sql = "SELECT SQL_CALC_FOUND_ROWS `alias`,`title`,`description`, `introtext`, `catid` \nFROM `" . NV_PREFIXLANG . "_" . $m_values['module_data'] . "` \nWHERE `catid` IN (" . $in . ") \nAND (" . nv_like_logic('title', $dbkeyword, $logic) . " \nOR " . nv_like_logic('description', $dbkeyword, $logic) . " \nOR " . nv_like_logic('introtext', $dbkeyword, $logic) . ") \nLIMIT " . $pages . "," . $limit;
$tmp_re = $db->sql_query($sql);
$result = $db->sql_query("SELECT FOUND_ROWS()");
list($all_page) = $db->sql_fetchrow($result);
if ($all_page) {
    $link = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $m_values['module_name'] . '&amp;' . NV_OP_VARIABLE . '=';
    while (list($alias, $tilterow, $content, $introtext, $catid) = $db->sql_fetchrow($tmp_re)) {
        $content = $content . ' ' . $introtext;
        $result_array[] = array('link' => $link . $list_cats[$catid]['alias'] . '/' . $alias, 'title' => BoldKeywordInStr($tilterow, $key, $logic), 'content' => BoldKeywordInStr($content, $key, $logic));
    }
}
开发者ID:atarubi,项目名称:nuke-viet,代码行数:31,代码来源:search.php

示例11: mktime

         $xtpl->parse('main.items.download_not_allow');
     }
     $today = mktime(0, 0, 0, date("n"), date("j"), date("Y"));
     $yesterday = $today - 86400;
     if ($row['uploadtime'] >= $today) {
         $row['uploadtime'] = $lang_module['today'] . ": " . date("H:i", $row['uploadtime']);
     } elseif ($row['uploadtime'] >= $yesterday) {
         $row['uploadtime'] = $lang_module['yesterday'] . ": " . date("H:i", $row['uploadtime']);
     } else {
         $row['uploadtime'] = nv_date("d/m/Y H:i", $row['uploadtime']);
     }
     $row['title2'] = $row['title'];
     if (!empty($key)) {
         $row['title'] = BoldKeywordInStr($row['title'], $key, "OR");
         $row['introtext'] = BoldKeywordInStr($row['introtext'], $key, "OR");
         $row['description'] = BoldKeywordInStr($row['description'], $key, "OR");
     }
     $icon_link = NV_BASE_SITEURL . "themes/" . $module_info['template'] . "/images/download/download.png";
     $row['icon'] = $icon_link;
     $xtpl->assign('CONTENT', $row);
     if (!empty($row['fileimage'])) {
         $imageinfo['src'] = $row['fileimage'];
     } else {
         $imageinfo['src'] = NV_BASE_SITEURL . "themes/" . $module_info['template'] . "/images/download/noimage.gif";
     }
     $xtpl->assign('FILEIMAGE', $imageinfo);
     $xtpl->parse('main.row.is_image');
     $xtpl->parse('main.items.image');
     $xtpl->parse('main.items');
 }
 if (!$cp_mark) {
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:31,代码来源:newsearch.php

示例12: search_result_theme

function search_result_theme($key, $numRecord, $per_pages, $pages, $array_content, $url_link, $catid)
{
    global $module_file, $module_info, $global_config, $lang_global, $lang_module, $db, $module_name, $global_array_cat;
    $xtpl = new XTemplate("search.tpl", NV_ROOTDIR . "/themes/" . $module_info['template'] . "/modules/" . $module_file);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('KEY', $key);
    $xtpl->assign('TITLE_MOD', $lang_module['search_modul_title']);
    if (!empty($array_content)) {
        foreach ($array_content as $value) {
            $catid_i = $catid > 0 ? $catid : end(explode(",", $value['listcatid']));
            $url = $global_array_cat[$catid_i]['link'] . '/' . $value['alias'] . "-" . $value['id'];
            $xtpl->assign('LINK', $url);
            $xtpl->assign('TITLEROW', BoldKeywordInStr($value['title'], $key));
            $xtpl->assign('CONTENT', BoldKeywordInStr($value['hometext'], $key) . "...");
            $xtpl->assign('AUTHOR', date('d/m/Y', $value['publtime']) . " - " . BoldKeywordInStr($value['author'], $key));
            $xtpl->assign('SOURCE', BoldKeywordInStr(GetSourceNews($value['sourceid']), $key));
            $img = "uploads/" . $module_name . "/" . $value['homeimgfile'];
            if (file_exists(NV_ROOTDIR . "/" . $img)) {
                if (is_file(NV_ROOTDIR . "/" . $img)) {
                    $xtpl->assign('IMG_SRC', NV_BASE_SITEURL . $img);
                    $xtpl->parse('results.result.result_img');
                }
            }
            $xtpl->parse('results.result');
        }
    }
    if ($numRecord == 0) {
        $xtpl->assign('KEY', $key);
        $xtpl->assign('INMOD', $lang_module['search_modul_title']);
        $xtpl->parse('results.noneresult');
    }
    if ($numRecord > $per_pages) {
        // show pages
        $url_link = $_SERVER['REQUEST_URI'];
        $in = strpos($url_link, '&page');
        if ($in != 0) {
            $url_link = substr($url_link, 0, $in);
        }
        $generate_page = nv_generate_page($url_link, $numRecord, $per_pages, $pages);
        $xtpl->assign('VIEW_PAGES', $generate_page);
        $xtpl->parse('results.pages_result');
    }
    $xtpl->assign('MY_DOMAIN', NV_MY_DOMAIN);
    $xtpl->assign('NUMRECORD', $numRecord);
    $xtpl->parse('results');
    return $xtpl->text('results');
}
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:47,代码来源:theme.php


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