Quote:
Originally Posted by LouiseWilson
As this works with 3.8 I've installed it works but there is no
Hash tag field
|
Looks like the
newthread template has changed in vBulletin 3.8.7..... so, in the AdminCP edit the
vBulletin 2 Twitter: Add Hashtag Field To New Thread plugin via
Plugins & Products ->
Plugin Manager and completely replace the contents with the following:
PHP Code:
if ($vbulletin->options['ms_vbtwitter_enable'] && ($vbulletin->options['ms_vbtwitter_enable_hashtag'] == 1 || $vbulletin->options['ms_vbtwitter_enable_hashtag'] == 3) && (!empty($vbulletin->options['ms_vbtwitter_twitter_consumer_key'])) && (!empty($vbulletin->options['ms_vbtwitter_twitter_consumer_secret'])) && (!empty($vbulletin->options['ms_vbtwitter_twitter_oauth_token'])) && (!empty($vbulletin->options['ms_vbtwitter_twitter_oauth_token_secret'])))
{
$twitterEnabled = false;
switch ($vbulletin->options['ms_vbtwitter_forums'])
{
case 1: // include selected forums
$forums = explode(",", $vbulletin->options['ms_vbtwitter_enabled_forums']);
$twitterEnabled = (in_array($foruminfo['forumid'], $forums)) ? true : false;
unset($forums);
break;
case 2: // exclude selected forums
$forums = explode(",", $vbulletin->options['ms_vbtwitter_enabled_forums']);
$twitterEnabled = (!in_array($foruminfo['forumid'], $forums)) ? true : false;
unset($forums);
break;
default: // include all forums
$twitterEnabled = true;
}
if ($twitterEnabled)
{
if ($vbulletin->options['templateversion'] >= "4.0.0")
{
$hashtag_field = '<div class="blockrow"><label for="hashtags" class="full">' . $vbphrase['hashtags'] . ':</label>
<input type="text" class="primary full textbox" name="hashtags" id="hashtags" value="' . $hashtag_values . '" maxlength="' . $vbulletin->options['titlemaxchars'] . '" tabindex="1" /></div>';
vB_Template::preRegister('newthread',array('hashtag_field' => $hashtag_field));
$vbulletin->templatecache['newthread'] = str_replace('$messagearea', '$hashtag_field . $messagearea', $vbulletin->templatecache['newthread']);
}
else
{
$hashtag_field = '<div class="smallfont">' . $vbphrase['hashtags'] . ':</div>
<div><input type="text" class="bginput" name="hashtags" id="hashtags" value="' . $hashtag_values . '" size="40" maxlength="' . $vbulletin->options['titlemaxchars'] . '" tabindex="1" /></div>';
$search = '<!-- / subject field -->';
$vbulletin->templatecache['newthread'] = str_replace($search, '$hashtag_field . $search', $vbulletin->templatecache['newthread']);
}
}
unset($twitterEnabled);
}