當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。