vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Miscellaneous Hacks - Mark Threads As "Solved" (https://vborg.vbsupport.ru/showthread.php?t=234935)

karel1985 09-18-2012 04:39 PM

Quote:

Originally Posted by Wolver2 (Post 2366399)
I was wondering we can add a "NEW BUTTON" beside edit Post or Reply

because the mark thread as solved is kinda hidden and adds additional steps.

Any ideas?

Sure this is possible, i have it posted in this thread somewhere, if i remember well

Wolver2 09-20-2012 11:05 AM

Quote:

Originally Posted by karel1985 (Post 2366468)
Sure this is possible, i have it posted in this thread somewhere, if i remember well

Thanks but sadly I couldnt find your post on it on this thread. I just saw that u showed pics and said "Its not yet perfect, but if you would like to have the code let me know."

Im sure alot would love to have your code :)


Btw Is it possible with this mod that the usergroup can make it "solve" and set it back to "unsolved" as often as they want?

Or is it only possible if they made that thread themselves?

PrivateFTA 10-10-2012 01:44 PM

as I can give some color to Solved

RichieBoy67 03-20-2013 01:59 PM

Hey guys,

I need this or something similar in one of my forum sites to be used only in a site support sub-forum. I have not read every single post in this thread so excuse me if this has been covered.

I understand it uses usergroup permissions. This is fine and I suppose it would not be hard to add a conditional for forums as well. Has anyone done this? I do not want moderators and admins to have the option to mark solved all over the site.

I would also like to know if anyone has this working successfully on 4.2 with a custom theme. if so did you have to customize? Does this use existing css or it's own?
If you could supply a link so I can test that would be awesome.

Thanks,
Rich

datoneer 05-19-2013 03:00 PM

Its working with vb 4.2.1

venom2124 06-03-2013 11:13 PM

Quote:

Originally Posted by RichieBoy67 (Post 2411157)
Hey guys,

I need this or something similar in one of my forum sites to be used only in a site support sub-forum. I have not read every single post in this thread so excuse me if this has been covered.

I understand it uses usergroup permissions. This is fine and I suppose it would not be hard to add a conditional for forums as well. Has anyone done this? I do not want moderators and admins to have the option to mark solved all over the site.

I would also like to know if anyone has this working successfully on 4.2 with a custom theme. if so did you have to customize? Does this use existing css or it's own?
If you could supply a link so I can test that would be awesome.

Thanks,
Rich

This mod will allow you to specify which forums the mod will work on. It should also not be affected by custom styles.

findingpeace 06-11-2013 02:54 PM

Great mod, works perfectly on 4.2.1! Be sure to set Usergroup permissions first, otherwise the Prefixes settings won't give you the option for forum permissions

Wolver2 08-08-2013 01:47 PM

Guys how can I add it as a new button "Solved" beside the +Reply to thread.. because the button where it is now isnt very seen.. no one will notice

I would gladly donate to someone who could do this for me :)

Tim Wheatley 09-13-2013 04:28 PM

Quote:

Originally Posted by findingpeace (Post 2427384)
Great mod, works perfectly on 4.2.1! Be sure to set Usergroup permissions first, otherwise the Prefixes settings won't give you the option for forum permissions

I'm a new installer onto 4.2.1. Have set permissions in usergroup, permissions for the prefixes, and selected which forums to show in... and it doesn't show in the dropdown. Yes, template edited as instructed, files uploaded, and product installed.

Tim Wheatley 09-13-2013 04:45 PM

Super... I tried to remove the product, got a fatal error. so I installed it again, overwriting. Now when I try to set usergroups to yes:
MySQL Error : Unknown column 'solvedthread_permissions' in 'field list'

Tim Wheatley 09-13-2013 04:51 PM

Had to alter the uninstall code to get it to uninstall without the fatal error.

karel1985 09-15-2013 01:29 PM

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...

ozzy47 09-15-2013 01:59 PM

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.

PrivateFTA 02-18-2014 05:53 PM

let me know if I can do several way to use a new place to settle and accepted our

djvj 05-01-2014 07:53 AM

Does this work on 4.2.2?

NM, just tested and it works fine.

john7911 05-01-2014 09:02 AM

I install it on 4.2.2 but I don't see it in the list.
https://vborg.vbsupport.ru/external/2014/05/78.png

aminp30 06-27-2014 06:10 AM

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

fxdigi-cash 08-02-2014 06:08 AM

Quote:

Originally Posted by aminp30 (Post 2503987)
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>

majickal 08-23-2014 12:01 PM

I can confirm this is working on 4.2.2 Patch Level 1 :D

majickal 08-24-2014 07:55 AM

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

https://vborg.vbsupport.ru/attachmen...1&d=1408869921

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:

https://vborg.vbsupport.ru/attachmen...1&d=1408870162

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)

https://vborg.vbsupport.ru/attachmen...1&d=1408873908

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.

https://vborg.vbsupport.ru/attachmen...1&d=1408916968

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

john7911 09-10-2014 05:38 AM

Hi,
How can I translate to French?
Thank you :)

ozzy47 09-10-2014 09:32 AM

Edit the phrases that belong to the mod with Phrase Manager.

john7911 11-24-2014 02:25 PM

Quote:

Originally Posted by ozzy47 (Post 2514516)
Edit the phrases that belong to the mod with Phrase Manager.

Thank you ozzy47 ;)

---------------------
How can I have SOLVED in Bold font?

https://vborg.vbsupport.ru/external/2014/11/8.jpg

Thank you.

gnrx 11-27-2014 06:39 PM

Hi,
A few minutes ago, I installed this mod in vb 4.2.2 pl2.
Works but not appears any button of Solved.

I search in SHOWTHREAD template the code that indicate:
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>

This exact code not exist in my template (any previous modification in this template), but I view some similar code:
Code:

<vb:if condition="$show['addpoll']">
                                                <li><a href="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}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>

I add the code just after this above code, its correct?
The button not appears and I search for view the problem but I don't view what are the problem.

Regards.

john7911 11-28-2014 04:34 AM

Quote:

Hi,
A few minutes ago, I installed this mod in vb 4.2.2 pl2.
Works but not appears any button of Solved.
Hi,
You have to Add New Prefix Set
https://vborg.vbsupport.ru/external/2014/11/1.jpg

gnrx 11-28-2014 12:18 PM

Quote:

Originally Posted by john7911 (Post 2524576)
Hi,
You have to Add New Prefix Set
https://vborg.vbsupport.ru/external/2014/11/1.jpg

Yes, I have New Prefix:
https://vborg.vbsupport.ru/external/2014/11/2.jpg

gnrx 12-20-2014 10:04 PM

Some user with this mod and vb 4.2 pl3 have visible the button of Solved?

I can't made for appears this button, and if not appears....

Thanks.

aeternitasster 03-25-2018 01:06 AM

Works with 4.2.5. Had initially the same problem that it was not showing up under "thread tools" although usergroup permissions were correctly set, etc. Found what was causing the issue; if anyone else has this problem, make sure to check that ALL forums AND sub-forums where you want this mod to work are selected under Thread Prefixes > Thread Prefix Manager. Selecting only a parent forum will not lead to the changes being inherited by the child forums, so they have to be selected individually.

chudvs 07-24-2019 09:01 AM

Yep can confirm working on 4.2.5, just installed and working great

john7911 07-25-2019 03:24 PM

Hi :-)
is it possible to add a button to go to the solution as this forum bellow:
https://forums.autodesk.com/t5/autoc...e/td-p/8910765

the user who asked for a solution choose the best solution.

https://vborg.vbsupport.ru/external/2019/07/11.jpg

https://vborg.vbsupport.ru/external/2019/07/12.jpg

Thank you ;-)

z3r0 07-25-2019 03:29 PM

Quote:

Originally Posted by john7911 (Post 2599960)
Hi :-)
is it possible to add a button to go to the solution as this forum bellow:
https://forums.autodesk.com/t5/autoc...e/td-p/8910765

the user who asked for a solution choose the best solution.


Thank you ;-)

This mod only marks the entire thread as solved and doesn't mark any post as the answer, the following mods may do what you are looking for.

https://vborg.vbsupport.ru/showthread.php?t=269776
https://vborg.vbsupport.ru/showthread.php?t=322478
https://vborg.vbsupport.ru/showthread.php?t=293596

john7911 07-25-2019 04:21 PM

Thank you z3r0 ;-)
I'll check it.


All times are GMT. The time now is 09:57 PM.

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.01496 seconds
  • Memory Usage 1,858KB
  • 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
  • (12)bbcode_code_printable
  • (1)bbcode_html_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (32)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete