vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   New Posting Features - [Ajax] Check for similar thread before posting a new one (https://vborg.vbsupport.ru/showthread.php?t=151714)

MrNase 07-07-2007 10:00 PM

[Ajax] Check for similar thread before posting a new one
 
You love the 'similar threads' function and you are sick of duplicate threads just because your users don't use the search function?

Why not just combine them?

This Add-on will grab the thread title the user typed in and it will load a small box (using Ajax magic ;)) with 5 similar threads just like the 'similar threads' function that you can normally find under an already posted thread.

The box also tells the user to search through the similar threads first BEFORE starting a new one.


Features:
- no edits whatsoever needed, just import the product file, enable the Add-on and it works (well, it should ;))
- you can turn it off for certain forums or
- you can turn it off completely without leaving any code that messes your templates/files
- it can be translated
- don't like it anymore? Remove the product and you'll never see that Add-on again


Known issues:
- none


Things to consider:

It uses jQuery to get the information from ajax.php. jQuery is great and you can do many great things with it and unlike the vBulletin method it's quite easy to understand. :)
The jQuery file is compressed and only 20kb large.
To download the file, visit the homepage at http://jquery.com/
The link to download the file is on the right hand side.

Here's the version I use: http://code.google.com/p/jqueryjs/do....1.3.1.pack.js

Just download it and put it into the 'clientscript' folder without renaming the file.


Installation:
Download jQuery as described above.
Import the attached file using the Product Manager. Go to your vBulletin settings and search for 'Check for similar threads?'. Enable it. :)


Important:
It adds 2 new templates, it changes 1 template and it edits 2 files. I highly doubt that it will break you vBulletin but do a back-up and be on the safe side.



Version history:
1. initial release
2. current release
*** fixed some browser issues. The attached file is up to date.





How to fix the Opera problems in the first release:
The first release of this Add-on didn't work on Opera. To fix the problems, please follow these steps:
Open the template 'mrnasesimilarthreadcheck_header' and REPLACE the content with this code:
HTML Code:

    <script type="text/javascript" src="clientscript/jquery-1.1.3.1.pack.js"></script>
    <script type="text/javascript">
        $(function(){
            $("#inputthreadtitle").bind("blur", function(){
                var value =$(this).val();
                $('td#similarthreadcheckcontent').html('<img src="$stylevar[imgdir_misc]/13x13progress.gif" />');
                $.ajax({
                    type: "GET",
                    url: "ajax.php",
                    data: "do=getsimilarthreads&title="+value,
                    success: function(msg){
                        $('td#similarthreadcheckcontent').html(msg);
                        }
                });
            });
        });
    </script>

The attached file is up to date. :)


Support will only given to those who have clicked 'install'. :)

Distance 07-08-2007 08:36 PM

Looks good, thanks.

Robi_Kenobi 07-08-2007 09:01 PM

HI this is great! *installed*

But is it possible to change the design of the threads shown?
I would like a more plain style to show the threads.

Or das it use another board function and just redirect the output?

Smoothie 07-08-2007 09:12 PM

Installed but, nothing in the setting for me either........

MrNase 07-08-2007 09:12 PM

Quote:

Originally Posted by Robi_Kenobi (Post 1286147)
HI this is great! *installed*

But is it possible to change the design of the threads shown?
I would like a more plain style to show the threads.

Or das it use another board function and just redirect the output?

It uses a slighty modified version of a default template so it should use your forum's colors. :)
But you can edit the appearance simply by editing the templates 'showthread_similarthreads_ajax' and 'showthread_similarthreadbit_ajax'. :)

Smoothie 07-08-2007 09:14 PM

Quote:

Originally Posted by MiahBeSmokin420 (Post 1286155)
sorry never mind i found it in there im going to test now and if all goes well then ill delete my posts anc click install

never mind found it. Hidden quite well I might add. ;)

MiahBeSmokin420 07-08-2007 09:15 PM

Quote:

Originally Posted by Smoothie (Post 1286158)
Installed but, nothing in the setting for me either........

the setting are in the message and posting options



but yo i got it all set up and i tried 2 diffrent versions of that pack thing you got to put in the client script

and both versions you posted links for


but yet it is not working correctly

i dont know whats wrong with it but it dosent say anything aobut finding any other threads
or anything like that

it just say it will search and yada yada yada

MrNase 07-08-2007 09:15 PM

Quote:

Originally Posted by Smoothie (Post 1286158)
Installed but, nothing in the setting for me either........


That might be a problem with the datastore. :)

Try running this link: http://www.yoursite.com/admincp/inde...buildbitfields

(Don't forget to change the url to yoursite ;))

Smoothie 07-08-2007 09:16 PM

tested and works quite well so far. Good one!

MiahBeSmokin420 07-08-2007 09:18 PM

ya im uninsalling this crap

thanks for the though of the mod though

unless ou can figure out why it dose not accually run the search stuff

then i wount be useing it

but thanks for the idea of it and good luck to the other that use it

Smoothie 07-08-2007 09:19 PM

Sorry for all the confusion. The settings are there. Didn't know to look for them under message posting and editing options....most products I've installed add the settings at the end of the list.

MiahBeSmokin420 07-08-2007 09:20 PM

ya same but is it accually working for you to the point that it accually searches for crap?

Robi_Kenobi 07-08-2007 09:23 PM

Seems only to work in Firefox.

In IE and Opera nothing happens.

IE gives me an Error Code in Line 372.

MiahBeSmokin420 07-08-2007 09:25 PM

ok thanks for letting me know that im test in FF if it works in there and not ie im not useing it cause i use ie and have my site restricted to only ie

Smoothie 07-08-2007 09:34 PM

Quote:

Originally Posted by MiahBeSmokin420 (Post 1286168)
ya same but is it accually working for you to the point that it accually searches for crap?

Yup!

steven s 07-08-2007 09:34 PM

Quote:

Originally Posted by Robi_Kenobi (Post 1286171)
Seems only to work in Firefox.

In IE and Opera nothing happens.

IE gives me an Error Code in Line 372.

Not working on FF (Mac).

MrNase 07-08-2007 09:35 PM

Quote:

Originally Posted by Robi_Kenobi (Post 1286171)
Seems only to work in Firefox.

I'll look into it, thanks for the feedback. :)

Smoothie 07-08-2007 09:40 PM

Tested in FF, Camino, Safari and Opera on the Mac. Not working in Safari or Opera. Need a fix or will need to uninstall....

MiahBeSmokin420 07-08-2007 09:41 PM

Quote:

Originally Posted by MrNase (Post 1286186)
I'll look into it, thanks for the feedback. :)

yesir

if you fix it for IE

then let me know cuase it looks very very intresting and like something i would like to have on my forums

Smoothie 07-08-2007 09:41 PM

Quote:

Originally Posted by 1996 328ti (Post 1286185)
Not working on FF (Mac).

Works for me with FF on the Mac. Mac 10.4.10 and FF 2.0.0.4

4x4 Mecca 07-08-2007 10:39 PM

not working here... FF and vista. It shows the message, but doesn't search for anything

Brandon Sheley 07-08-2007 11:03 PM

Quote:

Originally Posted by Smoothie (Post 1286184)
Yup!

doesn't work for me :(

Lizard King 07-09-2007 12:08 AM

Doesn't work for me also.

LPH2004 07-09-2007 12:25 AM

I get the message that there will a search but it does not happen.

FreshFroot 07-09-2007 01:18 AM

this is REALLY GREAT!!

Smoothie 07-09-2007 01:29 AM

The problem is this does not work with all browsers....but when it does work it's good. So, I had to uninstall until this gets fixed.

Carlos2 07-09-2007 02:45 AM

Great hack ;)

RMS-Chef 07-09-2007 04:25 AM

Nice.
I would like to see a button or small link to click in order to initiate the search rather than having it automatically search. I have a pretty large forum and although I have not yet installed it due to the reported browser issues, I can only guess that it may have a performance impact if it auto searches every time. A button to initiate would probably reduce usage and server impact.

Thanks again, will keep an eye on this one.

Coders Shack 07-09-2007 07:42 AM

nice!!

projectego 07-09-2007 08:25 AM

[high]* projectego clicks install :D[/high]

MrNase 07-09-2007 08:56 AM

I tested it on FF (latest) using my Mac and it works perfectly. I tested it yesterday using FF (latest) on Windows XP and it also worked perfectly.

I reported the Opera problems to the jQuery developers and I am still waiting for feedback.

RMS-Chef: Yes, that sounds good. I'll take a look at it. I'll also modify the query which loads the similar threads to make it faster.

As for the problem that it loads without showing the similar threads I can only guess that it comes because of the amount of threads your community has.

To help me find out more about this problem please go to http://yourforums.com/ajax.php?do=ge...ads&title=test and look if you see the table with the similar threads. :)

Lizard King 07-09-2007 09:17 AM

I tested this on two different live boards and my test board. It doesn't work with any browser. The url you gave returns similar threads however within the thread it doesn't search anything with any browser.

Smoothie 07-09-2007 10:50 AM

Quote:

Originally Posted by MrNase (Post 1286562)
I tested it on FF (latest) using my Mac and it works perfectly. I tested it yesterday using FF (latest) on Windows XP and it also worked perfectly.

I reported the Opera problems to the jQuery developers and I am still waiting for feedback.

RMS-Chef: Yes, that sounds good. I'll take a look at it. I'll also modify the query which loads the similar threads to make it faster.

As for the problem that it loads without showing the similar threads I can only guess that it comes because of the amount of threads your community has.

To help me find out more about this problem please go to http://yourforums.com/ajax.php?do=ge...ads&title=test and look if you see the table with the similar threads. :)

Did you test with safari? Because I tested this with Safari on the Mac and it did not work.

Mecho 07-09-2007 11:13 AM

installed but i can not see anything in vboption .

* i used this link : http://www.yoursite.com/admincp/inde...buildbitfields
* uninstalled and installed again !

but still nothing in vboption ... any idea ?

thanks in advance

aggiefan 07-09-2007 12:10 PM

marking this so i remember to come back to it.... would put this into use if/when the bugs get fixed. sounds like a really good idea.

Smoothie 07-09-2007 12:46 PM

Quote:

Originally Posted by Mecho (Post 1286633)
installed but i can not see anything in vboption .

* i used this link : http://www.yoursite.com/admincp/inde...buildbitfields
* uninstalled and installed again !

but still nothing in vboption ... any idea ?

thanks in advance

look under message posting options.

WiseOne38221 07-09-2007 02:09 PM

I DID set it to run in message posting and editiing options, put the file required in clientscript folder, it does NOTHING. I see the message, but it does not work for some reason. IE7, Windows XP, 3.6.7 PL1

Mecho 07-09-2007 02:17 PM

Quote:

Originally Posted by Smoothie (Post 1286674)
look under message posting options.

Thanks mate.. i got it now .. thank u

WiseOne38221 07-09-2007 02:21 PM

message posting and editing options...is wher it is at the bottom once you import the product. I can get that all working and then go to make a new thread and it does NOT do anything.

AzzidReign 07-09-2007 02:21 PM

This looks great! Maybe add to the bottom of the results: click here to see all results. Or something like that since there are usually more than 5 similar threads...at least on my site.


All times are GMT. The time now is 02:04 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01620 seconds
  • Memory Usage 1,830KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete