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


PHP nv_clean60函数代码示例

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


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

示例1: nv_page_list

 /**
  * nv_page_list()
  *
  * @return
  */
 function nv_page_list($block_config)
 {
     global $global_config, $site_mods, $db, $module_name;
     $module = $block_config['module'];
     if (!isset($site_mods[$module])) {
         return '';
     }
     $db->sqlreset()->select('id, title, alias')->from(NV_PREFIXLANG . '_' . $site_mods[$module]['module_data'])->where('status = 1')->order('weight ASC')->limit($block_config['numrow']);
     $list = nv_db_cache($db->sql(), 'id', $module);
     if (!empty($list)) {
         if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/page/block.page_list.tpl')) {
             $block_theme = $global_config['module_theme'];
         } elseif (file_exists(NV_ROOTDIR . '/themes/' . $global_config['site_theme'] . '/modules/page/block.page_list.tpl')) {
             $block_theme = $global_config['site_theme'];
         } else {
             $block_theme = 'default';
         }
         $xtpl = new XTemplate('block.page_list.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/modules/page');
         foreach ($list as $l) {
             $l['title_clean60'] = nv_clean60($l['title'], $block_config['title_length']);
             $l['link'] = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module . '&' . NV_OP_VARIABLE . '=' . $l['alias'] . $global_config['rewrite_exturl'];
             $xtpl->assign('ROW', $l);
             $xtpl->parse('main.loop');
         }
         $xtpl->parse('main');
         return $xtpl->text('main');
     } else {
         return '';
     }
 }
开发者ID:lzhao18,项目名称:nukeviet,代码行数:35,代码来源:global.page_list.php

示例2: nv_menu_blocks

/**
 * nv_menu_blocks()
 *
 * Ham xu ly chinh cho block
 *
 * @param mixed $block_config
 * @return
 */
function nv_menu_blocks($block_config)
{
    global $db, $global_config, $my_head;
    $list_cats = array();
    $sql = 'SELECT id, parentid, title, link, icon, note, subitem, groups_view, module_name, op, target, css, active_type FROM ' . NV_PREFIXLANG . '_menu_rows WHERE status=1 AND mid = ' . $block_config['menuid'] . ' ORDER BY weight ASC';
    $list = nv_db_cache($sql, '', $block_config['module']);
    foreach ($list as $row) {
        if (nv_user_in_groups($row['groups_view'])) {
            switch ($row['target']) {
                case 1:
                    $row['target'] = '';
                    break;
                case 3:
                    $row['target'] = ' onclick="window.open(this.href,\'targetWindow\',\'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,\');return false;"';
                    break;
                default:
                    $row['target'] = ' onclick="this.target=\'_blank\'"';
            }
            if (!empty($row['icon']) and file_exists(NV_UPLOADS_REAL_DIR . '/menu/' . $row['icon'])) {
                $row['icon'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/menu/' . $row['icon'];
            } else {
                $row['icon'] = '';
            }
            $list_cats[$row['id']] = array('id' => $row['id'], 'parentid' => $row['parentid'], 'subcats' => $row['subitem'], 'title' => $row['title'], 'title_trim' => nv_clean60($row['title'], $block_config['title_length']), 'target' => $row['target'], 'note' => empty($row['note']) ? $row['title'] : $row['note'], 'link' => nv_url_rewrite(nv_unhtmlspecialchars($row['link']), true), 'icon' => $row['icon'], 'html_class' => $row['css'], 'current' => nv_menu_check_current($row['link'], (int) $row['active_type']));
        }
    }
    if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/menu/' . $block_config['block_name'] . '.tpl')) {
        $block_theme = $global_config['module_theme'];
    } elseif (file_exists(NV_ROOTDIR . '/themes/' . $global_config['site_theme'] . '/modules/menu/' . $block_config['block_name'] . '.tpl')) {
        $block_theme = $global_config['site_theme'];
    } else {
        $block_theme = 'default';
    }
    $xtpl = new XTemplate($block_config['block_name'] . '.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/modules/menu');
    $xtpl->assign('BLOCK_THEME', $block_theme);
    $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
    foreach ($list_cats as $cat) {
        if (empty($cat['parentid'])) {
            $cat['class'] = nv_menu_blocks_active($cat);
            $xtpl->assign('CAT1', $cat);
            if (!empty($cat['icon'])) {
                $xtpl->parse('main.loopcat1.icon');
            }
            if (!empty($cat['subcats'])) {
                $html_content = nv_smenu_blocks($block_config['block_name'], $list_cats, $cat['subcats']);
                $xtpl->assign('HTML_CONTENT', $html_content);
                if ($html_content != '') {
                    $xtpl->parse('main.loopcat1.cat2');
                    $xtpl->parse('main.loopcat1.expand');
                }
            }
            $xtpl->parse('main.loopcat1');
        }
    }
    $xtpl->assign('MENUID', $block_config['bid']);
    $xtpl->parse('main');
    return $xtpl->text('main');
}
开发者ID:lzhao18,项目名称:nukeviet,代码行数:66,代码来源:menu_blocks.php

示例3: nv_product_center

 /**
  * nv_product_center()
  *
  * @return
  */
 function nv_product_center($block_config)
 {
     global $module_name, $lang_module, $module_info, $module_file, $global_array_shops_cat, $db, $module_data, $db_config, $pro_config, $global_config, $site_mods;
     $module = $block_config['module'];
     $num_view = 5;
     $num = 30;
     $array = array();
     $xtpl = new XTemplate('block.product_center.tpl', NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $module_file);
     $xtpl->assign('LANG', $lang_module);
     $xtpl->assign('THEME_TEM', NV_BASE_SITEURL . 'themes/' . $module_info['template']);
     $xtpl->assign('WIDTH', $pro_config['homewidth']);
     $xtpl->assign('NUMVIEW', $num_view);
     $cache_file = NV_LANG_DATA . '_block_module_product_center_' . NV_CACHE_PREFIX . '.cache';
     if (($cache = nv_get_cache($module_name, $cache_file)) != false) {
         $array = unserialize($cache);
     } else {
         $db->sqlreset()->select('bid')->from($db_config['prefix'] . '_' . $module_data . '_block_cat')->order('weight ASC')->limit(1);
         $result = $db->query($db->sql());
         $bid = $result->fetchColumn();
         $db->sqlreset()->select('t1.id, t1.listcatid, t1.' . NV_LANG_DATA . '_title AS title, t1.' . NV_LANG_DATA . '_alias AS alias, t1.homeimgfile, t1.homeimgthumb , t1.homeimgalt, t1.showprice, t1.discount_id')->from($db_config['prefix'] . '_' . $module_data . '_rows t1')->join('INNER JOIN ' . $db_config['prefix'] . '_' . $module_data . '_block t2 ON t1.id = t2.id')->where('t2.bid= ' . $bid . ' AND t1.status =1')->order('t1.id DESC')->limit($num);
         $array = nv_db_cache($db->sql(), 'id', $module_name);
         $cache = serialize($array);
         nv_set_cache($module_name, $cache_file, $cache);
     }
     foreach ($array as $row) {
         $link = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $global_array_shops_cat[$row['listcatid']]['alias'] . '/' . $row['alias'] . $global_config['rewrite_exturl'];
         if ($row['homeimgthumb'] == 1) {
             $src_img = NV_BASE_SITEURL . NV_FILES_DIR . '/' . $site_mods[$module]['module_upload'] . '/' . $row['homeimgfile'];
         } elseif ($row['homeimgthumb'] == 2) {
             $src_img = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $site_mods[$module]['module_upload'] . '/' . $row['homeimgfile'];
         } elseif ($row['homeimgthumb'] == 3) {
             $src_img = $row['homeimgfile'];
         } else {
             $src_img = NV_BASE_SITEURL . 'themes/' . $global_config['site_theme'] . '/images/shops/no-image.jpg';
         }
         $xtpl->assign('LINK', $link);
         $xtpl->assign('TITLE', $row['title']);
         $xtpl->assign('TITLE0', nv_clean60($row['title'], 30));
         $xtpl->assign('SRC_IMG', $src_img);
         if ($pro_config['active_price'] == '1') {
             if ($row['showprice'] == '1') {
                 $price = nv_get_price($row['id'], $pro_config['money_unit']);
                 $xtpl->assign('PRICE', $price);
                 if ($row['discount_id'] and $price['discount_percent'] > 0) {
                     $xtpl->parse('main.items.price.discounts');
                 } else {
                     $xtpl->parse('main.items.price.no_discounts');
                 }
                 $xtpl->parse('main.items.price');
             } else {
                 $xtpl->parse('main.items.contact');
             }
         }
         $xtpl->parse('main.items');
     }
     $xtpl->parse('main');
     return $xtpl->text('main');
 }
开发者ID:hoangvtien,项目名称:module-shops,代码行数:63,代码来源:module.block_product_center.php

示例4: nv_news_block_news

 function nv_news_block_news($block_config, $mod_data)
 {
     global $module_array_cat, $module_info, $db, $module_config, $global_config, $site_mods;
     $module = $block_config['module'];
     $blockwidth = $module_config[$module]['blockwidth'];
     $show_no_image = $module_config[$module]['show_no_image'];
     $numrow = isset($block_config['numrow']) ? $block_config['numrow'] : 20;
     $cache_file = NV_LANG_DATA . '__block_news_' . $numrow . '_' . NV_CACHE_PREFIX . '.cache';
     if (($cache = $nv_Cache->getItem($module, $cache_file)) != false) {
         $array_block_news = unserialize($cache);
     } else {
         $array_block_news = array();
         $db->sqlreset()->select('id, catid, publtime, exptime, title, alias, homeimgthumb, homeimgfile, hometext')->from(NV_PREFIXLANG . '_' . $mod_data . '_rows')->where('status= 1')->order('publtime DESC')->limit($numrow);
         $result = $db->query($db->sql());
         while (list($id, $catid, $publtime, $exptime, $title, $alias, $homeimgthumb, $homeimgfile, $hometext) = $result->fetch(3)) {
             $link = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module . '&' . NV_OP_VARIABLE . '=' . $module_array_cat[$catid]['alias'] . '/' . $alias . '-' . $id . $global_config['rewrite_exturl'];
             if ($homeimgthumb == 1) {
                 $imgurl = NV_BASE_SITEURL . NV_FILES_DIR . '/' . $site_mods[$module]['module_upload'] . '/' . $homeimgfile;
             } elseif ($homeimgthumb == 2) {
                 $imgurl = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $site_mods[$module]['module_upload'] . '/' . $homeimgfile;
             } elseif ($homeimgthumb == 3) {
                 $imgurl = $homeimgfile;
             } elseif (!empty($show_no_image)) {
                 $imgurl = NV_BASE_SITEURL . $show_no_image;
             } else {
                 $imgurl = '';
             }
             $array_block_news[] = array('id' => $id, 'title' => $title, 'link' => $link, 'imgurl' => $imgurl, 'width' => $blockwidth, 'hometext' => $hometext);
         }
         $cache = serialize($array_block_news);
         $nv_Cache->setItem($module, $cache_file, $cache);
     }
     if (file_exists(NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/news/block_news.tpl')) {
         $block_theme = $module_info['template'];
     } else {
         $block_theme = 'default';
     }
     $xtpl = new XTemplate('block_news.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/modules/news/');
     foreach ($array_block_news as $array_news) {
         $array_news['hometext'] = nv_clean60($array_news['hometext'], $block_config['tooltip_length'], true);
         $xtpl->assign('blocknews', $array_news);
         if (!empty($array_news['imgurl'])) {
             $xtpl->parse('main.newloop.imgblock');
         }
         if (!$block_config['showtooltip']) {
             $xtpl->assign('TITLE', 'title="' . $array_news['title'] . '"');
         }
         $xtpl->parse('main.newloop');
     }
     if ($block_config['showtooltip']) {
         $xtpl->assign('TOOLTIP_POSITION', $block_config['tooltip_position']);
         $xtpl->parse('main.tooltip');
     }
     $xtpl->parse('main');
     return $xtpl->text('main');
 }
开发者ID:nukeplus,项目名称:videos,代码行数:56,代码来源:module.block_news.php

示例5: nv_news_block_newscenter

 function nv_news_block_newscenter($block_config)
 {
     global $module_data, $module_name, $module_file, $global_array_cat, $global_config, $lang_module, $db, $module_config, $module_info;
     $module_name = 'news';
     $module_data = 'news';
     $xtpl = new XTemplate('block_newscenter.tpl', NV_ROOTDIR . '/themes/' . $module_info['template'] . '/blocks');
     $xtpl->assign('lang', $lang_module);
     $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
     $db->sqlreset()->select('id, catid, publtime, title, alias, hometext, homeimgthumb, homeimgfile')->from(NV_PREFIXLANG . '_' . $module_data . '_rows')->where('status= 1')->order('publtime DESC')->limit(5);
     $list = nv_db_cache($db->sql(), 'id', $module_name);
     $i = 1;
     foreach ($list as $row) {
         $row['publtime'] = nv_date('m/d/Y', $row['publtime']);
         $row['link'] = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $global_array_cat[$row['catid']]['alias'] . '/' . $row['alias'] . '-' . $row['id'] . $global_config['rewrite_exturl'];
         $row['title0'] = nv_clean60(strip_tags($row['title']), $i == 1 ? 50 : 30);
         $row['hometext'] = nv_clean60(strip_tags($row['hometext']), 260);
         $image = NV_UPLOADS_REAL_DIR . '/' . $module_name . '/' . $row['homeimgfile'];
         if ($row['homeimgfile'] != '' and file_exists($image)) {
             if ($i == 1) {
                 $width = 570;
                 $height = 490;
             } else {
                 $width = 270;
                 $height = 230;
             }
             $row['imgsource'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_name . '/' . $row['homeimgfile'];
             $imginfo = nv_is_image($image);
             $basename = basename($image);
             if ($imginfo['width'] > $width or $imginfo['height'] > $height) {
                 $basename = preg_replace('/(.*)(\\.[a-zA-Z]+)$/', $module_name . '_' . $row['id'] . '_\\1_' . $width . '-' . $height . '\\2', $basename);
                 if (file_exists(NV_ROOTDIR . '/' . NV_TEMP_DIR . '/' . $basename)) {
                     $row['imgsource'] = NV_BASE_SITEURL . NV_TEMP_DIR . '/' . $basename;
                 } else {
                     require_once NV_ROOTDIR . '/includes/class/image.class.php';
                     $_image = new image($image, NV_MAX_WIDTH, NV_MAX_HEIGHT);
                     $_image->cropFromCenter($width, $height);
                     $_image->save(NV_ROOTDIR . '/' . NV_TEMP_DIR, $basename);
                     if (file_exists(NV_ROOTDIR . '/' . NV_TEMP_DIR . '/' . $basename)) {
                         $row['imgsource'] = NV_BASE_SITEURL . NV_TEMP_DIR . '/' . $basename;
                     }
                 }
             }
         } elseif (nv_is_url($row['homeimgfile'])) {
             $row['imgsource'] = $row['homeimgfile'];
         } elseif (!empty($module_config[$module_name]['show_no_image'])) {
             $row['imgsource'] = NV_BASE_SITEURL . $module_config[$module_name]['show_no_image'];
         } else {
             $row['imgsource'] = NV_BASE_SITEURL . 'themes/' . $global_config['site_theme'] . '/images/no-image.png';
         }
         $xtpl->assign('main' . $i, $row);
         ++$i;
     }
     $xtpl->parse('main');
     return $xtpl->text('main');
 }
开发者ID:hongoctrien,项目名称:themes-newszine,代码行数:55,代码来源:global.block_newscenter.php

示例6: nv_message_about

 /**
  * nv_message_about()
  * 
  * @return
  */
 function nv_message_about()
 {
     global $global_config, $site_mods, $db, $module_name;
     if (!isset($site_mods['about'])) {
         return "";
     }
     if ($module_name == 'about') {
         return "";
     }
     $is_show = false;
     $pattern = "/^" . NV_LANG_DATA . "\\_about\\_([0-9]+)\\_" . NV_CACHE_PREFIX . "\\.cache\$/i";
     $cache_files = nv_scandir(NV_ROOTDIR . "/" . NV_CACHEDIR, $pattern);
     if (($count = count($cache_files)) >= 1) {
         $num = rand(1, $count);
         $num--;
         $cache_file = $cache_files[$num];
         if (($cache = nv_get_cache($cache_file)) != false) {
             $cache = unserialize($cache);
             $link = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=about&" . NV_OP_VARIABLE . "=" . $cache['alias'];
             $title = $cache['page_title'];
             $bodytext = strip_tags($cache['contents']);
             $bodytext = nv_clean60($bodytext, 300);
             $is_show = true;
         }
     }
     if (!$is_show) {
         $sql = "SELECT `id`,`title`,`alias`,`bodytext`,`keywords`,`add_time`,`edit_time` FROM `" . NV_PREFIXLANG . "_" . $site_mods['about']['module_data'] . "` ORDER BY rand() DESC LIMIT 1";
         if (($query = $db->sql_query($sql)) !== false) {
             if (($row = $db->sql_fetchrow($query)) !== false) {
                 $link = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=about&" . NV_OP_VARIABLE . "=" . $row['alias'];
                 $title = $row['title'];
                 $bodytext = $row['bodytext'];
                 //$bodytext = strip_tags( $row['bodytext'] );
                 $bodytext = nv_clean60($bodytext, 300);
                 $is_show = true;
             }
         }
     }
     if ($is_show) {
         if (file_exists(NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/blocks/global.about.tpl")) {
             $block_theme = $global_config['module_theme'];
         } elseif (file_exists(NV_ROOTDIR . "/themes/" . $global_config['site_theme'] . "/blocks/global.about.tpl")) {
             $block_theme = $global_config['site_theme'];
         } else {
             $block_theme = "default";
         }
         $xtpl = new XTemplate("global.about.tpl", NV_ROOTDIR . "/themes/" . $block_theme . "/blocks");
         $xtpl->assign('LINK', $link);
         $xtpl->assign('TITLE', $title);
         $xtpl->assign('BODYTEXT', $bodytext);
         $xtpl->parse('main');
         return $xtpl->text('main');
     }
     return "";
 }
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:60,代码来源:global.about.php

示例7: nv_message_page

 /**
  * nv_message_page()
  *
  * @return
  */
 function nv_message_page($block_config)
 {
     global $global_config, $site_mods, $db, $module_name;
     $module = $block_config['module'];
     if (!isset($site_mods[$module])) {
         return '';
     }
     if ($module_name == $module) {
         return '';
     }
     $is_show = false;
     $pattern = '/^' . NV_LANG_DATA . '\\_([a-zA-z0-9\\_\\-]+)\\_([0-9]+)\\_' . NV_CACHE_PREFIX . '\\.cache$/i';
     $cache_files = nv_scandir(NV_ROOTDIR . '/' . NV_CACHEDIR . '/' . $module, $pattern);
     if (($count = sizeof($cache_files)) >= 1) {
         $num = rand(1, $count);
         --$num;
         $cache_file = $cache_files[$num];
         if (($cache = nv_get_cache($module, $cache_file)) != false) {
             $cache = unserialize($cache);
             $link = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module . '&' . NV_OP_VARIABLE . '=' . $cache['alias'] . $global_config['rewrite_exturl'];
             $title = $cache['page_title'];
             $bodytext = strip_tags($cache['bodytext']);
             $is_show = true;
         }
     }
     if (!$is_show) {
         $sql = 'SELECT id,title,alias,bodytext,keywords,add_time,edit_time FROM ' . NV_PREFIXLANG . '_' . $site_mods[$module]['module_data'] . ' WHERE status=1 ORDER BY rand() DESC';
         if (($query = $db->query($sql)) !== false) {
             if (($row = $query->fetch()) !== false) {
                 $link = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module . '&' . NV_OP_VARIABLE . '=' . $row['alias'] . $global_config['rewrite_exturl'];
                 $title = $row['title'];
                 $bodytext = strip_tags($row['bodytext']);
                 $bodytext = nv_clean60($bodytext, 300);
                 $is_show = true;
             }
         }
     }
     if ($is_show) {
         if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/page/block.about.tpl')) {
             $block_theme = $global_config['module_theme'];
         } elseif (file_exists(NV_ROOTDIR . '/themes/' . $global_config['site_theme'] . '/modules/page/block.about.tpl')) {
             $block_theme = $global_config['site_theme'];
         } else {
             $block_theme = 'default';
         }
         $xtpl = new XTemplate('block.about.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/modules/page');
         $xtpl->assign('LINK', $link);
         $xtpl->assign('TITLE', $title);
         $xtpl->assign('BODYTEXT', $bodytext);
         $xtpl->parse('main');
         return $xtpl->text('main');
     }
     return '';
 }
开发者ID:lzhao18,项目名称:nukeviet,代码行数:59,代码来源:global.about.php

示例8: BoldKeywordInStr

function BoldKeywordInStr($str, $keyword)
{
    $str = nv_clean60($str, 300);
    $tmp = explode(" ", $keyword);
    foreach ($tmp as $k) {
        $tp = strtolower($k);
        $str = str_replace($tp, "<span class=\"keyword\">" . $tp . "</span>", $str);
        $tp = strtoupper($k);
        $str = str_replace($tp, "<span class=\"keyword\">" . $tp . "</span>", $str);
        $k[0] = strtoupper($k[0]);
        $str = str_replace($k, "<span class=\"keyword\">" . $k . "</span>", $str);
    }
    return $str;
}
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:14,代码来源:search.php

示例9: BoldKeywordInStr

function BoldKeywordInStr($str, $keyword)
{
    $str = nv_clean60($str, 300);
    if (!empty($keyword)) {
        $tmp = explode(' ', $keyword);
        foreach ($tmp as $k) {
            $tp = strtolower($k);
            $str = str_replace($tp, '<span class="keyword">' . $tp . '</span>', $str);
            $tp = strtoupper($k);
            $str = str_replace($tp, '<span class="keyword">' . $tp . '</span>', $str);
            $k[0] = strtoupper($k[0]);
            $str = str_replace($k, '<span class="keyword">' . $k . '</span>', $str);
        }
    }
    return $str;
}
开发者ID:NukeVietCMS,项目名称:CodeWeb,代码行数:16,代码来源:search.php

示例10: draw_field_archives_sub

 function draw_field_archives_sub($pid)
 {
     global $module_archives_field;
     $html = "<ul>";
     foreach ($module_archives_field as $fieldid => $fieldinfo) {
         if ($fieldinfo['parentid'] == $pid) {
             $fieldinfo['title0'] = nv_clean60($fieldinfo['title'], 100);
             $html .= "<li>\n";
             $html .= "\t<span class=\"folder\"><a href=\"" . $fieldinfo['link'] . "\" id=\"" . $fieldid . "\" title=\"" . $fieldinfo['title'] . "\" onclick=\"openlink(this)\" >" . $fieldinfo['title0'] . "" . "</a></span>\n";
             if ($fieldinfo['numsubfield'] > 0) {
                 $html .= draw_field_archives_sub($fieldid);
             }
             $html .= "</li>\n";
         }
     }
     $html .= "</ul>";
     return $html;
 }
开发者ID:ngoctu2008,项目名称:nv4_module_laws,代码行数:18,代码来源:global.block_fieldtree.php

示例11: nv_weblink_sub_category

 function nv_weblink_sub_category($catid, $title_length)
 {
     global $global_array_cat;
     if (empty($catid)) {
         return "";
     } else {
         $html = "<ul>\n";
         foreach ($global_array_cat as $cat) {
             if ($cat['parentid'] == $catid) {
                 $html .= "<li>\n";
                 $html .= "<a title=\"" . $global_array_cat[$cat['catid']]['title'] . "\" href=\"" . $global_array_cat[$cat['catid']]['link'] . "\">" . nv_clean60($global_array_cat[$cat['catid']]['title'], $title_length) . "</a>\n";
                 $html .= nv_weblink_sub_category($cat['catid'], $title_length);
                 $html .= "</li>\n";
             }
         }
         $html .= "</ul>\n";
         return $html;
     }
 }
开发者ID:hongoctrien,项目名称:module-weblink,代码行数:19,代码来源:module.block_category.php

示例12: nv_bdown_news

 function nv_bdown_news($block_config)
 {
     global $db, $module_info, $site_mods, $global_config, $nv_Cache;
     $module = $block_config['module'];
     $file = $site_mods[$module]['module_file'];
     // Lay thong tin phan quyen
     $sql = 'SELECT id, alias, groups_view FROM ' . NV_PREFIXLANG . '_' . $site_mods[$module]['module_data'] . '_categories WHERE status=1';
     $_tmp = $nv_Cache->db($sql, 'id', $module);
     $list_cat = array();
     if ($_tmp) {
         foreach ($_tmp as $row) {
             if (nv_user_in_groups($row['groups_view'])) {
                 $list_cat[$row['id']] = $row['alias'];
             }
         }
     }
     unset($_tmp, $sql);
     if ($list_cat) {
         $db->sqlreset()->select('id, catid, title, alias, updatetime')->from(NV_PREFIXLANG . '_' . $site_mods[$module]['module_data'])->where('status AND catid IN (' . implode(',', array_keys($list_cat)) . ')')->order('updatetime DESC')->limit($block_config['numrow']);
         $list = $nv_Cache->db($db->sql(), 'id', $module);
         if (!empty($list)) {
             if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $file . '/block_new_files.tpl')) {
                 $block_theme = $global_config['module_theme'];
             } else {
                 $block_theme = 'default';
             }
             $xtpl = new XTemplate('block_new_files.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/modules/' . $file);
             $xtpl->assign('CONFIG', $block_config);
             foreach ($list as $row) {
                 $row['link'] = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module . '&amp;' . NV_OP_VARIABLE . '=' . $list_cat[$row['catid']] . '/' . $row['alias'] . $global_config['rewrite_exturl'];
                 $row['updatetime'] = nv_date('d/m/Y', $row['updatetime']);
                 $row['stitle'] = nv_clean60($row['title'], $block_config['title_length']);
                 $xtpl->assign('ROW', $row);
                 if ($block_config['img_bullet']) {
                     $xtpl->parse('main.loop.bullet');
                 }
                 $xtpl->parse('main.loop');
             }
             $xtpl->parse('main');
             return $xtpl->text('main');
         }
     }
 }
开发者ID:NukeVlad,项目名称:module-download,代码行数:43,代码来源:global.new_files.php

示例13: nv_bdown_news

 function nv_bdown_news($block_config)
 {
     global $db, $module_info, $site_mods;
     $module = $block_config['module'];
     $file = $site_mods[$module]['module_file'];
     // Lay thong tin phan quyen
     $sql = "SELECT `id`, `alias`, `who_view`, `groups_view` FROM `" . NV_PREFIXLANG . "_" . $site_mods[$module]['module_data'] . "_categories` WHERE `status`=1";
     $_tmp = nv_db_cache($sql, 'id', $module);
     $list_cat = array();
     if ($_tmp) {
         foreach ($_tmp as $row) {
             if (nv_set_allow($row['who_view'], $row['groups_view'])) {
                 $list_cat[$row['id']] = $row['alias'];
             }
         }
     }
     unset($_tmp, $sql);
     if ($list_cat) {
         $sql = "SELECT `id`, `catid`, `title`, `alias`, `updatetime` FROM `" . NV_PREFIXLANG . "_" . $site_mods[$module]['module_data'] . "` WHERE `status` AND `catid` IN(" . implode(",", array_keys($list_cat)) . ") ORDER BY `updatetime` DESC LIMIT 0 , " . $block_config['numrow'];
         $list = nv_db_cache($sql, 'id', $module);
         if (!empty($list)) {
             if (file_exists(NV_ROOTDIR . "/themes/" . $module_info['template'] . "/modules/" . $file . "/block_new_files.tpl")) {
                 $block_theme = $module_info['template'];
             } else {
                 $block_theme = "default";
             }
             $xtpl = new XTemplate("block_new_files.tpl", NV_ROOTDIR . "/themes/" . $block_theme . "/modules/" . $file);
             $xtpl->assign('CONFIG', $block_config);
             foreach ($list as $row) {
                 $row['link'] = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $module . "&amp;" . NV_OP_VARIABLE . "=" . $list_cat[$row['catid']] . "/" . $row['alias'];
                 $row['updatetime'] = nv_date("d/m/Y", $row['updatetime']);
                 $row['stitle'] = nv_clean60($row['title'], $block_config['title_length']);
                 $xtpl->assign('ROW', $row);
                 if ($block_config['img_bullet']) {
                     $xtpl->parse('main.loop.bullet');
                 }
                 $xtpl->parse('main.loop');
             }
             $xtpl->parse('main');
             return $xtpl->text('main');
         }
     }
 }
开发者ID:atarubi,项目名称:nuke-viet,代码行数:43,代码来源:global.new_files.php

示例14: nv_archives_sub_category

 function nv_archives_sub_category($list_sub, $title_length)
 {
     global $module_archives_cat;
     if (empty($list_sub)) {
         return "";
     } else {
         $list = explode(",", $list_sub);
         $html = "<ul>\n";
         foreach ($list as $catid) {
             $html .= "<li>\n";
             $html .= "<a title=\"" . $module_archives_cat[$catid]['title'] . "\" href=\"" . $module_archives_cat[$catid]['link'] . "\">" . nv_clean60($module_archives_cat[$catid]['title'], $title_length) . "</a>\n";
             if (!empty($module_archives_cat[$catid]['subcatid'])) {
                 $html .= nv_archives_sub_category($module_archives_cat[$catid]['subcatid'], $title_length);
             }
             $html .= "</li>\n";
         }
         $html .= "</ul>\n";
         return $html;
     }
 }
开发者ID:ngoctu2008,项目名称:nv4_module_laws,代码行数:20,代码来源:global.block_category.php

示例15: nv_comment_new

 function nv_comment_new($block_config)
 {
     global $db, $site_mods, $db_slave, $module_info, $global_config;
     $module = $block_config['module'];
     $mod_data = $site_mods[$module]['module_data'];
     $sql = "SELECT * FROM " . NV_PREFIXLANG . "_comment WHERE module = " . $db->quote($module) . " AND status=1 ORDER BY post_time DESC LIMIT " . $block_config['numrow'];
     $result = $db_slave->query($sql);
     $array_comment = array();
     $array_news_id = array();
     while ($comment = $result->fetch()) {
         $array_comment[] = $comment;
         $array_news_id[] = $comment['id'];
     }
     if (!empty($array_news_id)) {
         $result = $db_slave->query('SELECT t1.id, t1.alias AS alias_id, t2.alias AS alias_cat FROM ' . NV_PREFIXLANG . '_' . $mod_data . '_rows t1 INNER JOIN ' . NV_PREFIXLANG . '_' . $mod_data . '_cat t2 ON t1.catid = t2.catid WHERE t1.id IN (' . implode(',', array_unique($array_news_id)) . ') AND status = 1');
         $array_news_id = array();
         while ($row = $result->fetch()) {
             $array_news_id[$row['id']] = $row;
         }
         $mod_file = $site_mods[$module]['module_file'];
         if (file_exists(NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $mod_file . '/block_new_comment.tpl')) {
             $block_theme = $module_info['template'];
         } else {
             $block_theme = 'default';
         }
         $xtpl = new XTemplate('block_new_comment.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/modules/' . $mod_file);
         $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
         $xtpl->assign('TEMPLATE', $block_theme);
         foreach ($array_comment as $comment) {
             if (isset($array_news_id[$comment['id']])) {
                 $comment['url_comment'] = nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module . '&' . NV_OP_VARIABLE . '=' . $array_news_id[$comment['id']]['alias_cat'] . '/' . $array_news_id[$comment['id']]['alias_id'] . '-' . $comment['id'] . $global_config['rewrite_exturl'], true);
                 $comment['content'] = nv_clean60($comment['content'], $block_config['titlelength']);
                 $comment['post_time'] = nv_date('d/m/Y H:i', $comment['post_time']);
                 $xtpl->assign('COMMENT', $comment);
                 $xtpl->parse('main.loop');
             }
         }
         $xtpl->parse('main');
         return $xtpl->text('main');
     }
 }
开发者ID:NukeVietCMS,项目名称:CodeWeb,代码行数:41,代码来源:global.block_new_comment.php


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