function highlightkeywords($text, $search, $partial_index = false, $field_name = "", $keywords_index = 1) { # do not highlight if the field is not indexed, so it is clearer where results came from. if ($keywords_index != 1) { return $text; } # Highlight searched keywords in $text # Optional - depends on $highlightkeywords being set in config.php. global $highlightkeywords; # Situations where we do not need to do this. if (!isset($highlightkeywords) || $highlightkeywords == false || $search == "" || $text == "") { return $text; } # Generate the cache of search keywords (no longer global so it can test against particular fields. # a search is a small array so I don't think there is much to lose by processing it. $hlkeycache = array(); $wildcards_found = false; $s = split_keywords($search); for ($n = 0; $n < count($s); $n++) { if (strpos($s[$n], ":") !== false) { $c = explode(":", $s[$n]); # only add field specific keywords if ($field_name != "" && $c[0] == $field_name) { $hlkeycache[] = $c[1]; } } else { $keyword = $s[$n]; global $stemming; if ($stemming && function_exists("GetStem")) { $keyword = GetStem($keyword); } if (strpos($keyword, "*") !== false) { $wildcards_found = true; $keyword = str_replace("*", "", $keyword); } $hlkeycache[] = $keyword; } } # Parse and replace. return str_highlight($text, $hlkeycache, STR_HIGHLIGHT_SIMPLE); }
?> " onClick="return CentralSpaceLoad(this,true);"><<?php echo $groups[$n]["pname"]; ?> ></a> <?php } else { ?> <a href="<?php echo $baseurl_short; ?> pages/admin/admin_group_management.php?filterbyparent=<?php echo $groups[$n]["pref"]; ?> " onClick="return CentralSpaceLoad(this,false);"><?php echo str_highlight($groups[$n]["pname"], $find, STR_HIGHLIGHT_SIMPLE); ?> </a> <?php } ?> </td> <td> <div class="ListTools"> > <a href="<?php echo $edit_url; ?> " onClick="return CentralSpaceLoad(this,true);"><?php echo $lang["action-edit"]; ?>
?> <td><div class="ListTools">Tools</div></td><?php } ?> </tr> </tbody> <tbody id="resource_type_field_table_body" class="ui-sortable"> <?php for ($i = 0; $i < count($results) && $i < 20; $i++) { ?> <tr class="resource_type_field_row"> <?php foreach ($results[$i] as $cell) { ?> <td><?php echo str_highlight(htmlspecialchars($cell), $filter); ?> </td><?php } ?> <?php if (count($actions) > 0) { ?> <td> <div class="ListTools"> <?php foreach ($actions as $title => $action) { ?> <a href="#">> <?php echo $title; ?>
$tmp_listing .= '<li class="ui-category"><span id="admin_ajax_res_footer">' . $this->pi_getLL('admin_label_total_number') . ': ' . $resultset['customers']['total_rows'] . '</span></li>'; } // end customers // products if (count($resultset['products']['products'])) { $tmp_listing .= '<li class="ui-category"><span id="admin_ajax_res_header">' . $this->pi_getLL('products') . '</span></li>'; foreach ($resultset['products']['products'] as $product) { $prod_link = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=edit_product&cid=' . $product['categories_id'] . '&pid=' . $product['products_id'] . '&action=edit_product', 1); if ($product['products_image']) { $prod_image = '<div class="ajax_products_image">' . '<img src="' . mslib_befe::getImagePath($product['products_image'], 'products', '50') . '">' . '</div>'; } else { $prod_image = '<div class="ajax_products_image"><div class="no_image_50"></div> </div>'; } $prod_name = '<div class="ajax_products_name">' . substr($product['products_name'], 0, 50) . '</div>'; $prod_desc = '<div class="ajax_products_shortdescription">' . str_highlight(substr($product['products_shortdescription'], 0, 75), $this->get['q']) . '</div>'; if ($product['products_price'] != $product['final_price']) { $prod_price = '<div class="ajax_products_price"><div class="ajax_old_price">' . mslib_fe::amount2Cents($product['products_price'], 0) . '</div><div class="ajax_specials_price">' . mslib_fe::amount2Cents($product['final_price'], 0) . '</div></div>'; } else { $prod_price = '<div class="ajax_products_price"><div class="ajax_normal_price">' . mslib_fe::amount2Cents($product['products_price'], 0) . '</div></div>'; } $tmp_listing .= '<li class="ui-menu-item ui-menu-item-alternate" role="menuitem"> <a alt="test product" class="ui-corner-all" tabindex="-1" href="' . $prod_link . '"> <div class="ajax_products_image_wrapper"> ' . $prod_image . ' </div> <div class="ajax_products_search_item"> ' . $prod_name . ' ' . $prod_desc . ' ' . $prod_price . ' </div>
<tr> <td> <a href="<?php echo $edit_url; ?> " onClick="return CentralSpaceLoad(this,true);"><?php echo str_highlight($report["ref"], $find, STR_HIGHLIGHT_SIMPLE); ?> </a> </td> <td> <a href="<?php echo $edit_url; ?> " onClick="return CentralSpaceLoad(this,true);"><?php echo str_highlight($report["name"], $find, STR_HIGHLIGHT_SIMPLE); ?> </a> </td> <td> <div class="ListTools"> > <a href="<?php echo $view_url; ?> " onClick="return CentralSpaceLoad(this,true);"><?php echo $lang["action-view"]; ?> </a> > <a href="<?php echo $edit_url; ?>
</a><?php } ?> </td> <td> <?php if ($edit_url != "") { ?> <a href="<?php echo $edit_url; ?> " onClick="return CentralSpaceLoad(this,true);"><?php } ?> <?php echo str_highlight($size["height"], $find, STR_HIGHLIGHT_SIMPLE); ?> <?php if ($edit_url != "") { ?> </a><?php } ?> </td> <td> <?php if ($edit_url != "") { ?> <div class="ListTools"> > <a href="<?php echo $edit_url;
function highlight($text, $search) { $text = str_highlight($text, $search); return $text; }
?> </td> <td> <?php echo str_highlight($fields[$n]["name"], $find, STR_HIGHLIGHT_SIMPLE); ?> </td> <td> <?php echo $fields[$n]["type"] != "" ? $field_types[$fields[$n]["type"]] : $field_types[0]; // if no value it is treated as type 0 (single line text) ?> </td> <td> <?php echo str_highlight(i18n_get_translated($fields[$n]["tab_name"]), $find, STR_HIGHLIGHT_SIMPLE); ?> </td> <td> <div class="ListTools"> <?php if ($field_order_by == "order_by") { ?> <a href="javascript:void(0)" class="movelink movedownlink" <?php if ($n == count($fields) - 1) { ?> disabled <?php }
function arrangetext($str, $separete) { $text = ""; if ($separete == "" || $separete == "input") { $lines = split("\n", preg_replace("/<BR>|\r\n|\r|\n/i", "\n", $str)); while (list($seq, $line) = each($lines)) { $s = $line; while (true) { if (strlen($s) > 76) { $ss = mb_strcut($s, 0, 76); $s = substr($s, strlen($ss)); } else { $ss = $s; $s = ""; } $ss = str_highlight($kwd, $ss); $ss = str_link(preg_replace("/\\s\\s/i", " ", $ss)); $text .= $ss . "\n"; if ($s == "") { break; } } } } elseif ($separete == "board") { $lines = split("\n", preg_replace("/<BR>|\r\n|\r|\n/i", "\n", $str)); while (list($seq, $line) = each($lines)) { $s = $line; while (true) { if (strlen($s) > 76) { $ss = mb_strcut($s, 0, 76); $s = substr($s, strlen($ss)); } else { $ss = $s; $s = ""; } $ss = str_highlight($kwd, $ss); $ss = str_link(preg_replace("/\\s\\s/i", " ", $ss)); $text .= $ss . "<BR>"; if ($s == "") { break; } } } } return $text; }