vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=134)
-   -   [3.0.3] Add a "Has this already been asked?" Button (https://vborg.vbsupport.ru/showthread.php?t=90048)

reteep 11-07-2004 10:00 PM

[3.0.3] 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: 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:

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&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><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-11-2004 12:01 PM

That is a BRILLIANT idea!

You are the man!

Tony G 11-12-2004 04:05 AM

Wow, this is indeed a **** great idea. Thank you for sharing! :)

M1th 11-15-2004 05:17 PM

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 11-28-2004 11:50 PM

Does not work for me. I click on it and NOTHING!

mholtum 11-29-2004 02:09 AM

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 12-17-2004 08:24 AM

Can you post the URL of your board?

Spinball 01-10-2005 07:01 AM

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 01-06-2006 01:59 PM

Will this work with vBulletin 3.5.x?


All times are GMT. The time now is 12:35 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.01592 seconds
  • Memory Usage 1,725KB
  • 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
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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