Git Product home page Git Product logo

Comments (7)

Kretol avatar Kretol commented on June 19, 2024

Forgot to mention that I'm using MyBB 1.6.15, PHP version 5.4.26-pl0-gentoo, and MySQLi 5.5.37.

from inferno-shoutbox.

TechyZeldaNerd avatar TechyZeldaNerd commented on June 19, 2024

Hmm, well this appears to be an issue where Mybb runs the "newthread_do_newthread_end" and the "newthread_end" hooks, even if it was only saved as a draft. I'm not really sure of a way to work around this unless we specifically check if the url is "usercp.php?action=drafts", but I'm not really an expert on Mybb.

from inferno-shoutbox.

Kretol avatar Kretol commented on June 19, 2024

Ah ha!
This can be fixed by ensuring the thread is visible. In function inferno_newthread():
Change

if ($settings['inferno_enabled'])
    {
        $inferno = inferno_init();
        $data = $mybb->input;
        $fid = $data['fid'];

        if ($settings['inferno_thread_post'] && !in_array($fid, explode(',', $settings['inferno_thread_forums'])))

to

if ($settings['inferno_enabled'])
    {
        $inferno = inferno_init();
        $data = $mybb->input;
        $fid = $data['fid'];
        $visible = $data['visible'];

        if ($settings['inferno_thread_post'] && $visible > 0 && !in_array($fid, explode(',', $settings['inferno_thread_forums'])))

from inferno-shoutbox.

TechyZeldaNerd avatar TechyZeldaNerd commented on June 19, 2024

That seems to fix the issue. The only problem is that it when you finally post a draft, it doesn't appear in the SB, but that's a pretty minor thing.

from inferno-shoutbox.

Kretol avatar Kretol commented on June 19, 2024

Blargh. I should have tested that more! Apparently, though it does fix drafts not showing up, it also makes it so that no thread announcements are posted! Bwa, back to the drawing board.
It appears all posts will have 'visible' as 0 in the above logic whether or not they're saved as a draft or posted immediately (tried changing "> 0" to ">= 0" just to see what would happen, considering drafts as saved as a -2 in the 'visible' database column).

from inferno-shoutbox.

TechyZeldaNerd avatar TechyZeldaNerd commented on June 19, 2024

Wait, really? Said code worked fine on my end, aside from what I mentioned before, so I'm not really sure what's going on.

Or nevermind... That's really odd though, I was certain I tested it out last night...

from inferno-shoutbox.

Kretol avatar Kretol commented on June 19, 2024

Got it!

I'm still using MyBB 1.6, so it's still applicable for me (though the same fix may work for 1.8)
Using the same block as before (with the addition of a change in the globals):

global $mybb, $db, $settings, $url, $lang, $tid;

if ($settings['inferno_enabled'])
    {
        $inferno = inferno_init();
        $data = $mybb->input;
        $fid = $data['fid'];
        $thread = get_thread($tid);

        if ($settings['inferno_thread_post'] && $thread['visible'] == 1 && !in_array($fid, explode(',', $settings['inferno_thread_forums'])))

from inferno-shoutbox.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.