MyBB Community Forums

Full Version: Publish Sticky Threads to Twitter?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to do what the below link is doing, where it autopost's to twitter and facebook.

http://community.mybb.com/thread-119874.html

My question is, Can i make it so it only posts threads that get stickied are posted to twitter, instead of all.

Anyone?
Anyone?
http://www.communityplugins.com/forum/sh....php?tid=7

But it needs some edits to only affect sticky threads.
(2014-09-21, 03:42 AM)Omar G. Wrote: [ -> ]http://www.communityplugins.com/forum/sh....php?tid=7

But it needs some edits to only affect sticky threads.

Cool i'll take a look, any idea on what i would need to edit?
It is a little complicated, if you only care about new threads edit the _mybbpublisher_do_newthread_ function.

But probably you also need it for edits, on which case you need to edit _mybbpublisher_editthread_. There it gets a little tricky.
(2014-09-21, 10:11 PM)Omar G. Wrote: [ -> ]It is a little complicated, if you only care about new threads edit the _mybbpublisher_do_newthread_ function.

But probably you also need it for edits, on which case you need to edit _mybbpublisher_editthread_. There it gets a little tricky.

Thanks hopefully i can figure something out.
Each thread in the table mybb_threads has a value for the field sticky. You'd want to do something like
$query = $db->simple_select("threads", "tid, sticky, subject", "tid=$tid");
$thread = $db->fetch_array($query);
if($thread['sticky']==1)
{
// Put the code to publish to Twitter here
}

Replace $tid with the appropriate variable that has the thread's tid.