PDA

View Full Version : Miscellaneous Hacks - Quick search pre-populated results: give your visitors quick thread suggestions


ibautocommunity
08-27-2009, 10:00 PM
Product video demo: http://www.youtube.com/watch?v=eOUq4Z6R7xI

This product integrates with the quicksearch drop down box in NAVBAR; and suggests popular threads while the visitor is typing in search keywords.

Read INSTRUCTIONS.txt for installation instructions.

NOTICE: To fine-tune and configure "relevancy threshold" you must edit /includes/cron/autocomplete-generate.php file. Default installation assumes you have a big discussion forums and suggests only threads which have more than 1000 replies or 1000 views. Edit this number, the query looks like this:

// This query needs to be customized on a per site basis
$ac_sql = "SELECT * FROM ". TABLE_PREFIX ."thread where threadid between ".$startat." AND ".$endat." AND (views > 1000 OR replycount > 1000) AND visible = '1' ORDER by views DESC";

TimberFloorAu
08-28-2009, 10:17 PM
*Awesome* gonna test :)

Shamil.
08-28-2009, 10:57 PM
Thanks Michael, installing.

al-Rsha.com
08-28-2009, 11:06 PM
Dose it support other languges
like ARABIC languge ..
becouse many mods dosn't support it ^^

Hornstar
08-29-2009, 01:43 AM
It is really awesome to see these modifications being released to the public. Now I just wish they were default in VB too.

Thanks.

Hornstar
08-29-2009, 01:58 AM
Does this error mean I don't have Sed on my server or that I have something else disabled on my server?

I was up to the scheduled task part and ran it and got this error:

Warning: system() has been disabled for security reasons in [path]/includes/cron/autocomplete-generate.php on line 21

Warning: system() has been disabled for security reasons in [path]/includes/cron/autocomplete-generate.php on line 22
The file /home/****/***/autocomplete/data_1251514584.txt is not writable

bleros
08-29-2009, 02:13 AM
thanks bro nice job

0ptima
08-29-2009, 03:43 AM
Great hack, thanks for releasing it. Im going to install this when I come back from vacation.

ctrlbrk
08-29-2009, 04:26 AM
Hi, this looks fantastic --- except it is not working for me. I ran into no problems or errors, but my search box results are unchanged.

Can you take a look please?

http://forum.bigmiketrading.com

Mike

ctrlbrk
08-29-2009, 04:27 AM
Does this error mean I don't have Sed on my server or that I have something else disabled on my server?

I was up to the scheduled task part and ran it and got this error:

Warning: system() has been disabled for security reasons in [path]/includes/cron/autocomplete-generate.php on line 21

Warning: system() has been disabled for security reasons in [path]/includes/cron/autocomplete-generate.php on line 22
The file /home/****/***/autocomplete/data_1251514584.txt is not writable

You probably need to check permissions on your autocomplete directory, make sure it is owned by the same user as your normal forum directory (ie: www-data), and set to 755.

Mike

funkmeister
08-29-2009, 05:26 AM
Hi, this looks fantastic --- except it is not working for me. I ran into no problems or errors, but my search box results are unchanged.Same here. Followed instructions to the letter. No errors at all. But search box is just as before.

I did lower the number from 1000 to reflect fewer replies and views on my site, but other than that. Just as per the instructions.

Any suggestions?

Zaivndotcom
08-29-2009, 08:41 AM
When I ran sheduled task manager, it appeared that. Help me plz
Refreshes autocomplete data

The file /autocomplete/data_1251538806.txt is not writable

RvG2
08-29-2009, 08:44 AM
try to CHMOD it to 777

Zaivndotcom
08-29-2009, 09:28 AM
Maybe I placed the dirctory autocomplete in the wrong place, cause i don't understand much about this sentence
Create writeable directory outside of publicly accessible forum root directory called "autocomplete"

Example: /var/www/autocomplete
Plz tell me exactly where I should create this folder
http://img340.imageshack.us/img340/8076/capturet.jpg

NAZIA
08-30-2009, 08:59 AM
goody.. will test it ASAP...

WildWeb
08-30-2009, 03:58 PM
Thanks for this fine work. Seems to be working fine for me.

Question - the autosearch only seems to populate with matches/suggestions when I am in a sub-forum itself and not from Forum Home or any other place on the site. Is this the default behavior or is there something I can change to have it "autocomplete/suggest" topics from anywhere on the site?

ctrlbrk
08-30-2009, 10:20 PM
Is the author going to provide support for this?

Mike

Hornstar
08-31-2009, 11:40 AM
nah, it looks like it is currently not supported by the author, but I am still really glad they shared it. I am currently about to enable the function on my server that was disabled (due to the tightened security on my server)

goyo
08-31-2009, 02:26 PM
I've followed word by word and enabled the system and exec execution in php.ini...unfortunately the cron job doesn't write anything to data.txt (although it creates the file with 0 byte).

We have our own dedicated servers but the hack doesn't work :(

ibautocommunity
08-31-2009, 03:14 PM
I've followed word by word and enabled the system and exec execution in php.ini...unfortunately the cron job doesn't write anything to data.txt (although it creates the file with 0 byte).

We have our own dedicated servers but the hack doesn't work :(

Try chmodding the directory and/or the data file 777; it's either not writeable or the server does not have support for "sed".

TimberFloorAu
08-31-2009, 10:28 PM
any suggestions as to where autocomplete.php file is ?, not in either of the 2 download packages we have d/l

ibautocommunity
08-31-2009, 10:39 PM
There is no autocomplete.php; there is autosearch.php, that goes into your forum root folder; then the cron job .php file goes into the /forumroot/includes/cron folder; that's it in terms of file uploads.

TimberFloorAu
08-31-2009, 11:11 PM
There is no autocomplete.php; there is autosearch.php, that goes into your forum root folder; then the cron job .php file goes into the /forumroot/includes/cron folder; that's it in terms of file uploads.

Your instructions mate not mine ;)


STEP #2) Configure writeable directory path in PHP files. To do this, open AUTOCOMPLETE.PHP and /includes/cron/AUTOCOMPLETE-GENERATE.PHP files and FIND & REPLACE:

ibautocommunity
08-31-2009, 11:21 PM
Your instructions mate not mine ;)

You are right, I am wrong. AUTOSEARCH.PHP; not AUTOCOMPLETE.PHP in the forums root. Sorry about that.

ibautocommunity
09-01-2009, 04:07 PM
Your instructions mate not mine ;)

Hi Steve, did you ever try this out?

funkmeister
09-02-2009, 12:29 AM
OK, got this working after uninstall/reinstall...

Apostrophes (') are not working for me in Safari/Firefox (pc & mac). I'm seeing question marks (?) instead. Also, and maybe this is how it's written for now; but it doesn't work in individual forum's search boxes (or sub-forums) for me, but only in the main forum (home) search box (navbar area)...is this as it should be for now? If so, a request...please add it's functionality everywhere!

I assume we can change highlight colors etc via CSS (the grey and white color scheme, navy blue highlight etc)? If so, where?

Other than that, it's very cool and works for me now. Thank you.

l_amhed
09-19-2009, 11:45 PM
Hi ! Surely a dumb question but, what is the difference between your hack and the live search hack : https://vborg.vbsupport.ru/showthread.php?t=204517&highlight=search ??

0ptima
09-30-2009, 11:43 PM
Any feedback from members on this hack?

0ptima
10-03-2009, 10:07 PM
I added this hack to my forum and tweaked the SQL

Following will select only open threads.
$ac_sql = "SELECT * FROM ". TABLE_PREFIX ."thread where threadid between ".$startat." AND ".$endat." AND (views > 1000 OR replycount > 1000) AND visible = '1' AND open = '1' ORDER by views DESC";
Following will select threads that are not in forums 1,2,3,4,5.
$ac_sql = "SELECT * FROM ". TABLE_PREFIX ."thread where threadid between ".$startat." AND ".$endat." AND (views > 1000 OR replycount > 1000) AND visible = '1' AND forumid NOT IN ('1', '2', '3', '4', '5') ORDER by views DESC";
Following will select threads that are only in forums 1,2,3,4,5.
$ac_sql = "SELECT * FROM ". TABLE_PREFIX ."thread where threadid between ".$startat." AND ".$endat." AND (views > 1000 OR replycount > 1000) AND visible = '1' AND forumid IN ('1', '2', '3', '4', '5') ORDER by views DESC";
Following will select only open threads that are not in forums 1,2,3,4,5.
$ac_sql = "SELECT * FROM ". TABLE_PREFIX ."thread where threadid between ".$startat." AND ".$endat." AND (views > 1000 OR replycount > 1000) AND visible = '1' AND open = '1' AND forumid NOT IN ('1', '2', '3', '4', '5') ORDER by views DESC";

0ptima
10-04-2009, 12:42 AM
Can this hack be changed so it populates the search box with popular thread titles and not take you directly to the thread?

For example, if someone searches for "Tickle me Elmo", I get a few suggestions. However, when they click on the suggestion, they are taken to very old threads. I would like the thread title to populate the search box and then a regular search is performed based on which auto suggested thread title that was selected.

ExplosiveGFX
10-27-2009, 08:41 PM
I don't understand this:

/ This query needs to be customized on a per site basis
$ac_sql = "SELECT * FROM ". TABLE_PREFIX ."thread where threadid between ".$startat." AND ".$endat." AND (views > 1000 OR replycount > 1000) AND visible = '1' ORDER by views DESC";

the "thread where threadid between" Do I change this, or leave it like that? Hopefully I can get a response, you've replied to me in the past..

ibautocommunity
10-27-2009, 08:55 PM
I don't understand this:

/ This query needs to be customized on a per site basis
$ac_sql = "SELECT * FROM ". TABLE_PREFIX ."thread where threadid between ".$startat." AND ".$endat." AND (views > 1000 OR replycount > 1000) AND visible = '1' ORDER by views DESC";

the "thread where threadid between" Do I change this, or leave it like that? Hopefully I can get a response, you've replied to me in the past..

See the number 1000?

This number means VIEWS/REPLIES need to be MORE THAN 1000 to get into the list. This works for BIG forums, but may not work on a small forum. If you have a small board you can change the 1000 to 100, and scale it even smaller to include all threads.

ExplosiveGFX
10-27-2009, 09:06 PM
I changed it to "3" and tried it.. hmm, it's not working. I ran the scheduled task and it's saying on there, that it's not been run since january.

I'll try again tomorrow...

ibautocommunity
10-27-2009, 09:12 PM
I changed it to "3" and tried it.. hmm, it's not working. I ran the scheduled task and it's saying on there, that it's not been run since january.

I'll try again tomorrow...

You can look at the file system to physically verify that the cron task actually created the text file for you, in the directory you specified. Also have to make sure Jquery is included.

ExplosiveGFX
10-27-2009, 09:20 PM
Well, actually, now I've looked for data.txt (I'd already looked, the code referenced it, I assumed it'd create it) it's not there.

DIR is CHMODDED to 777.

Could it be that I don't have SED on my server? How common is it on Linux/Unix Distros? This feature would be sweet for my site..

But Wait, RSS feeds and anything to do with scheduled tasks aren't working either.. looks like I have a conflict in mods.

ibautocommunity
10-27-2009, 09:21 PM
When you press RUN NOW button on that specific cron job it has to build the data file; if its not - sed is missing or your cron system is not working for some reason. This is a really simple mod.

ExplosiveGFX
10-27-2009, 09:28 PM
hmm, ok, so now the data_1256681036.txt files have appeared in my CHMOD'd dir, but still not autocompleting.

I'll go over the installation process and re-do it all..

ibautocommunity
10-27-2009, 09:34 PM
hmm, ok, so now the data_1256681036.txt files have appeared in my CHMOD'd dir, but still not autocompleting.

I'll go over the installation process and re-do it all..

Oh, I see the problem. You are using the vBNexus product which also loads jquery. In your head template, remove the jquery line you've added for autocomplete product.

Remove this first line:

<script src="autocompfiles/jquery-latest.min.js"></script>

oddmud
10-27-2009, 10:06 PM
Ok,

I've got it creating the text file properly... now when I'm trying to use the search function nothing is happening.

I cut and paste the code in to the template, but still nothing.. it runs, but it does not work on the board.

:(

ExplosiveGFX
10-28-2009, 12:51 AM
Ok,

I've got it creating the text file properly... now when I'm trying to use the search function nothing is happening.

I cut and paste the code in to the template, but still nothing.. it runs, but it does not work on the board.

:(

Same situation here.

grey_goose
10-28-2009, 01:31 AM
Same here. File created, autosearch.php edited... just no results.

oddmud
10-28-2009, 09:33 PM
Oh, I see the problem. You are using the vBNexus product which also loads jquery. In your head template, remove the jquery line you've added for autocomplete product.

Remove this first line:

<script src="autocompfiles/jquery-latest.min.js"></script>

I've tried this too, still not working at all.. :(

Ghostt
12-16-2009, 04:05 PM
i have the same problem like ALL others here, just dont getting the autocomplete shown!

the autocomplete is genereted succesful and so on!...

is it maybe because i havent unix how can i check it?

i use version 3.8.4 , FreeBSD and "Sed" installed

2. problem:
it isautocompleting the searchtext but you get redirected to the topic! how to disable that redirection to the topic?
then it would be perfect

Ghostt
12-17-2009, 11:14 AM
no support=? :@

Ghostt
12-18-2009, 11:50 AM
Any Support In Sight Omg? Wtf!

Ghostt
12-20-2009, 05:56 PM
No Help`??? THIS MOD IS BROKEN! Can someone pls test it with 3.8.4????!!!!

Lynne
12-20-2009, 06:07 PM
No Help`??? THIS MOD IS BROKEN! Can someone pls test it with 3.8.4????!!!!
It clearly says Not Supported which means you are on your own. You should not install unsupported mods unless you are prepared to fix any issues that come up on your board.

Ghostt
12-20-2009, 06:20 PM
in supported mods i get also never help thats realy sucks i pay for that expensive vb and never get help with mods. the moderators should help with mods also if the owner isnt supporting it!

i just need a confirmation that this mod is working!

Paul M
12-20-2009, 07:42 PM
the moderators should help with mods also if the owner isnt supporting it!
No, they should not.

We are not here to support mods, that is the task of the author - and if they choose not to, then thats their choice. This mod is not supported, and your continued rants are not going to change that. If you cannot live with that choice then dont install it - simple as that.

Ghostt
12-20-2009, 08:05 PM
bad argument. not to isntall a mod which someone realy need isn't a option!

Lynne
12-20-2009, 08:21 PM
bad argument. not to isntall a mod which someone realy need isn't a option!
The other options are to write your own or find someone else willing to write it for you. And saying you don't code is a bad argument - I didn't code either until I started a forum and had ideas about what I needed on my site. I either learned to code or went without. And guess what? I learned to code. (OK, I'm not great at it, but I know enough to get by.)

Ghostt
12-20-2009, 08:33 PM
not everyone has time/wants/comprehension to learn codeing. you cant say someone who need support go learn programming... and make your own Boardsoftware

Lynne
12-20-2009, 08:40 PM
not everyone has time/wants/comprehension to learn codeing. you cant say someone who need support go learn programming... and make your own Boardsoftware
OK, but *you* can't say "I don't have the time/wants/comprehension therefore I expect someone else to do it for me."

0ptima
12-20-2009, 11:55 PM
2. problem:
it isautocompleting the searchtext but you get redirected to the topic! how to disable that redirection to the topic?
then it would be perfect

replace this

$("#ac_suggest").result(function(event, data, formatted) {
if(data)
{
location.href = '$vboptions[bburl]/showthread.php?t='+data[1];
}

});


with this (just add '//' in front of location.href)


$("#ac_suggest").result(function(event, data, formatted) {
if(data)
{
// location.href = '$vboptions[bburl]/showthread.php?t='+data[1];
}

});

0ptima
12-20-2009, 11:55 PM
No Help`??? THIS MOD IS BROKEN! Can someone pls test it with 3.8.4????!!!!


Works fine on 3.8.4 PL 1

Ghostt
12-21-2009, 12:11 PM
Works fine on 3.8.4 PL 1

Thanks i test it now ones more on a clean testboard and give you an result by editing this post!
where can be the error?

replace this

$("#ac_suggest").result(function(event, data, formatted) {
if(data)
{
location.href = '$vboptions[bburl]/showthread.php?t='+data[1];
}

});


with this (just add '//' in front of location.href)


$("#ac_suggest").result(function(event, data, formatted) {
if(data)
{
// location.href = '$vboptions[bburl]/showthread.php?t='+data[1];
}

});


very good i rly hope it works. this mod is very usefull

Ghostt
12-21-2009, 02:46 PM
The mod is working on standart VB style!

but not in my boardstyle..

why it isnt working on my style?

/EDIT
i think i can fix it ,it's working on my style but not in the forumhome!

Mike-D
12-21-2009, 04:22 PM
My deepest respect to the Coder and his AddOn, but AJAX Live Search (https://vborg.vbsupport.ru/showthread.php?t=204517) is for me the better choice. It works in all Styles with conjunction in all Plugins without any problems since almost one year ;)

Mike-D
12-21-2009, 04:30 PM
I either learned to code or went without. Well and wise said, Lynne. Exactly this is the point :up:

Ghostt
12-21-2009, 04:34 PM
ok ive found the problem.
there was a conflict with my script "smoothscroll.js" a slow "anker" -scroll script

Ghostt
12-21-2009, 06:02 PM
/EDIT

NOW i see there is a problem with an other mod (https://vborg.vbsupport.ru/showthread.php?t=145187) using jquery!
https://vborg.vbsupport.ru/showthread.php?t=145187

how to solve that conflict?

to delete that part isnt working: <script src="autocompfiles/jquery-latest.min.js"></script>



/////////////////////////

how to sort the results by date and not by views:

$ac_sql = "SELECT * FROM ". TABLE_PREFIX ."thread where threadid between ".$startat." AND ".$endat." AND (views > 200 OR replycount > 200) AND visible = '1' ORDER by views DESC";

"ORDER by date DESC" isnt working

Ghostt
12-22-2009, 03:17 PM
no ideas?

Ghostt
12-24-2009, 03:15 PM
nice still no help -.-

Mike-D
12-24-2009, 03:27 PM
nice still no help -.-You know that this AddOn is NOT SUPPORTED?

Ghostt
12-24-2009, 03:48 PM
no matter i need this mod!

marshal_ramdev
12-24-2009, 04:14 PM
thank you

Ghostt
12-27-2009, 10:22 PM
jquery conflict solved by deleting the other mods jquery.js file and using this fix of the other mod for newest jquery https://vborg.vbsupport.ru/showpost.php?p=1868151&postcount=583


but there is still the question:
/////////////////////////

how to sort the results by date and not by views:

$ac_sql = "SELECT * FROM ". TABLE_PREFIX ."thread where threadid between ".$startat." AND ".$endat." AND (views > 200 OR replycount > 200) AND visible = '1' ORDER by views DESC";

"ORDER by date DESC" isnt working

Ichigo88
09-08-2010, 08:57 PM
work on vb4?

MoMan
09-12-2010, 11:53 PM
Fantastic mod! Installed :D

(it will likely work on vB4, as the only file that really uses any vbulletin code is the cron script)

Ghostt
09-13-2010, 12:09 AM
wrong post sorry