PDA

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


reteep
08 Nov 2004, 15:47
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! :p

MrToasty
11 Nov 2004, 14:01
That is a BRILLIANT idea!

You are the man!

Tony G
12 Nov 2004, 06:05
Wow, this is indeed a **** great idea. Thank you for sharing! :)

M1th
15 Nov 2004, 19:17
I've made it so it searches for titles of the threads. It's better this way, IMO.

Thanks for the mod though.

imported_1yesfan
29 Nov 2004, 01:50
Does not work for me. I click on it and NOTHING!

mholtum
29 Nov 2004, 04:09
I edited it EXACTLY as posted. When I click the button, nothing happens and I see in the lower corner of my browser "error on page"

reteep
17 Dec 2004, 10:24
Can you post the URL of your board?

Spinball
10 Jan 2005, 09:01
You might want to add instructions on how to include thread titles in the search and you have a few erroneous spaces in the javascript line which need to be removed.
Thanks

michaelbenson
06 Jan 2006, 15:59
Will this work with vBulletin 3.5.x?