31
tzvook
Re: Ajax autocompletion feeded with isearch module
  • 2009/3/13 13:47

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Yep, can also add dynamic youtube search results ( as I do in here: http://www.net4u.co.il/modules/mysearch/search.php?query=play&submit=Search&action=results ) - if you want me - I'll send the code for it ...quite simple ...

32
trabis
Re: Ajax autocompletion feeded with isearch module
  • 2009/3/13 13:51

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


tzvook, please send the code. Are you still using XOOPS 2.2? I'm asking this because I'm using 2.3 framework now, it is fast to develop and more secure (less code, less bugs).

33
tzvook
Re: Ajax autocompletion feeded with isearch module
  • 2009/3/13 15:43

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Most of my sites are still 2.2. since my 2.2. version was heavily modified, but the new one are 2.3.x (definately) ...
The code is client side anyway, I'm not @ home today, so I'll send it tomorrow from home ...

34
tzvook
Re: Ajax autocompletion feeded with isearch module
  • 2009/3/16 15:40

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Sorry trabis - I 4got about it, but here it is now

First of all here is the JS + CSS (kept it @ your module structure, and I'm 99.9% sure there's no hardcoded staff in it).
http://www.gifts45.com/tmp/mysearch.zip

@ /templates/mysearch_search.html I added ( before the <{$label_ignored_keywords}> section )

<link rel="stylesheet" type="text/css" href="css/lightwindow.css" />

<
script type="text/javascript" src="js/inthetube/prototype.js">script>
<
script type="text/javascript" src="js/inthetube/effects.js">script>
<
script type="text/javascript" src="js/inthetube/lightwindow.js">script>
<
link href="css/inTHEtube.css" rel="stylesheet" type="text/css" media="screen" />
<
script src="js/inthetube/inTHEtube.js" type="text/javascript">script>

<
p>

<
h2>Youtube video clips for: <{section name=cur_kw_searched loop=$searched_keywords}>
<{
$searched_keywords[cur_kw_searched]}><{if $smarty.section.cur_kw_searched.index <> $smarty.section.cur_kw_searched.total}>&nbsp;<{/if}><{/section}>h2>
<
center><div id="youtubeDiv" style="display: block; clear: both">
div>center>
<
script>
insertVideos('youtubeDiv','search','<{section name=cur_kw_searched loop=$searched_keywords}><{$searched_keywords[cur_kw_searched]}><{if $smarty.section.cur_kw_searched.index <>$smarty.section.cur_kw_searched.total}> <{/if}><{/section}>','10',1);
script>

p>

35
tzvook
Re: Ajax autocompletion feeded with isearch module
  • 2009/3/16 15:47

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Forgot one thing:

in this part:
<script>
insertVideos('youtubeDiv','search','<{section name=cur_kw_searched loop=$searched_keywords}><{$searched_keywords[cur_kw_searched]}><{if $smarty.section.cur_kw_searched.index <>$smarty.section.cur_kw_searched.total}> <{/if}><{/section}>','10',1);
script>


The no. 10 represents the clips no. and can be a $var of course

36
trabis
Re: Ajax autocompletion feeded with isearch module
  • 2009/3/16 18:33

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Thanks tzvook, I'll try to merge this into mysearch!

37
tzvook
Re: Ajax autocompletion feeded with isearch module
  • 2009/3/18 15:41

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


One more thing T

@ /templates/blocks/mysearch_block_last_search.html

<{foreach item=onesearch from=$block.searches}>
    <
tr class="<{cycle values="even,odd"}>"><td align='center'><{$onesearch.keyword}>a>td>tr>
<{/foreach}>


should be:
<{foreach item=onesearch from=$block.searches}>
    <
tr class="<{cycle values="even,odd"}>"><td align='center'><{$onesearch.link}><{$onesearch.keyword}>a>td>tr>
<{/foreach}>


Along with ( /blocks/mysearch_last_search.php ) :
$search['link'] = ".XOOPS_URL.'/search.php?query='.$oneelement->getVar('keyword')."&action=results' target='_blank'>";


Turning into this:
$search['link'] = ".XOOPS_URL.'/modules/mysearch/search.php?query='.$oneelement->getVar('keyword')."&action=results'>";


And in this line ( a bit above ) I needed to hard code it - so it probably should also be a block $var

$critere->setSort('datesearch');
// TZ for hard-coded limit        $critere->setLimit($visiblekeywords);
        
$critere->setLimit(5);


Since it's taking the $visiblekeywords from the module-wide preferences also for the block.

I didn't looked on all the blocks, just on this one ...

38
tzvook
Re: Ajax autocompletion feeded with isearch module
  • 2009/3/20 19:36

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


BUMP

Trabis - any news ?
can't wait to see the "terms" working ...
Have you seen the "double" keyword effect? am I the only one experiencing it ? ... each "word" is getting doubled ...

Login

Who's Online

267 user(s) are online (189 user(s) are browsing Support Forums)


Members: 0


Guests: 267


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits