Nome:Topic Solved
Ficheiro:TopicSolved1.1.zip Mod em En
Autor do Mod:[SiNaN]
Type: New Feature
Autor da instalacao manual: Candidosa2
Tradução: Pt_PT-UTF8
Tradução: Pt_br-UTF8
Versões Antigas:
disponível 2.0 RC1-1Download em En -
Versao:
disponível 2.0 RC1-2 Testado com tema default Funciona 100%
./
index.phpPesquisar
'theme' => array('Themes.php', 'ThemesMain'),
Alterar por
'theme' => array('Themes.php', 'ThemesMain'),
'topicsolved' => array('Subs-TopicSolved.php', 'TopicSolved'),
./Sources/
Admin.phpPesquisar
'modlog' => array($txt['moderation_log'], 'admin_forum', 'enabled' => in_array('ml', $context['admin_features'])),
Alterar por
'modlog' => array($txt['moderation_log'], 'admin_forum', 'enabled' => in_array('ml', $context['admin_features'])),
'topicsolvedlog' => array($txt['topic_solved_log'], 'admin_forum', 'enabled' => in_array('ml', $context['admin_features'])),
Pesquisar
'modlog' => array('Modlog.php', 'ViewModlog'),
Alterar por
'modlog' => array('Modlog.php', 'ViewModlog'),
'topicsolvedlog' => array('Modlog.php', 'ViewModlog'),
Pesquisar
'modlog' => array(
'description' => $txt['moderation_log_desc'],
),
Alterar por
'modlog' => array(
'description' => $txt['moderation_log_desc'],
),
'topicsolvedlog' => array(
'description' => $txt['topic_solved_desc'],
),
./Sources/
Display.phpPesquisar
$context['topic_first_message'] = $topicinfo['id_first_msg'];
Alterar por
$context['topic_first_message'] = $topicinfo['id_first_msg'];
$context['topic_solved'] = $topicinfo['is_solved'];
$context['can_solve_topic'] = (allowedTo('solve_topic_any') || (allowedTo('solve_topic_own') && $user_info['id'] == $topicinfo['id_member_started'])) && $board_info['topic_solved'];
Pesquisar
t.num_replies, t.num_views, t.locked, ms.subject, t.is_sticky
Trocar por
t.num_replies, t.num_views, t.locked, ms.subject, t.is_sticky, t.is_solved
./Sources/
Load.phpb.override_theme, b.count_posts
Trocar por
b.override_theme, b.count_posts, b.topic_solved
Pesquisar
'posts_count' => empty($row['count_posts']),
Trocar por
'posts_count' => empty($row['count_posts']),
'topic_solved' => $row['topic_solved'],
./Sources/
ManageBoards.phpPesquisar
$boardOptions['posts_count'] = isset($_POST['count']);
Alterar por
$boardOptions['posts_count'] = isset($_POST['count']);
$boardOptions['topic_solved'] = isset($_POST['topic_solved']);
Pesquisar
'count_posts' => 1,
Alterar Por
'count_posts' => 1,
'topic_solved' => 0,
./Sources/
ManagePermissions.phpPesquisar
'remove_own',
'view_attachments',
Alterar por
'remove_own',
'view_attachments',
'solve_topic_own',
Pesquisar
'poll_add_any',
'approve_posts',
Alterar por
'poll_add_any',
'approve_posts',
'solve_topic_any',
Pesquisar
'send_topic' => array(false, 'topic', 'moderate'),
Alterar por
'send_topic' => array(false, 'topic', 'moderate'),
'solve_topic' => array(true, 'topic', 'moderate'),
./Sources/
MessageIndex.phpPesquisar
$context['can_restore'] = allowedTo('move_any') && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] == $board;
Trocar por
$context['can_restore'] = allowedTo('move_any') && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] == $board;
$context['can_solve'] = allowedTo('solve_topic_any') && !empty($board_info['topic_solved']);
Pesquisar
'approve' => $context['can_approve'] && $topic['unapproved_posts']
Alterar por
'approve' => $context['can_approve'] && $topic['unapproved_posts'],
'solve' => (allowedTo('solve_topic_any') || ($started && allowedTo('solve_topic_own'))) && !empty($board_info['topic_solved'])
Pesquisar
$context['can_remove'] |= ($started && allowedTo('remove_own'));
Alterar por
$context['can_remove'] |= ($started && allowedTo('remove_own'));
$context['can_solve'] |= ($started && allowedTo('remove_own')) && !empty($board_info['topic_solved']);
Pesquisar
'approve_posts' => allowedTo('approve_posts') ? array($board) : array(),
Alterar por
'approve_posts' => allowedTo('approve_posts') ? array($board) : array(),
'solve_any' => allowedTo('solve_topic_any') ? array($board) : array(),
'solve_own' => allowedTo('solve_topic_own') ? array($board) : array(),
Pesquisar
'approve_posts' => boardsAllowedTo('approve_posts'),
Alterar por
'approve_posts' => boardsAllowedTo('approve_posts'),
'solve_any' => boardsAllowedTo('solve_topic_any'),
'solve_own' => boardsAllowedTo('solve_topic_own'),
Pesquisar
$possibleActions[] = 'approve';
Alterar por
$possibleActions[] = 'approve';
if (!empty($boards_can['solve_any']) || !empty($boards_can['solve_own']))
$possibleActions[] = 'solve';
Pesquisar
elseif ($_REQUEST['actions'][$row['id_topic']] == 'approve' && (!$row['unapproved_posts'] || (!in_array(0, $boards_can['approve_posts']) && !in_array($row['id_board'], $boards_can['approve_posts']))))
unset($_REQUEST['actions'][$row['id_topic']]);
Alterar por
elseif ($_REQUEST['actions'][$row['id_topic']] == 'approve' && (!$row['unapproved_posts'] || (!in_array(0, $boards_can['approve_posts']) && !in_array($row['id_board'], $boards_can['approve_posts']))))
unset($_REQUEST['actions'][$row['id_topic']]);
elseif ($_REQUEST['actions'][$row['id_topic']] == 'solve' && !in_array(0, $boards_can['solve_any']) && !in_array($row['id_board'], $boards_can['solve_any']) && ($row['id_member_started'] != $user_info['id'] || (!in_array(0, $boards_can['solve_own']) && !in_array($row['id_board'], $boards_can['solve_own']))))
unset($_REQUEST['actions'][$row['id_topic']]);
Pesquisar
$approveCache = array();
Alterar por
$approveCache = array();
$solveCache = array();
$approveCache[] = $topic;
$approveCache[] = $topic;
elseif ($action == 'solve')
$solveCache[] = $topic;
Pesquisar
foreach ($moveCache as $topic)
if (!empty($solveCache))
{
$solvePosts = array();
$solveStatus = array();
$result = $smcFunc['db_query']('', '
SELECT t.id_topic, t.id_board, t.id_first_msg, t.is_solved, b.topic_solved
FROM {db_prefix}topics AS t
LEFT JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
WHERE t.id_topic IN ({array_int:solve_topic_ids})
AND b.topic_solved = {int:topic_solved}' . (!empty($board) && !allowedTo('solve_topic_any') ? '
AND t.id_member_started = {int:current_member}' : '') . '
LIMIT ' . count($solveCache),
array(
'current_member' => $user_info['id'],
'solve_topic_ids' => $solveCache,
'topic_solved' => 1,
)
);
$solveCache = array();
$solveCacheBoards = array();
while ($row = $smcFunc['db_fetch_assoc']($result))
{
$solveCache[] = $row['id_topic'];
$solvePosts[] = $row['id_first_msg'];
$solveStatus[$row['id_topic']] = empty($row['is_solved']);
$solveCacheBoards[$row['id_topic']] = $row['id_board'];
}
$smcFunc['db_free_result']($result);
if (!empty($solveCache))
{
$smcFunc['db_query']('', '
UPDATE {db_prefix}topics
SET is_solved = CASE WHEN is_solved = {int:is_solved} THEN 0 ELSE 1 END
WHERE id_topic IN ({array_int:solve_topic_ids})',
array(
'solve_topic_ids' => $solveCache,
'is_solved' => 1,
)
);
$smcFunc['db_query']('', '
UPDATE {db_prefix}messages
SET icon = CASE WHEN icon = {string:topic_solved} THEN {string:normal} ELSE {string:topic_solved} END
WHERE id_msg IN ({array_int:solve_post_ids})',
array(
'solve_post_ids' => $solvePosts,
'topic_solved' => 'topicsolved',
'normal' => 'xx',
)
);
}
}
foreach ($moveCache as $topic)
Pesquisar
foreach ($stickyCache as $topic)
{
logAction('sticky', array('topic' => $topic, 'board' => $stickyCacheBoards[$topic]));
sendNotifications($topic, 'sticky');
}
Alterar por
foreach ($stickyCache as $topic)
{
logAction('sticky', array('topic' => $topic, 'board' => $stickyCacheBoards[$topic]));
sendNotifications($topic, 'sticky');
}
foreach ($solveCache as $topic)
logAction($solveStatus[$topic] ? 'solve' : 'not_solve', array('topic' => $topic, 'board' => $solveCacheBoards[$topic]), 'topic_solved');
./Sources/
ModerationCenter.phpPesquisar
'modlog' => array(
'enabled' => !empty($modSettings['modlog_enabled']),
'label' => $txt['modlog_view'],
'file' => 'Modlog.php',
'function' => 'ViewModlog',
),
Alterar Por
'modlog' => array(
'enabled' => !empty($modSettings['modlog_enabled']),
'label' => $txt['modlog_view'],
'file' => 'Modlog.php',
'function' => 'ViewModlog',
),
'topicsolvedlog' => array(
'enabled' => !empty($modSettings['modlog_enabled']),
'label' => $txt['topic_solved_log'],
'file' => 'Modlog.php',
'function' => 'ViewModlog',
)
./Sources/
Modlog.phpPesquisar
$context['log_type'] = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'adminlog' ? 3 : 1;
Alterar por
$context['log_type'] = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'adminlog' ? 3 : ((isset($_REQUEST['area']) && $_REQUEST['area'] == 'topicsolvedlog') || (isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'topicsolvedlog') || (isset($_REQUEST['type']) && $_REQUEST['type'] == 4) ? 4 : 1);
Pesquisar
$context['url_start'] = '?action=admin;area=logs;sa=' . ($context['log_type'] == 3 ? 'adminlog' : 'modlog') . ';type=' . $context['log_type'];
Alterar por
$context['url_start'] = '?action=admin;area=logs;sa=' . ($context['log_type'] == 3 ? 'adminlog' : ($context['log_type'] == 4 ? 'topicsolvedlog' : 'modlog')) . ';type=' . $context['log_type'];
Pesquisar
$context['page_title'] = $context['log_type'] == 3 ? $txt['modlog_admin_log'] : $txt['modlog_view'];
Alterar por
$context['page_title'] = $context['log_type'] == 3 ? $txt['modlog_admin_log'] : ($context['log_type'] == 4 ? $txt['topic_solved_log'] : $txt['modlog_view']);
Pesquisar
'title' => '<a href="' . $scripturl . '?action=helpadmin;help=' . ($context['log_type'] == 3 ? 'adminlog' : 'modlog') . '" onclick="return reqWin(this.href);" class="help"><img src="' . $settings['images_url'] . '/helptopics.gif" alt="' . $txt['help'] . '" align="top" /></a> ' . $txt['modlog_' . ($context['log_type'] == 3 ? 'admin' : 'moderation') . '_log'],
Alterar por
'title' => $context['log_type'] == 4 ? $txt['topic_solved_log'] : ('<a href="' . $scripturl . '?action=helpadmin;help=' . ($context['log_type'] == 3 ? 'adminlog' : 'modlog') . '" onclick="return reqWin(this.href);" class="help"><img src="' . $settings['images_url'] . '/helptopics.gif" alt="' . $txt['help'] . '" align="top" /></a> ' . $txt['modlog_' . ($context['log_type'] == 3 ? 'admin' : 'moderation') . '_log']),
Pesquisar
'value' => '<div class="smalltext">' . $txt['modlog_' . ($context['log_type'] == 3 ? 'admin' : 'moderation') . '_log_desc'] . '</div>',
Alterar por
'value' => '<div class="smalltext">' . $txt['modlog_' . ($context['log_type'] == 3 ? 'admin' : ($context['log_type'] == 4 ? 'topicsolved' : 'moderation')) . '_log_desc'] . '</div>',
./Sources/
Subs.phpPesquisar
'admin' => 3,
Alterar por
'admin' => 3,
'topic_solved' => 4,
./Sources/
Subs-Boards.phpPesquisar
// Set the theme for this board.
Alterar por
if (isset($boardOptions['topic_solved']))
{
$boardUpdates[] = 'topic_solved = {int:topic_solved}';
$boardUpdateParameters['topic_solved'] = $boardOptions['topic_solved'] ? 1 : 0;
}
// Set the theme for this board.
Pesquisar
b.board_order, b.count_posts
Alterar por
b.board_order, b.count_posts, b.topic_solved
pesquisar
'count_posts' => empty($row['count_posts']),
Alterar Por
'count_posts' => empty($row['count_posts']),
'topic_solved' => $row['topic_solved'],
./Themes/default/
Display.template.phpPesquisar
$mod_buttons[] = array('text' => 'restore_topic', 'image' => '', 'lang' => true, 'url' => $scripturl . '?action=restoretopic;topics=' . $context['current_topic'] . ';' . $context['session_var'] . '=' . $context['session_id']);
Alterar por
$mod_buttons[] = array('text' => 'restore_topic', 'image' => '', 'lang' => true, 'url' => $scripturl . '?action=restoretopic;topics=' . $context['current_topic'] . ';' . $context['session_var'] . '=' . $context['session_id']);
// The Topic Solved button.
if ($context['can_solve_topic'])
$mod_buttons[] = array('text' => $context['topic_solved'] ? 'topic_not_solved' : 'topic_solved', 'image' => '', 'lang' => true, 'url' => $scripturl . '?action=topicsolved;topic=' . $context['current_topic'] . ';sesc=' . $context['session_id']);
./Themes/default/
ManageBoards.template.phpPesquisar
document.getElementById("board_theme_div").style.display = redirectEnabled? "none" : "";
Alterar por
document.getElementById("board_theme_div").style.display = redirectEnabled? "none" : "";
document.getElementById("topic_solved_div").style.display = redirectEnabled? "none" : "";
Pesquisar
// Here the user can choose to force this board to use a theme other than the default theme for the forum.
Alterar por
echo '
<tr class="windowbg2" id="topic_solved_div">
<td>
<b>', $txt['topic_solved_board'], ':</b><br />
<span class="smalltext">', $txt['topic_solved_board_desc'], '</span><br />
</td>
<td valign="top" align="left">
<input type="checkbox" name="topic_solved" ', $context['board']['topic_solved'] ? ' checked="checked"' : '', ' class="check" />
</td>
</tr>';
// Here the user can choose to force this board to use a theme other than the default theme for the forum.
./Themes/default/
MessageIndex.template.phpPesquisar
', $context['can_restore'] ? '<option value="restore">' . $txt['quick_mod_restore'] . '</option>' : '', '
Alterar por
', $context['can_restore'] ? '<option value="restore">' . $txt['quick_mod_restore'] . '</option>' : '', '
', $context['can_solve'] ? '<option value="solve">' . $txt['topic_solved_quick'] . '</option>' : '', '
./Themes/default/languages/
Modifications.english.phpPesquisar
?>
Colocar antes
// Topic Solved
$txt['topic_solved'] = 'Topic Solved';
$txt['topic_not_solved'] = 'Topic Not Solved';
$txt['topic_solved_quick'] = 'Mark selected solved';
$txt['topic_solved_quick_confirm'] = 'Are you sure you want to mark selected topics as solved?';
$txt['topic_solved_board'] = 'Topic Solved Board';
$txt['topic_solved_board_desc'] = 'Enables the Topic Solved feature in the board';
$txt['topic_solved_log'] = 'Topic Solved Log';
$txt['topic_solved_no_log'] = 'There are no topic solve actions logged.';
$txt['topic_solved_desc'] = 'Lists topic solved actions that have been performed by moderators on your forum.';
$txt['modlog_topicsolved_log_desc'] = 'Below is a list of all the topic solved actions that have been carried out by moderators of the forum.<br /><b>Please note:</b> Entries cannot be removed from this log until they are at least twenty-four hours old.';
$txt['modlog_ac_solve'] = 'Solved "{topic}"';
$txt['modlog_ac_not_solve'] = 'Un-Solved "{topic}"';
$txt['permissionname_solve_topic'] = 'Marks topics solved';
$txt['permissionhelp_solve_topic'] = 'This permission allows a user to a topic solved.';
$txt['permissionname_solve_topic_own'] = 'Own topic';
$txt['permissionname_solve_topic_any'] = 'Any topic';
$txt['permissionname_simple_solve_topic_own'] = 'Mark their own topic as solved';
$txt['permissionname_simple_solve_topic_any'] = 'Mark anyone\'s topic as solved';
$txt['topic_solved_error_no_board'] = 'Sorry, topic solved feature is not enabled in this board.';
$txt['cannot_support_tools_solve_topic_own'] = 'You cannot mark your topics as solved.';
$txt['cannot_support_tools_solve_topic_any'] = 'You cannot mark topics as solved.';
// Topic Solved
./Themes/default/languages/
Modifications.portuguese_pt.phpPesquisar
?>
Adicionar antes
// Topic Solved translate By Candidosa2
$txt['topic_solved'] = 'Tópico Resolvido';
$txt['topic_not_solved'] = 'Tópico Não Resolvido';
$txt['topic_solved_quick'] = 'Marcar seleccionados resolvidos';
$txt['topic_solved_quick_confirm'] = 'Tem certeza de que deseja marcar tópico como resolvido?';
$txt['topic_solved_board'] = 'Quadro de Tópico Resolvido';
$txt['topic_solved_board_desc'] = 'Activar Tópico Resolvido no quadro ';
$txt['topic_solved_log'] = 'Tópico Resolvido Log';
$txt['topic_solved_no_log'] = 'Não há nenhum tópico resolver em acções autenticado.';
$txt['topic_solved_desc'] = 'Listas tópico resolvido acções que têm sido realizadas pelos moderadores no seu fórum.';
$txt['modlog_topicsolved_log_desc'] = 'Abaixo está uma lista de todos os tópicos que têm como resolvidos acções levadas a cabo pelos moderadores do fórum.<br /><b>Observe:</b> As inscrições não podem ser retirados a partir deste registo, até que sejam pelo menos vinte e quatro horas.';
$txt['modlog_ac_solve'] = 'Resolvido "{topic}"';
$txt['modlog_ac_not_solve'] = 'Não Resolvido "{topic}"';
$txt['permissionname_solve_topic'] = 'Marcas tópicos resolvidos';
$txt['permissionhelp_solve_topic'] = 'Esta permissão permite que um utilizador para marcar um tópico resolvido.';
$txt['permissionname_solve_topic_own'] = 'Tópico próprio';
$txt['permissionname_solve_topic_any'] = 'Qualquer tópico';
$txt['permissionname_simple_solve_topic_own'] = 'Marcar tópico como resolver os seus próprios';
$txt['permissionname_simple_solve_topic_any'] = 'Marcar tópico como resolvido de todos membros';
$txt['topic_solved_error_no_board'] = 'Desculpa,tópico como resolvido o recurso não está activado no presente Quadro.';
$txt['cannot_support_tools_solve_topic_own'] = 'Você não pode marcar seus tópicos como resolvido.';
$txt['cannot_support_tools_solve_topic_any'] = 'Você não pode marcar tópicos como resolvido.';
// Topic Solved Suporte smfpt.net
Subs-TopicSolved.php Para pasta "./Sources" esta no anexo
topicsolved.gif" que esta no anexo colocar ./Themes/teutema/images/post".