24 พฤษภาคม 2555, 23:52:21
ยินดีต้อนรับผู้เยี่ยมชม
  • noavata
  • ยินดีต้อนรับคุณ, ผู้เยี่ยมชม กรุณา เข้าสู่ระบบ หรือ ลงทะเบียน
    เข้าสู่ระบบด้วยชื่อผู้ใช้ รหัสผ่าน และระยะเวลาในเซสชั่น
Page Rank

ทำเว็บไซต์ | แต่งบอร์ด | ออกแบบ | SMF | Joomla | Drupal | WordPress | JQuery | CMS | ECommerce | Tel. +668-08577477

ส่งหัวข้อนี้พิมพ์ หน้า: 1 
icon message ผู้เขียน หัวข้อ: GoodPost BadPost ระบบโหวตกระทู้ดีกระทู้เสีย  (อ่าน 1162 ครั้ง)
0 สมาชิก และ 1 ผู้เยี่ยมชม กำลังดูหัวข้อนี้
*
*


!Personal

Germany   ชาย ผู้เริ่มต้นกระทู้นี้ ออฟไลน์544566157 DexMore DexMore DexMore
เว็บไซต์
  • ชื่อ: Good Post/Bad Post Mod
  • ผู้เขียน: OutofOrder
  • นำเสนอโดย: DexMoreGroup
  • ประเภท: Socialization
  • รองรับ: SMF 1.1.xx, 2.0.xx
  • ปรับปรุงล่าสุด: 11 มีนาคม 2553
  • ต้นฉบับ: Good Post/Bad Post Mod

รายละเอียด
      ระบบโหวตให้คะแนนกระทู้ ซึ่งจะออกมาในรูปแบบกระทู้ดี กระทู้เสียด้วยค่าที่กำหนดไว้เบื้องต้นคือ ติดลบ 5 คะแนนจัดเป็นกระทู้เสียการทำงานของ mod นี้มีดังนี้ครับ
  • สามารถโหวดได้ 1คน 1คะแนนต่อ 1 กระทู้
  • ผลโหวดจะถูกซ่อนในกระทู้เสีย
  • ผลโหวดที่เป็นบวกจะถูกแสดงในกระทู้และข้อมูลส่วนตัว
  • สมาชิกสามารถเลือกกระทู้เสียให้แสดง/ซ่อน/เป็นสีเทา
  • สมาชิกสามารถดูข้อความที่ซ่อนอยู่
  • แสดงสถิติ 10 กระทู้โหวตมากที่สุด และสมาชิกมีคะแนนโหวตมากที่สุด
  • กำหนดให้โหวตได้เฉพาะบอร์ด
  • กำหนดกระทู้เสียให้แสดง/ซ่อน/เป็นสีเทา ของสมาชิกได้ในการตั้งค่าธีม
  • ตั้งค่าซ่อนคะแนนกระทู้ แสดงผลรวมและสถิติใหม่
  • ทำงานได้ถึงแม้ว่าจะเปิดใช้งาน javaScript หรือไม่ก็ตาม (รวมถึงการโหวตด้วย AJAX)

ตัวอย่าง




สำหรับ SMF 1.1.xx

แก้ไขไฟล์:

file $boarddir/index.php

ค้นหา -->>
โค๊ด: [Select]
'findmember' => array('Subs-Auth.php', 'JSMembers'),

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'gpbp' => array('GoodPostBadPost.php', 'GPBP_Vote'),
'gpbpmanage' => array('GoodPostBadPost.php', 'GPBP_Manage'),

file $sourcedir/Display.php

ค้นหา -->>
โค๊ด: [Select]
else
loadTemplate('Display');

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
if (! WIRELESS)
{
// Load the cascade style sheet. Try the current theme's first.
if (file_exists($settings['theme_dir'] . '/gpbp.css'))
$context['html_headers'] = '
<link rel="stylesheet" type="text/css" href="' . $settings['theme_url'] . '/gpbp.css' . '" />';
// Perhaps we'll just use the one from the default template, then...
elseif (file_exists($settings['default_theme_dir'] . '/gpbp.css'))
$context['html_headers'] = '
<link rel="stylesheet" type="text/css" href="' . $settings['default_theme_url'] . '/gpbp.css' . '" />';
// Pre-load the GPBP images to smoothen up AJAX (which prevents making the user nervous)
$context['html_headers'] .= '
<script type="text/javascript" language="Javascript" src="' . $settings['default_theme_url'] . '/gpbp.js"></script>
<script type="text/javascript">
img_gpbp_up=new Image;img_gpbp_up.src=smf_images_url+"gpbp_arrow_up.gif";img_gpbp_up_lit=new Image;img_gpbp_up_lit.src=smf_images_url+"/gpbp_arrow_up_lit.gif";img_gpbp_down=new Image;img_gpbp_down.src=smf_images_url+"/gpbp_arrow_down.gif";img_gpbp_down_lit=new Image;img_gpbp_down_lit.src=smf_images_url+"/gpbp_arrow_down_lit.gif";
</script>';
}

ค้นหา -->>
โค๊ด: [Select]
ID_MSG_MODIFIED < $topicinfo[new_from] AS isRead

เพิ่มไ้ว้หลัง -->>
โค๊ด: [Select]
,
gpbp_score

ค้นหา -->>
โค๊ด: [Select]
$common_permissions = array(

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'can_vote_gpbp' => 'gpbp_vote',
'reveal_bad_post' => 'gpbp_reveal',

ค้นหา -->>
โค๊ด: [Select]
// Load up the "double post" sequencing magic.

เพิ่มไหว้ก่อน -->>
โค๊ด: [Select]
// Good Post Bad Post mod
$context['can_vote_gpbp'] &= !$context['user']['is_guest'];
$context['this_board'] = $board;
$context['gpbp_votes'] = array();
// Not a mistake! That's a single equals.
if ($context['gpbp_enabled'] = $board_info['gpbp_enabled'])
{
// Display hidden messages?
$context['gpbp_revealed'] = !empty($_REQUEST['revealmsg']) && $context['reveal_bad_post'] ? (int) $_REQUEST['revealmsg'] : 0;
if (! empty($messages))
{
// Gather any vote this user casted for each message.
$request = db_query("
SELECT ID_MSG, score
FROM {$db_prefix}log_gpbp
WHERE ID_MSG IN (" . implode(',', $messages) . ")
AND ID_MEMBER = " . $context['user']['id'],__FILE__,__LINE__);
while ($row = mysql_fetch_assoc($request))
$context['gpbp_votes'][$row['ID_MSG']] = $row['score'];
mysql_free_result($request);
}
}

ค้นหา -->>
โค๊ด: [Select]
'can_see_ip' => allowedTo('moderate_forum') || ($message['ID_MEMBER'] == $ID_MEMBER && !empty($ID_MEMBER)),

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'gpbp_score' => $message['gpbp_score'],

ค้นหา -->>
โค๊ด: [Select]
return $output;

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
// If this post is a Bad Post take actions according to the theme settings.
$context['gpbp_bad_post'] = false;
$context['gpbp_action'] = 'none';
// Good Post/Bad Post Mod is on?
if ($context['gpbp_enabled'])
{
$context['gpbp_bad_post'] = $message['gpbp_score'] <= $modSettings['gpbp_hide_threshold'];
if ($context['gpbp_bad_post'])
{
/* The 'gpbp_hide_action' option may have one out of three values:
0: by default hide post contents,
1: display greyed-out post contents,
2: display post contents regardless.
Remember to force post display for certain Bad posts: own or chosen.
*/
if (($message['ID_MEMBER'] == $context['user']['id'] && !$memberContext[$message['ID_MEMBER']]['is_guest']) || $message['ID_MSG'] == $context['gpbp_revealed'])
$context['gpbp_action'] = 'grey';
else
$context['gpbp_action'] = !empty($options['gpbp_hide_action']) ? ($options['gpbp_hide_action'] == 1 ? 'grey' : 'none') : 'hide';
}

// Do we need the Reveal Bad post link?
if ($context['reveal_bad_post'])
$output['href_gpbp_show'] = $scripturl . '?revealmsg=' . $message['ID_MSG'] . ';topic=' . $topic . '.msg' . $message['ID_MSG'] . '#msg' . $message['ID_MSG'];

// Prepare the UI elements
$gpbp_img = array(
'down' => array(
'lit_suffix' => '',
'alt' => 'gpbp_vote_down',
'title' => 'gpbp_to_vote_down'
),
'up' => array(
'lit_suffix' => '',
'alt' => 'gpbp_vote_up',
'title' => 'gpbp_to_vote_up'
)
);
if (!empty($context['gpbp_votes'][$message['ID_MSG']]) && $context['gpbp_votes'][$message['ID_MSG']] == -1)
$gpbp_img['down'] = array(
'lit_suffix' => '_lit',
'alt' => 'gpbp_voted_down_alt',
'title' => 'gpbp_voted_down'
);
elseif (!empty($context['gpbp_votes'][$message['ID_MSG']]) && $context['gpbp_votes'][$message['ID_MSG']] == 1)
$gpbp_img['up'] = array(
'lit_suffix' => '_lit',
'alt' => 'gpbp_voted_up_alt',
'title' => 'gpbp_voted_up'
);

$output['gpbp_img'] = $gpbp_img;
}

file $sourcedir/Load.php

ค้นหา -->>
โค๊ด: [Select]
b.ID_THEME, b.override_theme, b.permission_mode, b.countPosts

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
b.enable_gpbp

ค้นหา -->>
โค๊ด: [Select]
'posts_count' => empty($row['countPosts']),

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'gpbp_enabled' => !empty($row['enable_gpbp']),

ค้นหา -->>
โค๊ด: [Select]
mem.usertitle' : '');

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
$select_columns .= ',
mem.gpbp_respect';

ค้นหา -->>
โค๊ด: [Select]
IF(mem.ID_GROUP = 0 OR mg.stars = '', pg.stars, mg.stars) AS stars, mem.passwordSalt";

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
$select_columns .= ',
mem.gpbp_respect';

ค้นหา -->>
โค๊ด: [Select]
'local_time' => timeformat(time() + ($profile['timeOffset'] - $user_info['time_offset']) * 3600, false),

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'gpbp_respect' => $profile['gpbp_respect'],

file $sourcedir/ManagePermissions.php

ค้นหา -->>
โค๊ด: [Select]
'edit_news' => false,

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'gpbp_manage' => false,

ค้นหา -->>
โค๊ด: [Select]
)
),
'board' => array(

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
),
'gpbp' => array(
'gpbp_vote' => false,
'gpbp_reveal' => false,

ค้นหา -->>
โค๊ด: [Select]
'send_mail',

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'gpbp_manage',
'gpbp_vote',

file $sourcedir/Profile.php

ค้นหา -->>
โค๊ด: [Select]
// Can't change reserved vars.

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
if (empty($modSettings['gpbp_users_choice_none']))
$reservedVars[] = 'gpbp_users_choice_none';

file $sourcedir/Stats.php

ค้นหา -->>
โค๊ด: [Select]
krsort($context['monthly']);

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
// Good Post/Bad Post mod statistics
if (!empty($modSettings['gpbp_display_stats']))
{
// Top 10 Post Voters
$context['gpbp_top_voters'] = array();
$max_num_votes = 1;
$request = db_query("
SELECT l.ID_MEMBER, COUNT(*) AS votes, m.realName
FROM {$db_prefix}log_gpbp l
LEFT JOIN {$db_prefix}members m ON (m.ID_MEMBER = l.ID_MEMBER)
GROUP BY l.ID_MEMBER
ORDER BY votes DESC
LIMIT 10",__FILE__,__LINE__);
while ($row = mysql_fetch_assoc($request))
{
$context['gpbp_top_voters'][] = array(
'votes' => $row['votes'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>'
);
$max_num_votes = $max_num_votes < $row['votes'] ? $row['votes'] : $max_num_votes;
}
mysql_free_result($request);

foreach ($context['gpbp_top_voters'] as $i => $member)
$context['gpbp_top_voters'][$i]['votes_percent'] = round(($member['votes'] * 100) / $max_num_votes);

// 10 Most Respected
$context['gpbp_most_respected'] = array();
$max_respect = 1;
$min_respect = -1;
$request = db_query("
SELECT DISTINCT ID_POSTER
FROM {$db_prefix}log_gpbp",__FILE__,__LINE__);
$posters = array();
while ($row = mysql_fetch_assoc($request))
if (!empty($row['ID_POSTER']))
$posters[] = $row['ID_POSTER'];
mysql_free_result($request);
// No, the $posters array isn't meant to be used in the following query
$request = db_query("
SELECT ID_MEMBER, realName, gpbp_respect
FROM {$db_prefix}members
ORDER BY gpbp_respect DESC
LIMIT 10",__FILE__,__LINE__);
while ($row = mysql_fetch_assoc($request))
{
// Only leave members that have received votes (a Respect value of 0 doesn't mean the member received 0 votes)
if (in_array($row['ID_MEMBER'], $posters))
{
$context['gpbp_most_respected'][] = array(
'respect' => $row['gpbp_respect'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>'
);
$max_respect = $max_respect < $row['gpbp_respect'] ? $row['gpbp_respect'] : $max_respect;
$min_respect = $max_respect > $row['gpbp_respect'] ? $row['gpbp_respect'] : $min_respect;
}
}
mysql_free_result($request);

// This one's a little tricky.
$respect_range = $max_respect - $min_respect;
foreach ($context['gpbp_most_respected'] as $i => $member)
// Obtain the percent value by weighing the respect value within the possible respect range.
$context['gpbp_most_respected'][$i]['respect_percent'] = round((($member['respect'] - $min_respect) * 100) / $respect_range);
}

file $sourcedir/Subs.php

ค้นหา -->>
โค๊ด: [Select]
// Admin area 'Members'.

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
if (allowedTo('gpbp_manage'))
$context['admin_areas']['layout']['areas']['gpbp_manage'] = '<a href="' . $scripturl . '?action=gpbpmanage">' . $txt['gpbp_manage'] . '</a>';

file $themedir/Display.template.php

ค้นหา -->>
โค๊ด: [Select]
while ($message = $context['get_message']())
{
echo '
<tr

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
', $context['gpbp_action'] == 'hide' ? ' id="gpbp_hidden_' . $message['id'] . '"' : '' ,'

ค้นหา -->>
โค๊ด: [Select]
$message['alternate'] == 0 ? 'windowbg' : 'windowbg2'

แก้เป็น -->>
โค๊ด: [Select]
$context['gpbp_action'] == 'hide' ? 'gpbp_hider ' : '', $context['gpbp_bad_post'] && $context['gpbp_action'] != 'none' ? 'gpbp_greyed' : ($message['alternate'] == 0 ? 'windowbg' : 'windowbg2')

ค้นหา -->>
โค๊ด: [Select]
// This shows the popular messaging icons.

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
// Show their amount of Respect.
if ($context['gpbp_enabled'] && !empty($modSettings['gpbp_display_respect']))
echo '
', $txt['gpbp_respect'], ': <span class="gpbp_respect_count_', $message['member']['id'], '">', $message['member']['gpbp_respect'] > 0 ? '+' : '', $message['member']['gpbp_respect'], '</span><br />';

ค้นหา -->>
โค๊ด: [Select]
<td valign="top" width="85%" height="100%">

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
';

// If a Bad Post must be hidden, only display its date and a "Show" link... nothing else.
if ($context['gpbp_bad_post'] && $context['gpbp_action'] == 'hide')
echo '
<div class="gpbp_do_show middletext">
', $message['time'], ' - <em>', $txt['gpbp_hidden'], '</em>', $context['reveal_bad_post'] ? ' <a class="gpbp_show" onclick="gpbp_show_post(\'' . $message['id'] . '\'); return false" href="' . $message['href_gpbp_show'] . '">' . $txt['gpbp_show'] . '</a>' : '', '
</div>';

echo '

ค้นหา -->>
โค๊ด: [Select]
// Can they reply? Have they turned on quick reply?

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
// Good Post/Bad Post score and voting.
if ($context['gpbp_enabled'])
{
$message['gpbp_score'] = ( $message['gpbp_score'] > 0 ? '+' : '' ) . $message['gpbp_score'];
echo '
<div class="gpbp_vote normaltext">
<span id="gpbp_score_', $message['id'], '" class="help" title="', $txt['gpbp_post_score'], '">', $message['gpbp_score'], '</span>';

if ($context['can_vote_gpbp'] && $message['member']['id'] != $context['user']['id'])
{
echo '
<a onclick="oVotePost.vote(\'down\', \'', $message['id'], '\', \'', $context['session_id'], '\'); return false" href="', $scripturl, '?action=gpbp;sa=down;msg=', $message['id'], ';sesc=', $context['session_id'], ';board=', $context['this_board'], ';topic=', $context['current_topic'], '"><img class="gpbp_vote_img" id="gpbp_vote_down_', $message['id'], '" src="', $settings['default_images_url'], '/gpbp_arrow_down', $message['gpbp_img']['down']['lit_suffix'], '.gif" alt="', $txt[ $message['gpbp_img']['down']['alt'] ], '" title="', $txt[ $message['gpbp_img']['down']['title'] ], '" /></a>
<a onclick="oVotePost.vote(\'up\', \'', $message['id'], '\', \'', $context['session_id'], '\'); return false" href="', $scripturl, '?action=gpbp;sa=up;msg=', $message['id'], ';sesc=', $context['session_id'], ';board=', $context['this_board'], ';topic=', $context['current_topic'], '"><img class="gpbp_vote_img" id="gpbp_vote_up_', $message['id'], '" src="', $settings['default_images_url'], '/gpbp_arrow_up', $message['gpbp_img']['up']['lit_suffix'], '.gif" alt="', $txt[ $message['gpbp_img']['up']['alt'] ], '" title="', $txt[ $message['gpbp_img']['up']['title'] ], '" /></a>';
}

echo  '
</div>';
}

ค้นหา -->>

โค๊ด: [Select]
$message['body'

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
'gpbp_bad_post'] && !$context['reveal_bad_post'] ? '' :

ค้นหา -->>
โค๊ด: [Select]
showModifyButtons();

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
',
$context['gpbp_enabled'] ? '

var oVotePost = new PostVoting({
iBoard: ' . $context['this_board'] . ',
iTopic: ' . $context['current_topic'] . ',
sVoteDownAlt: "' . $txt['gpbp_vote_down'] . '",
sVoteUpAlt: "' . $txt['gpbp_vote_up'] . '",
sVotedDownAlt: "' . $txt['gpbp_voted_down_alt'] . '",
sVotedUpAlt: "' . $txt['gpbp_voted_up_alt'] . '",
sVotedDown: "' . $txt['gpbp_voted_down'] . '",
sToVoteDown: "' . $txt['gpbp_to_vote_down'] . '",
sVotedUp: "' . $txt['gpbp_voted_up'] . '",
sToVoteUp: "' . $txt['gpbp_to_vote_up'] . '",
sScriptUrl: "' . $scripturl . '",
sImagesUrl: "' . $settings['images_url'] . '"
});' : '', '

file $themedir/Profile.template.php

ค้นหา -->>
โค๊ด: [Select]
$txt['posts_per_day'], '

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
',
!empty($modSettings['gpbp_display_respect']) ? '
</tr><tr>
<td><b>' . $txt['gpbp_respect'] . ':</b></td>
<td>' . ($context['member']['gpbp_respect'] > 0 ? '+' : '') . $context['member']['gpbp_respect'] . '</td>' : '', '

ค้นหา -->>
โค๊ด: [Select]
$txt['display_quick_mod_image'], '</option>
</select>
</td>

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
</tr>';

if (!empty($modSettings['gpbp_users_choice']))
echo '
<tr>
<td colspan="2"><label for="display_quick_mod">', sprintf($txt['gpbp_member_hide_action'], $modSettings['gpbp_hide_threshold']) , '</label>
<select name="default_options[gpbp_hide_action]" id="gpbp_hide_action">
<option value="0"', empty($context['member']['options']['gpbp_hide_action']) ? ' selected="selected"' : '', '>', $txt['gpbp_hide_action_hide'], '</option>
<option value="1"', !empty($context['member']['options']['gpbp_hide_action']) && $context['member']['options']['gpbp_hide_action'] == 1 ? ' selected="selected"' : '', '>', $txt['gpbp_hide_action_grey'], '</option>', $modSettings['gpbp_users_choice_none'] ? '
<option value="2"' . (!empty($context['member']['options']['gpbp_hide_action']) && $context['member']['options']['gpbp_hide_action'] != 1 ? ' selected="selected"' : '') . '>' . $txt['gpbp_hide_action_none']. '</option>' : '', '
</select>
</td>

file $themedir/Settings.template.php

ค้นหา -->>
โค๊ด: [Select]
);
}

function template_settings()

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
array(
'id' => 'gpbp_hide_action',
'label' => $txt['gpbp_hide_action'],
'options' => array(
0 => $txt['gpbp_hide_action_hide'],
1 => $txt['gpbp_hide_action_grey'],
2 => $txt['gpbp_hide_action_none'],
),
'default' => true,
),

file $themedir/Stats.template.php

ค้นหา -->>
โค๊ด: [Select]
$poster['time_online'], '</td>
</tr>';

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
// Display Good Post/Bad Post mod stats?
if (!empty($modSettings['gpbp_display_stats']))
{
echo '
</table>
</td>
</tr><tr>
<td class="catbg" colspan="2" width="50%"><b>', $txt['gpbp_top_voters'], '</b></td>
<td class="catbg" colspan="2" width="50%"><b>', $txt['gpbp_most_respected'], '</b></td>
</tr><tr>
<td class="windowbg" width="20" valign="middle" align="center"><img src="', $settings['images_url'], '/stats_posters.gif" width="20" height="20" alt="" /></td>
<td class="windowbg2" width="50%" valign="top">
<table border="0" cellpadding="1" cellspacing="0" width="100%">';
foreach ($context['gpbp_top_voters'] as $poster)
echo '
<tr>
<td width="60%" valign="top">', $poster['link'], '</td>
<td width="20%" align="left" valign="top">', $poster['votes'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $poster['votes_percent'] . '" height="15" alt="" />' : '&nbsp;', '</td>
<td width="20%" align="right" valign="top">', $poster['votes'], '</td>
</tr>';
echo '
</table>
</td>
<td class="windowbg" width="20" valign="middle" align="center" nowrap="nowrap"><img src="', $settings['images_url'], '/stats_posters.gif" width="20" height="20" alt="" /></td>
<td class="windowbg2" width="50%" valign="top">
<table border="0" cellpadding="1" cellspacing="0" width="100%">';
foreach ($context['gpbp_most_respected'] as $poster)
echo '
<tr>
<td width="60%" valign="top">', $poster['link'], '</td>
<td width="20%" align="left" valign="top">', $poster['respect'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $poster['respect_percent'] . '" height="15" alt="" />' : '&nbsp;', '</td>
<td width="20%" align="right" valign="top" nowrap="nowrap">', $poster['respect'], '</td>
</tr>';
}

file $languagedir/Help.thai-utf8.php

เพิ่ม -->>
โค๊ด: [Select]
// Good Post/Bad Post mod strings
$helptxt['gpbp_threshold'] = 'Depending on each user\'s Theme and Layout configuration, this may result in collapsing a Bad Post, greying a Bad Post out, or nothing at all (the Bad Post subject is still greyed out).<br /><br /><b>Bad Posts that are voted back above the threshold become normal posts again.</b>';
$helptxt['gpbp_display_respect'] = 'Respect is the sum of all received votes. Negative votes substract from this value.';

file $languagedir/Who.thai-utf8.php

เพิ่ม -->>
โค๊ด: [Select]
// Good Post/Bad Post: it may be nice to let users know of this.
$txt['whotopic_gpbp'] = 'Voting a message from &quot;<a href="' . $scripturl . '?topic=%d.0">%s</a>&quot;.';

file $languagedir/Modifications.thai-utf8.php

โค๊ด: [Select]
// Good Post/Bad Post permission strings.
$txt['permissiongroup_gpbp'] = 'จัดการคะแนนกระทู้';
$txt['permissionname_gpbp_manage'] = 'Manage Good Post/Bad Post mod settings';
$txt['permissionhelp_gpbp_manage'] = 'This permission includes';
$txt['cannot_gpbp_manage'] = 'You are not allowed to manage settings of the Good Post/Bad Post mod.';
$txt['permissionname_gpbp_vote'] = 'Vote on posts (up or down)';
$txt['permissionhelp_gpbp_vote'] = 'Allows the user to positively or negatively change the score of a post. The board containing the post must also be configured to allow post voting.<br/><br/><strong>Note</strong>: Forum guests can\'t vote regardless this permission.';
$txt['cannot_gpbp_vote'] = 'Sorry, you are not allowed to vote posts.';
$txt['permissionname_gpbp_reveal'] = 'Reveal Bad posts';
$txt['permissionhelp_gpbp_reveal'] = 'Allows the user to view posts that were hidden because of a low voting score.';
$txt['cannot_gpbp_reveal'] = 'You can not have access to posts hidden by general voting.';
// Managing area.
$txt['gpbp_manage'] = 'Good Post/Bad Post';
$txt['gpbp_manage_title'] = 'Good Post/Bad Post Managing';
$txt['gpbp_hide_action'] = 'Good Post/Bad Post Mod: What to do with Bad Posts?';
$txt['gpbp_hide_action_hide'] = 'Hide them.';
$txt['gpbp_hide_action_grey'] = 'Grey them out.';
$txt['gpbp_hide_action_none'] = 'Nothing.';
$txt['gpbp_settings'] = 'Good Post/Bad Post (GP/BP) Mod settings';
$txt['gpbp_bad_threshold'] = 'Bad Post threshold';
$txt['gpbp_bad_threshold_desc'] = 'Any post currently at this value or below will be marked as a Bad Post.';
$txt['gpbp_show_respect'] = 'Show Respect gathered by users';
$txt['gpbp_show_respect_desc'] = 'Displays the Respect counter in posts and in the profile summary.';
$txt['gpbp_enable_boards'] = 'Enable GP/BP on these boards';
$txt['gpbp_enable_boards_desc'] = 'Choose which boards will have post voting enabled.<br /><br /><strong>Note:</strong> Post votes never get deleted. Re-enabling post voting in a board will simply result in displaying previously casted votes.';
$txt['gpbp_choose_boards'] = 'Boards to choose from';
$txt['gpbp_display_stats'] = 'Display GP/BP statistics in the Stats page?';
$txt['gpbp_display_stats_desc'] = 'Choose whether or not to display the <strong>Top 10 Post Voters</strong> list and <strong>10 Most Respected</strong> users.';
$txt['gpbp_users_choice'] = 'Users choose their own GP/BP layout settings';
$txt['gpbp_users_choice_desc'] = 'Check this option to allow members to choose their own settings (hide, grey-out, nothing), or uncheck to force the current settings.<br /> You can change the current theme settings by going to the <strong>Member Options</strong> section in the Themes managing area.';
$txt['gpbp_users_choice_none'] = 'Let users choose to do &quot;Nothing&quot; with Bad Posts?';
$txt['gpbp_users_choice_none_desc'] = 'Check this to allow displaying Bad Posts as normal posts. Unchecking this does not override any chosen options, so you still have to edit the member theme options to disable it completely.';
// Voting errors.
$txt['gpbp_lacks_msg'] = 'You did not specify a (valid) message to vote.';
$txt['gpbp_notinthisboard'] = 'Sorry, this board doesn\'t have post voting enabled.';
$txt['gpbp_msg_not_found'] = 'The message you specified was not found.';
$txt['gpbp_msg_own_voted'] = 'Sorry, you can\'t vote on your own posts.';
// General user interface.
$txt['gpbp_respect'] = 'Respect';
$txt['gpbp_post_score'] = 'The current score of this post.';
$txt['gpbp_vote_down'] = 'Vote Down';
$txt['gpbp_vote_up'] = 'Vote Up';
$txt['gpbp_voted_down_alt'] = 'Voted down.';
$txt['gpbp_voted_up_alt'] = 'Voted up.';
$txt['gpbp_voted_down'] = 'You have voted this post down. Click to un-vote.';
$txt['gpbp_to_vote_down'] = 'Click to vote this post down.';
$txt['gpbp_voted_up'] = 'You have voted this post up. Click to un-vote.';
$txt['gpbp_to_vote_up'] = 'Click to vote this post up.';
$txt['gpbp_hidden'] = 'Hidden.';
$txt['gpbp_show'] = 'Show this post.';
$txt['gpbp_member_hide_action'] = 'Voted posts: What to do with posts scoring <strong>%s</strong> or less?';
$txt['gpbp_top_voters'] = 'Top 10 Post Voters';
$txt['gpbp_most_respected'] = '10 Most Respected';

ดาวน์โหลด: gpbp1.rar
ขออภัย! ท่านไม่สามารถเข้าถึงข้อมูลส่วนนี้ได้ กรุณาอ่าน เงื่อนไขการใช้งาน DexMore.Com

แตกไฟล์แล้วอัพโหลดไปไว้ที่
file GoodPostBadPost.php -->> $sourcedir
file GPBPManage.template.php -->> $themedir
file gpbp.css -->> $themedir
file gpbp.js -->> $themedir
file gpbp_arrow_down.gif -->> $imagesdir
file gpbp_arrow_down_lit.gif -->> $imagesdir
file gpbp_arrow_up.gif -->> $imagesdir
file gpbp_arrow_up_lit.gif -->> $imagesdir
file gpbp_grey_stripes.png -->> $imagesdir

สร้างไฟล์: gpbp_install.php เพื่อสร้างฐานข้อมูล ไว้ใน $boarddir (ที่เดียวกับไฟล์ SSI.php) รัน http://www.your_url.xxx/$boarddir/gpbp_install.php -->> Enter เสร็จแล้วลบทิ้ง
โค๊ด: [Select]
<?php
if(file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF'))
require_once(dirname(__FILE__) . '/SSI.php');
else if(!
defined('SMF'))
die('<b>Error:</b> Cannot install - please verify you placed this file in the same folder as SMF\'s index.php and SSI.php files.');

if((
SMF == 'SSI') && !$user_info['is_admin'])
die('Admin priveleges required.');

db_extend('packages');

// New table: Vote tracking.
$smcFunc['db_create_table']('{db_prefix}log_gpbp',
array(
array(
'name' => 'id_msg',
'type' => 'int',
'size' => 10,
'unsigned' => true,
'null' => false
),
array(
'name' => 'id_member',
'type' => 'mediumint',
'size' => 8,
'unsigned' => true,
'null' => false
),
array(
'name' => 'score',
'type' => 'smallint',
'size' => 2,
'null' => false
),
array(
'name' => 'id_poster',
'type' => 'mediumint',
'size' => 8,
'unsigned' => true,
'null' => false
),
),
array(
array(
'type' => 'index',
'columns' => array('id_member'),
),
array(
'type' => 'index',
'columns' => array('id_poster'),
),
array(
'type' => 'primary',
'columns' => array('id_msg''id_member'),
),
),
array(),
'ignore');

// I'm sorry SMF, but some tables need extra columns!

// For instance, the vote count per message.
$smcFunc['db_add_column']('{db_prefix}messages',
array(
'name' => 'gpbp_score',
'type' => 'smallint',
'size' => 6,
'null' => false,
'default' => 0
),
array(),
'ignore'
);
// Or the Respect count per member.
$smcFunc['db_add_column']('{db_prefix}members',
array(
'name' => 'gpbp_respect',
'type' => 'smallint',
'size' => 6,
'null' => false,
'default' => 0
),
array(),
'ignore'
);
// Or the mod switch per board. 
$smcFunc['db_add_column']('{db_prefix}boards',
array(
'name' => 'enable_gpbp',
'type' => 'tinyint',
'size' => 1,
'null' => false,
'default' => 0
),
array(),
'ignore'
);

// Finally, add some default settings.
$smcFunc['db_insert']('ignore',
'{db_prefix}settings',
array(
'variable' => 'string',
'value' => 'string'
),
array(
array('gpbp_hide_threshold''-5'),
array('gpbp_display_respect''1'),
array('gpbp_display_stats''1'),
array('gpbp_users_choice''1'),
array('gpbp_users_choice_none''0'),
),
array('variable')
);

if(
SMF == 'SSI')
echo 'Finished updating the database. Please delete this file.';
?>

การตั้งค่า: ผู้ดูแล -->> จัดการคะแนนกระทู้

ลิงค์หัวข้อ: http://dexmore.com/topic/2028
Windows XP    Firefox 3.6.3   see ip บันทึกการเข้า
ดูรายการสิ่งของสำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  สำหรับติดหมุดกระทู้ของคุณ!  เพิ่มเวลาที่อยู่ในระบบอีก 12 ชั่วโมง  น้องหมี..เอาไว้กอดนอนแทนกิ๊ก  สำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  
*
*


!Personal

Germany   ชาย ผู้เริ่มต้นกระทู้นี้ ออฟไลน์544566157 DexMore DexMore DexMore
เว็บไซต์
icon message
general ความคิดเห็นที่ 1 เมื่อ: 19 มิถุนายน 2553, 18:50:51
สำหรับ SMF 2.0.xx

      สำหรับ SMF 2.2.xx จะมีความสามารถเพิ่มเติมจาก SMF 1.1.xx ดังนี้
  • ปุ่มให้คะแนนชุดเพิ่มเติม
  • สามารถดูรายชื่อผู้โหวตได้
  • ตัวเลือกปิดการให้คะแนนลบ
  • ตัวเลือกต้องมีจำนวนกระทู้ xx ถึงจะโหวตได้
  • แสดงรายการกระทู้ที่ได้รับการโหวตประจำสัปดาห์ บนศูนย์กลางข้อมูล
  • เพิ่มเครื่องมือสำหรับผู้ดูแลให้การจัดการกับคะแนนโหวต
  • จะต้องใส่หรัสผ่านเข้าไปจัดการกับคะแนนโหวต เหมือนการเข้าสู่ศูนย์ดำเนินการระบบ

แก้ไขไฟล์:

file $boarddir/index.php

ค้นหา -->>
โค๊ด: [Select]
'findmember' => array('Subs-Auth.php', 'JSMembers'),

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'gpbp' => array('GoodPostBadPost.php', 'GPBP_Vote'),
'gpbpmanage' => array('GoodPostBadPost.php', 'GPBP_Manage'),

file $sourcedir/Admin.php

ค้นหา -->>
โค๊ด: [Select]
'title' => $txt['layout_controls'],
'permission' => array('manage_boards', 'admin_forum', 'manage_smileys', 'manage_attachments', 'moderate_forum'

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
, 'gpbp_manage'

ค้นหา -->>
โค๊ด: [Select]
),
),
'members' => array(

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
'gpbp' => array(
'icon' => 'gpbp_manage.gif',
'label' => $txt['gpbp_manage'],
'file' => 'GoodPostBadPost.php',
'function' => 'GPBP_Manage',
'permission' => array('manage_gpbp'),
'subsections' => array(
'basic' => array($txt['gpbp_managearea_basic']),
'advanced' => array($txt['gpbp_managearea_advanced']),
'tools' => array($txt['gpbp_managearea_tools']),
),
),

file $sourcedir/BoardIndex.php

ค้นหา -->>
โค๊ด: [Select]
$context['page_title'] = sprintf($txt['forum_index'], $context['forum_name']);
}


เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
// GPBP: Load Best topics of the week?
if (!empty($modSettings['gpbp_show_best_topics']))
{
require_once($sourcedir . '/GoodPostBadPost.php');
$context['gpbp_best_topics'] = gpbp_getBestTopics();
}

file $sourcedir/Display.php

ค้นหา -->>
โค๊ด: [Select]
else
loadTemplate('Display');

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
if (! WIRELESS)
{
// Load the cascade style sheet for GP/BP elements. If the theme doesn't have its own gpbp.css, it will use the one in the default theme.
loadTemplate(false, array('gpbp'), false);
$gpbp_set = $modSettings['gpbp_button_set'];
$gpbp_ext = empty($gpbp_set) ? 'gif' : 'png';
// Pre-load the GPBP images to smoothen up AJAX and prevent making the user nervous.
$context['html_headers'] .= '
<script type="text/javascript" language="Javascript" src="' . $settings['default_theme_url'] . '/scripts/gpbp.js?2_0"></script>
<script type="text/javascript">
img_gpbp_up=new Image;img_gpbp_up.src="' . $settings['images_url'] . '/gpbp'.$gpbp_set.'_arrow_up.'.$gpbp_ext.'";img_gpbp_up_lit=new Image;img_gpbp_up_lit.src="' . $settings['images_url'] . '/gpbp'.$gpbp_set.'_arrow_up_lit.'.$gpbp_ext.'";img_gpbp_down=new Image;img_gpbp_down.src="' . $settings['images_url'] . '/gpbp'.$gpbp_set.'_arrow_down.'.$gpbp_ext.'";img_gpbp_down_lit=new Image;img_gpbp_down_lit.src="' . $settings['images_url'] . '/gpbp'.$gpbp_set.'_arrow_down_lit.'.$gpbp_ext.'";
</script>
<style type="text/css">
.gpbp_voted_up {
background: transparent top left url(' . $settings['images_url'] . '/gpbp'.$gpbp_set.'_arrow_up_lit.'.$gpbp_ext.') no-repeat;
}
.gpbp_voted_down {
background: transparent top left url(' . $settings['images_url'] . '/gpbp'.$gpbp_set.'_arrow_down_lit.'.$gpbp_ext.') no-repeat;
}
</style>';
}]]></add>
</operation>

<operation>
<search position="before"><![CDATA[
id_msg_modified < {int:new_from} AS is_read]]></search>
<add><![CDATA[,
gpbp_score]]></add>
</operation>

<operation>
<search position="before"><![CDATA[
'can_restore_msg' => 'move_any',]]></search>
<add><![CDATA[
'can_vote_gpbp' => 'gpbp_vote',
'reveal_bad_post' => 'gpbp_reveal',
'reveal_voterslist' => 'gpbp_voterslist',]]></add>
</operation>

<operation>
<search position="before"><![CDATA[$context['can_send_topic'] = (!$modSettings['postmod_active'] || $topicinfo['approved']) && allowedTo('send_topic');]]></search>
<add><![CDATA[
// Good Post/Bad Post cleanup
$context['can_vote_gpbp'] &= !$context['user']['is_guest'] && $modSettings['gpbp_post_count_limit'] <= $user_info['posts'];
$context['reveal_voterslist'] &= ! empty($modSettings['gpbp_voters_list_limit']);]]></add>
</operation>

<operation>
<search position="after"><![CDATA[ // Load up the "double post" sequencing magic.]]></search>
<add><![CDATA[ // Good Post Bad Post mod
$context['this_board'] = $board;
$context['gpbp_votes'] = array();
// Not a mistake! That's a single equals.
if ($context['gpbp_enabled'] = $board_info['gpbp_enabled'])
{
// Display hidden message?
$context['gpbp_revealed'] = !empty($_REQUEST['revealmsg']) && $context['reveal_bad_post'] ? (int) $_REQUEST['revealmsg'] : 0;
if (!empty($messages))
{
// Gather any vote this user casted for each message.
$request = $smcFunc['db_query']('', '
SELECT id_msg, score
FROM {db_prefix}log_gpbp
WHERE id_msg IN ({array_int:message_list})
AND id_member = {int:current}',
array(
'message_list' => $messages,
'current' => $context['user']['id'],
)
);
while ($row = $smcFunc['db_fetch_assoc']($request))
$context['gpbp_votes'][$row['id_msg']] = $row['score'];
$smcFunc['db_free_result']($request);
}
}

ค้นหา -->>
โค๊ด: [Select]
'can_see_ip' => allowedTo('moderate_forum') || ($message['id_member'] == $user_info['id'] && !empty($user_info['id'])),

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'gpbp_score' => $message['gpbp_score'],

ค้นหา -->>
โค๊ด: [Select]
return $output;
}

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
// Good Post/Bad Post Mod is on?
if ($context['gpbp_enabled'])
{
// Do we need the Reveal Bad post link?
if ($context['reveal_bad_post'])
$output['href_gpbp_show'] = $scripturl . '?revealmsg=' . $message['id_msg'] . ';topic=' . $topic . '.msg' . $message['id_msg'] . '#msg' . $message['id_msg'];

// Prepare the UI elements
$gpbp_img = array(
'down' => array(
'lit_suffix' => '',
'alt' => 'gpbp_vote_down',
'title' => 'gpbp_to_vote_down'
),
'up' => array(
'lit_suffix' => '',
'alt' => 'gpbp_vote_up',
'title' => 'gpbp_to_vote_up'
)
);
if (!empty($context['gpbp_votes'][$message['id_msg']]) && $context['gpbp_votes'][$message['id_msg']] == -1)
$gpbp_img['down'] = array(
'lit_suffix' => '_lit',
'alt' => 'gpbp_voted_down_alt',
'title' => 'gpbp_voted_down'
);
elseif (!empty($context['gpbp_votes'][$message['id_msg']]) && $context['gpbp_votes'][$message['id_msg']] == 1)
$gpbp_img['up'] = array(
'lit_suffix' => '_lit',
'alt' => 'gpbp_voted_up_alt',
'title' => 'gpbp_voted_up'
);

$output['gpbp_img'] = $gpbp_img;
}

file $sourcedir/Load.php

ค้นหา -->>
โค๊ด: [Select]
b.unapproved_topics, b.unapproved_posts' . (!empty($topic) ? ', t.approved, t.id_member_started' : '') . '

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
[,
b.enable_gpbp

ค้นหา -->>
โค๊ด: [Select]
'cur_topic_starter' => empty($topic) ? 0 : $row['id_member_started'],

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'gpbp_enabled' => !empty($row['enable_gpbp']),

ค้นหา -->>
โค๊ด: [Select]
$select_tables = '
LEFT JOIN {db_prefix}log_online AS lo ON (lo.id_member = mem.id_member)
LEFT JOIN {db_prefix}attachments AS a ON (a.id_member = mem.id_member)
LEFT JOIN {db_prefix}membergroups AS pg ON (pg.id_group = mem.id_post_group)
LEFT JOIN {db_prefix}membergroups AS mg ON (mg.id_group = mem.id_group)';
}
elseif ($set == 'profile')

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
$select_columns .= ',
mem.gpbp_respect';

ค้นหา -->>
โค๊ด: [Select]
$select_tables = '
LEFT JOIN {db_prefix}log_online AS lo ON (lo.id_member = mem.id_member)
LEFT JOIN {db_prefix}attachments AS a ON (a.id_member = mem.id_member)
LEFT JOIN {db_prefix}membergroups AS pg ON (pg.id_group = mem.id_post_group)
LEFT JOIN {db_prefix}membergroups AS mg ON (mg.id_group = mem.id_group)';
}
elseif ($set == 'minimal')

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
$select_columns .= ',
mem.gpbp_respect';

ค้นหา -->>
โค๊ด: [Select]
'is_guest' => false,

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'gpbp_respect' => $profile['gpbp_respect'],

file $sourcedir/ManagePermissions.php

ค้นหา -->>
โค๊ด: [Select]
),
'classic' => array(
'general',

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
'gpbp',

ค้นหา -->>
โค๊ด: [Select]
),
),
'board' => array(
'simple' => array(

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
'gpbp',

ค้นหา -->>
โค๊ด: [Select]
'profile_remote_avatar' => array(false, 'profile', 'use_avatar'),

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'gpbp_vote' => array(false, 'gpbp', 'gpbp'),
'gpbp_reveal' => array(false, 'gpbp', 'gpbp'),
'gpbp_voterslist' => array(false, 'gpbp', 'gpbp'),
'gpbp_manage' => array(false, 'maintenance', 'administrate'),

file $sourcedir/Profile-Modify.php

ค้นหา -->>
โค๊ด: [Select]
// Can't change reserved vars.

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
if (empty($modSettings['gpbp_users_choice_none']))
$reservedVars[] = 'gpbp_users_choice_none';

file $sourcedir/Stats.php

ค้นหา -->>
โค๊ด: [Select]
if (empty($_SESSION['expanded_stats']))
return;

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
// Good Post/Bad Post mod statistics
if (!empty($modSettings['gpbp_display_stats']))
{
// Top 10 Post Voters
$context['gpbp_top_voters'] = array();
$max_num_votes = 1;
$request = $smcFunc['db_query']('', '
SELECT l.id_member, COUNT(*) AS votes, m.real_name
FROM {db_prefix}log_gpbp l
LEFT JOIN {db_prefix}members m ON (m.id_member = l.id_member)
GROUP BY l.id_member
ORDER BY votes DESC
LIMIT 10');
while ($row = $smcFunc['db_fetch_assoc']($request))
{
$context['gpbp_top_voters'][] = array(
'votes' => $row['votes'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>'
);
$max_num_votes = $max_num_votes < $row['votes'] ? $row['votes'] : $max_num_votes;
}
$smcFunc['db_free_result']($request);

foreach ($context['gpbp_top_voters'] as $i => $member)
$context['gpbp_top_voters'][$i]['votes_percent'] = round(($member['votes'] * 100) / $max_num_votes);

// 10 Most Respected
$context['gpbp_most_respected'] = array();
$max_respect = 1;
$min_respect = -1;
$request = $smcFunc['db_query']('', '
SELECT DISTINCT id_poster
FROM {db_prefix}log_gpbp');
$posters = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
if (!empty($row['id_poster']))
$posters[] = $row['id_poster'];
$smcFunc['db_free_result']($request);
// No, the $posters array isn't meant to be used in the following query
$request = $smcFunc['db_query']('', '
SELECT id_member, real_name, gpbp_respect
FROM {db_prefix}members
ORDER BY gpbp_respect DESC
LIMIT 10');
while ($row = $smcFunc['db_fetch_assoc']($request))
{
// Only leave members that have received votes (a Respect value of 0 doesn't mean the member received 0 votes)
if (in_array($row['id_member'], $posters))
{
$context['gpbp_most_respected'][] = array(
'respect' => $row['gpbp_respect'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>'
);
$max_respect = $max_respect < $row['gpbp_respect'] ? $row['gpbp_respect'] : $max_respect;
$min_respect = $max_respect > $row['gpbp_respect'] ? $row['gpbp_respect'] : $min_respect;
}
}
$smcFunc['db_free_result']($request);

// This one's a little tricky.
$respect_range = $max_respect - $min_respect;
foreach ($context['gpbp_most_respected'] as $i => $member)
// Obtain the percent value by weighing the respect value within the possible respect range.
$context['gpbp_most_respected'][$i]['respect_percent'] = round((($member['respect'] - $min_respect) * 100) / $respect_range);
}

file $themedir/BoardIndex.template.php

ค้นหา -->>
โค๊ด: [Select]
// Show statistical style information...

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
// Good Post/Bad Post: Show most recently voted topics...
if (! empty($modSettings['gpbp_show_best_topics']) && ! empty($context['gpbp_best_topics']))
{
echo '
<h4 class="titlebg"><span class="left"></span>
<img class="icon" src="', $settings['images_url'], '/icons/gpbp_motw.gif" alt="MOTW" />
<span>Messages of the Week</span>
</h4>';
$odd = 0;
foreach ($context['gpbp_best_topics'] as $message)
echo '
<p class="inline windowbg', $odd++ % 2 ? '' : '2','">
<a href="', $scripturl, '?topic=', $message['topic'], '.msg', $message['msg'], '#msg', $message['msg'], '">', $message['subject'], '</a>
by ', ! empty($message['member_id']) ? '<a href="' . $scripturl . '?action=profile;u=' . $message['member_id'] . '"><strong>' : '', $message['member_name'], ! empty($message['member_id']) ? '</strong></a>' : '', '
(', $message['score'] > 0 ? '+' : '-', $message['score'], ')
in <em>', $message['board_name'], '</em>
</p>';
}


file $themedir/Display.template.ph

ค้นหา -->>
โค๊ด: [Select]
// Are we ignoring this message?

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
// If this post is a Bad Post take actions according to the theme settings.
$gpbp_badPost = false;
$gpbp_action = 'none';
if ($context['gpbp_enabled'])
{
// Prepare the GP/BP button set.
$gpbp_set = $modSettings['gpbp_button_set'];
$gpbp_ext = empty($gpbp_set) ? 'gif' : 'png';
$gpbp_badPost = $message['gpbp_score'] <= $modSettings['gpbp_hide_threshold'];
if ($gpbp_badPost)
{
/* The 'gpbp_hide_action' option may have one out of three values:
0: by default hide post contents,
1: display greyed-out post contents,
2: display post contents regardless.
Remember to force post display for certain Bad posts: own or chosen.
*/
if (($message['member']['id'] == $context['user']['id'] && !$message['member']['is_guest']) || $message['id'] == $context['gpbp_revealed'])
$gpbp_action = 'grey';
else
$gpbp_action = !empty($options['gpbp_hide_action']) ? ($options['gpbp_hide_action'] == 1 ? 'grey' : 'none') : 'hide';
}
}

ค้นหา -->>
โค๊ด: [Select]
<div class="', $message['approved'] ? ($message['alternate'] == 0 ? 'windowbg' : 'windowbg2')

แก้เป็น -->>
โค๊ด: [Select]
<div', $gpbp_action == 'hide' ? ' id="gpbp_hidden_' . $message['id'] . '"' : '' ,' class="', $message['approved'] ? ($gpbp_action == 'hide' ? 'gpbp_hider ' : '') . ($gpbp_badPost && $gpbp_action != 'none' ? 'gpbp_greyed' : ($message['alternate'] == 0 ? 'windowbg' : 'windowbg2'))

ค้นหา -->>
โค๊ด: [Select]
// Any custom fields to show as icons?

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
// Show their amount of Respect.
if ($context['gpbp_enabled'] && !empty($modSettings['gpbp_display_respect']))
echo '
<li class="gpbp_respect">', $txt['gpbp_respect'], ': <span class="gpbp_respect_count_', $message['member']['id'], '">', $message['member']['gpbp_respect'] > 0 ? '+' : '', $message['member']['gpbp_respect'], '</span></li>';

ค้นหา -->>
โค๊ด: [Select]
echo '
</div>';

// Ignoring this user?

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
// Good Post/Bad Post score, voting and voters list retrieval.
if ($context['gpbp_enabled'])
{
$message['gpbp_score'] = ( $message['gpbp_score'] > 0 ? '+' : '' ) . $message['gpbp_score'];
echo '
<div class="gpbp_vote">
<span id="gpbp_score_', $message['id'], '" class="help" title="', $txt['gpbp_post_score'], '">', $message['gpbp_score'], '</span>';

if (!$ignoring)
{
if ($context['can_vote_gpbp'] && $message['member']['id'] != $context['user']['id'])
{
// Should we not display the voting down button?
if (empty($modSettings['gpbp_disable_negative_voting']))
echo '
<a onclick="oVotePost.vote(\'down\', \'', $message['id'], '\'); return false" href="', $scripturl, '?action=gpbp;sa=down;msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], ';board=', $context['current_board'], ';topic=', $context['current_topic'], '"><img class="gpbp_vote_img" id="gpbp_vote_down_', $message['id'], '" src="', $settings['images_url'], '/gpbp', $gpbp_set, '_arrow_down', $message['gpbp_img']['down']['lit_suffix'], '.', $gpbp_ext, '" alt="', $txt[ $message['gpbp_img']['down']['alt'] ], '" title="', $txt[ $message['gpbp_img']['down']['title'] ], '" /></a>';
echo '
<a onclick="oVotePost.vote(\'up\', \'', $message['id'], '\'); return false" href="', $scripturl, '?action=gpbp;sa=up;msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], ';board=', $context['current_board'], ';topic=', $context['current_topic'], '"><img class="gpbp_vote_img" id="gpbp_vote_up_', $message['id'], '" src="', $settings['images_url'], '/gpbp', $gpbp_set, '_arrow_up', $message['gpbp_img']['up']['lit_suffix'], '.', $gpbp_ext, '" alt="', $txt[ $message['gpbp_img']['up']['alt'] ], '" title="', $txt[ $message['gpbp_img']['up']['title'] ], '" /></a>';
}
if ($context['reveal_voterslist'])
echo '
<a class="gpbp_voterslist" id="gpbp_voterslist_', $message['id'], '" onclick="oVotePost.voterslist(\'', $message['id'], '\'); return false"><img class="gpbp_vote_img" src="', $settings['images_url'], '/gpbp_voterslist.gif" alt="', $txt['gpbp_show_voters'], '" title="', $txt['gpbp_show_voters'], '" /></a>
<select onchange="gpbp_toProfile(\'gpbp_voters_select_', $message['id'], '\')" class="gpbp_voterslist_select" id="gpbp_voters_select_', $message['id'], '"><option value="0" selected="selected">', $txt['gpbp_voters_list'], '</option></select>';
}

echo  '
</div>';
}

ค้นหา -->>
โค๊ด: [Select]
$message['body'

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
$gpbp_badPost && !$context['reveal_bad_post'] ? '' :

ค้นหา -->>
โค๊ด: [Select]
echo '
</div>
<div class="moderatorbar">

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
// If a Bad Post must be hidden, only display its date and a "Show" link... nothing else.
if ($gpbp_badPost && $gpbp_action == 'hide')
echo '
</div>
<div class="postarea gpbp_do_show">
<div class="middletext gpbp_hidden_notice">
', $message['time'], ' - <em>', $txt['gpbp_hidden'], '</em>', $context['reveal_bad_post'] ? ' <a class="gpbp_show" onclick="gpbp_show_post(\'' . $message['id'] . '\'); return false" href="' . $message['href_gpbp_show'] . '">' . $txt['gpbp_show'] . '</a>' : '', '
</div>';

ค้นหา -->>
โค๊ด: [Select]
});';
}
}

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
if ($context['gpbp_enabled'])
echo '
var oVotePost = new PostVoting({
sSessionVar: "', $context['session_var'], '",
sSessionId: "', $context['session_id'], '",
iBoard: ', $context['this_board'], ',
iTopic: ', $context['current_topic'], ',
sButtonSet: "', $gpbp_set,'",
sVoteDownAlt: "', $txt['gpbp_vote_down'], '",
sVoteUpAlt: "', $txt['gpbp_vote_up'], '",
sVotedDownAlt: "', $txt['gpbp_voted_down_alt'], '",
sVotedUpAlt: "', $txt['gpbp_voted_up_alt'], '",
sVotedDown: "', $txt['gpbp_voted_down'], '",
sToVoteDown: "', $txt['gpbp_to_vote_down'], '",
sVotedUp: "', $txt['gpbp_voted_up'], '",
sToVoteUp: "', $txt['gpbp_to_vote_up'], '",
sNoVoters: "', $txt['gpbp_no_voters'], '",
sScriptUrl: "', $scripturl, '",
sImagesUrl: "', $settings['images_url'], '"
});';

file $themedir/Profile.template.php

ค้นหา -->>
โค๊ด: [Select]
$txt['posts_per_day'], ')</dd>';

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
// Good Post/Bad Post: gathered Respect amount
if ($modSettings['gpbp_display_respect'])
echo '
<dt>', $txt['gpbp_respect'], ': </dt>
<dd>', $context['member']['gpbp_respect'] > 0 ? '+' : '', $context['member']['gpbp_respect'], '</dd>';

ค้นหา -->>
โค๊ด: [Select]
$txt['display_quick_mod_image'], '</option>
</select>
</li>

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
';

if ($modSettings['gpbp_users_choice'])
echo '
<li>
<label for="gpbp_hide_action">', sprintf($txt['gpbp_member_hide_action'], $modSettings['gpbp_hide_threshold']) , '</label>
<select name="default_options[gpbp_hide_action]" id="gpbp_hide_action">
<option value="0"', empty($context['member']['options']['gpbp_hide_action']) ? ' selected="selected"' : '', '>', $txt['gpbp_hide_action_hide'], '</option>
<option value="1"', !empty($context['member']['options']['gpbp_hide_action']) && $context['member']['options']['gpbp_hide_action'] == 1 ? ' selected="selected"' : '', '>', $txt['gpbp_hide_action_grey'], '</option>', $modSettings['gpbp_users_choice_none'] ? '
<option value="2"' . (!empty($context['member']['options']['gpbp_hide_action']) && $context['member']['options']['gpbp_hide_action'] != 1 ? ' selected="selected"' : '') . '>' . $txt['gpbp_hide_action_none']. '</option>' : '', '
</select>
</li>';
echo '

file $themedir/Settings.template.php

ค้นหา -->>
โค๊ด: [Select]
2 => $txt['display_quick_mod_image'],
),
'default' => true,
),

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
array(
'id' => 'gpbp_hide_action',
'label' => $txt['gpbp_hide_action'],
'options' => array(
0 => $txt['gpbp_hide_action_hide'],
1 => $txt['gpbp_hide_action_grey'],
2 => $txt['gpbp_hide_action_none'],
),
'default' => true,
),

file $themedir/Stats.template.php

ค้นหา -->>
โค๊ด: [Select]
<br class="clear" />
<div class="flow_hidden">
<div class="cat_bar">
<h3 class="catbg">
<span class="ie6_header floatleft">
<img src="', $settings['images_url'], '/stats_history.gif" class="icon" alt="" /> ', $txt['forum_history'

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
';

if (!empty($modSettings['gpbp_display_stats']))
{
echo '
<style type="text/css">
#gpbp_top_voters {
float:left;
width:49.5%;
}
#gpbp_most_respected {
float:right;
width:49.5%;
}
</style>
<div class="flow_hidden">
<div id="gpbp_top_voters">
<div class="title_bar">
<h4 class="titlebg">
<span class="ie6_header floatleft">
<img src="', $settings['images_url'], '/stats_replies.gif" class="icon" alt="" /> ', $txt['gpbp_top_voters'], '
</span>
</h4>
</div>
<div class="windowbg2">
<span class="topslice"><span></span></span>
<div class="content">
<dl class="stats">';

foreach ($context['gpbp_top_voters'] as $poster)
{
echo '
<dt>
', $poster['link'], '
</dt>
<dd class="statsbar">';

if (!empty($poster['votes_percent']))
echo '
<span class="left"></span>
<div style="width: ', $poster['votes_percent'], 'px;" class="stats_bar"></div>
<span class="right"></span>';

echo '
<span class="righttext">' . $poster['votes'] . '</span>
</dd>';
}

echo '
</dl>
<div class="clear"></div>
</div>
<span class="botslice"><span></span></span>
</div>
</div>
<div id="gpbp_most_respected">
<div class="title_bar">
<h4 class="titlebg">
<span class="ie6_header floatleft">
<img src="', $settings['images_url'], '/stats_posters.gif" class="icon" alt="" /> ', $txt['gpbp_most_respected'], '
</span>
</h4>
</div>
<div class="windowbg">
<span class="topslice"><span></span></span>
<div class="content">
<dl class="stats">';

foreach ($context['gpbp_most_respected'] as $poster)
{
echo '
<dt>
', $poster['link'], '
</dt>
<dd class="statsbar">';

if (!empty($poster['respect_percent']))
echo '
<span class="left"></span>
<div style="width: ', $poster['respect_percent'], 'px;" class="stats_bar"></div>
<span class="right"></span>';

echo '
<span>', $poster['respect'], '</span>
</dd>';
}

echo '
</dl>
<div class="clear"></div>
</div>
<span class="botslice"><span></span></span>
</div>
</div>
</div>';
}

echo '

file $languagedir/Help.thai-utf8.php

เพิ่ม -->>
โค๊ด: [Select]
$helptxt['gpbp_threshold'] = 'Depending on each user\'s Theme and Layout configuration, this may result in collapsing a Bad Post, greying a Bad Post out, or nothing at all (the Bad Post subject is still greyed out).<br /><br /><strong>Bad Posts that are voted back above the threshold become normal posts again.</strong>';
$helptxt['gpbp_display_respect'] = 'Respect is the sum of all received votes. Negative votes substract from this value.';

file $languagedir/Who.thai-utf8.php

เพิ่ม -->>
โค๊ด: [Select]
// Good Post/Bad Post: it may be nice to let users know of this.
$txt['whotopic_gpbp'] = 'Voting a message from &quot;<a href="' . $scripturl . '?topic=%d.0">%s</a>&quot;.';

file $languagedir/Modifications.thai-utf8.php

เพิ่ม -->>
โค๊ด: [Select]
// Good Post/Bad Post permission strings.
$txt['permissiongroup_gpbp'] = 'Good Post/Bad Post mod permissions';
$txt['permissiongroup_simple_gpbp'] = 'Good Post/Bad Post mod permissions';
$txt['permissionname_gpbp_manage'] = 'Manage Good Post/Bad Post mod settings';
$txt['permissionhelp_gpbp_manage'] = 'This permission includes changing general GP/BP settings; choosing which boards will support this mod. <strong>Have in mind that it allows to configure this mod for the full board list.</strong>';
$txt['cannot_gpbp_manage'] = 'You are not allowed to manage settings of the Good Post/Bad Post mod.';
$txt['permissionname_gpbp_vote'] = 'Vote on posts (up or down)';
$txt['permissionhelp_gpbp_vote'] = 'Allows the user to positively or negatively change the score of a post. The board containing the post must also be configured to allow post voting.<br/><br/><strong>Note</strong>: Forum guests can\'t vote regardless this permission.';
$txt['cannot_gpbp_vote'] = 'Sorry, you are not allowed to vote posts.';
$txt['permissionname_gpbp_reveal'] = 'Reveal Bad posts';
$txt['permissionhelp_gpbp_reveal'] = 'Allows the user to view posts that were hidden because of a low voting score.';
$txt['cannot_gpbp_reveal'] = 'You can not have access to posts hidden by general voting.';
$txt['permissionname_gpbp_voterslist'] = 'Reveal post voters';
$txt['permissionhelp_gpbp_voterslist'] = 'Allows the user to view the list of members who voted together with their chosen vote.';
$txt['cannot_gpbp_voterslist'] = 'You can not have access to voters lists.';
// Managing area.
$txt['gpbp_manage'] = 'Good Post/Bad Post';
$txt['gpbp_managearea_basic'] = 'Basic settings';
$txt['gpbp_managearea_basic_desc'] = 'Below are the main Good Post/Bad Post settings.';
$txt['gpbp_managearea_advanced'] = 'Advanced configuration';
$txt['gpbp_managearea_advanced_desc'] = 'Here are some configurations that add more depth to the mod.';
$txt['gpbp_managearea_tools'] = 'GPBP Tools';
$txt['gpbp_managearea_tools_desc'] = 'Use these tools to quickly review voting behaviour, manually change votes and edit user\'s Respect values and post scores.<br /><strong>Note:</strong> You need to submit a search before being able to operate on votes.';
$txt['gpbp_manage_title'] = 'Good Post/Bad Post Managing';
$txt['gpbp_hide_action'] = 'Good Post/Bad Post Mod: What to do with Bad Posts?';
$txt['gpbp_hide_action_hide'] = 'Hide them.';
$txt['gpbp_hide_action_grey'] = 'Grey them out.';
$txt['gpbp_hide_action_none'] = 'Nothing.';
$txt['gpbp_settings'] = 'Good Post/Bad Post (GP/BP) Mod settings';
$txt['gpbp_bad_threshold'] = 'Bad Post threshold';
$txt['gpbp_bad_threshold_desc'] = 'Any post currently at this value or below will be marked as a Bad Post.';
$txt['gpbp_show_respect'] = 'Show Respect gathered by users';
$txt['gpbp_show_respect_desc'] = 'Displays the Respect counter in posts and in the profile summary.';
$txt['gpbp_affected_boards'] = 'Affected boards';
$txt['gpbp_enable_boards'] = 'Enable GP/BP on these boards';
$txt['gpbp_enable_boards_desc'] = 'Choose which boards will have post voting enabled.<br /><br /><strong>Note:</strong> Post votes never get deleted. Re-enabling post voting in a board will simply result in displaying previously casted votes.';
$txt['gpbp_choose_boards'] = 'Boards to choose from';
$txt['gpbp_display_stats'] = 'Display GP/BP statistics in the Stats page?';
$txt['gpbp_display_stats_desc'] = 'Check if you want to display the <strong>Top 10 Post Voters</strong> list and <strong>10 Most Respected</strong> users.';
$txt['gpbp_show_best_topics'] = 'Display "Messages of the week":';
$txt['gpbp_show_best_topics_desc'] = 'Choose the amount of messages to list in the <strong>Info center</strong> at the board index, including the most voted messages of the past few days.<br /><strong>Choose 0 to disable this option.</strong>';
$txt['gpbp_button_set'] = 'Button set to display in posts:';
$txt['gpbp_button_set_desc'] = 'You can choose different styles of voting buttons.';
$txt['gpbp_users_choice'] = 'Users choose their own GP/BP layout settings';
$txt['gpbp_users_choice_desc'] = 'Check this option to allow members to choose their own settings (hide, grey-out, nothing), or uncheck to force the current settings.<br /> You can change the current theme settings by going to the <strong>Member Options</strong> section in the Themes managing area.';
$txt['gpbp_users_choice_none'] = 'Let users choose to do &quot;Nothing&quot; with Bad Posts?';
$txt['gpbp_users_choice_none_desc'] = 'Check this to allow displaying Bad Posts as normal posts. Unchecking this does not override any chosen options, so you still have to edit the member theme options to disable it completely.';
$txt['gpbp_voters_list_limit'] = 'Amount of members to display in post voters list:';
$txt['gpbp_voters_list_limit_desc'] = 'Members beyond this number will not appear in the list (sorted alphabetically).<br /> <strong>Choose 0 to disable lists displaying</strong>.<br /> <strong>Note:</strong> list display only works with Javascript-enabled browsers.';
$txt['gpbp_disable_negative_voting'] = 'Disable negative voting?';
$txt['gpbp_disable_negative_voting_desc'] = 'Check this if you want members <strong>to only vote up</strong>.';
$txt['gpbp_post_count_limit'] = 'Restrict voting to members with at least this many forum posts:';
$txt['gpbp_post_count_limit_desc'] = 'Change this number if you want to force a minimum post count before being able to vote on posts.<br />Choose zero to disable post count restriction.';
$txt['gpbp_vote_search'] = 'GPBP Vote Search';
$txt['gpbp_vote_search_filters'] = 'Use these filters to start a custom vote search. Empty values will be ignored.';
$txt['gpbp_vote_search_filter_by'] = 'Filter by...';
$txt['gpbp_vote_search_topic_id'] = 'Topic ID:';
$txt['gpbp_vote_search_msg_id'] = 'Message ID:';
$txt['gpbp_vote_search_poster_name'] = 'Poster\'s name:';
$txt['gpbp_vote_search_voter_name'] = 'Voter\'s name:';
$txt['gpbp_vote_search_score'] = 'Score:';
$txt['gpbp_vote_search_any_score'] = 'Any score.';
$txt['gpbp_vote_list'] = 'Vote list';
$txt['gpbp_vote_list_showing'] = 'Showing %s of %s total votes.';
$txt['gpbp_vote_list_poster'] = 'Poster';
$txt['gpbp_vote_list_voter'] = 'Voter';
$txt['gpbp_vote_list_vote'] = 'Vote';
$txt['gpbp_vote_list_check'] = 'Click here to (un)check all votes.';
$txt['gpbp_vote_list_deleted'] = 'Deleted?';
$txt['gpbp_vote_list_mdeleted'] = 'Deleted.';
$txt['gpbp_vote_list_account_deleted'] = 'Account #%s deleted.';
$txt['gpbp_vote_list_subject'] = 'Topic subject:';
$txt['gpbp_vote_list_topic_deleted'] = 'Topic deleted?';
$txt['gpbp_vote_list_no_votes'] = 'There are no votes to show.';
$txt['gpbp_votes_deleted_s'] = '%s vote was deleted.';
$txt['gpbp_votes_reversed_s'] = '%s vote was reversed.';
$txt['gpbp_votes_deleted'] = '%s votes were deleted.';
$txt['gpbp_votes_reversed'] = '%s votes were reversed.';
$txt['gpbp_votes_delete'] = 'Delete';
$txt['gpbp_votes_reverse'] = 'Reverse the scores of';
$txt['gpbp_votes_all_checked'] = 'all checked votes.';
$txt['gpbp_votes_also_update'] = 'Also update Respect of affected posters.';
$txt['gpbp_filtered_edit'] = 'Edit all the filtered results at once';
$txt['gpbp_filtered_edit_desc'] = 'Use the following form if you want to edit all search results at once when there are many of them. <em>If you are only going to edit a few votes, then use the above tool instead.</em>';
$txt['gpbp_filtered_delete'] = 'Delete all of the searched votes.';
$txt['gpbp_filtered_reverse'] = 'Reverse the scores of all of the searched votes.';
$txt['gpbp_filtered_confirm'] = 'Are you sure you want to edit all %s searched votes?';
$txt['gpbp_votes_deleted_filter'] = '%s votes were deleted. %s member(s) needed Respect update. %s message(s) needed score update.';
$txt['gpbp_votes_reversed_filter'] = '%s votes were reversed. %s member(s) needed Respect update. %s message(s) needed score update.';
$txt['gpbp_respect_success'] = 'Respect was changed for %s.';
$txt['gpbp_respect_not_needed'] = 'You did not choose a different Respect value. No change was needed.';
$txt['gpbp_score_success'] = 'Score updated for post #%s';
$txt['gpbp_orphaned_title'] = 'Orphaned votes cleanup';
$txt['gpbp_orphaned_desc'] = 'Delete orphaned votes (votes of deleted messages) from the database. Respect from members won\'t be affected by this, but statistics from the Stats page will (Top 10 Post Voters, 10 Most Respected).';
$txt['gpbp_orphaned_report'] = 'There are <strong>%s</strong> orphaned votes.';
$txt['gpbp_orphaned_go'] = 'Clean orphaned votes.';
$txt['gpbp_orphaned_success'] = '%s votes were deleted.';
$txt['gpbp_totals'] = 'Recount totals';
$txt['gpbp_totals_success'] = 'Finished recounting totals for %s members and %s posts.';
$txt['gpbp_totals_desc'] = 'You may recount all the score and Respect values for messages and members respectively.<br /><strong>Note: </strong>This may be a demanding process so if your forum is really active or you have ran this mod for a long time. Please consider enabling the <em>Maintenance mode</em> first before using this tool.';
// Managing area errors.
$txt['gpbp_names_not_found'] = 'The names you submitted weren\'t found in the memberlist.';
$txt['gpbp_voter_not_found'] = 'The voter\'s name you submitted was not found in the memberlist.';
$txt['gpbp_poster_not_found'] = 'The poster\'s name you submitted was not found in the memberlist.';
$txt['gpbp_vote_not_sent'] = 'No vote was selected, please try again.';
$txt['gpbp_filter_edit_needed'] = 'No action chosen to take on all search results, please go back and try again.';
$txt['gpbp_chosenmember_not_found'] = 'The member name you entered does not exist. Please check and try again.';
$txt['gpbp_message_not_found'] = 'The ID you entered does not belong to an existing message.';
// Voting errors.
$txt['gpbp_lacks_msg'] = 'You did not specify a (valid) message to vote.';
$txt['gpbp_notinthisboard'] = 'Sorry, this board doesn\'t have post voting enabled.';
$txt['gpbp_msg_not_found'] = 'The message you specified was not found.';
$txt['gpbp_msg_not_approved'] = 'You can\'t submit a vote on the specified message until it gets approved by a moderator.';
$txt['gpbp_msg_own_voted'] = 'Sorry, you can\'t vote on your own posts.';
$txt['gpbp_can_not_vote_down'] = 'Sorry, you can\'t vote posts down.';
$txt['gpbp_must_fill_field'] = 'You must at least fill one field in.';
// General user interface.
$txt['gpbp_respect'] = 'Respect';
$txt['gpbp_post_score'] = 'The current score of this post.';
$txt['gpbp_vote_down'] = 'Vote Down';
$txt['gpbp_vote_up'] = 'Vote Up';
$txt['gpbp_voted_down_alt'] = 'Voted down.';
$txt['gpbp_voted_up_alt'] = 'Voted up.';
$txt['gpbp_voted_down'] = 'You have voted this post down. Click to un-vote.';
$txt['gpbp_to_vote_down'] = 'Click to vote this post down.';
$txt['gpbp_voted_up'] = 'You have voted this post up. Click to un-vote.';
$txt['gpbp_to_vote_up'] = 'Click to vote this post up.';
$txt['gpbp_hidden'] = 'Hidden.';
$txt['gpbp_show'] = 'Show this post.';
$txt['gpbp_member_hide_action'] = 'Voted posts: What to do with posts scoring <strong>%s</strong> or less?';
$txt['gpbp_top_voters'] = 'Top 10 Post Voters';
$txt['gpbp_most_respected'] = '10 Most Respected';
$txt['gpbp_show_voters'] = 'Show voters';
$txt['gpbp_voters_list'] = 'Voters list:';
$txt['gpbp_no_voters'] = 'No one has voted.';
// The following strings are meant to be used in "Respect was/was not updated" below.
$txt['gpbp_was'] = 'was';
$txt['gpbp_was_not'] = 'was not';
// Moderation log
$txt['modlog_ac_gpbp_deleted_votes'] = 'GP/BP: Deleted {amount} post vote(s). Respect <strong>{respect}</strong> updated.';
$txt['modlog_ac_gpbp_reversed_votes'] = 'GP/BP: Reversed {amount} post vote(s). Respect <strong>{respect}</strong> updated.';
$txt['modlog_ac_gpbp_score_updated'] = 'GP/BP: Changed score to {score} for post #{msg}';
$txt['modlog_ac_gpbp_respect_updated'] = 'GP/BP: Changed Respect to {respect} for member {membername}';
$txt['modlog_ac_gpbp_clean_orphaned'] = 'GP/BP: Cleaned {orphaned} orphaned votes.';
$txt['modlog_ac_gpbp_basic_settings'] = 'GP/BP: Updated Basic settings.';
$txt['modlog_ac_gpbp_boards'] = 'GP/BP: Updated affected board list.';
$txt['modlog_ac_gpbp_advanced_settings'] = 'GP/BP: Updated Advanced settings.';
$txt['modlog_ac_gpbp_totals'] = 'GP/BP: Scores and Respect totals were recounted.';
// End of Good Post / Bad Post strings.

ดาวน์โหลด: gpbp2.rar
ขออภัย! ท่านไม่สามารถเข้าถึงข้อมูลส่วนนี้ได้ กรุณาอ่าน เงื่อนไขการใช้งาน DexMore.Com

แตกไฟล์แล้วอัพโหลดไปไว้ที่
file GoodPostBadPost.php -->> $sourcedir
file GPBPManage.template.php -->> $themedir
file gpbp.css -->> $themedir/css
file gpbp.js -->> $themedir/scripts
file gpbp_arrow_down.gif -->> $imagesdir
file gpbp_arrow_down_lit.gif -->> $imagesdir
file gpbp_arrow_up.gif -->> $imagesdir
file gpbp_arrow_up_lit.gif -->> $imagesdir
file gpbp_grey_stripes.png -->> $imagesdir
file gpbp_2_arrow_down.png -->> $imagesdir
file gpbp_2_arrow_down_lit.png -->> $imagesdir
file gpbp_2_arrow_up.png -->> $imagesdir
file gpbp_2_arrow_up_lit.png -->> $imagesdir
file gpbp_3_arrow_down.png -->> $imagesdir
file gpbp_3_arrow_down_lit.png -->> $imagesdir
file gpbp_3_arrow_up.png -->> $imagesdir
file gpbp_3_arrow_up_lit.png -->> $imagesdir
file gpbp_4_arrow_down.png -->> $imagesdir
file gpbp_4_arrow_down_lit.png -->> $imagesdir
file gpbp_4_arrow_up.png -->> $imagesdir
file gpbp_4_arrow_up_lit.png -->> $imagesdir
file gpbp_voterslist.gif -->> $imagesdir
file gpbp_manage.gif -->> $imagesdir/admin
file gpbp_motw.gif -->> $imagesdir/icons

สร้างไฟล์: gpbp_install.php เพื่อสร้างฐานข้อมูล ไว้ใน $boarddir (ที่เดียวกับไฟล์ SSI.php) รัน http://www.your_url.xxx/$boarddir/gpbp_install.php -->> Enter เสร็จแล้วลบทิ้ง
โค๊ด: [Select]
<?php
if(file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF'))
require_once(dirname(__FILE__) . '/SSI.php');
else if(!
defined('SMF'))
die('<b>Error:</b> Cannot install - please verify you placed this file in the same folder as SMF\'s index.php and SSI.php files.');

if((
SMF == 'SSI') && !$user_info['is_admin'])
die('Admin priveleges required.');

db_extend('packages');

// New table: Vote tracking.
$smcFunc['db_create_table']('{db_prefix}log_gpbp',
array(
array(
'name' => 'id_msg',
'type' => 'int',
'size' => 10,
'unsigned' => true,
'null' => false
),
array(
'name' => 'id_member',
'type' => 'mediumint',
'size' => 8,
'unsigned' => true,
'null' => false
),
array(
'name' => 'score',
'type' => 'smallint',
'size' => 2,
'null' => false
),
array(
'name' => 'id_poster',
'type' => 'mediumint',
'size' => 8,
'unsigned' => true,
'null' => false
),
array(
'name' => 'log_time',
'type' => 'int',
'size' => 10,
'unsigned' => true,
'null' => false
),
),
array(
array(
'type' => 'index',
'columns' => array('id_member'),
),
array(
'type' => 'index',
'columns' => array('id_poster'),
),
array(
'type' => 'primary',
'columns' => array('id_msg''id_member'),
),
),
array(),
'ignore');

// I'm sorry SMF, but some tables need extra columns!
// RC3 fails to process signed columns in mysql, so we'll have to use a custom query in such case.
global $db_type;
// For instance, the vote count per message.
if ($db_type == 'mysql')
{
global $db_prefix$db_package_log$db_type;
$columns $smcFunc['db_list_columns']('{db_prefix}messages');
$table_name str_replace('{db_prefix}'$db_prefix'{db_prefix}messages');
if (! in_array('gpbp_score'$columns))
{
$smcFunc['db_query']('','
ALTER TABLE '
$table_name .'
ADD `gpbp_score` smallint(6) NOT NULL default \'0\''
,
'security_override');
$db_package_log[] = array('remove_column'$table_name'gpbp_score');
}
else
$smcFunc['db_query']('','
ALTER TABLE '
$table_name .'
CHANGE COLUMN `gpbp_score` `gpbp_score` smallint(6) NOT NULL default \'0\''
,
'security_override');
}
else
$smcFunc['db_add_column']('{db_prefix}messages',
array(
'name' => 'gpbp_score',
'type' => 'smallint',
'size' => 6,
'null' => false,
'unsigned' => false,
'default' => 0
),
array(),
'ignore'
);

// Or the Respect count per member.
if ($db_type == 'mysql')
{
$columns $smcFunc['db_list_columns']('{db_prefix}members');
$table_name str_replace('{db_prefix}'$db_prefix'{db_prefix}members');
if (! in_array('gpbp_respect'$columns))
{
$smcFunc['db_query']('','
ALTER TABLE '
$table_name .'
ADD `gpbp_respect` smallint(6) NOT NULL default \'0\''
,
'security_override');
$db_package_log[] = array('remove_column'$table_name'gpbp_respect');
}
else
$smcFunc['db_query']('','
ALTER TABLE '
$table_name .'
CHANGE COLUMN `gpbp_respect` `gpbp_respect` smallint(6) NOT NULL default \'0\''
,
'security_override');
}
else
$smcFunc['db_add_column']('{db_prefix}members',
array(
'name' => 'gpbp_respect',
'type' => 'smallint',
'size' => 6,
'null' => false,
'unsigned' => false,
'default' => 0
),
array(),
'ignore'
);

// Or the mod switch per board. Well, I don't mind this one being unsigned.
$smcFunc['db_add_column']('{db_prefix}boards',
array(
'name' => 'enable_gpbp',
'type' => 'tinyint',
'size' => 1,
'null' => false,
'default' => 0
),
array(),
'ignore'
);

// Finally, add some default settings.
$smcFunc['db_insert']('ignore',
'{db_prefix}settings',
array(
'variable' => 'string',
'value' => 'string'
),
array(
array('gpbp_hide_threshold''-5'),
array('gpbp_display_respect''1'),
array('gpbp_display_stats''1'),
array('gpbp_users_choice''1'),
array('gpbp_users_choice_none''0'),
array('gpbp_voters_list_limit''0'),
array('gpbp_disable_negative_voting''0'),
array('gpbp_post_count_limit''0'),
array('gpbp_show_best_topics''0'),
array('gpbp_button_set'''),
),
array('variable')
);

if(
SMF == 'SSI')
echo 'Finished updating the database. Please delete this file.';
?>

ลิงค์หัวข้อ: http://dexmore.com/topic/2028
Windows XP    Firefox 3.6.3   see ip บันทึกการเข้า
ดูรายการสิ่งของสำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  สำหรับติดหมุดกระทู้ของคุณ!  เพิ่มเวลาที่อยู่ในระบบอีก 12 ชั่วโมง  น้องหมี..เอาไว้กอดนอนแทนกิ๊ก  สำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  
*



Thailand   ชาย ออฟไลน์ เว็บไซต์
icon message
general ความคิดเห็นที่ 2 เมื่อ: 29 กรกฎาคม 2553, 08:40:34
รบกวนด้วยคับพอดีทมำตามขั้นตอนของ1.1.xx แล้ว พอเปิดกระทุ้ด฿มันฟ้องว่า Unknown column 'b.enable_gpbp' in 'field list' ไม่ทราบต้องไปเพิ่มอะไรตรงไหนอีกบ้างคับ

ลิงค์หัวข้อ: http://dexmore.com/topic/2028
Windows XP    Chrome 5.0.375.125   see ip บันทึกการเข้า
*
*


!Personal

Germany   ชาย ผู้เริ่มต้นกระทู้นี้ ออฟไลน์544566157 DexMore DexMore DexMore
เว็บไซต์
icon message
general ความคิดเห็นที่ 3 เมื่อ: 29 กรกฎาคม 2553, 09:53:38
รันไฟล์ gpbp_install.php หรือยังครับ

ถ้ารันแล้วมันบอกว่าอย่างไร..

ลิงค์หัวข้อ: http://dexmore.com/topic/2028
Windows XP    Firefox 3.6.8   see ip บันทึกการเข้า
ดูรายการสิ่งของสำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  สำหรับติดหมุดกระทู้ของคุณ!  เพิ่มเวลาที่อยู่ในระบบอีก 12 ชั่วโมง  น้องหมี..เอาไว้กอดนอนแทนกิ๊ก  สำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  
*



Thailand   ชาย ออฟไลน์ เว็บไซต์
icon message
general ความคิดเห็นที่ 4 เมื่อ: 29 กรกฎาคม 2553, 11:23:29
ตอนนี้แก้ไขได้แล้วคับแต่มีปัญหาอยุ่ว่าหา ผู้ดูแล -->> จัดการคะแนนกระทู้ ไม่เจอรบกวนด้วยคับ



ลิงค์หัวข้อ: http://dexmore.com/topic/2028
Windows XP    Chrome 5.0.375.125   see ip บันทึกการเข้า
*
*


!Personal

Germany   ชาย ผู้เริ่มต้นกระทู้นี้ ออฟไลน์544566157 DexMore DexMore DexMore
เว็บไซต์
icon message
general ความคิดเห็นที่ 5 เมื่อ: 29 กรกฎาคม 2553, 11:40:00
แปลไทยหรือยังครับ ถ้ายังไม่แปลไทยมันก็ยังเป็น EN

ลองหาดูนะครับ อยู่ในเมนูผู้ดูแลนั่นแหละ

ป.ล. ใช้ฟอร์มอัพโหลดรูปที่เรามีไว้ให้ก็ได้ครับ ไม่ต้องไปฝากรูปแล้วต้องตามไปดูโฆษณาลายตา เหมือนแอบโฆษณาเว็บฝากรูปไงไม่รู๊..

ลิงค์หัวข้อ: http://dexmore.com/topic/2028
Windows XP    Firefox 3.6.8   see ip บันทึกการเข้า
ดูรายการสิ่งของสำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  สำหรับติดหมุดกระทู้ของคุณ!  เพิ่มเวลาที่อยู่ในระบบอีก 12 ชั่วโมง  น้องหมี..เอาไว้กอดนอนแทนกิ๊ก  สำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  
ส่งหัวข้อนี้พิมพ์ หน้า: 1 
กระโดดไป:  

Creative Commons License

SMF Thai Translation Powered by SMF © 2006–2012, Simple Machines LLC

WordPress Google เข้าเยี่ยมชมหน้านี้ล่าสุดเมื่อ : 17 พฤษภาคม 2555, 10:12:44

jQuery Plugin Copyright © 2551-2555 Themes Design & Hosting by DexMoreGroup

Sitemap | Thai Simple Machines Forum support SMF Thai

Web Begining | SMF Modifications | SMF Thai Translation Web Begining

Drupal | WordPress | CMS Joomla | jQuery Plugin | Web Graphics CMS Joomla