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

PHP highlightkeywords函数代码示例

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

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



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

示例1: CentralSpaceLoad

                echo $url;
                ?>
"  onClick="return CentralSpaceLoad(this,true);" <?php 
                if (!$infobox) {
                    ?>
title="<?php 
                    echo str_replace(array("\"", "'"), "", htmlspecialchars(i18n_get_translated($value)));
                    ?>
"<?php 
                }
                //end if infobox
                ?>
><?php 
            }
            //end link
            echo highlightkeywords(tidy_trim(TidyList(i18n_get_translated($value)), 28), $search, $df[$x]['partial_index'], $df[$x]['name'], $df[$x]['indexed']);
            if ($x == 0) {
                // add link if necessary
                ?>
</a><?php 
            }
            //end link
            ?>
&nbsp;</div><div class="clearer"></div>
			<?php 
        }
    }
    ?>
			<?php 
}
?>
开发者ID:vongalpha,项目名称:resourcespace,代码行数:31,代码来源:smallthumbs.php


示例2: display_field_data

function display_field_data($field, $valueonly = false, $fixedwidth = 452)
{
    global $ref, $fieldcount, $tabcount, $show_expiry_warning, $access, $tabname, $search, $extra, $lang, $used_tab_names, $related_type_show_with_data, $show_default_related_resources;
    $value = $field["value"];
    $modified_field = hook("beforeviewdisplayfielddata_processing", "", array($field));
    if ($modified_field) {
        $field = $modified_field;
    }
    # Handle expiry fields
    if (!$valueonly && $field["type"] == 6 && $value != "" && $value <= date("Y-m-d H:i") && $show_expiry_warning) {
        $extra .= "<div class=\"RecordStory\"> <h1>" . $lang["warningexpired"] . "</h1><p>" . $lang["warningexpiredtext"] . "</p><p id=\"WarningOK\"><a href=\"#\" onClick=\"document.getElementById('RecordDownload').style.display='block';document.getElementById('WarningOK').style.display='none';\">" . $lang["warningexpiredok"] . "</a></p></div><style>#RecordDownload {display:none;}</style>";
    }
    if ($value != "" && $value != "," && $field["display_field"] == 1 && ($access == 0 || $access == 1 && !$field["hide_when_restricted"])) {
        if (!$valueonly) {
            $title = htmlspecialchars(str_replace("Keywords - ", "", $field["title"]));
        } else {
            $title = "";
        }
        //if ($field["type"]==4 || $field["type"]==6) {$value=NiceDate($value,false,true);}
        # Value formatting
        if ($field["type"] == 2 || $field["type"] == 7 || $field["type"] == 9) {
            $i18n_split_keywords = true;
        } else {
            $i18n_split_keywords = false;
        }
        $value = i18n_get_translated($value, $i18n_split_keywords);
        if ($field["type"] == 2 || $field["type"] == 3 || $field["type"] == 7 || $field["type"] == 9) {
            $value = TidyList($value);
        }
        $value_unformatted = $value;
        # store unformatted value for replacement also
        if ($field["type"] != 8 || $field["type"] == 8 && $value == strip_tags($value)) {
            $value = nl2br(htmlspecialchars($value));
        }
        $modified_value = hook('display_field_modified_value', '', array($field));
        if ($modified_value) {
            $value = $modified_value['value'];
        }
        # draw new tab panel?
        if (!$valueonly && $tabname != $field["tab_name"] && $fieldcount > 0) {
            $resource_type_tab_names = sql_array('SELECT tab_name as value FROM resource_type', '');
            $resource_type_tab_names = array_filter($resource_type_tab_names);
            # Display related resources on this tab, if set:
            if (isset($related_type_show_with_data)) {
                # NOTE: the resource type tab name and the current tab you are on need to be the same:
                if (in_array($tabname, $resource_type_tab_names)) {
                    if (($key = array_search($tabname, $resource_type_tab_names)) !== false) {
                        # Fields with display template should be rendered before the related resources list:
                        echo $extra;
                        $extra = '';
                        include '../include/related_resources.php';
                        unset($resource_type_tab_names[$key]);
                        $show_default_related_resources = FALSE;
                    }
                }
            }
            $tabcount++;
            # Also display the custom formatted data $extra at the bottom of this tab panel.
            ?>
<div class="clearerleft"> </div><?php 
            echo $extra;
            ?>
</div></div><div class="TabbedPanel StyledTabbedPanel" style="display:none;" id="tab<?php 
            echo $tabcount;
            ?>
"><div><?php 
            $extra = "";
        }
        $tabname = $field["tab_name"];
        $used_tab_names[] = $tabname;
        $used_tab_names = array_unique($used_tab_names);
        $fieldcount++;
        if (!$valueonly && trim($field["display_template"]) != "") {
            # Process the value using a plugin
            $plugin = "../plugins/value_filter_" . $field["name"] . ".php";
            if ($field['value_filter'] != "") {
                eval($field['value_filter']);
            } else {
                if (file_exists($plugin)) {
                    include $plugin;
                } else {
                    if ($field["type"] == 4 || $field["type"] == 6) {
                        $value = NiceDate($value, false, true);
                    }
                }
            }
            # Highlight keywords
            $value = highlightkeywords($value, $search, $field["partial_index"], $field["name"], $field["keywords_index"]);
            # Use a display template to render this field
            $template = $field["display_template"];
            $template = str_replace("[title]", $title, $template);
            $template = str_replace("[value]", $value, $template);
            $template = str_replace("[value_unformatted]", $value_unformatted, $template);
            $template = str_replace("[ref]", $ref, $template);
            $extra .= $template;
        } else {
            #There is a value in this field, but we also need to check again for a current-language value after the i18n_get_translated() function was called, to avoid drawing empty fields
            if ($value != "") {
                # Draw this field normally.
                # value filter plugin should be used regardless of whether a display template is used.
//.........这里部分代码省略.........
开发者ID:claytondaley,项目名称:resourcespace,代码行数:101,代码来源:view.php


示例3: i18n_get_collection_name

                $collection_tag = $lang['collection'];
            } else {
                $collection_prefix = "";
                # The prefix $lang['smartcollection'] . ": " is added in i18n_get_collection_name()
                $collection_tag = $lang['smartcollection'];
            }
            if (!hook("replacelistviewcolresults")) {
                ?>
		<td nowrap><div class="ListTitle"><a onClick="return CentralSpaceLoad(this,true);" href="<?php 
                echo $pub_url;
                ?>
" title="<?php 
                echo str_replace(array("\"", "'"), "", $collection_prefix . i18n_get_collection_name($collections[$n]));
                ?>
"><?php 
                echo $collection_prefix . highlightkeywords(tidy_trim(i18n_get_collection_name($collections[$n]), 45), $search);
                ?>
</a></div></td>
		<?php 
                for ($x = 0; $x < count($df) - 1; $x++) {
                    ?>
<td>-</td><?php 
                }
                ?>
		<td>-</td>
	    <?php 
                if ($display_user_rating_stars && $k == "") {
                    ?>
<td>&nbsp;&nbsp;</td><?php 
                }
                ?>
开发者ID:perryrothjohnson,项目名称:resourcespace,代码行数:31,代码来源:search_public.php


示例4: hook

<?php hook("beforecollectiontoolscolumnheader");?>
<td class="tools"><div class="ListTools"><?php echo $lang["tools"]?></div></td>
</tr>
<form method="get" name="colactions" id="colactions" action="<?php echo $baseurl_short?>pages/collection_manage.php">
<?php

for ($n=$offset;(($n<count($collections)) && ($n<($offset+$per_page)));$n++)
	{
    $colusername=$collections[$n]['fullname'];

	?><tr <?php hook("collectionlistrowstyle");?>>
	<td class="name"><div class="ListTitle">
		<a <?php if ($collections[$n]["public"]==1 && (strlen($collections[$n]["theme"])>0)) { ?>style="font-style:italic;"<?php } ?> href="<?php echo $baseurl_short?>pages/search.php?search=<?php echo urlencode("!collection" . $collections[$n]["ref"])?>" onClick="return CentralSpaceLoad(this);"><?php echo highlightkeywords(i18n_get_collection_name($collections[$n]),$find) ?></a></div></td>
	<td class="fullname"><?php echo highlightkeywords($colusername,$find) ?></td>
	<td class="ref"><?php echo highlightkeywords($collection_prefix . $collections[$n]["ref"],$find) ?></td>
	<td class="created"><?php echo nicedate($collections[$n]["created"],true) ?></td>
	<td class="count"><?php echo $collections[$n]["count"] ?></td>
<?php if (! $hide_access_column){ ?>	<td class="access"><?php
# Work out the correct access mode to display
if (!hook('collectionaccessmode')) {
	if ($collections[$n]["public"]==0){
		echo $lang["private"];
	}
	else{
		if (strlen($collections[$n]["theme"])>0){
			echo $lang["theme"];
		}
	else{
		echo $lang["public"];
		}
开发者ID:artsmia,项目名称:mia_resourcespace,代码行数:30,代码来源:collection_manage.php


示例5: highlightkeywords

<td><?php echo $lang["date"]?></td>
<td><?php echo $lang["news_headline"]?></td>
<td><?php echo $lang["news_body"]?></td>
<td><div class="ListTools"><?php echo $lang["tools"]?></div></td>
</tr>

<?php
for ($n=$offset;(($n<count($news)) && ($n<($offset+$per_page)));$n++)
	{
	?>
	<tr>
	<td><div class="ListTitle"><?php echo highlightkeywords($news[$n]["date"],$findtext,true);?></div></td>
	
	<td><div class="ListTitle"><?php echo "<a href=\"" . $baseurl . "/plugins/news/pages/news.php?ref=" . $news[$n]["ref"] . "\">" . highlightkeywords($news[$n]["title"],$findtext,true);?></a></div></td>
	
	<td><?php echo highlightkeywords(tidy_trim(htmlspecialchars($news[$n]["body"]),100),$findtext,true)?></td>
	
	<td>
	<div class="ListTools">
		<a href="news_content_edit.php?ref=<?php echo $news[$n]["ref"]?>&backurl=<?php echo urlencode($url . "&offset=" . $offset . "&findtext=" . $findtext)?>">&gt;&nbsp;<?php echo $lang["action-edit"]?> </a>
		<a href="#" onclick="if (confirm('<?php echo $lang["confirm-deletion"]?>')) {document.getElementById('newsdelete').value='<?php echo $news[$n]["ref"]?>';document.getElementById('newsform').submit();} return false;">&gt;&nbsp;<?php echo $lang["action-delete"]?></a>
		</div>
	</td>
	</tr>
	<?php
	}
?>

</table>
</div>
<div class="BottomInpageNav"><?php pager(true); ?></div>
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:31,代码来源:news_edit.php


示例6: if

			?>		
			<?php 
			// extended css behavior 
			if ( in_array($df[$x]['ref'],$thumbs_display_extended_fields) &&
			( (isset($metadata_template_title_field) && $df[$x]['ref']!=$metadata_template_title_field) || !isset($metadata_template_title_field) ) ){ ?>
			<?php if (!hook("replaceresourcepanelinfo")){?>
			<div class="ResourcePanelInfo"><div class="extended">
			<?php if ($x==0){ // add link if necessary ?><a href="<?php echo $url?>"  onClick="return CentralSpaceLoad(this,true);" <?php if (!$infobox) { ?>title="<?php echo str_replace(array("\"","'"),"",htmlspecialchars(i18n_get_translated($value)))?>"<?php } //end if infobox ?>><?php } //end link
			echo format_display_field($value);
			?><?php if ($show_extension_in_search) { ?><?php echo " " . str_replace_formatted_placeholder("%extension", $result[$n]["file_extension"], $lang["fileextension-inside-brackets"])?><?php } ?><?php if ($x==0){ // add link if necessary ?></a><?php } //end link?>&nbsp;</div></div>
			<?php } /* end hook replaceresourcepanelinfo */?>
			<?php 

			// normal behavior
			} else if  ( (isset($metadata_template_title_field)&&$df[$x]['ref']!=$metadata_template_title_field) || !isset($metadata_template_title_field) ) {?> 
			<div class="ResourcePanelInfo"><?php if ($x==0){ // add link if necessary ?><a href="<?php echo $url?>"  onClick="return CentralSpaceLoad(this,true);" <?php if (!$infobox) { ?>title="<?php echo str_replace(array("\"","'"),"",htmlspecialchars(i18n_get_translated($value)))?>"<?php } //end if infobox ?>><?php } //end link?><?php echo highlightkeywords(tidy_trim(TidyList(i18n_get_translated($value)),$search_results_title_trim),$search,$df[$x]['partial_index'],$df[$x]['name'],$df[$x]['indexed'])?><?php if ($x==0){ // add link if necessary ?></a><?php } //end link?>&nbsp;</div><div class="clearer"></div>
			<?php } ?>
			<?php
			}
		?>

		<!-- Checkboxes -->
		<div class="ResourcePanelIcons">
		<?php if(!hook("thumbscheckboxes")){?>
		<?php if ($use_checkboxes_for_selection){?><input type="checkbox" id="check<?php echo htmlspecialchars($ref)?>" class="checkselect" <?php if (in_array($ref,$collectionresources)){ ?>checked<?php } ?> onclick="if (jQuery('#check<?php echo htmlspecialchars($ref)?>').attr('checked')=='checked'){ AddResourceToCollection(<?php echo htmlspecialchars($ref)?>); } else if (jQuery('#check<?php echo htmlspecialchars($ref)?>').attr('checked')!='checked'){ RemoveResourceFromCollection(<?php echo htmlspecialchars($ref)?>); }">&nbsp;<?php } ?>
		<?php } # end hook thumbscheckboxes?>
		<?php if ($display_resource_id_in_thumbnail && $ref>0) { echo htmlspecialchars($ref); } else { ?>&nbsp;<?php } ?>
		</div>	

		<?php if (!hook("replaceresourcetools")){?>
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:30,代码来源:thumbs.php


示例7: display_field_data

function display_field_data($field, $valueonly = false, $fixedwidth = 452)
{
    global $ref, $fieldcount, $tabcount, $show_expiry_warning, $access, $tabname, $search, $extra, $lang;
    $value = $field["value"];
    # Handle expiry fields
    if (!$valueonly && $field["type"] == 6 && $value != "" && $value <= date("Y-m-d H:i") && $show_expiry_warning) {
        $extra .= "<div class=\"RecordStory\"> <h1>" . $lang["warningexpired"] . "</h1><p>" . $lang["warningexpiredtext"] . "</p><p id=\"WarningOK\"><a href=\"#\" onClick=\"document.getElementById('RecordDownload').style.display='block';document.getElementById('WarningOK').style.display='none';\">" . $lang["warningexpiredok"] . "</a></p></div><style>#RecordDownload {display:none;}</style>";
    }
    if ($value != "" && $value != "," && $field["display_field"] == 1 && ($access == 0 || $access == 1 && !$field["hide_when_restricted"])) {
        if (!$valueonly) {
            $title = htmlspecialchars(str_replace("Keywords - ", "", $field["title"]));
        } else {
            $title = "";
        }
        //if ($field["type"]==4 || $field["type"]==6) {$value=NiceDate($value,false,true);}
        # Value formatting
        if ($field["type"] == 2 || $field["type"] == 7 || $field["type"] == 9) {
            $i18n_split_keywords = true;
        } else {
            $i18n_split_keywords = false;
        }
        $value = i18n_get_translated($value, $i18n_split_keywords);
        if ($field["type"] == 2 || $field["type"] == 3 || $field["type"] == 7 || $field["type"] == 9) {
            $value = TidyList($value);
        }
        $value_unformatted = $value;
        # store unformatted value for replacement also
        if ($field["type"] != 8) {
            $value = nl2br(htmlspecialchars($value));
        }
        # draw new tab panel?
        if (!$valueonly && $tabname != $field["tab_name"] && $fieldcount > 0) {
            $tabcount++;
            # Also display the custom formatted data $extra at the bottom of this tab panel.
            ?>
<div class="clearerleft"> </div><?php 
            echo $extra;
            ?>
</div></div><div class="TabbedPanel StyledTabbedPanel" style="display:none;" id="tab<?php 
            echo $tabcount;
            ?>
"><div><?php 
            $extra = "";
        }
        $tabname = $field["tab_name"];
        $fieldcount++;
        if (!$valueonly && trim($field["display_template"]) != "") {
            # Process the value using a plugin
            $plugin = "../plugins/value_filter_" . $field["name"] . ".php";
            if ($field['value_filter'] != "") {
                eval($field['value_filter']);
            } else {
                if (file_exists($plugin)) {
                    include $plugin;
                } else {
                    if ($field["type"] == 4 || $field["type"] == 6) {
                        $value = NiceDate($value, false, true);
                    }
                }
            }
            # Highlight keywords
            $value = highlightkeywords($value, $search, $field["partial_index"], $field["name"], $field["keywords_index"]);
            # Use a display template to render this field
            $template = $field["display_template"];
            $template = str_replace("[title]", $title, $template);
            $template = str_replace("[value]", $value, $template);
            $template = str_replace("[value_unformatted]", $value_unformatted, $template);
            $template = str_replace("[ref]", $ref, $template);
            $extra .= $template;
        } else {
            #There is a value in this field, but we also need to check again for a current-language value after the i18n_get_translated() function was called, to avoid drawing empty fields
            if ($value != "") {
                # Draw this field normally.
                # value filter plugin should be used regardless of whether a display template is used.
                $plugin = "../plugins/value_filter_" . $field["name"] . ".php";
                if ($field['value_filter'] != "") {
                    eval($field['value_filter']);
                } else {
                    if (file_exists($plugin)) {
                        include $plugin;
                    } else {
                        if ($field["type"] == 4 || $field["type"] == 6) {
                            $value = NiceDate($value, false, true);
                        }
                    }
                }
                # Highlight keywords
                $value = highlightkeywords($value, $search, $field["partial_index"], $field["name"], $field["keywords_index"]);
                ?>
<div <?php 
                if (!$valueonly) {
                    echo "class=\"itemNarrow\"";
                } elseif (isset($fixedwidth)) {
                    echo "style=\"width:" . $fixedwidth . "px\"";
                }
                ?>
>
				<h3><?php 
                echo $title;
                ?>
//.........这里部分代码省略.........
开发者ID:chandradrupal,项目名称:resourcespace,代码行数:101,代码来源:view.php


示例8: hook

		{
		?>
		<tr <?php hook("collectionlistrowstyle");?>>
		<?php hook ("listsearchpubliccheckboxes");
		if ($use_checkboxes_for_selection){echo "<td></td>";}
		if (!isset($collections[$n]['savedsearch'])||(isset($collections[$n]['savedsearch'])&&$collections[$n]['savedsearch']==null))
			{
			$collection_prefix = $lang["collection"] . ": ";
			$collection_tag = $lang['collection'];
			}
		else
			{
			$collection_prefix = ""; # The prefix $lang['smartcollection'] . ": " is added in i18n_get_collection_name()
			$collection_tag = $lang['smartcollection'];
			}?>
		<td nowrap><div class="ListTitle"><a onClick="return CentralSpaceLoad(this,true);" href="<?php echo $pub_url?>" title="<?php echo str_replace(array("\"","'"),"", $collection_prefix . i18n_get_collection_name($collections[$n]))?>"><?php echo $collection_prefix . highlightkeywords(tidy_trim(i18n_get_collection_name($collections[$n]),45),$search)?></a></div></td>
		<?php 
		for ($x=0;$x<count($df)-1;$x++){
			?><td>-</td><?php
			}
				
		?>
		<td>-</td>
	    <?php if ($display_user_rating_stars && $k==""){ ?><td>&nbsp;&nbsp;</td><?php } ?>
		<?php if ($id_column){?><td><?php echo $collections[$n]['ref']?></td><?php } ?>
		<?php if ($resource_type_column){?><td><?php echo $collection_tag?></td><?php } ?>
		<?php if ($date_column){?><td><?php echo nicedate($collections[$n]["created"],false,true)?></td><?php } ?>
        <?php hook("addlistviewcolumnpublic");?>
		<td><div class="ListTools">
		<?php if (!hook("replacecollectiontools")){?>
		<a href="<?php echo $baseurl_short?>pages/collections.php?collection=<?php echo $collections[$n]["ref"]?>"  onClick="return CollectionDivLoad(this);">&gt;&nbsp;<?php echo $lang["action-select"]?></a>&nbsp;&nbsp;<a onClick="return CentralSpaceLoad(this,true);" href="<?php echo $pub_url?>">&gt;&nbsp;<?php echo $lang["viewall"]?></a>
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:31,代码来源:search_public.php


示例9: urlencode

        ?>
style="font-style:italic;"<?php 
    }
    ?>
 href="<?php 
    echo $baseurl_short;
    ?>
pages/search.php?search=<?php 
    echo urlencode("!collection" . $collections[$n]["ref"]);
    ?>
" onClick="return CentralSpaceLoad(this);"><?php 
    echo highlightkeywords(i18n_get_collection_name($collections[$n]), $find);
    ?>
</a></div></td>
	<td><?php 
    echo highlightkeywords($collection_prefix . $collections[$n]["ref"], $find);
    ?>
</td>
	<td><?php 
    echo nicedate($collections[$n]["created"], true);
    ?>
</td>
	<td><?php 
    echo $collections[$n]["count"];
    ?>
</td>

<?php 
    hook("beforecollectiontoolscolumn");
    ?>
	<td>	
开发者ID:claytondaley,项目名称:resourcespace,代码行数:31,代码来源:purchases.php


示例10: CentralSpaceLoad

    echo $text[$n]["name"];
    ?>
&findpage=<?php 
    echo $findpage;
    ?>
&findname=<?php 
    echo $findname;
    ?>
&findtext=<?php 
    echo $findtext;
    ?>
&offset=<?php 
    echo $offset;
    ?>
" onClick="return CentralSpaceLoad(this,true);"><?php 
    echo highlightkeywords(tidy_trim(htmlspecialchars($text[$n]["text"]), 100), $findtext, true);
    ?>
</a></td>
	
	<td><div class="ListTools"><a href="<?php 
    echo $baseurl_short;
    ?>
pages/team/team_content_edit.php?page=<?php 
    echo $text[$n]["page"];
    ?>
&name=<?php 
    echo $text[$n]["name"];
    ?>
&findpage=<?php 
    echo $findpage;
    ?>
开发者ID:chandradrupal,项目名称:resourcespace,代码行数:31,代码来源:team_content.php


示例11: display_field_data

function display_field_data($field,$valueonly=false,$fixedwidth=452)
	{
	global $ref, $show_expiry_warning, $access, $search, $extra, $lang;
	$value=$field["value"];

	$modified_field=hook("beforeviewdisplayfielddata_processing","",array($field));
	if($modified_field){
		$field=$modified_field;
	}
	
	# Handle expiry fields
	if (!$valueonly && $field["type"]==6 && $value!="" && $value<=date("Y-m-d H:i") && $show_expiry_warning) 
		{
		$extra.="<div class=\"RecordStory\"> <h1>" . $lang["warningexpired"] . "</h1><p>" . $lang["warningexpiredtext"] . "</p><p id=\"WarningOK\"><a href=\"#\" onClick=\"document.getElementById('RecordDownload').style.display='block';document.getElementById('WarningOK').style.display='none';\">" . $lang["warningexpiredok"] . "</a></p></div><style>#RecordDownload {display:none;}</style>";
		}
	
	if (($value!="") && ($value!=",") && ($field["display_field"]==1) && ($access==0 || ($access==1 && !$field["hide_when_restricted"])))
		{
		if (!$valueonly)
			{$title=htmlspecialchars(str_replace("Keywords - ","",$field["title"]));}
		else {$title="";}
		//if ($field["type"]==4 || $field["type"]==6) {$value=NiceDate($value,false,true);}

		# Value formatting
		if (($field["type"]==2) || ($field["type"]==7) || ($field["type"]==9))
			{$i18n_split_keywords =true;}
		else 	{$i18n_split_keywords =false;}
		$value=i18n_get_translated($value,$i18n_split_keywords );
		if (($field["type"]==2) || ($field["type"]==3) || ($field["type"]==7) || ($field["type"]==9)) {$value=TidyList($value);}
		
		// Don't display the comma for radio buttons:
		if($field['type'] == 12) {
			$value = str_replace(',', '', $value);
		}
		
		$value_unformatted=$value; # store unformatted value for replacement also

		if ($field["type"]!=8 || ($field["type"]==8 && $value == strip_tags($value))) # Do not convert HTML formatted fields (that are already HTML) to HTML. Added check for extracted fields set to ckeditor that have not yet been edited.
			{
			$value=nl2br(htmlspecialchars($value));
			}
		
		$modified_value = hook('display_field_modified_value', '', array($field));
		if($modified_value) {		
			$value = $modified_value['value'];
		}

		if (!$valueonly && trim($field["display_template"])!="")
			{
			# Process the value using a plugin
			$plugin="../plugins/value_filter_" . $field["name"] . ".php";
			if ($field['value_filter']!=""){
				eval($field['value_filter']);
			}
			else if (file_exists($plugin)) {include $plugin;}
			else if ($field["type"]==4 && strpos($value,":")!=false){$value=NiceDate($value,true,true);} // Show the time as well as date if entered
			else if ($field["type"]==4 || $field["type"]==6) {$value=NiceDate($value,false,true);}
			
			# Highlight keywords
			$value=highlightkeywords($value,$search,$field["partial_index"],$field["name"],$field["keywords_index"]);
			
			$value_mod_after_highlight=hook('value_mod_after_highlight', '', array($field,$value));
			if($value_mod_after_highlight){
				$value=$value_mod_after_highlight;
			}

			# Use a display template to render this field
			$template=$field["display_template"];
			$template=str_replace("[title]",$title,$template);
			$template=str_replace("[value]",$value,$template);
			$template=str_replace("[value_unformatted]",$value_unformatted,$template);
			$template=str_replace("[ref]",$ref,$template);
			$extra.=$template;
			}
		else
			{
			#There is a value in this field, but we also need to check again for a current-language value after the i18n_get_translated() function was called, to avoid drawing empty fields
			if ($value!=""){
				# Draw this field normally.				
				
					# value filter plugin should be used regardless of whether a display template is used.
					$plugin="../plugins/value_filter_" . $field["name"] . ".php";
					if ($field['value_filter']!=""){
						eval($field['value_filter']);
					}
					else if (file_exists($plugin)) {include $plugin;}
					else if ($field["type"]==4 && strpos($value,":")!=false){$value=NiceDate($value,true,true);} // Show the time as well as date if entered
					else if ($field["type"]==4 || $field["type"]==6) {$value=NiceDate($value,false,true);}
				
				# Highlight keywords
				$value=highlightkeywords($value,$search,$field["partial_index"],$field["name"],$field["keywords_index"]);
				
				$value_mod_after_highlight=hook('value_mod_after_highlight', '', array($field,$value));
				if($value_mod_after_highlight){
					$value=$value_mod_after_highlight;
				}
				
				?><div <?php if (!$valueonly){echo "class=\"itemNarrow\""; } elseif (isset($fixedwidth)) {echo "style=\"width:" . $fixedwidth . "px\""; } ?>>
				<h3><?php echo $title?></h3><p><?php echo $value?></p></div><?php
				}
//.........这里部分代码省略.........
开发者ID:artsmia,项目名称:mia_resourcespace,代码行数:101,代码来源:view.php


示例12: format_display_field

function format_display_field($value){
	
	// applies trim/wordwrap/highlights 
	
	global $results_title_trim,$results_title_wordwrap,$df,$x,$search;
	$string=i18n_get_translated($value);
	$string=TidyList($string);
	$string=tidy_trim($string,$results_title_trim);
	$wordbreaktag="<wbr>"; // $wordbreaktag="&#8203;" I'm having slightly better luck with <wbr>, but this pends more testing.
	// Opera doesn't renders the zero-width space with a small box.
	$extra_word_separators=array("_"); // only underscore is necessary (regex considers underscores not to separate words, 
	// but we want them to); I've based these transformations on an array just in case more characters act this way.
	
	$ews_replace=array();
	foreach($extra_word_separators as $extra_word_separator){
		$ews_replace[]="{".$extra_word_separator." }";
	}

	//print_r($config_separators_replace);
	$string=str_replace($extra_word_separators,$ews_replace,$string);
	$string=wordwrap($string,$results_title_wordwrap,"#zwspace",false);
	$string=str_replace($ews_replace,$extra_word_separators,$string);
	$string=htmlspecialchars($string);
	$string=highlightkeywords($string,$search,$df[$x]['partial_index'],$df[$x]['name'],$df[$x]['indexed']);
	
	$ews_replace2=array();
	foreach($extra_word_separators as $extra_word_separator){
		$ews_replace2[]="{".$extra_word_separator."#zwspace}";
	}
	$ews_replace3=array();
	foreach($extra_word_separators as $extra_word_separator){
		$ews_replace3[]=$wordbreaktag.$extra_word_separator;
	}
	
	$string=str_replace($ews_replace2,$ews_replace3,$string);
	$string=str_replace("#zwspace",$wordbreaktag." ",$string);
	return $string;
}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:38,代码来源:general.php


示例13: if

					if ($value!=""){
						# Draw this field normally.
						
						
							# value filter plugin should be used regardless of whether a display template is used.
							$plugin="../plugins/value_filter_" . $fields[$n]["name"] . ".php";
							if ($fields[$n]['value_filter']!=""){
								eval($fields[$n]['value_filter']);
							}
							else if (file_exists($plugin)) {include $plugin;}
							else if ($fields[$n]["type"]==4 || $fields[$n]["type"]==6) { 
								$value=NiceDate($value,false,true);
							}
						
						# Highlight keywords
						$value=highlightkeywords($value,$search,$fields[$n]["partial_index"],$fields[$n]["name"],$fields[$n]["keywords_index"]);
						?><div class="itemNarrow"><h3><?php echo $title?></h3><p><?php echo $value?></p></div><?php
						}
					}
				}
			}
		}
	}
?><?php hook("extrafields2");?><div class="clearerleft"></div>
<?php echo $extra?>
</div>
</div>
<?php hook("renderafterresourcedetails"); ?>
<!-- end of tabbed panel-->
</div></div>
<div class="PanelShadow"></div>
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:31,代码来源:view.php


示例14: hook

	<?php 
        }
        if ($display == "list") {
            ?>
		<tr <?php 
            hook("collectionlistrowstyle");
            ?>
>
		<?php 
            hook("listsearchpubliccheckboxes");
            ?>
<td nowrap><div class="ListTitle"><a href="<?php 
            echo $pub_url;
            ?>
"><?php 
            echo $lang["collection"] . ": " . highlightkeywords(tidy_trim(i18n_get_translated($collections[$n]["name"]), 45), $search);
            ?>
</a></div></td>
		<?php 
            for ($x = 0; $x < count($df) - 1; $x++) {
                ?>
<td>-</td><?php 
            }
            ?>
		<td>-</td>
	    <?php 
            if ($display_user_rating_stars && $k == "") {
                ?>
<td>&nbsp;&nbsp;</td><?php 
            }
            ?>
开发者ID:vongalpha,项目名称:resourcespace,代码行数:31,代码来源:search_public.php


示例15: urlencode

 href="<?php 
    echo $baseurl_short;
    ?>
pages/search.php?search=<?php 
    echo urlencode("!collection" . $collections[$n]["ref"]);
    ?>
" onClick="return CentralSpaceLoad(this);"><?php 
    echo highlightkeywords(i18n_get_collection_name($collections[$n]), $find);
    ?>
</a></div></td>
	<td><?php 
    echo htmlspecialchars(highlightkeywords($colusername, $find));
    ?>
</td>
	<td><?php 
    echo htmlspecialchars(highlightkeywords($collection_prefix . $collections[$n]["ref"], $find));
    ?>
</td>
	<td><?php 
    echo htmlspecialchars(nicedate($collections[$n]["created"], true));
    ?>
</td>
	<td><?php 
    echo htmlspecialchars($collections[$n]["count"]);
    ?>
</td>
<?php 
    if (!$hide_access_column) {
        ?>
	<td><?php 
        # Work out the correct access mode to display
开发者ID:chandradrupal,项目名称:resourcespace,代码行数:31,代码来源:collection_manage.php


示例16: if

<?php if (!$hide_access_column_public){ ?><td><?php if ($col_order_by=="public") {?><span class="Selected"><?php } ?><a href="<?php echo $baseurl_short?>pages/collection_public.php?offset=0&col_order_by=public&sort=<?php echo urlencode($revsort)?>&find=<?php echo urlencode($find)?>" onClick="return CentralSpaceLoad(this);"><?php echo $lang["access"]?></a><?php if ($col_order_by=="public") {?><div class="<?php echo urlencode($sort)?>">&nbsp;</div><?php } ?></td><?php } ?>
<?php hook("beforecollectiontoolscolumnheader");?>

<td><div class="ListTools"><?php echo $lang["tools"]?></div></td>
</tr>
<?php

for ($n=$offset;(($n<count($collections)) && ($n<($offset+$per_page)));$n++)
	{
	?>
    <tr <?php hook("collectionlistrowstyle");?>>
	<td><div class="ListTitle">
			<a href="<?php echo $baseurl_short?>pages/search.php?search=<?php echo urlencode("!collection" . $collections[$n]["ref"])?>" onClick="return CentralSpaceLoad(this,true);"><?php echo highlightkeywords(i18n_get_collection_name($collections[$n]),$find)?></a></div></td>

	<?php if (!$collection_public_hide_owner) { ?><td><?php echo highlightkeywords($collections[$n]["fullname"],$find)?></td><?php } ?>
	<td><?php echo highlightkeywords($collections[$n]["ref"],$find)?></td>
	<td><?php echo nicedate($collections[$n]["created"],true)?></td>
    <td><?php echo $collections[$n]["count"]?></td>
	<?php if (!$hide_access_column_public){ ?><td><?php echo ($collections[$n]["public"]==0)?$lang["private"]:$lang["public"]?></td><?php } ?>
	<?php hook("beforecollectiontoolscolumn");?>
	<td><div class="ListTools">
    <?php if ($collections_compact_style){
         draw_compact_style_selector($collections[$n]["ref"]);
    } else {
    ?><a href="<?php echo $baseurl_short?>pages/search.php?search=<?php echo urlencode("!collection" . $collections[$n]["ref"])?>" onClick="return CentralSpaceLoad(this,true);">&gt;&nbsp;<?php echo $lang["viewall"]?></a>
	<?php if ($contact_sheet==true) { ?>
    &nbsp;<a href="<?php echo $baseurl_short?>pages/contactsheet_settings.php?ref=<?php echo urlencode($collections[$n]["ref"]) ?>" onClick="return CentralSpaceLoad(this);">&gt;&nbsp;<?php echo $lang["contactsheet"]?></a>
	<?php } ?>
	<?php if (!checkperm("b")) { ?>
	&nbsp;<a href="#" onclick="document.getElementById('collectionadd').value='<?php echo urlencode($collections[$n]["ref"]) ?>';document.getElementById('collectionform').submit(); return false;">&gt;&nbsp;<?php echo $lang["addtomycollections"]?></a><?php } ?>
	</div></td>
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:31,代码来源:collection_public.php


示例17: format_display_field

function format_display_field($value)
{
    // applies trim/wordwrap/highlights
    global $results_title_trim, $results_title_wordwrap, $df, $x, $search;
    if (isset($df[$x]['type']) && $df[$x]['type'] == 8) {
        $value = strip_tags($value);
    }
    $string = i18n_get_translated($value);
    $string = TidyList($string);
    //$stri 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

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