Comments (7)
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.
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.
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.
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.
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.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from inferno-shoutbox.