แจกของฟรี
Website => SMF => Modยอดนิยม => ข้อความที่เริ่มโดย: smf ที่ 24 ตุลาคม 2015, 10:44:50
-
Mod Name:Topic Solved
http://custom.simplemachines.org/mods/index.php?mod=1601
ติดตั้งเสร็จให้ไปที่ Modify Boards เลือกบอร์ดที่ต้องการใช้ คลิ้กmodify
(http://www.pordoo.com/pic/Topic Solved.png)
(http://www.pordoo.com/pic/Topic Solved2.png)
(http://www.pordoo.com/pic/Topic Solved3.png)
-
If I selected 'Topic Solved', I hope this topic cannot reply (not including Administrator,Global Moderator,Moderator), how do I edit file?
install.xml
search
<file name="$sourcedir/Display.php">
<operation>
<search position="replace"><![CDATA[ $context['topic_first_message'] = $topicinfo['id_first_msg'];]]></search>
<add><![CDATA[ $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'];]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[t.num_replies, t.num_views, t.locked, ms.subject, t.is_sticky]]></search>
<add><![CDATA[t.num_replies, t.num_views, t.locked, ms.subject, t.is_sticky, t.is_solved]]></add>
</operation>
</file>
replace
<file name="$sourcedir/Display.php">
<operation>
<search position="replace"><![CDATA[ $context['topic_first_message'] = $topicinfo['id_first_msg'];]]></search>
<add><![CDATA[ $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'];]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[t.num_replies, t.num_views, t.locked, ms.subject, t.is_sticky]]></search>
<add><![CDATA[t.num_replies, t.num_views, t.locked, ms.subject, t.is_sticky, t.is_solved]]></add>
</operation>
<operation>
<search position="before"><![CDATA[$context['is_locked'] = $topicinfo['locked'];]]></search>
<add><![CDATA[$context['is_solved'] = $topicinfo['is_solved'];]]></add>
</operation>
<operation>
<search position="before"><![CDATA[$context['can_reply'] &= empty($topicinfo['locked']) || allowedTo('moderate_board');]]></search>
<add><![CDATA[$context['can_reply'] &= $context['is_solved'] == '0' || allowedTo('moderate_board');]]></add>
</operation>
</file>
-
./Themes/default/languages/Modifications.english.php
find:
$txt['topic_solved'] = 'Topic Solved';
replace:
$txt['topic_solved'] = '<span style="color: green;">Topic Solved</span>';
Some custom themes would require
$txt['topic_solved'] = '<font style="color: green;">Topic Solved</font>';
$txt['topic_not_solved'] = '<font style="color: red;">Topic Not Solved</font>';
or
$txt['topic_solved'] = '<div style="color: #00BB00; font-weight: bold;">Mark Topic Solved</div>';
$txt['topic_not_solved'] = '<div style="color: #FF0000; font-weight: bold;">Topic Not Solved</div>';
-
(http://www.pordoo.com/pic/Topic Solved4.png) (http://www.pordoo.com/pic/Topic Solved4.png)
in display.template
Search for:
function template_main()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;
replace with:
function template_main()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings, $topicinfo, $board_info;
search for:
// Show the member's signature?
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
echo '
<div class="signature" id="msg_', $message['id'], '_signature">', $message['member']['signature'], '</div>';
echo '
and replace with:
// Show the member's signature?
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
echo '
<div class="signature" id="msg_', $message['id'], '_signature">', $message['member']['signature'], '</div>';
if ($message['id'] == $context['topic_last_message'] && ($board_info['topic_solved']))
{
echo'<div style="float:left;font-size:x-small;padding:0 4px;border: 1px solid #ddd;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;">';
if ($topicinfo['is_solved'])
echo'<a style="color:#ff0000;" href="'. $scripturl. '?action=topicsolved;topic=' . $context['current_topic'] . ';sesc=' . $context['session_id'] . '"><strong>Topic Not Solved</strong></a>';
else
echo'<a style="color:#00bb00;" href="'. $scripturl. '?action=topicsolved;topic=' . $context['current_topic'] . ';sesc=' . $context['session_id'] . '"><strong>Mark Topic Solved</strong></a>';
echo'</div>';
}
echo '
-
(http://www.pordoo.com/pic/Topic Solved5.png)
../Sources/MessageIndex.php
Find:
t.id_previous_board,
Replace:
t.id_previous_board, t.is_solved,
Find:
// Decide how many pages the topic should have.
Replace:
$row['first_subject'] = $row['is_solved'] ? '[SOLVED] ' . $row['first_subject'] : $row['first_subject'];
// Decide how many pages the topic should have.