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


PHP gcms::HighlightSearch方法代码示例

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


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

示例1: is_file

     $canonical = gcms::getURL($index['module'], '', 0, $index['id']);
 }
 // แก้ไขบทความ เจ้าของหรือ mod
 $canEdit = is_file(ROOT_PATH . 'modules/document/write.php') && ($moderator || $isMember && $login['id'] == $index['member_id']);
 // แทนที่ลงใน template ของโมดูล
 $patt = array('/{BREADCRUMS}/', '/{COMMENTLIST}/', '/{REPLYFORM}/', '/{TOPIC}/', '/<MEMBER>(.*)<\\/MEMBER>/s', '/(edit-{QID}-0-0-{MODULE})/', '/(delete-{QID}-0-0-{MODULE})/', '/(quote-{QID}-0-0-{MODULE})/', '/{DETAIL}/', '/{LANGUAGE}/', '/{UID}/', '/{DISPLAYNAME}/', '/{IMG}/', '/{STATUS}/', '/{DATE}/', '/{DATEISO}/', '/{CATEGORY}/', '/{VISITED}/', '/{TAGS}/', '/{COMMENTS}/', '/{QID}/', '/{LOGIN_PASSWORD}/', '/{LOGIN_EMAIL}/', '/{ANTISPAM}/', '/{ANTISPAMVAL}/', '/{DELETE}/', '/{MODULE}/', '/{MODULEID}/', '/{VOTE}/', '/{VOTE_COUNT}/', '/{CATID}/');
 $replace = array();
 $replace[] = implode("\n", $breadcrumbs);
 $replace[] = sizeof($comments) == 0 ? '' : implode("\n", $comments);
 $replace[] = $canReply ? gcms::loadtemplate($index['module'], 'document', 'reply') : '';
 $replace[] = $index['topic'];
 $replace[] = $isMember ? '' : '$1';
 $replace[] = $canEdit ? '\\1' : 'hidden';
 $replace[] = $canDelete ? '\\1' : 'hidden';
 $replace[] = $canReply ? '\\1' : 'hidden';
 $replace[] = gcms::HighlightSearch(gcms::showDetail($index['detail'], $canview, false), $search);
 $replace[] = LANGUAGE;
 $replace[] = (int) $index['member_id'];
 $replace[] = empty($index['displayname']) ? $index['email'] : $index['displayname'];
 if (is_file(DATA_PATH . "document/{$index['picture']}")) {
     // รูปภาพของบทความ
     $image_src = DATA_URL . "document/{$index['picture']}";
     $replace[] = '<figure><img src="' . $image_src . '" alt="' . $index['topic'] . '"></figure>';
 } else {
     $image_src = WEB_URL . "/{$index['default_icon']}";
     $replace[] = '';
 }
 $replace[] = $index['status'];
 $replace[] = gcms::mktime2date($index['create_date']);
 $replace[] = date(DATE_ISO8601, $index['create_date']);
 $replace[] = $category;
开发者ID:phannack,项目名称:GCMS,代码行数:31,代码来源:view.php

示例2: array

    // breadcrumbs
    $breadcrumb = gcms::loadtemplate('', '', 'breadcrumb');
    $breadcrumbs = array();
    // หน้าหลัก
    $breadcrumbs['HOME'] = gcms::breadcrumb('icon-home', WEB_URL . '/index.php', $install_modules[$module_list[0]]['menu_tooltip'], $install_modules[$module_list[0]]['menu_text'], $breadcrumb);
    // หน้าค้นหา
    $canonical = WEB_URL . '/index.php?module=search&q=' . urlencode($search);
    $breadcrumbs['MODULE'] = gcms::breadcrumb('', $canonical, '{LNG_SEARCH}', '{LNG_SEARCH}', $breadcrumb);
    // แสดงผล
    $patt = array('/{BREADCRUMS}/', '/{(LNG_[A-Z0-9_]+)}/e', '/{WEBURL}/', '/{MODULE}/', '/{SEARCH}/', '/{RESULT}/', '/{LIST}/', '/{SPLITPAGE}/');
    $replace = array();
    $replace[] = implode("\n", $breadcrumbs);
    $replace[] = OLD_PHP ? '$lng[\'$1\']' : 'gcms::getLng';
    $replace[] = WEB_URL;
    $replace[] = $module;
    $replace[] = $search;
    $replace[] = sizeof($list) == 0 ? '' : sprintf($lng['ALL_SEARCH'], $start + 1, $end, $rows, $search, number_format($time_end - $time_start, 4));
    if ($search == '') {
        $replace[] = $lng['LNG_SEARCH_TIP'];
    } elseif (sizeof($list) == 0) {
        $replace[] = sprintf($lng['LNG_SEARCH_NOT_FOUND'], $search) . $lng['LNG_SEARCH_TIP'];
    } else {
        $replace[] = gcms::HighlightSearch(implode("\n", $list), $search);
    }
    $replace[] = $splitpage;
    $content = gcms::pregReplace($patt, $replace, gcms::loadtemplate('search', 'search', 'search'));
    // title, keywords, description
    $title = ($search == '' ? "" : "{$search} - ") . $lng['LNG_SEARCH'];
    $keywords = "{$title} {$keywords}";
    $description = "{$title} {$description}";
}
开发者ID:phannack,项目名称:GCMS,代码行数:31,代码来源:main.php

示例3: array

 $detail = gcms::showDetail($index['detail'], $canView, true, true);
 $replace = array();
 $replace[] = implode("\n", $breadcrumbs);
 $replace[] = implode("\n", $comments);
 $replace[] = $canEdit ? '\\1' : 'hidden';
 $replace[] = $canDelete ? '\\1' : 'hidden';
 $replace[] = !$canReply || $index['locked'] == 1 ? 'hidden' : '\\1';
 $replace[] = $moderator ? '\\1' : 'hidden';
 $replace[] = $moderator ? '\\1' : 'hidden';
 $replace[] = $canonical;
 $replace[] = $index['topic'];
 $replace[] = $index['pin'] == 0 ? 'un' : '';
 $replace[] = $index['locked'] == 0 ? 'un' : '';
 $replace[] = $index['pin'] == 0 ? $lng['LNG_PIN'] : $lng['LNG_UNPIN'];
 $replace[] = $index['locked'] == 0 ? $lng['LNG_LOCK'] : $lng['LNG_UNLOCK'];
 $replace[] = $picture . gcms::HighlightSearch($detail, $search);
 $replace[] = (int) $index['member_id'];
 $replace[] = $index['displayname'];
 $replace[] = $index['status'];
 $replace[] = gcms::mktime2date($index['create_date']);
 $replace[] = date(DATE_ISO8601, $index['create_date']);
 $replace[] = number_format($index['visited']);
 $replace[] = number_format($index['comments']);
 $replace[] = !$canReply || $index['locked'] == 1 ? '' : gcms::loadtemplate($index['module'], 'board', 'reply');
 $replace[] = $isMember ? '' : '$1';
 $replace[] = $index['img_upload_type'] == '' ? '' : '$1';
 $replace[] = $login['password'];
 $replace[] = $login['email'];
 $replace[] = $register_antispamchar;
 $replace[] = $isAdmin ? $_SESSION[$register_antispamchar] : '';
 $replace[] = $index['id'];
开发者ID:phannack,项目名称:GCMS,代码行数:31,代码来源:view.php


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