Tweet this topic

Sends a link to a topic to Twitter. Hashtags, topic title and ShortURL's are optional

Requested by andrew55 in this topic, this snippet allows you to tweet this topic. If you are not logged in when you click the link, simply log in and you will be redirected with the tweet still in tact.

#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
    // Send vars to template  
#
#-----[ AFTER ADD ]------------------------------------------
#
    $hashtag        = ' #phpBB #6StringMODs'; 
#
#-----[ FIND ]------------------------------------------
#
       'WARN_IMG'         => $user->img('icon_user_warn', 'WARN_USER'),
#
#-----[ AFTER ADD ]------------------------------------------
#
       'TWEET_TOPIC'      => urlencode('Read This: ') . generate_board_url() . "/viewtopic.$phpEx?f=$forum_id%26t=$topic_id" . htmlspecialchars(urlencode($hashtag)),
#
#-----[ OPEN ]------------------------------------------
#
language/en/viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
       'SUBMIT_VOTE'         => 'Submit vote',
#
#-----[ AFTER ADD ]------------------------------------------
#
       'TWEET_TOPIC'         => 'Tweet this topic',
#
#-----[ OPEN ]------------------------------------------
#
styles/prosilver/template/viewtopic_body.html
#
#-----[ FIND ]------------------------------------------
#
    </h2>
#
#-----[ BEFORE ADD ]------------------------------------------
#
     <span class="tweet-link"><a href="http://twitter.com/home?status={TWEET_TOPIC}" class="tweet-link" title="{L_TWEET_TOPIC}"></a></span>
#
#-----[ OPEN ]------------------------------------------
#
styles/prosilver/theme/colours.css
#
#-----[ FIND ]------------------------------------------
#
    a.right:hover {
       color: #5E7BAA;
    }
#
#-----[ AFTER ADD ]------------------------------------------
#
    .tweet-link a {
       float: left;
       background-image: url("{T_THEME_PATH}/images/twitter-logo.png");
       padding-left:18px;
       height: 18px;
       background-repeat: no-repeat;
       position: absolute;
    }

Place this image in your ./styles/STYLE_NAME/theme/images/ folder

Twitter Logo