Post Threads to Twitter

xF2 Template Modification Post Threads to Twitter 1.0

No permission to download
Compatible XF Versions
  1. 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):

screen-shot-2018-05-02-at-1-47-09-am-png.174501


INSTALLATION:

First: PHP script
  1. Unpack the attached download file into your forum directory.
  2. Modify "config.php" with:
    1. Twitter App information. (You can obtain one from https://apps.twitter.com)
    2. Database Information.
    3. Site URL (without the trailing slash)
    4. Adjust the strings to your translation needs.
Second: Template Modification
  1. In template "thread_view" find the following:
    Code:
                        <xf:if is="$canInlineMod">
                        <xf:macro template="inline_mod_macros" name="button" />
                        </xf:if>
  2. 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>
Third: Database Table Creation
  1. Find the sql file included "tweeted_threads.sql" (You can find it in the folder created above)
  2. Run it in your forum database to create the required table.
  • Like
Reactions: xenx1
Author
AnimeHaxor
Size
15.5 KB
Extension
zip
Downloads
3
Views
1,830
First release
Last update

More resources from AnimeHaxor

730Threads
2,282Messages
62,908Members
quantummmmmmLatest member
Back