Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
[Ajax] Best Answer Details »»
[Ajax] Best Answer
Version: 1.9, by emath emath is offline
Developer Last Online: Jul 2022 Show Printable Version Email this Page

Category: Board Optimization - Version: 4.2.x Rating:
Released: 04-27-2016 Last Update: 07-01-2016 Installs: 17
DB Changes Uses Plugins
Re-useable Code Additional Files Translations  
No support by the author.

This is a quite simple and effective mod to select a post as Best Answer .

see readme file before installing .

Donations are always welcome

------------------------------------------------
## Features ##
  • Allow to select/unselect post as 'best answer'
  • Best answer is bumped ( duplicated ) to the top
  • Best answer post has an indication 'best answer' on top of the post
  • [SOLVED] prefix is added to threads with best answer, this will not replace any exiting prefix.
  • Can be configured to apply for specific forums only
  • By default, only the one who opened the thread can select/unselect a post as best answer
  • Pemissions allowing select as 'best answer' can be add for specific user groups
  • on/off configuration

## HOW TO INSTALL ##
  1. upload the content of the upload folder into your forum root directory
  2. import the XML file as new product
  3. go to settings -> options -> best answer and configure the product as u wish

## Style - css ##

The mod doesn't come with any particular css with it, as each forum has its own style.
With that said, all of the mod related html elements were attached to class so adding css is easy .

In addition, there is example.css file which can be used for those who want the css i wrote .
just add it to additional.css or wherever u like this css to be .

## Compatability ##

was tested over vB4.2.2 nad vB4.2.3 but should work with any vB4.x .

use this at your own risk, always backup your database before installing any new mod !

## Changelog ##

V1.9

- bug fix, handle deleted posts

V1.8

- bug fix : show best answer only in first page
- bug fix : first post in second page could not be selected as 'best answer'
- bug fix in plugins ( add global $vbulletin; at top of each plugin )
- verified that works with 4.2.3

V1.3

- bug fix : change exection order of plugin from 1 to 5

V1.2

- changed loading script from 'async' to 'defer'
- add uninstall code

## license ##

MIT license

## Q & A ##

How can i find my forum ids ?

read here : http://www.vbulletin.com/forum/forum...-id-of-a-forum

Download Now

File Type: zip best answerV1.9.zip (37.8 KB, 75 views)

Screenshots

File Type: jpg select.JPG (14.0 KB, 0 views)
File Type: jpg thread_solved.JPG (31.1 KB, 0 views)
File Type: jpg unselect_and_post_indication.JPG (15.6 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
3 благодарности(ей) от:
MarkFL, S!p, TheLastSuperman

Comments
  #2  
Old 04-29-2016, 04:25 AM
mysimsek mysimsek is offline
 
Join Date: Dec 2010
Location: Turkey
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't understand the changes to the database
Reply With Quote
  #3  
Old 04-29-2016, 04:49 AM
emath emath is offline
 
Join Date: Sep 2008
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just mentioned what database changes there is, I've removed that section .
Reply With Quote
  #4  
Old 04-29-2016, 06:47 AM
Sforums Sforums is offline
 
Join Date: Dec 2010
Posts: 142
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Using 4.1.0 myself. Upon installing it took almost 5 minutes to open single topic.
Uninstalled.
Reply With Quote
  #5  
Old 04-29-2016, 08:04 AM
emath emath is offline
 
Join Date: Sep 2008
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Sforums View Post
Using 4.1.0 myself. Upon installing it took almost 5 minutes to open single topic.
Uninstalled.
I'm not familiar with any such errors.
By topic u meant thread ? And did the installation went good ?
Please provide a link to your forum ( if u have a test forum, PM it to me and I will check it, I don't have a vb4.1 and I cannot reproduce it over 4.2)
Reply With Quote
  #6  
Old 04-29-2016, 05:56 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello fellow math enthusiast!

You could remove the need for editing the "SHOWTHREAD" template by adding a plugin hooked at "parse_templates" with the following Plugin PHP Code:

PHP Code:
if (THIS_SCRIPT === 'showthread')
{
    
$javascript '<script type="text/javascript" src="./bestAnswer/bestAnswer.js?version=0"></script>';
    
$template_hook['headinclude_javascript'] .= $javascript;

In the conditional, you should add any other conditions you want to be true before the script is added, such as whether the product is enabled, if the browsing user has permission to use the button, etc.

Adding the version number parameter (which you should increment anytime you change that .js file when you upload an update of this product here) will ensure the new version is loaded by browsers, rather than using the cached older version which browsers will do unless the cache is cleared.

Manual template edits will keep some folks from trying a product (hacking templates is rightfully frowned upon by many, and in addition template hacks have to be done for each active style), and so I wanted to offer a little help to remove that need.
Reply With Quote
Благодарность от:
emath
  #7  
Old 04-29-2016, 08:04 PM
emath emath is offline
 
Join Date: Sep 2008
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yeah i know, I've also could use showthread_below_posts template hook,

I didn't find it right to add a hook for script src tag, because then it will be 'hidden' and some like to bundle and minify all their javascript files, but i guess you are right.

I've added async attirbute to the script tag so it won't block any content .

The product has been updated and now no template edits are needed .

Thanks .
Reply With Quote
  #8  
Old 04-30-2016, 06:05 AM
mysimsek mysimsek is offline
 
Join Date: Dec 2010
Location: Turkey
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

unfortunately it did not work
Reply With Quote
  #9  
Old 04-30-2016, 06:12 AM
emath emath is offline
 
Join Date: Sep 2008
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mysimsek View Post
unfortunately it did not work
What didnt work ? Could u explain what did u try to do and what went wrong ?
Reply With Quote
  #10  
Old 05-01-2016, 03:03 PM
emath emath is offline
 
Join Date: Sep 2008
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

mysimsek, maybe the update will fix your issue

## Changelog ##

V1.2

- changed loading script from 'async' to 'defer'
- add uninstall code
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 01:50 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.05055 seconds
  • Memory Usage 2,336KB
  • Queries Executed 24 (?)
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
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (4)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (4)postbit_attachment
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete