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
Mark Threads As "Solved" Details »»
Mark Threads As "Solved"
Version: 2.0.1, by Eric Eric is offline
Developer Last Online: Jun 2023 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 4.0.x Rating:
Released: 02-03-2010 Last Update: 07-29-2010 Installs: 304
DB Changes Uses Plugins Template Edits
Re-useable Code Additional Files  
No support by the author.

My time is very limited these days, with my full time job. I have marked this mod as re-usable code, if any other coder wishes to continue work on it. I may still try to support this mod as time permits.



If you use this modification, please >> Mark As Installed, and consider Nominate for MOTM and Support Developer <<


What is this!?
This modification will allow you & your members (based on usergroup permissions) to mark a thread as "Solved". It will add the prefix "[SOLVED]" to the thread title, and if set in the admincp - it will also close the thread.

Current Version
2.0.1.

Features flagged for future version(s):
  • Thread starter can choose to solve a thread, and input the username of who solved it - that user would receive rep. points. (admin-configurable amount of rep. points)
  • Given the above - include count of threads a user has solved in postbit & profile
  • Option to move the thread to a specific forum when a thread is "Solved"
  • Possibly figure out a way to automate everything on install - so there are no template edits.
And anything else that is suggested

Will this work on x.x.x ??
Unless otherwise stated, this will work on all 4.0.x versions. This will not work on 3.x.

Sounds cool. How do I install?
  1. Extract the zip, you should have the following directories/files:

    Code:
    /
    |_ install.html
    |_ product-solvedthread.xml
    
    /upload/
    |_ solved.php
    
    	/upload/images/
    		/buttons/
    		|_ marksolved.gif
    
    	/upload/includes/
    		/xml/
    		|_ bitfield_solvedthread.xml
  2. Upload: (in the below instructions 'yourforum' would be where you have vBulletin installed)
    • /upload/solved.php to /yourforum/solved.php
    • /upload/images/buttons/marksolved.gif to /yourforum/images/buttons/marksolved.gif (upload to each style folder, if you have more than one style)
    • /upload/includes/xml/bitfield_solvedthread.xml to /yourforum/includes/xml/bitfield_solvedthread.xml
  3. Import the product, product-solvedthreads.xml by going to: AdminCP -> Plugins & Products -> Manage Products -> [Add/Import Product]
  4. Make the following template edits to all of your installed styles:

    SHOWTHREAD

    Find:
    HTML Code:
    					<vb:if condition="$show['addpoll']">
    						<li><a href="poll.php?{vb:raw session.sessionurl}do=newpoll&amp;t={vb:raw threadid}">{vb:rawphrase add_a_poll_to_this_thread}&hellip;</a></li>
    					</vb:if>
    Add after:
    HTML Code:
    					<vb:if condition="$show['solvedthread']">
    						<li><a href="solved.php?{vb:raw session.sessionurl}do=marksolved&amp;t={vb:raw threadid}">{vb:rawphrase solvedthread_marksolved}&hellip;</a></li>
    					<vb:else />
    						<vb:if condition="$show['solvedthread_unsolve']">
    						<li><a href="solved.php?{vb:raw session.sessionurl}do=markunsolved&amp;t={vb:raw threadid}">{vb:rawphrase solvedthread_markunsolved}&hellip;</a></li>
    						</vb:if>
    					</vb:if>
  5. Set options in AdminCP > Settings > Options > Solved Threads
  6. Edit Solved Threads Permissions > Can Mark Threads as Solved for each usergroup.
  7. To setup the forums it can be used in, follow the instructions in this post.

Upgrade
  1. Re-import the product, product-solvedthreads.xml, with "Allow Overwrite" set to yes
  2. Upload the files/folders in the "upload" folder, allowing it to overwrite the old files.

That's it! Enjoy!

Changelog
2.0.1 - July 30, 2010
- Changes to solved.php, to check for errors while saving thread, changed how threadinfo is pulled.
- Changes to bitfield_solvedthread.xml, removed the "install" attribute, doesn't seem to work anyway.
- Changes to product-solvedthread.xml, install process. Gave the install a small delay between rebuilding prefix datastore (after adding prefixset), and creating prefix.
- Changes to product-solvedthread.xml, plugin. Removed check for can_use_prefix function, as vB 3.8 + includes it, and this mod is for 4.0

2.0.0 - February 3, 2010
- Updated to vBulletin 4

1.1.2 - January 15, 2010
- Updated the product file, permissions, and phrases. This should, hopefully, resolve the blank page problems, along with the permission not showing up for usergroups.

1.1.1 - July 21, 2009
- Updated the product plugins and phrases, this should solve the blank page problem, and the problem of the option not showing in Admincp for ug permissions.

1.1.0 - April 14, 2009
- Small updates to xml file, no version # change. If it works for you, no need to do anything.
- If you have problems uninstalling, please see this post.

1.1.0 - April 12, 2009
- Updated for 3.7 & 3.8
- Now uses the built-in Thread Prefix system
- Instead of 'excluding' forums, since using the Thread Prefix system, you can choose which forums this will be shown in.

1.0.1 - July 12, 2007
- Added the ability to unsolve a thread.
- Added the ability to exclude this in certain forums
- Added the ability to change the prefix in that acp

1.0.0 - June 8, 2007
- Initial release.



If you use this modification, please >> Mark As Installed, and consider Nominate for MOTM and Support Developer <<



NOTE: This mod is marked "unsupported", but I'll try my best (as time permits) to help those who have marked as installed.

Download Now

File Type: zip solved_threads_2.0.0.zip (7.8 KB, 370 views)
File Type: zip solved_threads_2.0.1.zip (8.0 KB, 1256 views)

Screenshots

File Type: jpg admincp_edit_prefix_forums.jpg (45.7 KB, 0 views)
File Type: jpg admincp_options.jpg (66.9 KB, 0 views)
File Type: jpg admincp_thread_prefixes.jpg (41.2 KB, 0 views)
File Type: jpg admincp_ug_perms.jpg (136.2 KB, 0 views)
File Type: jpg showforum_solvedthread.jpg (87.5 KB, 0 views)
File Type: jpg showthread_marksolved.jpg (74.5 KB, 0 views)
File Type: jpg showthread_markunsolved.jpg (74.6 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
4 благодарности(ей) от:
babyv0x, findingpeace, FReeSTER, Ov3rrun

Comments
  #172  
Old 09-13-2013, 04:51 PM
Tim Wheatley's Avatar
Tim Wheatley Tim Wheatley is offline
 
Join Date: Nov 2001
Location: England
Posts: 489
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Had to alter the uninstall code to get it to uninstall without the fatal error.
Reply With Quote
  #173  
Old 09-15-2013, 01:29 PM
karel1985 karel1985 is offline
 
Join Date: Mar 2007
Location: Belgium
Posts: 101
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Eric,

As user of your mod since the beginning, i'm wondering if you are working on a vb5 version? I would really need to have this working in vb5...

Without this mod, we will never upgrade i guess, we can't live without...
Reply With Quote
  #174  
Old 09-15-2013, 01:59 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I believe another developer would have to pick up work on the mod to port it to vB5 as Eric said, he is very limited with time as of now.
Reply With Quote
  #175  
Old 02-18-2014, 05:53 PM
PrivateFTA PrivateFTA is offline
 
Join Date: Jul 2010
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

let me know if I can do several way to use a new place to settle and accepted our
Reply With Quote
  #176  
Old 05-01-2014, 07:53 AM
djvj djvj is offline
 
Join Date: May 2009
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this work on 4.2.2?

NM, just tested and it works fine.
Reply With Quote
  #177  
Old 05-01-2014, 09:02 AM
john7911 john7911 is offline
 
Join Date: Feb 2013
Posts: 258
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I install it on 4.2.2 but I don't see it in the list.
Reply With Quote
  #178  
Old 06-27-2014, 06:10 AM
aminp30 aminp30 is offline
 
Join Date: Jul 2013
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi
thank you Eric. very nice hack

would you please tell me is that possible to use this hack as a button?
I need to add a button in first post of thread to let starter set solved or not.

best regards
Reply With Quote
  #179  
Old 08-02-2014, 06:08 AM
fxdigi-cash fxdigi-cash is offline
 
Join Date: Jul 2012
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by aminp30 View Post
Hi
thank you Eric. very nice hack

would you please tell me is that possible to use this hack as a button?
I need to add a button in first post of thread to let starter set solved or not.

best regards
maybe you didn't read whole main post...

from there, this code you need to add it to your showthread template to see the button:

HTML Code:
<vb:if condition="$show['solvedthread']">                         <li><a href="solved.php?{vb:raw session.sessionurl}do=marksolved&amp;t={vb:raw threadid}">{vb:rawphrase solvedthread_marksolved}&hellip;</a></li>                     <vb:else />                         <vb:if condition="$show['solvedthread_unsolve']">                         <li><a href="solved.php?{vb:raw session.sessionurl}do=markunsolved&amp;t={vb:raw threadid}">{vb:rawphrase solvedthread_markunsolved}&hellip;</a></li>                         </vb:if>                     </vb:if>
Reply With Quote
  #180  
Old 08-23-2014, 12:01 PM
majickal majickal is offline
 
Join Date: Sep 2011
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I can confirm this is working on 4.2.2 Patch Level 1
Reply With Quote
  #181  
Old 08-24-2014, 07:55 AM
majickal majickal is offline
 
Join Date: Sep 2011
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there anyway to remove the following prefix option when starting a new thread in a Q & A forum?



I guess, I'm wondering if there is some form of identifier I can test against to hide this option when a forum is detected that is running the solved feature.

I found this:



But am currently unsure how it is evaluated when the newthread template is evaluated.

The following code block shows the section in the section I am referring to:

Code:
					<vb:if condition="$prefix_options">
						<label for="prefixfield" class="full">{vb:rawphrase prefix}:</label>
						<select name="prefixid" id="prefixfield" class="full" tabindex="1">
							<option value="">{vb:rawphrase no_prefix_meta}</option>
							{vb:raw prefix_options}
						</select>
						<p class="description"></p>
					</vb:if>
I'll keep digging and if I find a solution, I'll post it, else if someone else knows, please let me know.

Cheers

M

update

I have had some success with this:

Starting @ line 45 in the newthread template, find the code noted above and replace with the one below:
Code:
			<!-- Start hiding the prefix option if Q & A thread -->
			<vb:if condition="$forumid == 16">
				<!-- Do Not show prefix options-->
			<vb:else />
				<!-- Start Prefix Options Display -->
					<vb:if condition="$prefix_options">
						<label for="prefixfield" class="full">{vb:rawphrase prefix}:</label>
						<select name="prefixid" id="prefixfield" class="full" tabindex="1">
							<option value="">{vb:rawphrase no_prefix_meta}</option>
							{vb:raw prefix_options}
						</select>
						<p class="description"></p>
					</vb:if>
				<!-- End Prefix Options Display -->	
			</vb:if>	
			<!-- End hiding the prefix option if Q & A thread -->
you will note in the following line:

Code:
<vb:if condition="$forumid == 16">
You will need to change the number 16 for whatever your Q & A forumid is.

To find this out, you can execute the following SQL against your DB:

Code:
select * from forumprefixset;
This will provide you a list of all forums where you have selected them as Q & A type forums as shown below: (I'm using mysql workbench in this example)



Hope this helps someone.

Next I'll see if I can get an array of forums based on the table forumprefixset

SQL will be something like:

Code:
SELECT forumid from forumprefixset WHERE prefixsetid = 'solvedthread';
Once I can get this into an array and register that array as a variable vBulletin can accept, perhaps I can test against that array in the template and not have to manually code the forum ids in. This would mean a one time change in the newthread template and any forum could have this feature.

Any help with this would be really awesome as I am really unfamiliar with the vBulletin codebase and have just started looking into it.


I'll report back as I make progress.

Cheers

M

Update

Can select from an array now

Code:
			<!-- Start hiding the prefix option if Q & A thread -->
			<vb:if condition="in_array($forumid, array(16))">
Update

So I got this working,

I created a new plugin by using the Add New Plugin in the Products & Plugins section as shown below. The only reason I went down this route is to avoid changing any of the original plugins code. So I hope this method for extending the plugin is OK.



Then I added the following PHP code:

Code:
$result = $vbulletin->db->query_read("SELECT * FROM " . TABLE_PREFIX . "forumprefixset WHERE prefixsetid = 'solvedthread'");
$returnSolvedForumIDS = array();
		while ($output = $vbulletin->db->fetch_array($result))
		{
			$returnSolvedForumIDS[] = $output['forumid'];

		}



if(is_array($returnSolvedForumIDS)){

vB_Template::preRegister('newthread', array('returnSolvedForumIDS' => $returnSolvedForumIDS));

}
Finally in the newthread template, as noted in the above template edits, the following change was made:

Find:
Code:
					<vb:if condition="$prefix_options">
						<label for="prefixfield" class="full">{vb:rawphrase prefix}:</label>
						<select name="prefixid" id="prefixfield" class="full" tabindex="1">
							<option value="">{vb:rawphrase no_prefix_meta}</option>
							{vb:raw prefix_options}
						</select>
						<p class="description"></p>
					</vb:if>
Replace with:

Code:
			<!-- Start hiding the prefix option if Q & A thread -->
			<vb:if condition="in_array($forumid, $returnSolvedForumIDS)">
				<!-- Do Not show prefix options-->
			<vb:else />
				<!-- Start Prefix Options Display -->
					<vb:if condition="$prefix_options">
						<label for="prefixfield" class="full">{vb:rawphrase prefix}:</label>
						<select name="prefixid" id="prefixfield" class="full" tabindex="1">
							<option value="">{vb:rawphrase no_prefix_meta}</option>
							{vb:raw prefix_options}
						</select>
						<p class="description"></p>
					</vb:if>
				<!-- End Prefix Options Display -->	
			</vb:if>	
			<!-- End hiding the prefix option if Q & A thread -->
The core bit of information I was missing, was the method used to return variables from PHP in a way that they can be used in conditional statements in vBulletin templates. This eluded me for a while but was the key to making the changes I required work. See below for the exact code I used to register the PHP variable for use in the template system:

Code:
vB_Template::preRegister('newthread', array('returnSolvedForumIDS' => $returnSolvedForumIDS));
As soon as this variable was registered, everything fell into place.

You could easily modify the original Plugins PHP code to return this information. It is probably the best way forward too, as the method outlined in this post does add an additional query, which is not really required, as the same query exists in the original plugin. As stated previously, I did this to:
  1. Separate the test/modification code from the actual plugin code
  2. Avoid changin the plugin code as I am not 100% sure if this is an OK thing to do?
  3. Teach myself and provide an example to others how to accomplish such modifications to the original plugin without changing any of the core plugin code.

I hope this helps someone else understand how this system works. I'll continue to extend this plugin via the separate plugin code.

Unless anyone has an issue with it, I'll keep posting updates on my progress.

Hope you have found this useful.

Cheers

M
Attached Images
File Type: png prefix.png (4.0 KB, 0 views)
File Type: png forumprefixset.png (3.4 KB, 0 views)
File Type: jpg QandA Solved Prefix.jpg (48.2 KB, 0 views)
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:06 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.06288 seconds
  • Memory Usage 2,396KB
  • Queries Executed 26 (?)
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
  • (11)bbcode_code
  • (3)bbcode_html
  • (1)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
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (4)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (12)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)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