vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=155)
-   -   Add a "Has this already been asked?" Button (https://vborg.vbsupport.ru/showthread.php?t=98032)

reteep 10-09-2005 10:00 PM

Add a "Has this already been asked?" Button
 
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: Andreas Kraus - sunlab / Musiker-Board

Installation Instructions:

# Open the Admin Control Panel > Styles & Templates > Style Manager > New Posting Template Group > newthread template, and directly above </head>:

Code:

<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>

# now find this code inside newthread:

Code:

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

# and replace with:

Code:

<td><input type="text" class="bginput" name="subject" value="$subject" size="40" maxlength="85" tabindex="1" /></td>
<td>&nbsp;<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:

predatorkill 10-10-2005 11:00 AM

i ve installed this mod...the only problem is that the box "have this being asked before?" is not aligned correctly with the "Title" box.It appears slightly below the "Title" box...I think u are missing an align= command.I didnt tested it myself tho,i m not an expert in coding. :rolleyes:

please note that the part of the code:
<td><input type="text" class="bginput" name="subject" value="$subject" size="40" maxlength="85" tabindex="1" /></td>
<td>&nbsp;&nbsp;</td>

Cannot be found through the "Search in Template" in template editor.(admin cp)

I ve use firefox ctrl+f to find the lines.It found only <td><input type="text" class="bginput" name="subject" value="$subject" size="40" maxlength="85" tabindex="1" /></td> so there are some spaces missing betwen this and <td>&nbsp;&nbsp;</td> .

mod works perfectly tho!!!

Thanx!
*installed*

reteep 10-10-2005 12:23 PM

Hey there, thanks for your input.

For me it's perfectly aligned or are you talking about the slight 1px at the top? It looks better that way imo (like on the screenshot) but that's just about my taste ;)

hotrod1 10-10-2005 02:06 PM

Great idea, thanks!

predatorkill 10-10-2005 02:11 PM

below in the photo attached you can see what i mean...

MrNase 10-10-2005 04:00 PM

Quote:

Originally Posted by predatorkill
below in the photo attached you can see what i mean...


Just delete this &nbsp; found in

Code:

<td>&nbsp;<input type="button" class="button" value="Has this already been asked?" onClick="checktitle(vbform);"></td>

Author:
The first point of your instruction is wrong.. the code must be added after:
Code:

</head>
and before:
Code:

<body$onload>

predatorkill 10-10-2005 06:11 PM

problem solved,now it's aligned perfectly!!

thank you very much...

reteep 10-10-2005 06:48 PM

Thanks for the input! Changed the instructions. As for the &nbsp; -> on my forum it works :o

MrNase 10-10-2005 07:34 PM

Stupid me :(

I had a typo in my post.. It must go directly ABOVE </head> :D

nailerpa 10-10-2005 11:20 PM

Does the Search function work for everyone? I typed in, verbatim, the title of a previous post. The search function said that nothing was found with those words in the title. Am I missing something?

Steve A.
Site Admin, I.T. Help Community

reteep 10-11-2005 05:21 AM

Quote:

Originally Posted by nailerpa
Does the Search function work for everyone? I typed in, verbatim, the title of a previous post. The search function said that nothing was found with those words in the title. Am I missing something?

Steve A.
Site Admin, I.T. Help Community

By default it only searches the title. You can change that here:

Quote:

window.open('search.php?do=process&titleonly=1&que ry='+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'); }
Just remove the &titleonly=1 to search the full posts.

Tony G 10-11-2005 05:27 AM

Please attach a text file with the instructions too. Thanks. :)

reteep 10-11-2005 05:59 AM

Quote:

Originally Posted by Tony G
Please attach a text file with the instructions too. Thanks. :)

Ok, done..

rb290 10-13-2005 04:55 PM

When I click on it nothing happens....?

The Wise One 10-13-2005 08:34 PM

installed. thanks.

reteep 10-14-2005 07:39 AM

Quote:

Originally Posted by rb290
When I click on it nothing happens....?

Did you implent the JavaScript Code correctly?

mholtum 10-14-2005 10:08 AM

works great for me thanks!

Yahookan 05-17-2006 11:07 PM

Old but great.

:)

GamerJunk.net 05-20-2006 06:20 PM

Great idea

reteep 07-13-2006 07:50 AM

Just FYI: Tested on vB 3.6, running fine!

techartist1 11-08-2006 09:20 PM

great mod!

SoftDux 05-11-2007 10:23 AM

Great hack, thank you :)

ArchangelX 08-18-2007 02:15 AM

Great edit! I've changed my button to read "Search for similar topics?". Thanks!


All times are GMT. The time now is 04:49 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.01874 seconds
  • Memory Usage 1,762KB
  • 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
  • (6)bbcode_code_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (23)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete