This post contains edits for tweeting posts. You will also need the code from the first post.
OPEN:
viewtopic.phpFIND:
Code: Select all
$postrow = array(
ADD BEFORE:
Code: Select all
if ($s_tweet)
{
$post_url = $topic_url . '%23p' . $row['post_id'];
$post_subject = str_replace(array('<span class="posthilit">', '</span>'), '', $row['post_subject']);
$post_subject = htmlspecialchars(urlencode($post_subject . ': '));
$strlen = strlen($post_subject . truncate_string($row['post_text'], 60, 255, true, '... ') . $post_url);
if ($strlen > 140)
{
$strlen = strlen($post_subject . $post_url);
if ($strlen > 140)
{
$chars = 140 - strlen(': ' . $post_url);
$tweet = truncate_string($row['post_subject'], $chars, 255, true, '');
$tweet .= ': ' . $post_url;
}
else
{
$chars = 140 - strlen($post_subject . ': ' . $post_url);
$tweet = truncate_string($row['post_text'], $chars, 255, true, '');
$tweet = $post_subject . $tweet . ': ' . $post_url;
}
}
else
{
$tweet = $post_subject . truncate_string($row['post_text'], 60, 255, true, '... ') . $post_url;
}
}
ADD AFTER:
Code: Select all
'TWEET_POST' => ($s_tweet) ? $tweet : '',
OPEN:
includes/acp/acp_language.phpFIND:
Code: Select all
'button_topic_new', 'button_topic_reply', 'button_issue_new'
IN-LINE ADD AFTER (add on the same line direct after that find):
Code: Select all
, 'button_tweet_post'
OPEN:
includes/acp/acp_styles.phpFIND:
Code: Select all
'button_topic_new', 'button_topic_reply', 'button_issue_new'
IN-LINE ADD AFTER (add on the same line direct after that find):
Code: Select all
, 'button_tweet_post'
OPEN:
language/en/viewtopic.phpFIND:
Code: Select all
'TOTAL_VOTES' => 'Total votes',
ADD AFTER:
Code: Select all
'TWEET_POST' => 'Tweet this post',
OPEN:
language/en/acp/styles.phpFIND:
Code: Select all
'IMG_BUTTON_TOPIC_REPLY' => 'Reply topic',
ADD AFTER:
Code: Select all
'IMG_BUTTON_TWEET_POST' => 'Tweet post',
OPEN:
styles/{your_style}/imageset/en/imageset.cfgFIND:
Code: Select all
img_icon_post_quote = icon_post_quote.gif*20*54
ADD AFTER:
Code: Select all
img_button_tweet_post = button_tweet_post.gif*20*54
You need to change the file name and its dimensions if you don't use our buttons
OPEN:
styles/{your_style}/template/viewtopic_body.htmlFIND:
Code: Select all
<!-- IF postrow.U_INFO --><li class="info-icon"><a href="{postrow.U_INFO}" title="{L_INFORMATION}"><span>{L_INFORMATION}</span></a></li><!-- ENDIF -->
ADD AFTER:
Code: Select all
<!-- IF not S_IS_BOT and S_TWEET --><li class="tweet-post"><a href="http://twitter.com/home?status={postrow.TWEET_POST}" title="{L_TWEET_POST}"><span>{L_TWEET_POST}</span></a></li><!-- ENDIF -->
OPEN:
styles/{your_style}/theme/buttons.cssFIND:
Code: Select all
.quote-icon, .quote-icon a { background: none top left no-repeat; }
ADD AFTER:
Code: Select all
.tweet-post, .tweet-post a { background: none top left no-repeat; }
FIND:
Code: Select all
ul.profile-icons li.quote-icon { width: {IMG_ICON_POST_QUOTE_WIDTH}px; height: {IMG_ICON_POST_QUOTE_HEIGHT}px; }
ADD AFTER:
Code: Select all
ul.profile-icons li.tweet-post { width: {IMG_BUTTON_TWEET_POST_WIDTH}px; height: {IMG_BUTTON_TWEET_POST_HEIGHT}px; }
OPEN:
styles/{your_style}/theme/colours.cssFIND:
Code: Select all
.quote-icon, .quote-icon a { background-image: url("{IMG_ICON_POST_QUOTE_SRC}"); }
ADD AFTER:
Code: Select all
.tweet-post, .tweet-post a { background-image: url("{IMG_BUTTON_TWEET_POST_SRC}"); }