Skip to content

Instantly share code, notes, and snippets.

View deepagupta's full-sized avatar

Deepa Gupta deepagupta

View GitHub Profile
@deepagupta
deepagupta / search_tag_hook() at modsearchsearch_hooks.php
Created April 11, 2012 20:31
search for tags at search_hooks.php at mod/search (core plugin of elgg)
<?php
/** copied a part of code: /mod/search/search_hooks.php
* Return default results for searches on tags.
*
* @param unknown_type $hook
* @param unknown_type $type
* @param unknown_type $value
* @param unknown_type $params
@deepagupta
deepagupta / modsearch_extensionstart.php
Created April 11, 2012 20:23
search for tags when a partial string is provided
<?php
/**
* @auth: d.gupta
* @date: Apr/11/12
* @desc: This file (start.php) along a manifest file constitute a plugin namely "search_extension" that extends the "search"
The core plugin "search" displays tag results only if the inputted string matches the tags exactly and completely
[concerned code: search_tag_hook(..) in /mod/search/search_hooks.php]
However, the following code overrides it by correctly displaying the tag-search-results even when the searched string is a substring of the tag