Loading...
 
Features / Usability

Features / Usability


SOLVED: Trying to strip.tags in searchresults

posts: 3665 United States

tmuth's solution works great for the index search (tiki-searchindex.php) but not for the database search (tiki-searchresults.php) — I kept hitting a String/Array error.

So, borrowing from tmuth, here's my hack:

  1. In tiki-searchresults.php add the following lines:
    • $search1= array('__','!','!!','!!!','^','{maketoc}','%%%','::');
    • $replace1= array('','','','','','','','');
  2. Then assign the variables to be used in the template:
    • $smarty->assign('search1', $search1);
    • $smarty->assign('replace1', $replace1);
  3. Finally, in the tiki-searchresults.tpl template file, replace:
    • {$results[search].data|strip_tags}

with this:

    • {$results[search].data|replace:$search1:$replace1}


I'm sure there's a more elegant solution, but this seems to work for me.

-Rick

There are no comments at this time.

Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting