./index.php
Pesquisar
'theme' => array('Themes.php', 'ThemesMain'),
Adicionar depois
'thankyou' => array('ThankYouPost.php', 'ThankYou'),
'thankyouajax' => array('ThankYouPost.php', 'ThankYouPostAJAX'),
'thankyoupostlock' => array('ThankYouPost.php', 'ThankYouPostLock'),
'thankyoupostlist' => array('ThankYouPost.php', 'ThankYouPostListShow'),
'thankyoupostdelete' => array('ThankYouPost.php', 'ThankYouPostDelete'),
'thankyoupostdm' => array('ThankYouPost.php', 'ThankYouPostDeletePost'),
'thankyoupostcloseall' => array('ThankYouPost.php', 'ThankYouPostCloseAll'),
'thankyoupostunlockall' => array('ThankYouPost.php', 'ThankYouPostUnlockAllPosts'),
./SSI.php
Pesquisar
// Check the passed id_member/password. If $is_username is true, treats $id as a username.
Trocar por este
// Shows the top Thank You Resive.
function ssi_thankYouPostTopResived($topMembers = 5, $output_method = 'echo')
{
global $txt, $scripturl, $modSettings, $smcFunc;
// Fix mistakes ;P
$topMembers = (int) $topMembers;
$topMembers = empty($topMembers) ? 5 : $topMembers;
// Find the latest poster.
$request = $smcFunc['db_query']('', '
SELECT id_member, real_name, thank_you_post_became, thank_you_post_made
FROM {db_prefix}members
ORDER BY thank_you_post_became DESC
LIMIT {int:limit}',
array(
'limit' => $topMembers
)
);
$return = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
{
$return[] = array(
'id' => $row['id_member'],
'name' => $row['real_name'],
'href' => $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
'thank_you_post_became' => $row['thank_you_post_became'],
'thank_you_post_made' => $row['thank_you_post_made']
);
$colorids[$row['id_member']] = $row['id_member'];
}
$smcFunc['db_free_result']($request);
// Add colors only on installed SSI Member Color Link
if (function_exists('ssi_loadColors') && !empty($colorids))
{
global $color_profile;
ssi_loadColors($colorids);
foreach ($return as $k => $p)
{
$profile = $color_profile[$p['id']];
if (!empty($profile))
$return[$k]['link'] = $profile['link'];
}
}
if ($output_method != 'echo')
return $return;
if (empty($return))
return;
echo '
<table class="ssi_table">
<tr>
<th align="left"></th>
<th align="left">', $txt['thank_you_post_became_display'], '</th>
<th align="left">', $txt['thank_you_post_made_display'], '</th>
</tr>';
foreach ($return as $temp)
echo '
<tr>
<td align="left">
', $temp['link'], '
</td>
<td align="right">', $temp['thank_you_post_became'], '</td>
<td align="right">', $temp['thank_you_post_made'], '</td>
</tr>';
echo '
</table>';
}
// Shows the top Thank You Given.
function ssi_thankYouPostTopGiven($topMembers = 5, $output_method = 'echo')
{
global $txt, $scripturl, $modSettings, $smcFunc;
// Fix mistakes ;P
$topMembers = (int) $topMembers;
$topMembers = empty($topMembers) ? 5 : $topMembers;
// Find the latest poster.
$request = $smcFunc['db_query']('', '
SELECT id_member, real_name, thank_you_post_became, thank_you_post_made
FROM {db_prefix}members
ORDER BY thank_you_post_made DESC
LIMIT {int:limit}',
array(
'limit' => $topMembers
)
);
$return = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
{
$return[] = array(
'id' => $row['id_member'],
'name' => $row['real_name'],
'href' => $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
'thank_you_post_became' => $row['thank_you_post_became'],
'thank_you_post_made' => $row['thank_you_post_made']
);
$colorids[$row['id_member']] = $row['id_member'];
}
$smcFunc['db_free_result']($request);
// Add colors only on installed SSI Member Color Link
if (function_exists('ssi_loadColors') && !empty($colorids))
{
global $color_profile;
ssi_loadColors($colorids);
foreach ($return as $k => $p)
{
$profile = $color_profile[$p['id']];
if (!empty($profile))
$return[$k]['link'] = $profile['link'];
}
}
if ($output_method != 'echo')
return $return;
if (empty($return))
return;
echo '
<table class="ssi_table">
<tr>
<th align="left"></th>
<th align="left">', $txt['thank_you_post_made_display'], '</th>
<th align="left">', $txt['thank_you_post_became_display'], '</th>
</tr>';
foreach ($return as $temp)
echo '
<tr>
<td align="left">
', $temp['link'], '
</td>
<td align="right">', $temp['thank_you_post_made'], '</td>
<td align="right">', $temp['thank_you_post_became'], '</td>
</tr>';
echo '
</table>';
}
// Check the passed id_member/password. If $is_username is true, treats $id as a username.
./ssi_examples.php
Pesquisar
<h3>Miscellaneous</h3>
Substituir por este
<h3>Thank-O-Matic</h3>
<ul>
<li><a href="#" onclick="showSSIBlock('ssi_thankYouPostTopResived'); return false;">Top Thank You Received</a></li>
<li><a href="#" onclick="showSSIBlock('ssi_thankYouPostTopGiven'); return false;">Top Thank You Given</a></li>
</ul>
<h3>Miscellaneous</h3>
Pesquisar
<!-- MISCELLANEOUS -->
Trocar por
<!-- THANK-O-MATIC FUNCTION -->
<div class="ssi_preview" id="ssi_thankYouPostTopResived">
<h2>Top Thank You Received</h2>
<h3>Code</h3>
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php ssi_thankYouPostTopResived(); ?></code>
<h3>Result</h3>
<div class="ssi_result"><?php ssi_thankYouPostTopResived(); flush(); ?></div>
</div>
<div class="ssi_preview" id="ssi_thankYouPostTopGiven">
<h2>Top Thank You Given</h2>
<h3>Code</h3>
<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code"><?php ssi_thankYouPostTopGiven(); ?></code>
<h3>Result</h3>
<div class="ssi_result"><?php ssi_thankYouPostTopGiven(); flush(); ?></div>
</div>
<!-- MISCELLANEOUS -->
./Sources/Admin.php
'current_theme' => array(
Substituir Por
'thankyoupostsettings' => array(
'label' => $txt['thankyouposttitle'],
'file' => 'ManageThankYouPost.php',
'function' => 'ManageThankYouPost',
'icon' => 'thank_you_settings.gif',
'subsections' => array(
'general' => array($txt['general_settings']),
'layout' => array($txt['mods_cat_layout']),
'permission' => array($txt['edit_permissions'], 'enabled' => allowedTo('manage_permissions')),
'boards' => array($txt['admin_boards']),
'modrelated' => array($txt['thxmodification']),
),
),
'current_theme' => array(
Pesquisar
'reports' => array(
'enabled' => in_array('rg', $context['admin_features']),
'label' => $txt['generate_reports'],
'file' => 'Reports.php',
'function' => 'ReportsMain',
'icon' => 'reports.gif',
),
Substituir Por
'reports' => array(
'enabled' => in_array('rg', $context['admin_features']),
'label' => $txt['generate_reports'],
'file' => 'Reports.php',
'function' => 'ReportsMain',
'icon' => 'reports.gif',
),
'maintainThankYouPost' => array(
'label' => $txt['maintain_thxpost'],
'file' => 'ThankYouPost-Maintaince.php',
'icon' => 'thank_you_maintain.gif',
'function' => 'ManageMaintenanceThankYouPost',
'subsections' => array(
'maintain' => array($txt['maintain_thank_you_post_maintainaince'], 'admin_forum'),
'recount' => array($txt['maintain_thank_you_post_recount'], 'admin_forum'),
),
),
./Sources/Display.php
Pesquisar
t.id_member_started, t.id_first_msg, t.id_last_msg, t.approved,
Trocar por
t.thank_you_post_locked,
t.id_member_started, t.id_first_msg, t.id_last_msg, t.approved,
Pesquisar
$context['is_hot'] = $topicinfo['num_replies'] >= $modSettings['hotTopicPosts'];
$context['is_approved'] = $topicinfo['approved'];
Substituir por
$context['is_hot'] = $topicinfo['num_replies'] >= $modSettings['hotTopicPosts'];
$context['is_approved'] = $topicinfo['approved'];
// Some Thanky You things ;)
$context['is_thank_you_post_locked'] = $topicinfo['thank_you_post_locked'];
$context['thank_you_lock_allowed'] = !empty($board_info['thank_you_post_enable']) && !$user_info['is_guest'] && (allowedTo('thank_you_post_lock_all_any') || (allowedTo('thank_you_post_lock_all_own') && $user_info['id'] == $topicinfo['id_member_started']));
$context['thank_you_post_enable'] = $board_info['thank_you_post_enable'];
$context['thank_you_post_unlock_all'] = false;
Pesquisar
FROM {db_prefix}messages
WHERE id_topic = {int:current_topic}
Adidionar depois
'.($board_info['thank_you_post_enable'] ? ', thank_you_post' : '').'
Pesquisar
$messages = array();
$posters = array();
ou
$messages = array();
$all_posters = array();
Adicionar depois esta linha
$thank_you_posts = array();
Pesquisar
if (!empty($row['id_member']))
$all_posters[$row['id_msg']] = $row['id_member'];
$messages[] = $row['id_msg'];
Adicionar por Baixo
if (!empty($row['thank_you_post']))
$thank_you_posts[] = $row['id_msg'];
Pesquisar
// This is better than sorting it with the query...
ksort($temp);
foreach ($temp as $row)
$attachments[$row['id_msg']][] = $row;
}
Substituir por
// This is better than sorting it with the query...
ksort($temp);
foreach ($temp as $row)
$attachments[$row['id_msg']][] = $row;
}
$context['thank_you_post']['postet_thanks'] = array();
$context['thank_you_post']['topic'] = null;
// The user will a thank you list?
if ($board_info['thank_you_post_enable'] && (allowedTo('thank_you_post_show') || allowedTo('thank_you_post_post')))
{
// Possible strange settings fix...
if (!empty($modSettings['thankYouPostDisableUnhide']) && empty($modSettings['thankYouPostThxUnhideAll']) && empty($modSettings['thankYouPostUnhidePost']))
$modSettings['thankYouPostDisableUnhide'] = 0;
$modSettings['thankYouPostType'] = empty($modSettings['thankYouPostType']) ? 0 : $modSettings['thankYouPostType'];
if (!empty($modSettings['thankYouPostPreview']) && !empty($thank_you_posts) && allowedTo('thank_you_post_show'))
{
// Should i gernerate a list? Need a extra query :)
require_once($sourcedir . '/ThankYouPost.php');
ThankYouPostList($thank_you_posts, true);
}
// Let's say the user try everything... even if it not logical :P
else
{
$modSettings['thankYouPostCounterOutput'] = empty($modSettings['thankYouPostCounterOutput']) ? 0 : $modSettings['thankYouPostCounterOutput'];
$context['thank_you_post_template']['disable_counter_text'] = $modSettings['thankYouPostCounterOutput'] == 2;
$context['thank_you_post_template']['disable_counter_link'] = $modSettings['thankYouPostCounterOutput'] == 1;
}
// Okay no preview so in need to load the data extra for this :)
if (!empty($thank_you_posts) && !empty($user_info['id']) && allowedTo('thank_you_post_post'))
{
// Search for one made or the made one in the thread ;)
$thx = $smcFunc['db_query']('', '
SELECT id_thx_post, id_msg
FROM {db_prefix}thank_you_post
WHERE id_topic = {int:topic}
AND id_member = {int:id_member}
' . (!empty($modSettings['thankYouPostType']) ? 'AND id_msg IN ({array_int:thank_you_posts})' : '') . '
{raw:limit}',
array(
'topic' => $topic,
'id_member' => $user_info['id'],
'limit' => $modSettings['thankYouPostType'] != 1 ? 'LIMIT 1' : '',
'thank_you_posts' => $modSettings['thankYouPostType'] == 1 ? $thank_you_posts : array($context['topic_first_message']),
)
);
while ($row = $smcFunc['db_fetch_assoc']($thx))
$context['thank_you_post']['postet_thanks'][$row['id_msg']] = $row['id_thx_post'];
$smcFunc['db_free_result']($thx);
$context['thank_you_post']['topic'] = $topic;
// Okay Hide Tag Special Handling in Thank You Mod
if (!empty($modSettings['thankYouPostDisableUnhide']))
$context['user_post_avaible'] = 0;
// Unhide all after one post?
if (!empty($modSettings['thankYouPostThxUnhideAll']) && !empty($context['thank_you_post']['postet_thanks']))
$context['user_post_avaible'] = 1;
}
elseif (!empty($modSettings['thankYouPostDisableUnhide']))
$context['user_post_avaible'] = 0;
}
Pesquisar
id_msg_modified < {int:new_from} AS is_read
FROM {db_prefix}messages
Adicionar por baixo
' . ($board_info['thank_you_post_enable'] && allowedTo('thank_you_post_show') ? 'thank_you_post, thank_you_post_counter,' : '') . '
Pesquisar
// Do the censor thang.
censorText($message['body']);
censorText($message['subject']);
Adicionar por baixo
// Second Option for unhide content, for special hide tag
$disable_unhideafter = false;
if ((!empty($modSettings['thankYouPostUnhidePost']) && empty($context['user_post_avaible']) && isset($context['thank_you_post']['postet_thanks'][$message['id_msg']]) && empty($modSettings['thankYouPostThxUnhideAll'])) || (!empty($modSettings['thankYouPostDisableUnhide']) && $user_info['id'] == $message['id_member']))
{
$disable_unhideafter = true;
$context['user_post_avaible'] = 1;
}
Pesquisar
'can_see_ip' => allowedTo('moderate_forum') || ($message['id_member'] == $user_info['id'] && !empty($user_info['id'])),
Adicionar por baixo
'thank_you_post' => array(
'post' =>
// Sorry i need to clear it for me... it's a huge check you know *g*
$context['thank_you_post_enable']
&& empty($context['is_thank_you_post_locked'])
&& allowedTo('thank_you_post_post')
&& $user_info['id'] != $message['id_member']
&& !isset($context['thank_you_post']['postet_thanks'][$message['id_msg']])
&& (
!empty($modSettings['thankYouPostOnePerPost'])
||
(
empty($modSettings['thankYouPostFirstPostOnly'])
&&
empty($context['thank_you_post']['postet_thanks'])
)
||
(
!empty($modSettings['thankYouPostFirstPostOnly'])
&&
$context['topic_first_message'] == $message['id_msg']
)
)
,
'lock' => $context['thank_you_post_enable'] && empty($context['is_thank_you_post_locked']) && (allowedTo('thank_you_post_lock_any') || (allowedTo('thank_you_post_lock_own') && $user_info['id'] == $message['id_member'])),
'delete' => $context['thank_you_post_enable'] && allowedTo('thank_you_post_delete_any') || (allowedTo('thank_you_post_delete_own') && $user_info['id'] == $message['id_member']),
'counter' => $context['thank_you_post_enable'] && !empty($message['thank_you_post_counter']) ? $message['thank_you_post_counter'] : '0',
'locked' => $context['thank_you_post_enable'] && !empty($message['thank_you_post']) && $message['thank_you_post'] > 1,
'isThankYouPost' => $context['thank_you_post_enable'] && !empty($message['thank_you_post']) && $message['thank_you_post'] >= 1,
'href' => $context['thank_you_post_enable'] ? $scripturl . '?action=thankyoupostlist;topic=' . $topic . '.0;msg=' . $message['id_msg'] : '',
),
Pesquisar
if (empty($options['view_newest_first']))
$counter++;
else
$counter--;
Adicionar por baixo
// This Options apear only if realy a thank you is in there, and one is locked *g*
if ($context['thank_you_post_enable'] && allowedTo('thank_you_post_unlock_all') && !empty($message['thank_you_post']) && $message['thank_you_post'] > 1)
$context['thank_you_post_unlock_all'] = true;
// Second Option for unhide content, for special hide tag
if ($disable_unhideafter)
$context['user_post_avaible'] = 0;
/Sources/Load.php
Pesquisar
'permissions' => array(),
Substituir por
'permissions' => array(),
'last_thank_you_time' => isset($user_settings['last_thank_you_time']) ? $user_settings['last_thank_you_time'] : 0,
Pesquisar
b.id_theme, b.override_theme, b.count_posts, b.id_profile,
Substituir
b.id_theme, b.override_theme, b.count_posts, b.id_profile,
b.thank_you_post_enable,
Pesquisar
'posts_count' => empty($row['count_posts']),
Substituir
'posts_count' => empty($row['count_posts']),
'thank_you_post_enable' => empty($row['thank_you_post_enable']),
Pesquisar
mem.birthdate, mem.member_ip, mem.member_ip2, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login,
mem.karma_good, mem.id_post_group, mem.karma_bad, mem.lngfile, mem.id_group, mem.time_offset, mem.show_online,
Adicionar por baixo
mem.thank_you_post_made, mem.thank_you_post_became, last_thank_you_time,
Pesquisar
mem.time_format, mem.secret_question, mem.is_activated, mem.additional_groups, mem.smiley_set, mem.show_online,
mem.total_time_logged_in, mem.id_post_group, mem.notify_announcements, mem.notify_regularity, mem.notify_send_body,
Adicionar
mem.thank_you_post_made, mem.thank_you_post_became, last_thank_you_time,
Pesquisar
mem.id_member, mem.member_name, mem.real_name, mem.email_address, mem.hide_email, mem.date_registered,
Adicionar por baixo
mem.thank_you_post_made, mem.thank_you_post_became, last_thank_you_time,
Pesquisar
'local_time' => timeformat(time() + ($profile['time_offset'] - $user_info['time_offset']) * 3600, false),
Adicionar por baixo
'thank_you_post' => array(
'made' => &$profile['thank_you_post_made'],
'became' => &$profile['thank_you_post_became'],
'last_thank_you_time' => &$profile['last_thank_you_time'],
),
Pesquisar
// Load the template/language file using eval or require? (with eval we can show an error message!)
Substituir
// Call the Thank-O-Matic Function.
function loadThankYouTemplateFunctions()
{
global $context;
// Assume if is allready setup, but check something before ;)
if (!empty($context['call_thank_you_post_func']))
return true;
// I try to find if the function is loaded, and if it loaded try to find out if the function exists :)
// Define the standard :)
$context['call_thank_you_post_func'] = 'callback_template_thank_you_post';
if (function_exists('template_thank_you_post'))
$context['call_thank_you_post_func'] = 'template_thank_you_post';
}
// This is the last check before you can call a diffrent function!
function callback_template_thank_you_post($thankYouPost, $id_msg)
{
global $context, $sourcedir;
// This is the last test if the Standard Function exists!
if ($context['call_thank_you_post_func'] != 'callback_template_thank_you_post' && function_exists($context['call_thank_you_post_func']))
return $context['call_thank_you_post_func']($thankYouPost, $id_msg);
elseif (function_exists('template_thank_you_post'))
return template_thank_you($thankYouPost, $id_msg) ;
// This is the master function that will work evertime!
require_once($sourcedir . '/ThankYouPost.php');
return backup_template_thank_you_post($thankYouPost, $id_msg);
}
// Load the template/language file using eval or require? (with eval we can show an error message!)
/Sources/ManageBoards.php
Pesquisar
'override_theme' => 0,
Adicionar
'thank_you_post_enable' => 0,
Pesquisar
$boardOptions['posts_count'] = isset($_POST['count']);
Adicionar
$boardOptions['thank_you_post_enable'] = isset($_POST['thank_you_post_enable']);
/Sources/ManagePermissions.php
Pesquisar
'profile_view_own',
'profile_identity_own',
Adicionar por baixo
'thank_you_post_show',
Pesquisar
'report_any',
'send_topic',
Adicionar por baixo
'thank_you_post_post',
'thank_you_post_lock_own',
'thank_you_post_lock_any',
'thank_you_post_delete_own',
'thank_you_post_delete_any',
'thank_you_post_delete_mem_own',
'thank_you_post_delete_mem_any',
'thank_you_post_lock_all_own',
'thank_you_post_lock_all_any',
Pesquisar
'modify',
'notification',
Adicionar por baixo
'thank_you_post',
Pesquisar
'poll',
'notification',
Adicionar Por BAIXO
'thank_you_post',
pESQUISAR
'mark_any_notify' => array(false, 'notification', 'notification'),
'mark_notify' => array(false, 'notification', 'notification'),
Adicionar por baixo
'thank_you_post_post' => array(false, 'thank_you_post', 'thank_you_post'),
'thank_you_post_show' => array(false, 'thank_you_post', 'thank_you_post'),
'thank_you_post_delete' => array(true, 'thank_you_post', 'thank_you_post', 'thank_you_post_any'),
'thank_you_post_lock' => array(true, 'thank_you_post', 'thank_you_post', 'thank_you_post_any'),
'thank_you_post_lock_all' => array(true, 'thank_you_post', 'thank_you_post', 'thank_you_post_any'),
'thank_you_post_unlock_all' => array(false, 'thank_you_post', 'thank_you_post_any'),
'thank_you_post_delete_mem' => array(true, 'thank_you_post', 'thank_you_post', 'thank_you_post_any'),
Pesquisar
'send_mail',
'approve_posts',
Adicionar por baixo
'thank_you_post_post',
'thank_you_post_lock',
'thank_you_post_delete',
'thank_you_post_delete_mem',
'thank_you_post_lock_all',
'thank_you_post_unlock_all',
Sources/ManageSettings.php
Pesquisar
array('text', 'karmaSmiteLabel'),
Substituir por
array('text', 'karmaSmiteLabel'),
'',
// Yes i think the option is usefull here, too
array('check', 'thankYouPostIncraseKarmaGood'),
Pesquisar
$fields_no_registration = array('posts', 'warning_status');
Substituir por
$fields_no_registration = array('posts', 'warning_status');
// Extent the Standard Fields for Thank-O-Matic
if (!empty($modSettings['thankYouPostMemberList']))
{
$standard_fields[] = 'thank_you_post_became';
$fields_no_registration[] = 'thank_you_post_became';
$standard_fields[] = 'thank_you_post_made';
$fields_no_registration[] = 'thank_you_post_made';
}
Pesquisar
// What fields can't you put on the registration page?
$context['fields_no_registration'] = array('posts', 'warning_status');
Substituir
// What fields can't you put on the registration page?
$context['fields_no_registration'] = array('posts', 'warning_status');
// Extent the Standard Fields for Thank-O-Matic
if (!empty($modSettings['thankYouPostMemberList']))
{
$standard_fields[] = 'thank_you_post_became';
$context['fields_no_registration'][] = 'thank_you_post_became';
$standard_fields[] = 'thank_you_post_made';
$context['fields_no_registration'][] = 'thank_you_post_made';
}
/Sources/Memberlist.php
Pesquisar
$context['colspan'] = 0;
Substituir
// Thank-O-Matic Extent the Memerlist with Addition Data
if(!empty($modSettings['thankYouPostMemberList']))
{
$context['columns'] += array(
'thank_you_post_became' => array(
'label' => $txt['standard_profile_field_thank_you_post_became'],
'width' => '120',
'default_sort_rev' => true,
),
'thank_you_post_made' => array(
'label' => $txt['standard_profile_field_thank_you_post_made'],
'width' => '100',
'default_sort_rev' => true,
)
);
// Change the size as the user wish for ;).
if(!empty($modSettings['thankYouPostMemberListSizeBecame']))
$context['columns']['thank_you_post_became']['width'] = $modSettings['thankYouPostMemberListSizeBecame'];
if(!empty($modSettings['thankYouPostMemberListSizeMade']))
$context['columns']['thank_you_post_made']['width'] = $modSettings['thankYouPostMemberListSizeMade'];
}
$context['colspan'] = 0;
Pesquisar
foreach ($context['columns'] as $key => $column)
{
Substituir por
// Thank-O-Matic do not output this fields :P if the modifcation is disabled :D
if(empty($modSettings['thankYouPostMemberList']))
$context['disabled_fields'] += array('thank_you_post_became' => 1, 'thank_you_post_made' => 1);
else
{
if(!empty($modSettings['thankYouPostMemberListDisableBecame']))
$context['disabled_fields'] += array('thank_you_post_became' => 1);
if(!empty($modSettings['thankYouPostMemberListDisableMade']))
$context['disabled_fields'] += array('thank_you_post_made' => 1);
}
foreach ($context['columns'] as $key => $column)
{
Pesquisar
$limit = $_REQUEST['start'];
Substituir por
// Extent for the Thank-O-Matic the sorts :)
if(!empty($modSettings['thankYouPostMemberList']))
{
$sort_methods += array(
'thank_you_post_became' => array(
'down' => 'mem.thank_you_post_became DESC',
'up' => 'mem.thank_you_post_became ASC'
),
'thank_you_post_made' => array(
'down' => 'mem.thank_you_post_made DESC',
'up' => 'mem.thank_you_post_made ASC'
)
);
}
$limit = $_REQUEST['start'];
Pesquisar
$context['members'][$member]['registered_date'] = strftime('%Y-%m-%d', $context['members'][$member]['registered_timestamp']);
Substituir por
$context['members'][$member]['registered_date'] = strftime('%Y-%m-%d', $context['members'][$member]['registered_timestamp']);
// Resort some Options for the output of the Thank-O-Matic
if(!empty($modSettings['thankYouPostMemberList']))
{
$context['members'][$member]['thank_you_post_made'] = $memberContext[$member]['thank_you_post']['made'];
$context['members'][$member]['thank_you_post_became'] = $memberContext[$member]['thank_you_post']['became'];
}
/Sources/MoveTopic.php
Pesquisar
$smcFunc['db_query']('', '
UPDATE {db_prefix}calendar
SET id_board = {int:id_board}
WHERE id_topic IN ({array_int:topics})',
array(
'id_board' => $toBoard,
'topics' => $topics,
)
);
Adicionar por baixo
// Move the thank you's to the the new Board :)
$smcFunc['db_query']('', '
UPDATE {db_prefix}thank_you_post
SET id_board = {int:id_board}
WHERE id_topic IN ({array_int:topics})',
array(
'id_board' => $toBoard,
'topics' => $topics,
)
);
/Sources/Profile.php
Pesquisar
'permissions' => array(
Substituir por
'showThankYouPosts' => array(
'label' => $txt['thankyoutitle'],
'file' => 'Profile-ThankYouPost.php',
'function' => 'showThankYouPosts',
'subsections' => array(
'messages' => array($txt['thankyou_messages_become'], 'profile_view_any'),
'topics' => array($txt['thankyou_topics_become'], 'profile_view_any'),
'messages_given' => array($txt['thankyou_messages_given'], 'profile_view_any'),
'topics_given' => array($txt['thankyou_topics_given'], 'profile_view_any'),
),
'permission' => array(
'own' => array('profile_view_own'),
'any' => array('profile_view_any'),
)
),
'permissions' => array(
/Sources/Profile-Modify.php
Pesquisar
'yim' => array(
Adicionar por baixo
'thank_you_post_made' => array(
'type' => 'callback',
'callback_func' => 'thank_you_post_modify',
'subtext' => $txt['thankyoutitle'],
'permission' => 'admin_forum',
// Set thank_you_post_became too!
'input_validate' => create_function('&$value', '
global $profile_vars, $cur_profile;
$value = (int) $value;
if (isset($_POST[\'thank_you_post_became\']))
{
$profile_vars[\'thank_you_post_became\'] = $_POST[\'thank_you_post_became\'] != \'\' ? (int) $_POST[\'thank_you_post_became\'] : "\'\'";
$cur_profile[\'thank_you_post_became\'] = $_POST[\'thank_you_post_became\'] != \'\' ? (int) $_POST[\'thank_you_post_became\'] : \'\';
}
return true;
'),
'preload' => create_function('', '
global $context, $cur_profile;
$context[\'member\'][\'thank_you_post\'][\'became\'] = $cur_profile[\'thank_you_post_became\'];
$context[\'member\'][\'thank_you_post\'][\'made\'] = $cur_profile[\'thank_you_post_made\'];
return true;
'),
'enabled' => true,
),
Pesquisar
'website_title', 'website_url',
Substituir por
'website_title', 'website_url',
'thank_you_post_made',
/Sources/RemoveTopic.php
Pesquisar
UPDATE {db_prefix}messages
SET icon = {string:recycled}
Adicionar abaixo
, thank_you_post = IF(thank_you_post = 1, 2, thank_you_post)
Pesquisar
// Make sure this message isn't getting deleted later on.
Adicionar por Cima
// Okay the thank you must be moved to the recycler too ;)
$smcFunc['db_query']('', '
UPDATE {db_prefix}thank_you_post
SET
id_topic = {int:id_topic},
id_board = {int:recycle_board}
WHERE id_msg = {int:id_msg}',
array(
'id_topic' => $topicID,
'recycle_board' => $modSettings['recycle_board'],
'id_msg' => $message,
)
);
Pesquisar
// Delete anything related to the topic.
Adicionar antes
// Delete the Thank You Posts from this topics, before the message removed... i need the starter of the messages <<
require_once($sourcedir . '/ThankYouPost.php');
ThankYouPostRemoveTopics($topics);
/Sources/Security.php
Pesquisar
'move_any',
'send_topic',
Adicionar
'thank_you_post_post', 'thank_you_post_lock_own', 'thank_you_post_lock_any',
'thank_you_post_delete_own', 'thank_you_post_delete_any',
'thank_you_post_delete_mem_own', 'thank_you_post_delete_mem_any',
'thank_you_post_lock_all_own', 'thank_you_post_lock_all_any',
'thank_you_post_unlock_all',
/Sources/SplitTopics.php
Pesquisar
// Any associated reported posts better follow...
Adicionar antes
$smcFunc['db_query']('', '
UPDATE {db_prefix}thank_you_post
SET
id_topic = {int:id_topic}
WHERE id_msg IN ({array_int:split_msgs})',
array(
'split_msgs' => $splitMessages,
'id_topic' => $split2_ID_TOPIC,
)
);
Pesquisar
// Merge log topic entries.
Trocar por
// Change the Thank You post to the new board and topic ;D
$smcFunc['db_query']('', '
UPDATE {db_prefix}thank_you_post
SET
id_topic = {int:id_topic},
id_board = {int:target_board}
WHERE id_topic IN ({array_int:deleted_topics})',
array(
'deleted_topics' => $deleted_topics,
'id_topic' => $id_topic,
'target_board' => $target_board,
)
);
// Merge log topic entries.
/Sources/Stats.php
Pesquisar
// Cache the ones we found for a bit, just so we don't have to look again.
if ($temp !== $temp2)
cache_put_data('stats_total_time_members', $temp2, 480);
Trocar por
// Cache the ones we found for a bit, just so we don't have to look again.
if ($temp !== $temp2)
cache_put_data('stats_total_time_members', $temp2, 480);
// Thank-O-Matic Stats Callculation
if (!empty($modSettings['thankYouPostStatsEnabled']))
{
// Load chached data for Thank-O-Matic, should speed up the stats for big boards :)
$temp_thankomatic = cache_get_data('stats_thank_o_matic_members', 360);
// Load Top Thank-O-Matic Stats :)
$request = $smcFunc['db_query']('', '
SELECT id_member, real_name, thank_you_post_became, thank_you_post_made
FROM {db_prefix}members as mem' . (!empty($temp_thankomatic) ? '
WHERE id_member IN ({array_int:member_list_cached})' : '') . '
ORDER BY thank_you_post_made DESC
LIMIT {int:limit}',
array(
'limit' => 10,
'member_list_cached' => $temp_thankomatic,
)
);
$collectThxid_member = array();
$context['top_ThankOMatic_Given'] = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
{
$context['top_ThankOMatic_Given'][] = array(
'id' => $row['id_member'],
'name' => $row['real_name'],
'href' => $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '" title="' . $txt['thank_you_post_thx_display'] .' ' . $txt['thank_you_post_made_display'] . '">' . $row['real_name'] . '</a>',
'thank_you_post_became' => $row['thank_you_post_became'],
'thank_you_post_made' => $row['thank_you_post_made']
);
$collectThxid_member[$row['id_member']] = $row['id_member'];
}
$smcFunc['db_free_result']($request);
$request = $smcFunc['db_query']('', '
SELECT id_member, real_name, thank_you_post_became, thank_you_post_made
FROM {db_prefix}members' . (!empty($temp_thankomatic) ? '
WHERE id_member IN ({array_int:member_list_cached})' : '') . '
ORDER BY thank_you_post_became DESC
LIMIT {int:limit}',
array(
'limit' => 10,
'member_list_cached' => $temp_thankomatic,
)
);
$context['top_ThankOMatic_Receive'] = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
{
$context['top_ThankOMatic_Receive'][] = array(
'id' => $row['id_member'],
'name' => $row['real_name'],
'href' => $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '" title="' . $txt['thank_you_post_thx_display'] .' ' . $txt['thank_you_post_became_display'] . '">' . $row['real_name'] . '</a>',
'thank_you_post_became' => $row['thank_you_post_became'],
'thank_you_post_made' => $row['thank_you_post_made']
);
$collectThxid_member[$row['id_member']] = $row['id_member'];
}
$smcFunc['db_free_result']($request);
// Chache the data for the Thank-O-Matic stats
if($temp_thankomatic != $collectThxid_member)
cache_put_data('stats_thank_o_matic_members', $collectThxid_member, 480);
// Okay Fix the colors for the Thank You Post :)
if (!empty($collectThxid_member) && !empty($modSettings['thankYouPostColors']) && empty($modSettings['MemberColorStats']))
{
global $sourcedir, $color_profile;
// Okay load the colors and add them :)
require_once($sourcedir.'/ThankYouPost.php');
thank_you_post_loadColors($collectThxid_member);
// Hoho let's color it the thx color way :D
if (!empty($context['top_ThankOMatic_Given']))
{
foreach ($context['top_ThankOMatic_Given'] as $key => $items)
{
// Okay Let's boogie woogie ;D
$profile = $color_profile[$items['id']];
if (!empty($profile['member_group_color']) || !empty($profile['post_group_color']))
$context['top_ThankOMatic_Given'][$key]['link'] = '<a href="' . $scripturl . '?action=profile;u=' . $profile['id_member'] . '" title="' . $txt['thank_you_post_thx_display'] .' ' . $txt['thank_you_post_made_display'] . '"><span style="color:'.(!empty($profile['member_group_color']) ? $profile['member_group_color'] : $profile['post_group_color']).';">' . $profile['real_name'] . '</span></a>';
}
}
if (!empty($context['top_ThankOMatic_Receive']))
{
foreach ($context['top_ThankOMatic_Receive'] as $key => $items)
{
// Okay Let's boogie woogie ;D
$profile = $color_profile[$items['id']];
if (!empty($profile['member_group_color']) || !empty($profile['post_group_color']))
$context['top_ThankOMatic_Receive'][$key]['link'] = '<a href="' . $scripturl . '?action=profile;u=' . $profile['id_member'] . '" title="' . $txt['thank_you_post_thx_display'] .' ' . $txt['thank_you_post_became_display'] . '"><span style="color:'.(!empty($profile['member_group_color']) ? $profile['member_group_color'] : $profile['post_group_color']).';">' . $profile['real_name'] . '</span></a>';
}
}
}
}
/Sources/Subs.php
Pesquisar
'notify_announcements', 'notify_send_body', 'notify_regularity', 'notify_types',
Adicionar por baixo
'thank_you_post_became', 'thank_you_post_made',
Pesquisar
// Ensure posts, instant_messages, and unread_messages don't overflow or underflow.
Adicionar por baixo
// Ensure Thank-o_matic posts don't overflow or underflow.
if (in_array($var, array('thank_you_post_became', 'thank_you_post_made')))
{
if (preg_match('~^' . $var . ' (\+ |- |\+ -)([\d]+)~', $val, $match))
{
if ($match[1] != '+ ')
$val = 'CASE WHEN ' . $var . ' <= ' . abs($match[2]) . ' THEN 0 ELSE ' . $val . ' END';
$type = 'raw';
}
}
/Sources/Subs-Boards.php
Pesquisar
// This setting is a little twisted in the database...
if (isset($boardOptions['posts_count']))
{
$boardUpdates[] = 'count_posts = {int:count_posts}';
$boardUpdateParameters['count_posts'] = $boardOptions['posts_count'] ? 0 : 1;
}
Adicionar depois
// So enable or disable the Thank You Post in a board :D...
if (isset($boardOptions['thank_you_post_enable']))
{
$boardUpdates[] = 'thank_you_post_enable = {int:thank_you_post_enable}';
$boardUpdateParameters['thank_you_post_enable'] = $boardOptions['thank_you_post_enable'] ? 0 : 1;
}
Pesquisar
'posts_count' => true,
Adicionar
'thank_you_post_enable' => false,
Pesquisar
// Delete any message icons that only appear on these boards.
Trocar por
// Delete any Thank You Posts that only appear on these boards.
$smcFunc['db_query']('', '
DELETE FROM {db_prefix}thank_you_post
WHERE id_board IN ({array_int:boards_to_remove})',
array(
'boards_to_remove' => $boards_to_remove,
)
);
// Delete any message icons that only appear on these boards.
Pesquisar
b.board_order, b.count_posts, b.member_groups, b.id_theme, b.override_theme, b.id_profile,
Adicionar antes
b.thank_you_post_enable,
Pesquisar
'count_posts' => empty($row['count_posts']),
Adiconar depois
'thank_you_post_enable' => empty($row['thank_you_post_enable']),
/default/index.template.php
Pesquisar
?>
Adicionar antes
// A Output for the Thank You list, it's used for the Single Preview and Display Template :)
function template_thank_you_post($thankYouPost, $id_msg)
{
global $txt, $context, $modSettings;
if (!empty($context['thank_you_post'][$id_msg]))
{
if(empty($context['thank_you_post_template']['disable_start_text']))
echo '
<div class="smalltext" id="thank_you_start_text">', $context['thank_you_post_template']['start_text'] , '</div>';
// Output the Thank You List...
echo '
<div class="smalltext" id="thank_you_list">';
foreach ($context['thank_you_post'][$id_msg]['fulllist'] as $thx)
echo $thx['link'] , (!empty($thx['deletelink']) ? $thx['deletelink'] : '').($thx['last'] ? '' : ', ');
echo '
</div>';
}
// Counter and Link to the direct or a link to the complete list :)
if (empty($context['thank_you_post_template']['disable_counter_text']))
{
echo '
<div class="smalltext" id="thank_you_list_link">';
if (empty($context['thank_you_post_template']['disable_counter_link']))
echo '
<a href="', $thankYouPost['href'] ,'">';
echo '
', $txt['thank_you_link_beforecounter'], ' <strong>', $thankYouPost['counter'], '</strong> ', ($thankYouPost['counter'] == 1 ? $txt['thank_you_link_member'] : $txt['thank_you_link_members']).' '.($thankYouPost['counter'] == 1 ? $txt['thank_you_link_aftercounter'] : $txt['thank_you_link_aftercounters']);
if (empty($context['thank_you_post_template']['disable_counter_link']))
echo '
</a>';
echo '
</div>';
}
// Show some information if the Thank-O-Matic Post is locked
if ($thankYouPost['locked'])
echo '
<div class="smalltext" id="thank_you_lock_text">', $txt['thank_you_is_locked'], '</div>';
}
/Themes/default/Display.template.php
Pesquisar
'print' => array('text' => 'print', 'image' => 'print.gif', 'lang' => true, 'custom' => 'rel="new_win nofollow"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'),
);
Adicionar depois
// Special Lock for the Thank You :)
if ($context['thank_you_lock_allowed'])
if (empty($context['is_thank_you_post_locked']))
$normal_buttons['thankyoupostlock'] = array('text' => 'thank_you_post_lock_all_b', 'image' => 'thank_you_lock1.gif', 'lang' => true, 'url' => $scripturl . '?action=thankyoupostcloseall;topic=' . $context['current_topic']);
else
$normal_buttons['thankyoupostlock'] = array('text' => 'thank_you_post_open_all_b', 'image' => 'thank_you_lock2.gif', 'lang' => true, 'url' => $scripturl . '?action=thankyoupostcloseall;topic=' . $context['current_topic']);
// A Fix for later, if some Translations are not Updated
if (empty($txt['thank_you_link_aftercounters']))
$txt['thank_you_link_aftercounters'] = $txt['thank_you_link_aftercounter'];
Pesquisar ( Existe para RC3 Tambem Rc3 mais nao precisa mexer )
echo '
<form action="', $scripturl, '?action=quickmod2;topic=', $context['current_topic'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;" onsubmit="return oQuickModify.bInEditMode ? oQuickModify.modifySave(\'' . $context['session_id'] . '\', \'' . $context['session_var'] . '\') : false">';
Adicionar Antes ( RC5Nao precisa adicionar )
// AJAX Style Thank You Post
if (!empty($modSettings['thankYouPostAJAX']))
{
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var thank_you_ajax_url = smf_scripturl + \'?action=thankyouajax;topic=' . $context['current_topic'] . '\';
function thankyou(msg_id) {
// Follow the link if no ajax support...
if (!window.XMLHttpRequest)
return true;
// Standard Variables
var elementName = "ThankOMaticID" + msg_id;
var elementButton = "buttonThxID" + msg_id;
var elementLockButton = "thank_lock_button_" + msg_id;
var elementDeleteButton = "thank_delete_button_" + msg_id;
// Tell him that something loading :)
ajax_indicator(true);
// Remove the Thank You Button :)
document.getElementById(elementButton).style.display = "none";
document.getElementById(elementLockButton).style.display = "none";
document.getElementById(elementDeleteButton).style.display = "none";
var thank_you_ajax_thx = thank_you_ajax_url + ";sa=thx;msg=" + msg_id;
var data = ThankYouLoadTextData(thank_you_ajax_thx, elementName, elementButton, elementDeleteButton, elementLockButton);
return !data;
}
function ThankYouLoadTextData(url, elementName, elementButton, elementDeleteButton, elementLockButton) {
if (!window.XMLHttpRequest)
return false;
request = new XMLHttpRequest();
request.onreadystatechange = function() {
if (request.readyState != 4)
return;
if (request.responseText != null && request.status == 200) {
if (request.responseText.substr(0, 7) == "#ERROR#") {
setInnerHTML(document.getElementById("Error" + elementName), request.responseText.substr(7));
document.getElementById(elementName).style.display = "block";
document.getElementById(elementButton).style.display = "inline";
document.getElementById(elementLockButton).style.display = "none";
document.getElementById(elementDeleteButton).style.display = "none";
ajax_indicator(false);
}
else {
document.getElementById(elementName).style.display = "block";
setInnerHTML(document.getElementById(elementName), request.responseText);
document.getElementById(elementButton).style.display = "none";
document.getElementById(elementLockButton).style.display = "inline";
document.getElementById(elementDeleteButton).style.display = "inline";
ajax_indicator(false);
}
return false;
}
else {
return true;
}
}
// Load the Request!
request.open("GET", url, true);
request.send(null);
return request;
}
// ]]></script>';
}
Pesquisar
// Show avatars, images, etc.?
Adicionar ntes
// Show some Thank-O-Matic Stats ;D
if (!empty($modSettings['thankYouPostDisplayPage']) && (empty($modSettings['thankYouPostDisplayDisableBecame']) || empty($modSettings['thankYouPostDisplayDisableMade'])))
{
echo '
<li>', $txt['thank_you_post_thx_display'], '</li>';
// Disabled?
if(empty($modSettings['thankYouPostDisplayDisableMade']))
echo '
<li>-', $txt['thank_you_post_made_display'], ': ', $message['member']['thank_you_post']['made'], '</li>';
// Disabled?
if(empty($modSettings['thankYouPostDisplayDisableBecame']))
echo '
<li>-', $txt['thank_you_post_became_display'], ': ', $message['member']['thank_you_post']['became'], '</li>';
}
Pesquisar
echo '
<ul class="reset smalltext quickbuttons">';
Adicionar depois
// Thank-O-Matic need an reset sometimes... on special cases :D, Thanks to NIBIGO for the Bug info
elseif (($message['thank_you_post']['post'] && !$message['thank_you_post']['locked']) || (($message['thank_you_post']['lock'] || $message['thank_you_post']['delete']) && $message['thank_you_post']['isThankYouPost']))
echo '
<ul class="reset smalltext quickbuttons">';
Pesquisar
// What about splitting it off the rest of the topic?
if ($context['can_split'] && !empty($context['num_replies']))
echo '
<li class="split_button"><a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '">', $txt['split'], '</a></li>';
// Can do some Thank You Post things :)
if ($message['thank_you_post']['post'] && !$message['thank_you_post']['locked'])
{
echo '
<li class="thank_you_button"><span id="buttonThxID' . $message['id'] . '" style="display: inline;"><a id="buttonThxHrefID' . $message['id'] . '" href="', $scripturl, '?action=thankyou;topic=', $context['current_topic'], '.0;msg=', $message['id'], '"'.(!empty($modSettings['thankYouPostAJAX']) ? ' onclick="return thankyou(' . $message['id'] . ');"' : '').'>', $txt['thank_you_post_post_b'], '</a></span></li>';
if(!empty($modSettings['thankYouPostAJAX']) && $context['browser']['is_ie']) {
// I HATE INTERNET EXPLORER!!!!!!!!!!!!!!!!!!!!!!!
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
// Rewrite the url :x so that internet explorer can not follow it
document.getElementById("buttonThxHrefID' . $message['id'] . '").href = "#msg=' . $message['id'] . '";
// ]]></script>';
}
}
// This is the Thank-O-Matic Lock Button with Ajax special Addon :D
if ($message['thank_you_post']['lock'] && $message['thank_you_post']['isThankYouPost'])
echo '
<li class="', $message['thank_you_post']['locked'] ? 'thank_you_open_button' : 'thank_you_lock_button', '"><a href="', $scripturl, '?action=thankyoupostlock;topic=', $context['current_topic'], '.0;msg=', $message['id'], '">', $message['thank_you_post']['locked'] ? $txt['thank_you_post_open_b'] : $txt['thank_you_post_lock_b'], '</a></li>';
elseif ($message['thank_you_post']['lock'] && !$message['thank_you_post']['isThankYouPost'] && !empty($modSettings['thankYouPostAJAX']) && empty($modSettings['thankYouPostAJAXModButtonsDisable']))
echo '
<li class="', $message['thank_you_post']['locked'] ? 'thank_you_open_button' : 'thank_you_lock_button', '" id="thank_lock_button_' . $message['id'] . '" style="display: none;"><a href="', $scripturl, '?action=thankyoupostlock;topic=', $context['current_topic'], '.0;msg=', $message['id'], '">', $message['thank_you_post']['locked'] ? $txt['thank_you_post_open_b'] : $txt['thank_you_post_lock_b'], '</a></li>';
// This will prevent Java Script errors on most browser...
elseif (!empty($modSettings['thankYouPostAJAX']) || !empty($modSettings['thankYouPostAJAXModButtonsDisable']))
echo '
<span id="thank_lock_button_' . $message['id'] . '" style="display: none;"></span>';
// This is the Thank-O-Matic Delete Button with Ajax special Addon ;P
if ($message['thank_you_post']['delete'] && $message['thank_you_post']['isThankYouPost'])
echo '
<li class="thank_you_delete_button"><a href="', $scripturl, '?action=thankyoupostdelete;topic=', $context['current_topic'], '.0;msg=', $message['id'], ';sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt['remove_thank_you_post'], '?\');">', $txt['thank_you_post_delete_b'], '</a></li>';
elseif ($message['thank_you_post']['delete'] && !$message['thank_you_post']['isThankYouPost'] && !empty($modSettings['thankYouPostAJAX']) && empty($modSettings['thankYouPostAJAXModButtonsDisable']))
echo '
<li class="thank_you_delete_button" id="thank_delete_button_' . $message['id'] . '" style="display: none;"><a href="', $scripturl, '?action=thankyoupostdelete;topic=', $context['current_topic'], '.0;msg=', $message['id'], ';sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt['remove_thank_you_post'], '?\');">', $txt['thank_you_post_delete_b'], '</a></li>';
// This will prevent Java Script errors on most browser...
elseif (!empty($modSettings['thankYouPostAJAX']) || !empty($modSettings['thankYouPostAJAXModButtonsDisable']))
echo '
<span id="thank_delete_button_' . $message['id'] . '" style="display: none;"></span>';
Pesquisar
if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
echo '
</ul>';
Adicionar antes
// Thank-O-Matic okay close the ul on sometimes :D
elseif (($message['thank_you_post']['post'] && !$message['thank_you_post']['locked']) || (($message['thank_you_post']['lock'] || $message['thank_you_post']['delete']) && $message['thank_you_post']['isThankYouPost']))
echo '
</ul>';
Pesquisar
// Restore topic. eh? No monkey business.
Adicionar antes
if($context['thank_you_post_unlock_all'])
$mod_buttons[] = array('text' => 'thank_you_post_unlock_all', 'image' => 'thankyoulock2.gif', 'lang' => true, 'url' => $scripturl . '?action=thankyoupostunlockall;topic=' . $context['current_topic'] . '.0');
/Themes/default/ManageBoards.template.php
Pesquisar
echo '
<input type="hidden" name="rid" value="', $context['redirect_location'], '" />
Adicionar antes
echo '
<div id="thank_o_matic_div">
<dl class="settings">
<dt>
<strong>', $txt['mboards_thank_you_post_enable'], ':</strong><br />
<span class="smalltext">', $txt['mboards_thank_you_post_enable_desc'], '</span><br />
</dt>
<dd>
<input type="checkbox" name="thank_you_post_enable"', $context['board']['thank_you_post_enable'] ? ' checked="checked"' : '', ' class="input_check" />
</dd>
</dl>
</div>';
/Themes/default/Profile.template.php
Pesquisar
<a href="', $scripturl, '?action=profile;area=showposts;u=', $context['id_member'], '">', $txt['showPosts'], '</a><br />
Substituir por este
<a href="', $scripturl, '?action=profile;area=showposts;u=', $context['id_member'], '">', $txt['showPosts'], '</a><br />
<a href="', $scripturl, '?action=profile;area=showThankYouPosts;u=', $context['id_member'], '">', $txt['thankyoutitle_show'], '</a><br />
Pesquisar
// Show the users signature.
if ($context['signature_enabled'] && !empty($context['member']['signature']))
Substituir por este
// Thank You Infomations :)
echo '
<dl>
<h5>', $txt['thankyoutitle'], ':</h5>
<dt>', $txt['thankyoupostmade'], ':</dt>
<dd>', $context['member']['thank_you_post']['made'], '</dd>
<dt>', $txt['thankyoupostbecame'], ':</dt>
<dd>', $context['member']['thank_you_post']['became'], '</dd>
</dl>';
// Show the users signature.
if ($context['signature_enabled'] && !empty($context['member']['signature']))
Pesquisar
// Callback for modifying karam.
function template_profile_karma_modify()
Substituir por este
// Callback for modifying Thank-O-Matic Stats ;D
function template_profile_thank_you_post_modify()
{
global $context, $modSettings, $txt;
// Admins are allowed to change the Thank-O-Matic Stats :D
echo '
<dt>
<strong>', $txt['thankyoutitle'], ' ', $txt['thankyoupostmade'], ': </strong>
</dt>
<dd>
<input type="text" name="thank_you_post_made" size="4" value="', $context['member']['thank_you_post']['made'], '" />
</dd>
<dt>
<strong>', $txt['thankyoutitle'], ' ', $txt['thankyoupostbecame'], ': </strong>
</dt>
<dd>
<input type="text" name="thank_you_post_became" size="4" value="', $context['member']['thank_you_post']['became'], '" />
</dd>';
}
// Callback for modifying karam.
function template_profile_karma_modify()
/Themes/default/Memberlist.template.php
Pesquisar
echo '
</tr>';
}
Substituir por este
// Thank-O-Matic show on Memberlist the Output
if (!isset($context['disabled_fields']['thank_you_post_became']))
echo '
<td class="windowbg2">', $member['thank_you_post']['became'], '</td>';
if (!isset($context['disabled_fields']['thank_you_post_made']))
echo '
<td class="windowbg2">', $member['thank_you_post']['made'], '</td>';
echo '
</tr>';
}
/Themes/default/Stats.template.php
Pesquisar
echo '
<span>', $poster['time_online'], '</span>
</dd>';
}
Substituir por este
echo '
<span>', $poster['time_online'], '</span>
</dd>';
}
// Thank-O-Matic Stats
if (!empty($modSettings['thankYouPostStatsEnabled']))
{
echo '
</dl>
<div class="clear"></div>
</div>
<span class="botslice"><span></span></span>
</div>
</div>
</div>
<div class="flow_hidden">
<div id="most_thank_you_receive">
<h3 class="catbg"><span class="left"></span>
<img src="', $settings['images_url'], '/buttons/thank_you_b.gif" class="icon" alt="" /> ', $txt['thank_you_post_Top10Receive'], ' <span class="smalltext">(', $txt['thank_you_post_became_display'], ' / ', $txt['thank_you_post_made_display'], ')</span>
</h3>
<div class="windowbg">
<span class="topslice"><span></span></span>
<div class="content">
<dl class="stats">';
foreach ($context['top_ThankOMatic_Receive'] as $poster)
echo '
<dt>', $poster['link'], '</dt>
<dd>', $poster['thank_you_post_became'], '/', $poster['thank_you_post_made'], '</dd>';
echo '
</dl>
<div class="clear"></div>
</div>
<span class="botslice"><span></span></span>
</div>
</div>
<div id="most_thank_you_given">
<h3 class="catbg"><span class="left"></span>
<img src="', $settings['images_url'], '/buttons/thank_you_b.gif" class="icon" alt="" /> ', $txt['thank_you_post_Top10Given'], ' <span class="smalltext">(', $txt['thank_you_post_made_display'], ' / ', $txt['thank_you_post_became_display'], ')</span>
</h3>
<div class="windowbg2">
<span class="topslice"><span></span></span>
<div class="content">
<dl class="stats">';
foreach ($context['top_ThankOMatic_Given'] as $poster)
echo '
<dt>', $poster['link'], '</dt>
<dd>', $poster['thank_you_post_made'], '/', $poster['thank_you_post_became'], '</dd>';
}
Themes/default/css/index.css
Pesquisar
ul.quickbuttons li.restore_button
{
background: url(../images/theme/quickbuttons.png) no-repeat 0 -120px;
}
Adicionar depois
/* This are the the Thank-O-Matic Buttons START */
ul.quickbuttons li.thank_you_button
{
background: url(../images/buttons/thank_you_b.gif) no-repeat;
}
ul.quickbuttons li.thank_you_open_button
{
background: url(../images/buttons/thank_you_open.gif) no-repeat;
}
ul.quickbuttons li.thank_you_lock_button
{
background: url(../images/buttons/thank_you_lock.gif) no-repeat;
}
ul.quickbuttons li.thank_you_delete_button
{
background: url(../images/buttons/thank_you_delete.gif) no-repeat;
}
/* This are the the Thank-O-Matic Buttons END */
Pesquisar
/* Styles for the help section.
------------------------------------------------- */
Adicionar antes
/* Styles for the Thank-O-Matic sections.
------------------------------------------------- */
.ThankOMatic
{
margin: 0.5em 0.5em 0.5em 0.5em;
padding: 0.2em 0.2em 0.2em 0.2em;
}
.ThankOMatic #thank_you_start_text
{
}
.ThankOMatic #thank_you_list
{
font-family: arial, helvetica, sans-serif;
padding-left: 0.5em;
padding-top: 0.2em;
}
.ThankOMatic #thank_you_list_link
{
}
.ThankOMatic #thank_you_lock_text
{
font-style: italic;
}
#most_thank_you_receive
{
float:left;
width: 49.5%;
}
#most_thank_you_given
{
float: right;
width: 49.5%;
}
Tem os ficheiro do core por alterar se alguem estiver a usar core diga para eu fazer alteracao manual
/Themes/core/index.template.php
/Themes/core/Display.template.php
/Themes/core/Memberlist.template.php
/Themes/core/Stats.template.php
/Themes/core/css/index.css
Themes/default/languages/Admin.english.php
Pesquisar
?>
Adiciona antes
//Thank-O-Matic
$txt['thankyouposttitle'] = 'Thank-O-Matic';
$txt['maintain_thxpost'] = 'Maintaince Thank-O-Matic';
$txt['maintain_thank_you_post_maintainaince'] = 'Maintaince';
$txt['maintain_thank_you_post_maintainaince_desc'] = 'Optimize Thank-O-Matic tables, Delete Thank You Posts of specific members.';
$txt['maintain_thank_you_post_recount'] = 'Stats Recount';
$txt['maintain_thank_you_post_recount_desc'] = 'Recalculate Thank-O-Matic Stats for all, thread based or member specific.';
$txt['maintain_thxpostrecount'] = 'Recalculate Thank-O-Matic stats';
$txt['maintain_thxpostrecount_info'] = 'Recalculate most of the Thank-O-Matic stats, and reset also manual changed values.';
$txt['maintain_thxpostrecount_member'] = 'Recalculate Thank-O-Matic Member stats';
$txt['maintain_thxpostrecount_member_info'] = 'Recalculate the Thank-O-Matic stats of one Member.';
$txt['maintain_thxpostrecount_member_value'] = 'Please insert the Member ID for recalculation here:';
$txt['maintain_thxpostrecount_topic'] = 'Recalculate Thank-O-Matic Topic stats';
$txt['maintain_thxpostrecount_topic_info'] = 'Recalculate the Thank-O-Matic stats of one Topic.';
$txt['maintain_thxpostrecount_topic_value'] = 'Please insert the Topic ID for recalculation here:';
$txt['maintain_thxpostrepair'] = 'Repair and optimize Thank-O-Matic tables';
$txt['maintain_thxpostrepair_info'] = 'Delete all not needed items, remove thank you posts of disabled board (or deleted boards).';
$txt['maintain_thank_you_optimize'] = 'Repair and optimize Thank-O-Matic Tables';
// Please don't forget to insert [MEMBER], this will insert the link to the member profile
$txt['maintain_thank_you_deleteMemberposts'] = 'Delete Thankyoupost of Member: [MEMBER]';
$txt['maintain_thank_you_recountAll'] = 'Recount All Thank-O-Matic Stats';
// Please don't forget to insert [MEMBER], this will insert the link to the member profile
$txt['maintain_thank_you_recountMember'] = 'Recount Topic Thank-O-Matic Stats for the Member: [MEMBER]';
// Please don't forget to insert [TOPIC], this will insert the link to the Topic
$txt['maintain_thank_you_recountTopic'] = 'Recount Topic Thank-O-Matic Stats for [TOPIC]';
/Themes/default/languages/index.english.php
Pesquisar
?>
Adicionar antes
//Thank You text for the Thread :)
$txt['thank_you_link_beforecounter'] = 'For this post,';
$txt['thank_you_link_members'] = 'members';
$txt['thank_you_link_member'] = 'member';
$txt['thank_you_link_aftercounter'] = 'gave a thank you!';
$txt['thank_you_link_aftercounters'] = 'gave a thank you!';
$txt['thank_you_is_locked'] = 'Thank You is locked';
$txt['thank_you_post_post_b'] = 'Thank You';
$txt['thank_you_post_delete_b'] = 'Delete Thank You';
$txt['thank_you_post_lock_b'] = 'Lock Thank You';
$txt['thank_you_post_open_b'] = 'Open Thank You';
$txt['thank_you_post_lock_all_b'] = 'Lock All Thank You';
$txt['thank_you_post_open_all_b'] = 'Open All Thank You';
$txt['remove_thank_you_post'] = 'Remove this Thank You';
$txt['followgiveathank'] = 'Follow members gave a thank to your post:';
$txt['thank_you_post_unlock_all'] = 'Unlock All Thank You Posts';
$txt['thankyoupostlist'] = 'Thank You Post List (Complete)';
$txt['thankyouposterrorinscript'] = 'Error in scirpt... somehow this should not happen!';
$txt['thank_you_post_thx_display'] = 'Thank You';
$txt['thank_you_post_made_display'] = 'Given';
$txt['thank_you_post_became_display'] = 'Receive';
$txt['standard_profile_field_thank_you_post_made'] = 'Given Thank You';
$txt['standard_profile_field_thank_you_post_became'] = 'Received Thank You';
/Themes/default/languages/ManageBoards.english.php
Pesquisar
?>
Adicionar antes
//Thank-O-Matic
$txt['mboards_thank_you_post_enable'] = 'Enable Thank-O-Matic';
$txt['mboards_thank_you_post_enable_desc'] = 'This option enable the "Thank You" option for posts on this board';
/Themes/default/languages/ManagePermissions.english.php