Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
Split thread title into searchable keyword components Details »»
Split thread title into searchable keyword components
Version: 1.00, by Dean C Dean C is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 12-03-2004 Last Update: Never Installs: 10
 
No support by the author.

[Split thread title into searchable keyword components]

Information
  • [high]vBulletin Version:[/high] 3.0.x

  • [high]Author:[/high] Dean Clatworthy

  • [high]Copyright:[/high] You may use this modification at your own risk. I cannot and will not be held responsible for any damage you may cause to your forums during installation or thereafter. You may not distribute this modification in whole or parts and anyone found doing so faces risk of prosecution. All my modifications are released at vBulletin.org and anyone found releasing them elsewhere also faces risk of prosecution. You may not translate this modification without my prior permission.

  • [high]Donations:[/high] I release my modifications for free. If you wish to donate please contact me and I will give you my details. All donations are graciously appreciated.

What does this modification do?
[size=1]This modification will allow you to split your thread title into the navbar into searchable components. You have three searchable options at the moment but it can easily be modified. These searchable sites are:
  • Your forums search engine (default)
  • Dictionary.com
  • Google

Installation

1/

In showthread.php find:

PHP Code:
$navbits[''] = $thread['title']; 
ABOVE it place:
PHP Code:
// #############################################################################
// START: split thread title into keyword search components
$sites = array(
    
=> '<a href="' $vboptions['bburl'] . '/search.php?q=%1s">%2s</a>',
    
=> '<a href="http://www.google.com/search?q=%1s">%2s</a>',
    
=> '<a href="http://dictionary.reference.com/search?q=%1s">%2s</a>',
);

// selete the number from above of the site you want to search
$chooseoption 1;

// get rid of all stupid characters (sacrifice so we don't break the query string
$ttitle preg_replace("/[^a-z0-9\-_\'\s]/i"''$thread['title']);

// split thread title by any number of commas or space characters
$ttitle preg_split("/[\s,]+/"$ttitle);

// loop through all words replacing the delimeter with the word
if(is_array($ttitle))
{
    foreach(
$ttitle AS $tword)
    {
        
$twords[] = sprintf($sites["$chooseoption"], $tword$tword);
    }

    
// get back into a readable title
    
$thread['title'] = implode(' '$twords);
}
// END: split thread title into keyword search components
// ############################################################################# 
Please Click Install!
If you installed this modifcation please click the install button. It'll help you keep up to date with future releases and important bugfixes, security updates.

Show Your Support

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

Comments
  #2  
Old 12-04-2004, 12:54 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Custom Searches

This modification offers a great flexibility in that you can make other searches. Unfortunately you can only choose one at a time but this post will contain a list of some of the other search options you can choose.

How to make/add a search

You can only use TWO arguements when writing your search addon. These are BOTH the word in question. These are referenced by placing %1s and %2s within your search string. It'll replace these with the word.

What you need to do is find the last search. by default it will be
PHP Code:
    3 => '<a href="http://dictionary.reference.com/search?q=%1s">%2s</a>'
Then below it place the custom search. Be sure to place the X with the next number down.

List of custom searches

Urban Dictionary
PHP Code:
    X => '<a href="http://www.urbandictionary.com/define.php?term=%1s">%2s</a>'
Yahoo Search
PHP Code:
    X => '<a href="http://search.yahoo.com/search?p=%1s">%2s</a>'
Reply With Quote
  #3  
Old 12-04-2004, 01:20 PM
vBTotal vBTotal is offline
 
Join Date: Jul 2004
Location: Computer
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

cool, thanks
Reply With Quote
  #4  
Old 12-04-2004, 01:48 PM
Lethal Lethal is offline
 
Join Date: Feb 2002
Location: PA/USA
Posts: 164
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice
Reply With Quote
  #5  
Old 12-04-2004, 04:12 PM
NightWalk8r NightWalk8r is offline
 
Join Date: Jul 2002
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

very cool.....thanks =D
Reply With Quote
  #6  
Old 12-04-2004, 04:46 PM
glenvw glenvw is offline
 
Join Date: Nov 2001
Posts: 135
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cool!

This will really help me find posts in a hurry.
Reply With Quote
  #7  
Old 12-04-2004, 06:02 PM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That does not work with foreign languages with accent. For example the character " ï " is not recognized, therefore is skipped. Haïfa becomes Hafa in the thread title.

it also skips characters such as "(" etc... basically distorting the title
Reply With Quote
  #8  
Old 12-04-2004, 07:05 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I deliberately did this. Foreign characters are not recognized by vB3's search (when using the query string), and also not by most sites which allow input from the query string. The same with other characters like brackets
Reply With Quote
  #9  
Old 12-04-2004, 07:58 PM
okc okc is offline
 
Join Date: Sep 2004
Posts: 99
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Dean - thx so much for working on this - I changed the text in my showthread.php then replaced the old file with the new - I don't see a change on my boards - did I do s/thing wrong?

Cheers
Reply With Quote
  #10  
Old 12-04-2004, 08:36 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by okc
Dean - thx so much for working on this - I changed the text in my showthread.php then replaced the old file with the new - I don't see a change on my boards - did I do s/thing wrong?

Cheers
I don't know is the honest answer. Are you using vB3.0.3? Make sure you added the code in the right place? I just applied this modification to my second test board and it works there too so it must be something your end
Reply With Quote
Reply

Thread Tools

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 06:33 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09311 seconds
  • Memory Usage 2,303KB
  • 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
  • (5)bbcode_php
  • (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