View Full Version : [3.0.3] Add a "Has this already been asked?" Button


reteep
8th November 2004, 05:40 PM
Add a "Has this already been asked?" Button

Adds a button besides the title when creating a new thread which executes a search query of the filled in words. This helps a bit preventing new users post questions which has already been asked in the past.

Author: stormblast - http://www.musiker-board.de/vb

Installation Instructions:

# Open the Admin Control Panel > Styles & Templates > Style Manager > New Posting Template Group > newthread template, and add at the top of it:

<script language="javascript">
<!--
function checktitle(theform) {
if(theform.subject.value==""){
alert("Please enter a topic in the subject field.");
return false; } else {
window.open('search.php?do=process&query='+document.vbform.subject.value+'','javascript_1','toolbar=no,location=no, directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no, width=700,height=400'); }
}
//-->
</script>


# now find this code inside newthread:


<td><input type="text" class="bginput" name="subject" value="$subject" size="40" maxlength="85" tabindex="1" /></td>
<td>&nbsp;&nbsp;</td>


# and replace with:


<td><input type="text" class="bginput" name="subject" value="$subject" size="40" maxlength="85" tabindex="1" /></td>
<td><input type="button" class="button" value="Has this already been asked?" onClick="checktitle(vbform);"></td>


# Save the newthread template and you're done!

Enjoy! :cool:

Floris
8th November 2004, 06:31 PM
YAY

That is really cool.
Good mod and thank you for sharing.
I added 100 karma points to your post for sharing your hard work.
Hope to see more soon!!

Disjunto
8th November 2004, 06:36 PM
amazing mod. probably one of the most useful features a forum could ever need, even though my forum has no need for it at the moment alot out there will

HiDeo
8th November 2004, 06:52 PM
Really nice job

Thanks :D

Karma ++

Montada
10th November 2004, 01:00 AM
It's really a good work bro :)

Thank you so mush ...

Zacharicus
20th November 2004, 11:01 AM
Very sweet. Installed for sure. Very useful :)

hansd
23rd December 2004, 07:56 PM
I think thats a "killer feature". I have to install this :).
Thanks for sharing this cool idea. The only improvement suggestion I have right now is to use the phrase system. But everybody should be able to figure out the necessary changes anyway.

C.Birch
31st December 2004, 11:36 PM
very nice and usefully edit.

reteep
5th January 2005, 12:56 AM
Thanks guys ;)

One small note: If you want to make it searching the titles only replace the above stated code in the newthread template with this one:


<script language="javascript">
<!--
function checktitle(theform) {
if(theform.subject.value==""){
alert("Please enter a topic in the subject field.");
return false; } else {
window.open('search.php?do=process&titleonly=1&query='+document.vbform.subject.value+'','javascript_1','toolbar=no,location=no, directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no, width=700,height=400'); }
}
//-->
</script>


A &titleonly=1 has been added. On big forums this might be much more accurate.

Greets

sb

Estaban
5th January 2005, 01:18 AM
Very good work, great I must say. Handy and neat. +33 karma point's for you.