$boarddir/index.php
Pesquisar por
'sticky' => array('LockTopic.php', 'Sticky'),
Adicionar
'tags' => array('Tags.php', 'TagsMain'),
$teutema/index.template.php
Pesquisar por
$current_action = 'admin';
if (in_array($context['current_action'], array(
Adicionar
'tags',
Pesquisar por
// the [member] list button
if ($context['allow_memberlist'])
echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'mlist' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a>
</td>' , $current_action == 'mlist' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
Adicionar
// the [tags] button
echo ($current_action == 'tags' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'tags' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=tags">' , $txt['smftags_menu'] , '</a>
</td>' , $current_action == 'tags' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
/Post.template.php
Pesquisar por
<input type="text" name="subject"', $context['subject'] == '' ? '' : ' value="' . $context['subject'] . '"', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80" />
</td>
</tr>
Adicionar
';
//Tagging system Mod
if(!isset($context['num_replies']))
{
echo '
<tr>
<td align="right">
<b>', $txt['smftags_topic'], '</b></td>
<td>
<input type="text" name="tags"', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80" />
<br /><span class="smalltext">', $txt['smftags_seperate'], '</span>
</td>
</tr>';
}
//End Tagging system mod
echo '
sourcedir/ManagePermissions.php
Pesquisar
'pm' => array(
'pm_read' => false,
'pm_send' => false,
),
Adicionar
'smftags' => array(
'smftags_manage' => false,
),
$sourcedir/Subs.php
Pesquisar
'edit_settings' => '<a href="' . $scripturl . '?action=serversettings;sesc=' . $sc . '">' . $txt[222] . '</a>',
Adicionar
'tags_settings' => '<a href="' . $scripturl . '?action=tags;sa=admin;sesc=' . $sc . '">' . $txt['smftags_admin'] . '</a>',
$sourcedir/Post.php
Pesquisar
createPost($msgOptions, $topicOptions, $posterOptions);
if (isset($topicOptions['id']))
$topic = $topicOptions['id'];
}
Adicionar
//Tagging System
if(isset($_REQUEST['tags']) && !isset($_REQUEST['num_replies']))
{
//Get how many tags there have been for the topic
$dbresult = db_query("SELECT COUNT(*) as total FROM {$db_prefix}tags_log WHERE ID_TOPIC = " . $topic, __FILE__, __LINE__);
$row = mysql_fetch_assoc($dbresult);
$totaltags = $row['total'];
mysql_free_result($dbresult);
//Check Tag restrictions
$tags = explode(',',htmlspecialchars($_REQUEST['tags'],ENT_QUOTES));
if($totaltags < $modSettings['smftags_set_maxtags'])
{
$tagcount = 0;
foreach($tags as $tag)
{
if($tagcount >= $modSettings['smftags_set_maxtags'])
continue;
if(empty($tag))
continue;
//Check min tag length
if(strlen($tag) < $modSettings['smftags_set_mintaglength'])
continue;
//Check max tag length
if(strlen($tag) > $modSettings['smftags_set_maxtaglength'])
continue;
//Insert The tag
$dbresult = db_query("SELECT ID_TAG FROM {$db_prefix}tags WHERE tag = '$tag'", __FILE__, __LINE__);
if(db_affected_rows() == 0)
{
//Insert into Tags table
db_query("INSERT INTO {$db_prefix}tags
(tag, approved)
VALUES ('$tag',1)", __FILE__, __LINE__);
$ID_TAG = db_insert_id();
//Insert into Tags log
db_query("INSERT INTO {$db_prefix}tags_log
(ID_TAG,ID_TOPIC, ID_MEMBER)
VALUES ($ID_TAG,$topic,$ID_MEMBER)", __FILE__, __LINE__);
$tagcount++;
}
else
{
$row = mysql_fetch_assoc($dbresult);
$ID_TAG = $row['ID_TAG'];
$dbresult2= db_query("SELECT ID FROM {$db_prefix}tags_log WHERE ID_TAG = $ID_TAG AND ID_TOPIC = $topic", __FILE__, __LINE__);
if(db_affected_rows() != 0)
{
continue;
}
mysql_free_result($dbresult2);
//Insert into Tags log
db_query("INSERT INTO {$db_prefix}tags_log
(ID_TAG,ID_TOPIC, ID_MEMBER)
VALUES ($ID_TAG,$topic,$ID_MEMBER)", __FILE__, __LINE__);
$tagcount++;
}
mysql_free_result($dbresult);
}
}
}
//End Tagging System
$sourcedir/Display.php
[logged]if (empty($_SESSION['last_read_topic']) || $_SESSION['last_read_topic'] != $topic)
{
db_query("
UPDATE {$db_prefix}topics
SET numViews = numViews + 1
WHERE ID_TOPIC = $topic
LIMIT 1", __FILE__, __LINE__);
$_SESSION['last_read_topic'] = $topic;
}
Adicionar
//Tagging System
$dbresult= db_query("SELECT t.tag,l.ID,t.ID_TAG FROM {$db_prefix}tags_log as l, {$db_prefix}tags as t WHERE t.ID_TAG = l.ID_TAG && l.ID_TOPIC = $topic", __FILE__, __LINE__);
$context['topic_tags'] = array();
while($row = mysql_fetch_assoc($dbresult))
{
$context['topic_tags'][] = array(
'ID' => $row['ID'],
'ID_TAG' => $row['ID_TAG'],
'tag' => $row['tag'],
);
}
mysql_free_result($dbresult);
//End Tagging System
teutema/Display.template.php
Pesquisar
<a name="lastPost"></a>';
Adicionar
//Tagging System
echo '<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="windowbg">
<b>', $txt['smftags_topic'], '</b>';
foreach ($context['topic_tags'] as $i => $tag)
{
echo '<a href="' . $scripturl . '?action=tags;id=' . $tag['ID_TAG'] . '">' . $tag['tag'] . '</a> ';
if(!$context['user']['is_guest'])
echo '<a href="' . $scripturl . '?action=tags;sa=deletetag;id=' . $tag['ID'] . '"><font color="#FF0000">[X]</font></a> ';
}
if(!$context['user']['is_guest'])
echo '
<a href="' . $scripturl . '?action=tags;sa=addtag;topic=',$context['current_topic'], '">' . $txt['smftags_addtag'] . '</a>
</td>
</tr>
</table>';
//End Tagging System
[/logged]
Modifications.portuguese.php
Antes
?>
Server também para Brazilian
[hide]$txt['smftags_menu'] = 'Tags';
$txt['smftags_admin'] = 'Tags Configurações';
$txt['smftags_addtag'] = '[Add Tag]';
$txt['smftags_seperate'] = 'Separe cada tag por uma vírgula';
$txt['smftags_topic'] = 'Tags: ';
$txt['permissiongroup_smftags'] = 'SMF Tags';
$txt['permissionname_smftags_suggest'] = 'Tags Sugerir';
$txt['permissionhelp_smftags_suggest'] = 'Os usuários podem sugerir para adicionar tags';
$txt['cannot_smftags_suggest'] = 'Você não está autorizado a sugerir tags.';
$txt['permissionname_smftags_manage'] = 'Gerenciar Tags';
$txt['permissionhelp_smftags_manage'] = 'Os membros podem modificar as definições de tag e adicionar e remover tags';
$txt['cannot_smftags_manage'] = 'Você não está autorizado a gerir tags.';
[/hide]
Colocar os ficheiro no anexo mais antes correr o ficheiro tagsql.php
Tags.php /Sources
Tags.template.php Themes/default
Tags.portuguese_pt.php na pasta languages