- Compatible XF Versions
- 2.0
- Additional Requirements
- Twitter Apps account
If you are like me, you don't want every thread in your forum to be sent "automatically" to your forum's twitter account, especially for busy forums. This template modification plus a small php script will give your forum moderators the freedom to send any thread to the forum's twitter account. You won't need to give the Mods a direct access to the account.
Every thread will have a twitter blue button next to the inline moderation buttons (as in the following image):
INSTALLATION:
First: PHP script
Every thread will have a twitter blue button next to the inline moderation buttons (as in the following image):
INSTALLATION:
First: PHP script
- Unpack the attached download file into your forum directory.
- Modify "config.php" with:
- Twitter App information. (You can obtain one from https://apps.twitter.com)
- Database Information.
- Site URL (without the trailing slash)
- Adjust the strings to your translation needs.
- In template "thread_view" find the following:
Code:<xf:if is="$canInlineMod"> <xf:macro template="inline_mod_macros" name="button" /> </xf:if>
- Replace it with the following:
Code:<xf:if is="$canInlineMod"> <span class="tweet"><a class="shareButtons-button shareButtons-button--twitter" target="_New" href="javascript:window.open('tweetpost/tweet.php?id={$thread.thread_id}&title={$thread.title}&username={$thread.username}&action=update','mywindowtitle','width=500,height=150')"><i aria-hidden="true"></i></a></span> </xf:if> <xf:if is="$canInlineMod"> <xf:macro template="inline_mod_macros" name="button" /> </xf:if>
- Find the sql file included "tweeted_threads.sql" (You can find it in the folder created above)
- Run it in your forum database to create the required table.