Autor Tópico: Topic Solved  (Lida 2992 vezes)

0 Membros e 1 Visitante estão a ver este tópico.

Offline candidosa2

  • Suporte Tecnico
  • Fundador
  • *
  • Mensagens: 5061
  • Rank: 1658
  • Sexo: Masculino
  • Suporte
    • Hosting Moçambique
Topic Solved
« em: 29 de Julho de 2009, 16:03 »
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-1
Download em En - Versao: disponível  2.0 RC1-2

Testado com tema default Funciona 100%


./index.php

Pesquisar
Código: [Seleccione]
'theme' => array('Themes.php', 'ThemesMain'),
Alterar por
Código: [Seleccione]
'theme' => array('Themes.php', 'ThemesMain'),
'topicsolved' => array('Subs-TopicSolved.php', 'TopicSolved'),


./Sources/Admin.php

Pesquisar
Código: [Seleccione]
'modlog' => array($txt['moderation_log'], 'admin_forum', 'enabled' => in_array('ml', $context['admin_features'])),
Alterar por
Código: [Seleccione]
'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
Código: [Seleccione]
'modlog' => array('Modlog.php', 'ViewModlog'),
Alterar por
Código: [Seleccione]
'modlog' => array('Modlog.php', 'ViewModlog'),
'topicsolvedlog' => array('Modlog.php', 'ViewModlog'),


Pesquisar
Código: [Seleccione]
'modlog' => array(
'description' => $txt['moderation_log_desc'],
),

Alterar por
Código: [Seleccione]
'modlog' => array(
'description' => $txt['moderation_log_desc'],
),
'topicsolvedlog' => array(
'description' => $txt['topic_solved_desc'],
),



./Sources/Display.php

Pesquisar
Código: [Seleccione]
$context['topic_first_message'] = $topicinfo['id_first_msg'];
Alterar por
Código: [Seleccione]
$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
Código: [Seleccione]
t.num_replies, t.num_views, t.locked, ms.subject, t.is_sticky
Trocar por
Código: [Seleccione]
t.num_replies, t.num_views, t.locked, ms.subject, t.is_sticky, t.is_solved


./Sources/Load.php

Código: [Seleccione]
b.override_theme, b.count_posts

Trocar por
Código: [Seleccione]
b.override_theme, b.count_posts, b.topic_solved

Pesquisar
Código: [Seleccione]
'posts_count' => empty($row['count_posts']),
Trocar por
Código: [Seleccione]
'posts_count' => empty($row['count_posts']),
'topic_solved' => $row['topic_solved'],



./Sources/ManageBoards.php

Pesquisar
Código: [Seleccione]
$boardOptions['posts_count'] = isset($_POST['count']);
Alterar por
Código: [Seleccione]
$boardOptions['posts_count'] = isset($_POST['count']);
$boardOptions['topic_solved'] = isset($_POST['topic_solved']);

Pesquisar
Código: [Seleccione]
'count_posts' => 1,
Alterar Por
Código: [Seleccione]
'count_posts' => 1,
'topic_solved' => 0,



./Sources/ManagePermissions.php
Pesquisar
Código: [Seleccione]
'remove_own',
'view_attachments',

Alterar por
Código: [Seleccione]
'remove_own',
'view_attachments',
'solve_topic_own',


Pesquisar
Código: [Seleccione]
'poll_add_any',
'approve_posts',

Alterar por
Código: [Seleccione]
'poll_add_any',
'approve_posts',
'solve_topic_any',


Pesquisar
Código: [Seleccione]
'send_topic' => array(false, 'topic', 'moderate'),
Alterar por
Código: [Seleccione]
'send_topic' => array(false, 'topic', 'moderate'),
'solve_topic' => array(true, 'topic', 'moderate'),



./Sources/MessageIndex.php
Pesquisar
Código: [Seleccione]
$context['can_restore'] = allowedTo('move_any') && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] == $board;
Trocar por
Código: [Seleccione]
$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
Código: [Seleccione]
'approve' => $context['can_approve'] && $topic['unapproved_posts']
Alterar por
Código: [Seleccione]
'approve' => $context['can_approve'] && $topic['unapproved_posts'],
'solve' => (allowedTo('solve_topic_any') || ($started && allowedTo('solve_topic_own'))) && !empty($board_info['topic_solved'])

Pesquisar
Código: [Seleccione]
$context['can_remove'] |= ($started && allowedTo('remove_own'));
Alterar por
Código: [Seleccione]
$context['can_remove'] |= ($started && allowedTo('remove_own'));
$context['can_solve'] |= ($started && allowedTo('remove_own')) && !empty($board_info['topic_solved']);

Pesquisar
Código: [Seleccione]
'approve_posts' => allowedTo('approve_posts') ? array($board) : array(),
Alterar por
Código: [Seleccione]
'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
Código: [Seleccione]
'approve_posts' => boardsAllowedTo('approve_posts'),
Alterar por
Código: [Seleccione]
'approve_posts' => boardsAllowedTo('approve_posts'),
'solve_any' => boardsAllowedTo('solve_topic_any'),
'solve_own' => boardsAllowedTo('solve_topic_own'),

Pesquisar
Código: [Seleccione]
$possibleActions[] = 'approve';

Alterar por
Código: [Seleccione]
$possibleActions[] = 'approve';
if (!empty($boards_can['solve_any']) || !empty($boards_can['solve_own']))
$possibleActions[] = 'solve';

Pesquisar
Código: [Seleccione]
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
Código: [Seleccione]
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
Código: [Seleccione]
$approveCache = array();
Alterar por
Código: [Seleccione]
$approveCache = array();
$solveCache = array();

Código: [Seleccione]
$approveCache[] = $topic;
Código: [Seleccione]
$approveCache[] = $topic;
elseif ($action == 'solve')
$solveCache[] = $topic;


Pesquisar
Código: [Seleccione]
foreach ($moveCache as $topic)
Código: [Seleccione]
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
Código: [Seleccione]
foreach ($stickyCache as $topic)
{
logAction('sticky', array('topic' => $topic, 'board' => $stickyCacheBoards[$topic]));
sendNotifications($topic, 'sticky');
}

Alterar por
Código: [Seleccione]
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.php

Pesquisar
Código: [Seleccione]
'modlog' => array(
'enabled' => !empty($modSettings['modlog_enabled']),
'label' => $txt['modlog_view'],
'file' => 'Modlog.php',
'function' => 'ViewModlog',
),

Alterar Por
Código: [Seleccione]
'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.php

Pesquisar
Código: [Seleccione]
$context['log_type'] = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'adminlog' ? 3 : 1;
Alterar por
Código: [Seleccione]
$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
Código: [Seleccione]
$context['url_start'] = '?action=admin;area=logs;sa=' . ($context['log_type'] == 3 ? 'adminlog' : 'modlog') . ';type=' . $context['log_type'];
Alterar por
Código: [Seleccione]
$context['url_start'] = '?action=admin;area=logs;sa=' . ($context['log_type'] == 3 ? 'adminlog' : ($context['log_type'] == 4 ? 'topicsolvedlog' : 'modlog')) . ';type=' . $context['log_type'];

Pesquisar
Código: [Seleccione]
$context['page_title'] = $context['log_type'] == 3 ? $txt['modlog_admin_log'] : $txt['modlog_view'];
Alterar por
Código: [Seleccione]
$context['page_title'] = $context['log_type'] == 3 ? $txt['modlog_admin_log'] : ($context['log_type'] == 4 ? $txt['topic_solved_log'] : $txt['modlog_view']);
Pesquisar
Código: [Seleccione]
'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
Código: [Seleccione]
'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
Código: [Seleccione]
'value' => '<div class="smalltext">' . $txt['modlog_' . ($context['log_type'] == 3 ? 'admin' : 'moderation') . '_log_desc'] . '</div>',

Alterar por
Código: [Seleccione]
'value' => '<div class="smalltext">' . $txt['modlog_' . ($context['log_type'] == 3 ? 'admin' : ($context['log_type'] == 4 ? 'topicsolved' : 'moderation')) . '_log_desc'] . '</div>',


./Sources/Subs.php

Pesquisar
Código: [Seleccione]
'admin' => 3,
Alterar por
Código: [Seleccione]
'admin' => 3,
'topic_solved' => 4,



./Sources/Subs-Boards.php

Pesquisar
Código: [Seleccione]
// Set the theme for this board.
Alterar por
Código: [Seleccione]
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
Código: [Seleccione]
b.board_order, b.count_posts
Alterar por
Código: [Seleccione]
b.board_order, b.count_posts, b.topic_solved
pesquisar
Código: [Seleccione]
'count_posts' => empty($row['count_posts']),
Alterar Por
Código: [Seleccione]
'count_posts' => empty($row['count_posts']),
'topic_solved' => $row['topic_solved'],

./Themes/default/Display.template.php

Pesquisar
Código: [Seleccione]
$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
Código: [Seleccione]
$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.php

Pesquisar
Código: [Seleccione]
document.getElementById("board_theme_div").style.display = redirectEnabled? "none" : "";

Alterar por
Código: [Seleccione]
document.getElementById("board_theme_div").style.display = redirectEnabled? "none" : "";
document.getElementById("topic_solved_div").style.display = redirectEnabled? "none" : "";


Pesquisar
Código: [Seleccione]
// Here the user can choose to force this board to use a theme other than the default theme for the forum.
Alterar por
Código: [Seleccione]
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.php

Pesquisar
Código: [Seleccione]
', $context['can_restore'] ? '<option value="restore">' . $txt['quick_mod_restore'] . '</option>' : '', '
Alterar por
Código: [Seleccione]
', $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.php
Pesquisar
Código: [Seleccione]
?>
Colocar antes

Código: [Seleccione]
// 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 &quot;{topic}&quot;';
$txt['modlog_ac_not_solve'] = 'Un-Solved &quot;{topic}&quot;';

$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.php

Pesquisar
Código: [Seleccione]
?>
Adicionar antes
Código: [Seleccione]
// Topic Solved translate By Candidosa2
$txt['topic_solved'] = 'T&oacute;pico Resolvido';
$txt['topic_not_solved'] = 'T&oacute;pico N&atilde;o Resolvido';
$txt['topic_solved_quick'] = 'Marcar seleccionados resolvidos';
$txt['topic_solved_quick_confirm'] = 'Tem certeza de que deseja marcar t&oacute;pico como resolvido?';

$txt['topic_solved_board'] = 'Quadro de T&oacute;pico Resolvido';
$txt['topic_solved_board_desc'] = 'Activar T&oacute;pico Resolvido no quadro ';

$txt['topic_solved_log'] = 'T&oacute;pico Resolvido Log';
$txt['topic_solved_no_log'] = 'N&atilde;o h&aacute; nenhum t&oacute;pico resolver em ac&ccedil;&otilde;es autenticado.';
$txt['topic_solved_desc'] = 'Listas t&oacute;pico resolvido ac&ccedil;&otilde;es que t&ecirc;m sido realizadas pelos moderadores no seu f&oacute;rum.';
$txt['modlog_topicsolved_log_desc'] = 'Abaixo est&aacute; uma lista de todos os t&oacute;picos que t&ecirc;m como resolvidos ac&ccedil;&otilde;es levadas a cabo pelos moderadores do f&oacute;rum.<br /><b>Observe:</b> As inscri&ccedil;&otilde;es n&atilde;o podem ser retirados a partir deste registo, até que sejam pelo menos vinte e quatro horas.';
$txt['modlog_ac_solve'] = 'Resolvido &quot;{topic}&quot;';
$txt['modlog_ac_not_solve'] = 'N&atilde;o Resolvido &quot;{topic}&quot;';

$txt['permissionname_solve_topic'] = 'Marcas t&oacute;picos resolvidos';
$txt['permissionhelp_solve_topic'] = 'Esta permiss&atilde;o permite que um utilizador para marcar um t&oacute;pico resolvido.';
$txt['permissionname_solve_topic_own'] = 'T&oacute;pico pr&oacute;prio';
$txt['permissionname_solve_topic_any'] = 'Qualquer t&oacute;pico';
$txt['permissionname_simple_solve_topic_own'] = 'Marcar t&oacute;pico como resolver os seus pr&oacute;prios';
$txt['permissionname_simple_solve_topic_any'] = 'Marcar t&oacute;pico como resolvido de todos membros';

$txt['topic_solved_error_no_board'] = 'Desculpa,t&oacute;pico como resolvido o recurso n&atilde;o est&aacute; activado no presente Quadro.';
$txt['cannot_support_tools_solve_topic_own'] = 'Voc&ecirc; n&atilde;o pode marcar seus t&oacute;picos como resolvido.';
$txt['cannot_support_tools_solve_topic_any'] = 'Voc&ecirc; n&atilde;o pode marcar t&oacute;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".
« Última modificação: 29 de Julho de 2009, 16:09 por candidosa2 »