Code: Select all
$thanks_img = '';
if ( ($userdata['session_logged_in']) && ($userdata['user_id'] != $poster_id) ) {
Code: Select all
$thanks_img = '';
if ($userdata['session_logged_in']) {
Code: Select all
// If the user isn't the user who made the post
if ($userdata['user_id'] != $post_row['poster_id']) {
Code: Select all
}
else {
$l_message = $lang['Thanks_self'];
}
Yes!!! That is it! (I have deleted this comments before, in troubleshooting process )alexi02 wrote: And if your viewtopic_body.tpl has the <!-- BEGIN thanks --> and <!-- END thanks -->.
The quick way to 'kind' of skip the confirmation page is to go to includes/subSilver/thanks.tpl, find the first line:Tumbo wrote:- Is there a possibility tho skip the "Confirmation"/"Popup" window that you have Thanked a post? I mean. If you thank, your named ads in the bottom, and that's it.
Code: Select all
<meta http-equiv="refresh" content="5;URL={U_BACK_LINK}">
Code: Select all
<meta http-equiv="refresh" content="0;URL={U_BACK_LINK}">
Code: Select all
ALTER TABLE `phpbb_forums` ADD `thanks_enabled` SMALLINT( 1 ) NOT NULL ;
Code: Select all
case 'forum_sync':
sync('forum', intval($HTTP_GET_VARS[POST_FORUM_URL]));
$show_index = TRUE;
break;
Code: Select all
case 'thanks_yes':
$forum_id = intval($HTTP_GET_VARS[POST_FORUM_URL]);
$sql = "UPDATE " . FORUMS_TABLE . "
SET thanks_enabled = '1'
WHERE forum_id = $forum_id";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't change category order", "", __LINE__, __FILE__, $sql);
}
$show_index = TRUE;
break;
case 'thanks_no':
$forum_id = intval($HTTP_GET_VARS[POST_FORUM_URL]);
$sql = "UPDATE " . FORUMS_TABLE . "
SET thanks_enabled = '0'
WHERE forum_id = $forum_id";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't change category order", "", __LINE__, __FILE__, $sql);
}
$show_index = TRUE;
break;
Code: Select all
$template->assign_block_vars("catrow.forumrow",
Code: Select all
$thanks_enabled = 'Yes';
$thanks_disabled = "<b>No</b>";
if ($forum_rows[$j]['thanks_enabled'] == 1) {
$thanks_enabled = "<b>Yes</b>";
$thanks_disabled = "No";
}
Code: Select all
'U_FORUM_MOVE_DOWN' => append_sid("admin_forums.$phpEx?mode=forum_order&move=15&" . POST_FORUM_URL . "=$forum_id"),
Code: Select all
'THANKS_ENABLED' => $thanks_enabled,
'THANKS_DISABLED' => $thanks_disabled,
'U_FORUM_THANKS_YES' => append_sid("admin_forums.$phpEx?mode=thanks_yes&" . POST_FORUM_URL . "=$forum_id"),
'U_FORUM_THANKS_NO' => append_sid("admin_forums.$phpEx?mode=thanks_no&" . POST_FORUM_URL . "=$forum_id"),
Code: Select all
<th class="thHead" colspan="7">{L_FORUM_TITLE}</th>
Code: Select all
<th class="thHead" colspan="8">{L_FORUM_TITLE}</th>
Code: Select all
<td class="catRight" align="center" valign="middle"><span class="gen"> </span></td>
Code: Select all
<td class="cat" align="center" valign="middle" nowrap="nowrap"><span class="gen"> </span></td>
<td class="catRight" align="center" valign="middle"><span class="gen">Thanks Allowed?</span></td>
Code: Select all
<td class="row2" align="center" valign="middle"><span class="gen"><a href="{catrow.forumrow.U_FORUM_RESYNC}">{L_RESYNC}</a></span></td>
Code: Select all
<td class="row1" align="center" valign="middle"><span class="gen"><a href="{catrow.forumrow.U_FORUM_THANKS_YES}">{catrow.forumrow.THANKS_ENABLED}</a> <a href="{catrow.forumrow.U_FORUM_THANKS_NO}">{catrow.forumrow.THANKS_DISABLED}</a></span></td>
Code: Select all
<tr>
<td colspan="7" class="row2"><input class="post" type="text" name="{catrow.S_ADD_FORUM_NAME}" /> <input type="submit" class="liteoption" name="{catrow.S_ADD_FORUM_SUBMIT}" value="{L_CREATE_FORUM}" /></td>
</tr>
<tr>
<td colspan="7" height="1" class="spaceRow"><img src="../templates/subSilver/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
<!-- END catrow -->
<tr>
<td colspan="7" class="catBottom"><input class="post" type="text" name="categoryname" /> <input type="submit" class="liteoption" name="addcategory" value="{L_CREATE_CATEGORY}" /></td>
</tr>
Code: Select all
<tr>
<td colspan="8" class="row2"><input class="post" type="text" name="{catrow.S_ADD_FORUM_NAME}" /> <input type="submit" class="liteoption" name="{catrow.S_ADD_FORUM_SUBMIT}" value="{L_CREATE_FORUM}" /></td>
</tr>
<tr>
<td colspan="8" height="1" class="spaceRow"><img src="../templates/subSilver/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
<!-- END catrow -->
<tr>
<td colspan="8" class="catBottom"><input class="post" type="text" name="categoryname" /> <input type="submit" class="liteoption" name="addcategory" value="{L_CREATE_CATEGORY}" /></td>
</tr>
Code: Select all
$sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments" . $count_sql . "
Code: Select all
$sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments, f.thanks_enabled" . $count_sql . "
Code: Select all
$forum_id = intval($forum_topic_data['forum_id']);
Code: Select all
$thanks_forum_enabled = intval($forum_topic_data['thanks_enabled']);
Code: Select all
if ( ($userdata['session_logged_in']) && ($userdata['user_id'] != $poster_id) ) {
Code: Select all
if ( ($userdata['session_logged_in']) && ($userdata['user_id'] != $poster_id) && $thanks_forum_enabled == 1) {
Code: Select all
if ($postrow[$i]['user_id'] != ANONYMOUS) {
Code: Select all
if ($postrow[$i]['user_id'] != ANONYMOUS && $thanks_forum_enabled == 1) {
Code: Select all
if ($postrow[$i]['thanks_count'] >= 1) {
Code: Select all
if ($postrow[$i]['thanks_count'] >= 1 && $thanks_forum_enabled == 1) {
It should run with the Mod Color Groups but it won't use anything from that mod. To incorporate your own colors into the thanked users follow the step below. You can then add more cases for different user levels or you could change the $user_row['user_level'] variable with something else to suit your needs.CiberRed wrote:your MOD Thank Post by User 0.2.6 is compatible with the MOD Color Groups v1.2.1???
Code: Select all
if ($x >= 1) { $thanked_by .= ", "; }
// Add user to thanked by list
$temp_url = "profile.$phpEx?mode=viewprofile&u=" . $user_row['user_id'];
$thanked_by .= '<a href="' . $temp_url . '">' . $user_row['username'] . '</a>';
Code: Select all
switch ( $user_row['user_level'] )
{
case ADMIN:
$poster_name = '<b>' . $poster . '</b>';
$style_color = ' style="color:#' . $theme['fontcolor3'] . '"';
break;
case MOD:
$poster_name = '<b>' . $poster . '</b>';
$style_color = ' style="color:#' . $theme['fontcolor2'] . '"';
break;
default:
$poster_name = $poster;
$style_color = '';
break;
}
if ($x >= 1) { $thanked_by .= ", "; }
// Add user to thanked by list
$temp_url = "profile.$phpEx?mode=viewprofile&u=" . $user_row['user_id'];
$thanked_by .= '<a href="' . $temp_url . '"' . $style_color . '>' . $user_row['username'] . '</a>';
alexi02 wrote:apocan wrote: can we show how much a user thanked in index page
e.g:top 5 thanked users...
This should work.
Open index.php
FindAfter AddCode: Select all
$is_auth_ary = array(); $is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data);
FindCode: Select all
// // Start Top 5 Thanked Users // $lang['Top_5_thanked'] = 'Top 5 thanked users'; $sql = "SELECT user_id, username, user_thanks_received FROM " . USERS_TABLE . " WHERE user_id <> " . ANONYMOUS . " ORDER BY user_thanks_received DESC"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query users table', '', __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrowset($result); $db->sql_freeresult($result); $row_count = count($row); for ($x = 0; $x < 5; $x++) { if ($row[$x]['user_id']) { if ($x >= 1) { $top_5_thanked_users .= ", "; } // Add user to thanked list $temp_url = "profile.$phpEx?mode=viewprofile&u=" . $row[$x]['user_id']; $top_5_thanked_users .= '<a href="' . $temp_url . '">' . $row[$x]['username'] . '</a> (' . $row[$x]['user_thanks_received'] . ')'; } } // // End Top 5 Thanked Users //
After AddCode: Select all
'NEWEST_USER' => sprintf($lang['Newest_user'], '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$newest_uid") . '">', $newest_user, '</a>'),
Code: Select all
'L_TOP_5_THANKED_TEXT' => $lang['Top_5_thanked'], 'L_TOP_5_THANKED_USERS' => $top_5_thanked_users,
Open templates/subSilver/index_body.tpl
FindReplace withCode: Select all
<td class="row1" align="center" valign="middle" rowspan="2"><img src="templates/subSilver/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td>
FindCode: Select all
<td class="row1" align="center" valign="middle" rowspan="3"><img src="templates/subSilver/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td>
After AddCode: Select all
<tr> <td class="row1" align="left"><span class="gensmall">{TOTAL_USERS_ONLINE} [ {L_WHOSONLINE_ADMIN} ] [ {L_WHOSONLINE_MOD} ]<br />{RECORD_USERS}<br />{LOGGED_IN_USER_LIST}</span></td> </tr>
Code: Select all
<tr> <td class="row1" align="left"><span class="gensmall">{L_TOP_5_THANKED_TEXT}: {L_TOP_5_THANKED_USERS}</span></td> </tr>