Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Add a "Has this already been asked?" Button Details »»
Add a "Has this already been asked?" Button
Version: 1.00, by reteep reteep is offline
Developer Last Online: Dec 2013 Show Printable Version Email this Page

Version: 3.5.0 Rating:
Released: 10-09-2005 Last Update: 10-10-2005 Installs: 35
Template Edits
 
No support by the author.

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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 10-10-2005, 11:00 AM
predatorkill predatorkill is offline
 
Join Date: Apr 2005
Location: Greece
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.

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*
Reply With Quote
  #3  
Old 10-10-2005, 12:23 PM
reteep reteep is offline
 
Join Date: Mar 2004
Location: Germany
Posts: 164
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 10-10-2005, 02:06 PM
hotrod1 hotrod1 is offline
 
Join Date: Apr 2005
Posts: 112
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great idea, thanks!
Reply With Quote
  #5  
Old 10-10-2005, 02:11 PM
predatorkill predatorkill is offline
 
Join Date: Apr 2005
Location: Greece
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

below in the photo attached you can see what i mean...
Reply With Quote
  #6  
Old 10-10-2005, 04:00 PM
MrNase MrNase is offline
 
Join Date: May 2003
Location: Germany
Posts: 670
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #7  
Old 10-10-2005, 06:11 PM
predatorkill predatorkill is offline
 
Join Date: Apr 2005
Location: Greece
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

problem solved,now it's aligned perfectly!!

thank you very much...
Reply With Quote
  #8  
Old 10-10-2005, 06:48 PM
reteep reteep is offline
 
Join Date: Mar 2004
Location: Germany
Posts: 164
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the input! Changed the instructions. As for the &nbsp; -> on my forum it works
Reply With Quote
  #9  
Old 10-10-2005, 07:34 PM
MrNase MrNase is offline
 
Join Date: May 2003
Location: Germany
Posts: 670
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Stupid me

I had a typo in my post.. It must go directly ABOVE </head>
Reply With Quote
  #10  
Old 10-10-2005, 11:20 PM
nailerpa nailerpa is offline
 
Join Date: Aug 2005
Posts: 38
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:45 AM.


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.04766 seconds
  • Memory Usage 2,298KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete