I was just wondering, could there be "Thanks" option for every post. And not just for topic.
Because, someone could start topic in searching for help about something. And if user who replies, gives good answer and solution. That user deserve "Thanks". But there is no way to Thank that user for good reply.
Also would be nice, to see how many "Thanks" user collected.
I didn't found that feature among many IP features :loveit:
Could someone please help me and point me the way??
Question, Regarding Thanks Option
Subject: Re: Question, Regarding Thanks Option
Since I didn't find what was I looking for in IP. Now I'm trying to install phpbb2 Thank Post by User v0.3.2 http://www.phpbb.com/community/viewtopic.php?f=16&t=441758
I've tried few times, but no success
So can someone take a quick look at the installation file, and give some pointers how to properly install it to IP
I've tried few times, but no success
So can someone take a quick look at the installation file, and give some pointers how to properly install it to IP
Spoiler: [ Show ]
Spoiler: [ Hide ]
##############################################################
## MOD Title: Thank Post by User
## MOD Author: alexi02 < N/A > (Alejandro Iannuzzi) http://www.uzzisoft.com
## MOD Description: Allows registered users to thank a post which was posted by another user
## MOD Version: 0.3.2
##
## Installation Level: Easy
## Installation Time: 10 Minutes
## Files To Edit: modcp.php
## viewtopic.php
## admin/admin_forums.php
## admin/admin_users.php
## includes/functions_post.php
## includes/usercp_viewprofile.php
## language/lang_english/lang_main.php
## templates/subSilver/profile_view_body.tpl
## templates/subSilver/subSilver.cfg
## templates/subSilver/viewtopic_body.tpl
## templates/subSilver/admin/forum_admin_body.tpl
## Included Files: thanks.php
## templates/subSilver/thanks.tpl
## templates/subSilver/thanks_popup.tpl
## templates/subSilver/images/lang_english/icon_thank.gif
##
## License: http://opensource.org/licenses/GPL-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## A mod which allows you to thank a post that a user has posted.
## When the Thanks button is pressed a page is displayed showing the user that they have successfully thanked the other user for their post.
##
## You can choose whether that page should be a popup or not by editing the $popup_enabled to 0 or 1 in viewtopic.php and thanks.php
## If set to 0, the user is shown the thanks page on the current window and will be automatically redirected to the post they thanked.
##
## You can view the thanks given and thanks received by a user in the topic under their username.
## You are shown the users who have thanked the specific post.
## When a post has been deleted, the thanked received for the poster is decreased as well as the thanks given by other users.
##
## You can enable or disable this mod for each forum via the ACP -> Forum Admin -> Management.
## This mod is set to 'disabled' as default, therefore you will have to enable it on which ever forums you want.
##
##############################################################
## MOD History:
##
## 2008-06-10 - Version 0.3.2
## - Thanks is now removed for each post when deleting threads
##
## 2008-06-01 - Version 0.3.1 (RC1)
## - Fixed a slight bug which was added in v0.3 that allowed users to thank anonymous posts
## - Added in thanks in user profile
## - Improved sql query in thanks.php
##
## 2008-04-03 - Version 0.3
## - New thanks table created
## - Thanked x times in y posts now only shows y posts as the posts which users have thanked and not the total posts the user has
## - Ability to enable / disable this mod on each forum via the ACP
##
## 2007-10-26 - Version 0.2.6
## - Updates thanks_given and thanked_received when posts are deleted
##
## 2006-10-29 - Version 0.2.5a
## - Thanks icon updated
##
## 2006-10-23 - Version 0.2.5
## - Bug Fix: Thanks button was sometimes displayed even though the user had thanked the post
##
## 2006-10-22 - Version 0.2.4
## - Removes the thanks button from posts that the user has already thanked
##
## 2006-10-21 - Version 0.2.3
## - Updated the way "Thanked 2 Times in 1 Posts" is displayed. Posts are now referred to the total number of posts that were thanked by other users instead of the user's total posts.
##
## 2006-10-19 - Version 0.2.2
## - Bug Fix: Adjusted Thanked by row in viewtopic to wrap the users who thanked the post
##
## 2006-10-19 - Version 0.2.1
## - Bug Fix: Moved Thanks icon back next to quote icon since the ICQ icon gets displayed over the thanks icon if the user has an ICQ number set (couldn't find a reasonable solution)
##
## 2006-09-27 - Version 0.2.0
## - Moved Thanks icon to right hand side of where Profile, PM, links are displayed
## - Made the username of people who thanked a user link to their profile
## - Be able to select whether the thanks should popup or be displayed on the same page
##
## 2006-09-12 - Version 0.1.1
## - Bug Fix: Thanks received wasn't updating correctly
##
## 2006-09-11 - Version 0.1.0
## - Initial Release (for phpBB 2.0.21)
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]------------------------------------------
# Use your SQL tool to create the following table
# Change phpbb_forums to your forums table
#
CREATE TABLE `phpbb_thanksmod` (
`post_id` mediumint(8) unsigned NOT NULL default '0',
`thanked_user` mediumint(8) NOT NULL default '0',
`thanks_by` mediumint(8) NOT NULL default '0',
`thanked_time` int(10) NOT NULL default '0'
);
ALTER TABLE `phpbb_forums` ADD `thanks_enabled` SMALLINT( 1 ) NOT NULL ;
#
#-----[ COPY ]------------------------------------------
#
copy root/thanks.php to thanks.php
copy root/templates/subSilver/thanks.tpl to templates/subSilver/thanks.tpl
copy root/templates/subSilver/thanks_popup.tpl to templates/subSilver/thanks_popup.tpl
copy root/templates/subSilver/images/lang_english/icon_thank.gif to templates/subSilver/images/lang_english/icon_thank.gif
#
#-----[ OPEN ]------------------------------------------
#
modcp.php
#
#-----[ FIND ]------------------------------------------
#
$post_id_sql .= ( ( $post_id_sql != '' ) ? ', ' : '' ) . intval($row['post_id']);
#
#-----[ AFTER ADD ]------------------------------------------
#
//
// Start Thank Post by User Mod
//
// Delete all thanks which match the post id
$sqldel = "DELETE FROM
phpbb_thanksmod
WHERE post_id = '" . intval($row['post_id']) . "'";
if ( !($resultdel = $db->sql_query($sqldel)) ) {
message_die(GENERAL_ERROR, "Could not remove thanks from thanks table", '', __LINE__, __FILE__, $sql);
}
//
// End Thank Post by User Mod
//
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
$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 . "
#
#-----[ IN-LINE FIND ]------------------------------------------
#
f.auth_attachments
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, f.thanks_enabled
#
#-----[ FIND ]------------------------------------------
#
$forum_id = intval($forum_topic_data['forum_id']);
#
#-----[ AFTER, ADD ]------------------------------------------
#
$thanks_forum_enabled = intval($forum_topic_data['thanks_enabled']);
#
#-----[ FIND ]------------------------------------------
#
$pagination = ( $highlight != '' ) ? generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order&highlight=$highlight", $total_replies, $board_config['posts_per_page'], $start) : generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order", $total_replies, $board_config['posts_per_page'], $start);
#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// Start Thank Post by User Mod
//
// Set to 1 if you wish to use pop-ups instead of using the same window
$popup_enabled = 0;
if ($popup_enabled == 1) {
$thanks_javascript ='<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=400,height=225');");
}
// End -->
</script>';
}
//
// End Thank Post by User Mod
//
#
#-----[ FIND ]------------------------------------------
#
'FORUM_ID' => $forum_id,
#
#-----[ BEFORE, ADD ]------------------------------------------
#
'THANKS_JAVASCRIPT' => $thanks_javascript,
#
#-----[ FIND ]------------------------------------------
#
$search = '<a href="' . $temp_url . '">' . sprintf($lang['Search_user_posts'], $postrow[$i]['username']) . '</a>';
#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// Start Thank Post by User Mod
//
$thanks_img = '';
// If the user is logged in, the user is not the poster, the poster is not anonymous and thanks is enabled on this fourm
if ( ($userdata['session_logged_in']) && ($userdata['user_id'] != $poster_id) && ($poster_id != ANONYMOUS) && ($thanks_forum_enabled == 1) ) {
// Posts SQL
$sql = "SELECT thanks_by
FROM phpbb_thanksmod
WHERE post_id = '" . $postrow[$i]['post_id'] . "'
AND thanks_by = '" . $userdata['user_id'] . "'";
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain thanks information", '', __LINE__, __FILE__, $sql);
}
$post_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// If the user hasn't thanked this post
if (!$post_row) {
$temp_url = append_sid("thanks.$phpEx?p=" . $postrow[$i]['post_id']);
if ($popup_enabled == 1) {
$thanks_img = '<a href="javascript:popUp('' . $temp_url . '')"><img src="' . $images['icon_thank'] . '" alt="' . $lang['Thanks_text'] . '" title="' . $lang['Thanks_text'] . '" border="0" /></a>';
}
else {
$thanks_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_thank'] . '" alt="' . $lang['Thanks_text'] . '" title="' . $lang['Thanks_text'] . '" border="0" /></a>';
}
}
}
//
// End Thank Post by User Mod
//
#
#-----[ FIND ]------------------------------------------
#
$template->assign_block_vars('postrow', array(
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//
// Start Thank Post by User Mod
//
// If the user isn't anonymous then show the user's thanks given and thanks received
if ($postrow[$i]['user_id'] != ANONYMOUS) {
// Thanks by
$sql = "SELECT COUNT(thanks_by) AS thanks_by
FROM phpbb_thanksmod
WHERE thanks_by = " . $postrow[$i]['user_id'];
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain thanks information", '', __LINE__, __FILE__, $sql);
}
$thanks_by_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// Thanked user
$sql = "SELECT post_id, thanked_user
FROM phpbb_thanksmod
WHERE thanked_user = '" . $postrow[$i]['user_id'] . "'
ORDER BY post_id";
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain thanks information", '', __LINE__, __FILE__, $sql);
}
// Calculate the user's thanks given and thanks received
$thanked_count = 0;
$thanked_posts = 0;
$old_post_id = 0;
while ($row = mysql_fetch_array($result)) {
if ($row['post_id'] != $old_post_id) {
$thanked_posts++;
}
$old_post_id = $row['post_id'];
$thanked_count++;
}
$thanks_given = $lang['Thanks_thanks'] . ': ' . $thanks_by_row['thanks_by'];
$thanks_received = $lang['Thanks_thanked_1'] . ' ' . $thanked_count . ' ' . $lang['Thanks_thanked_2'] . ' ' . $thanked_posts . ' ' . $lang['Thanks_thanked_3'];
}
else {
$thanks_given = '';
$thanks_received = '';
}
//
// End Thank Post by User Mod
//
#
#-----[ FIND ]------------------------------------------
#
'POSTER_FROM' => $poster_from,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'POSTER_THANKS_GIVEN' => $thanks_given,
'POSTER_THANKS_RECEIVED' => $thanks_received,
#
#-----[ FIND ]------------------------------------------
#
'EDIT' => $edit,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'THANKS_IMG' => $thanks_img,
#
#-----[ FIND ]------------------------------------------
#
}
$template->pparse('body');
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//
// Start Thank Post by User Mod
//
// If the user isn't anonymous and thanks on this fourm is enabled
if ($postrow[$i]['user_id'] != ANONYMOUS && $thanks_forum_enabled == 1) {
$thanked_by = '';
// Thanked post
$sql = "SELECT thanks_by
FROM phpbb_thanksmod
WHERE post_id = '" . $postrow[$i]['post_id'] . "'
ORDER BY thanked_time ASC";
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql);
}
$x = 0;
while ($row = mysql_fetch_array($result)) {
// Users SQL
$users_sql = "SELECT user_id, username
FROM " . USERS_TABLE . "
WHERE user_id = '" . $row['thanks_by'] . "'";
if ( !($users_result = $db->sql_query($users_sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $users_sql);
}
$user_row = $db->sql_fetchrow($users_result);
$db->sql_freeresult($users_result);
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>';
$x++;
}
if ($thanked_by) {
$template->assign_block_vars('postrow.thanks', array(
'L_THANKS_TEXT' => $lang['Thanks_thanked_by'],
'THANKS_USERS' => $thanked_by)
);
}
}
//
// End Thank Post by User Mod
//
#
#-----[ OPEN ]---------------------------------
#
admin/admin_forums.php
#
#-----[ FIND ]---------------------------------
#
case 'forum_sync':
sync('forum', intval($HTTP_GET_VARS[POST_FORUM_URL]));
$show_index = TRUE;
break;
#
#-----[ AFTER, ADD ]---------------------------------
#
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 thanks to enabled", "", __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 thanks to disabled", "", __LINE__, __FILE__, $sql);
}
$show_index = TRUE;
break;
#
#-----[ FIND ]---------------------------------
#
$template->assign_block_vars("catrow.forumrow",
#
#-----[ BEFORE, ADD ]---------------------------------
#
$thanks_enabled = 'Yes';
$thanks_disabled = '<b>No</b>';
if ($forum_rows[$j]['thanks_enabled'] == 1) {
$thanks_enabled = '<b>Yes</b>';
$thanks_disabled = 'No';
}
#
#-----[ FIND ]---------------------------------
#
'U_FORUM_MOVE_DOWN' => append_sid("admin_forums.$phpEx?mode=forum_order&move=15&" . POST_FORUM_URL . "=$forum_id"),
#
#-----[ AFTER, ADD ]---------------------------------
#
'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"),
#
#-----[ OPEN ]---------------------------------
#
admin/admin_users.php
#
#-----[ FIND ]---------------------------------
#
$message = $lang['User_deleted'] . '<br /><br />' . sprintf($lang['Click_return_useradmin'], '<a href="' . append_sid("admin_users.$phpEx") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid("index.$phpEx?pane=right") . '">', '</a>');
#
#-----[ BEFORE, ADD ]---------------------------------
#
// Delete users thanks from phpbb_thanksmod table
$sql = "DELETE FROM phpbb_thanksmod
WHERE thanked_user = '" . $user_id . "'
OR thanks_by = '" . $user_id . "'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not delete thanks for this user', '', __LINE__, __FILE__, $sql);
}
#
#-----[ OPEN ]---------------------------------
#
includes/functions_post.php
#
#-----[ FIND ]---------------------------------
#
function delete_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id)
{
global $board_config, $lang, $db, $phpbb_root_path, $phpEx;
global $userdata, $user_ip;
#
#-----[ AFTER, ADD ]---------------------------------
#
//
// Start Thank Post by User Mod
//
// Delete all thanks which match the post id
$sql = "DELETE FROM
phpbb_thanksmod
WHERE post_id = '$post_id'";
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not remove thanks from thanks table", '', __LINE__, __FILE__, $sql);
}
//
// End Thank Post by User Mod
//
#
#-----[ OPEN ]---------------------------------
#
includes/usercp_viewprofile.php
#
#-----[ FIND ]---------------------------------
#
$avatar_img = '';
#
#-----[ BEFORE, ADD ]---------------------------------
#
//
// Start Thank Post by User Mod
//
// Thanks by
$sql = "SELECT COUNT(thanks_by) AS thanks_by
FROM phpbb_thanksmod
WHERE thanks_by = '" . $profiledata['user_id'] . "'";
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain thanks information", '', __LINE__, __FILE__, $sql);
}
$thanks_by_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// Thanked user
$sql = "SELECT post_id, thanked_user
FROM phpbb_thanksmod
WHERE thanked_user = '" . $profiledata['user_id'] . "'
ORDER BY post_id";
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain thanks information", '', __LINE__, __FILE__, $sql);
}
// Calculate the user's thanks given and thanks received
$thanked_count = 0;
$thanked_posts = 0;
$old_post_id = 0;
while ($row = mysql_fetch_array($result)) {
if ($row['post_id'] != $old_post_id) {
$thanked_posts++;
}
$old_post_id = $row['post_id'];
$thanked_count++;
}
$thanks_given = $thanks_by_row['thanks_by'];
$thanks_received = $thanked_count . ' ' . $lang['Thanks_thanked_2'] . ' ' . $thanked_posts . ' ' . $lang['Thanks_thanked_3'];
//
// End Thank Post by User Mod
//
#
#-----[ FIND ]---------------------------------
#
'L_INTERESTS' => $lang['Interests'],
#
#-----[ AFTER, ADD ]---------------------------------
#
'L_THANKS' => $lang['Thanks_thanks'],
'L_THANKED' => $lang['Thanks_thanked_1'],
'THANKS' => $thanks_given,
'THANKED' => $thanks_received,
#
#-----[ OPEN ]---------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]---------------------------------
#
?>
#
#-----[ BEFORE, ADD ]---------------------------------
#
//
// Start Thank Post by User Mod
//
$lang['Thanks_title'] = 'Thank User for Post';
$lang['Thanks_text'] = 'Thank this user for their post';
$lang['Thanks_thanked_by'] = 'Thanked by';
$lang['Thanks_thanks'] = 'Thanks';
$lang['Thanks_thanked_1'] = 'Thanked';
$lang['Thanks_thanked_2'] = 'Times in';
$lang['Thanks_thanked_3'] = 'Posts';
$lang['Thanks_not_logged_in'] = 'You aren't logged in.';
$lang['Thanks_no_post_specified'] = 'No post was specified.';
$lang['Thanks_no_such_post'] = 'Post doesn't exist.';
$lang['Thanks_anonymous'] = 'You can't thank an anonymous post.';
$lang['Thanks_self'] = 'You can't thank your own post.';
$lang['Thanks_already_thanked'] = 'You have already thanked this post.';
$lang['Thanks_success_1'] = 'Post by';
$lang['Thanks_success_2'] = 'in thread';
$lang['Thanks_success_3'] = 'has successfully been thanked.';
$lang['Thanks_success_back'] = 'Click here if you can't wait or if redirection is not supported by your browser';
$lang['Thanks_success_redirect'] = 'Redirecting to the topic/post you came from in 5 seconds.';
//
// End Thank Post by User Mod
//
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_view_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_TOTAL_POSTS}: </span></td>
<td valign="top"><b><span class="gen">{POSTS}</span></b><br /><span class="genmed">[{POST_PERCENT_STATS} / {POST_DAY_STATS}]</span> <br /><span class="genmed"><a href="{U_SEARCH_USER}" class="genmed">{L_SEARCH_USER_POSTS}</a></span></td>
</tr>
#
#-----[ AFTER, ADD ]---------------------------------
#
<tr>
<td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_THANKS}: </span></td>
<td valign="top"><b><span class="gen">{THANKS}</span></b></td>
</tr>
<tr>
<td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_THANKED}: </span></td>
<td valign="top"><b><span class="gen">{THANKED}</span></b></td>
</tr>
#
#-----[ OPEN ]---------------------------------
#
templates/subSilver/subSilver.cfg
#
#-----[ FIND ]---------------------------------
#
$images['icon_edit'] = "$current_template_images/{LANG}/icon_edit.gif";
#
#-----[ AFTER, ADD ]---------------------------------
#
$images['icon_thank'] = "$current_template_images/{LANG}/icon_thank.gif";
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<table width="100%" cellspacing="2" cellpadding="2" border="0">
#
#-----[ BEFORE, ADD ]---------------------------------
#
{THANKS_JAVASCRIPT}
#
#-----[ FIND ]------------------------------------------
#
{postrow.ROW_CLASS}
#
#-----[ IN-LINE FIND ]------------------------------------------
#
{postrow.POSTER_POSTS}<br />
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
<br />{postrow.POSTER_THANKS_GIVEN}<br />{postrow.POSTER_THANKS_RECEIVED}<br /><br />
#
#-----[ FIND ]------------------------------------------
#
{postrow.QUOTE_IMG}
#
#-----[ IN-LINE FIND ]------------------------------------------
#
{postrow.QUOTE_IMG}
#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
{postrow.QUOTE_IMG} {postrow.THANKS_IMG}
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="spaceRow" colspan="2" height="1"><img src="templates/subSilver/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<!-- BEGIN thanks -->
<tr>
<td colspan="2" class="{postrow.ROW_CLASS}" width="100%" valign="bottom"><table cellspacing="0" cellpadding="0" border="0" height="18">
<tr>
<td valign="middle"><span class="gen">{postrow.thanks.L_THANKS_TEXT}: {postrow.thanks.THANKS_USERS}</span></td>
</tr>
</table></td>
</tr>
<!-- END thanks -->
#
#-----[ OPEN ]---------------------------------
#
templates/subSilver/admin/forum_admin_body.tpl
#
#-----[ FIND ]---------------------------------
#
<th class="thHead" colspan="{%:1}">{L_FORUM_TITLE}</th>
#
#-----[ INCREMENT ]-------------------------------------
#
%:1
#
#-----[ FIND ]---------------------------------
#
<td class="catRight" align="center" valign="middle"><span class="gen"> </span></td>
#
#-----[ REPLACE WITH ]---------------------------------
#
<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>
#
#-----[ FIND ]---------------------------------
#
<td class="row2" align="center" valign="middle"><span class="gen"><a href="{catrow.forumrow.U_FORUM_RESYNC}">{L_RESYNC}</a></span></td>
#
#-----[ AFTER, ADD ]---------------------------------
#
<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>
#
#-----[ FIND ]---------------------------------
#
<td colspan="{%:1}" 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>
#
#-----[ INCREMENT ]-------------------------------------
#
%:1
#
#-----[ FIND ]---------------------------------
#
<td colspan="{%:1}" height="1" class="spaceRow"><img src="../templates/subSilver/images/spacer.gif" alt="" width="1" height="1" /></td>
#
#-----[ INCREMENT ]-------------------------------------
#
%:1
#
#-----[ FIND ]---------------------------------
#
<td colspan="{%:1}" class="catBottom"><input class="post" type="text" name="categoryname" /> <input type="submit" class="liteoption" name="addcategory" value="{L_CREATE_CATEGORY}" /></td>
#
#-----[ INCREMENT ]-------------------------------------
#
%:1
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
## MOD Title: Thank Post by User
## MOD Author: alexi02 < N/A > (Alejandro Iannuzzi) http://www.uzzisoft.com
## MOD Description: Allows registered users to thank a post which was posted by another user
## MOD Version: 0.3.2
##
## Installation Level: Easy
## Installation Time: 10 Minutes
## Files To Edit: modcp.php
## viewtopic.php
## admin/admin_forums.php
## admin/admin_users.php
## includes/functions_post.php
## includes/usercp_viewprofile.php
## language/lang_english/lang_main.php
## templates/subSilver/profile_view_body.tpl
## templates/subSilver/subSilver.cfg
## templates/subSilver/viewtopic_body.tpl
## templates/subSilver/admin/forum_admin_body.tpl
## Included Files: thanks.php
## templates/subSilver/thanks.tpl
## templates/subSilver/thanks_popup.tpl
## templates/subSilver/images/lang_english/icon_thank.gif
##
## License: http://opensource.org/licenses/GPL-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## A mod which allows you to thank a post that a user has posted.
## When the Thanks button is pressed a page is displayed showing the user that they have successfully thanked the other user for their post.
##
## You can choose whether that page should be a popup or not by editing the $popup_enabled to 0 or 1 in viewtopic.php and thanks.php
## If set to 0, the user is shown the thanks page on the current window and will be automatically redirected to the post they thanked.
##
## You can view the thanks given and thanks received by a user in the topic under their username.
## You are shown the users who have thanked the specific post.
## When a post has been deleted, the thanked received for the poster is decreased as well as the thanks given by other users.
##
## You can enable or disable this mod for each forum via the ACP -> Forum Admin -> Management.
## This mod is set to 'disabled' as default, therefore you will have to enable it on which ever forums you want.
##
##############################################################
## MOD History:
##
## 2008-06-10 - Version 0.3.2
## - Thanks is now removed for each post when deleting threads
##
## 2008-06-01 - Version 0.3.1 (RC1)
## - Fixed a slight bug which was added in v0.3 that allowed users to thank anonymous posts
## - Added in thanks in user profile
## - Improved sql query in thanks.php
##
## 2008-04-03 - Version 0.3
## - New thanks table created
## - Thanked x times in y posts now only shows y posts as the posts which users have thanked and not the total posts the user has
## - Ability to enable / disable this mod on each forum via the ACP
##
## 2007-10-26 - Version 0.2.6
## - Updates thanks_given and thanked_received when posts are deleted
##
## 2006-10-29 - Version 0.2.5a
## - Thanks icon updated
##
## 2006-10-23 - Version 0.2.5
## - Bug Fix: Thanks button was sometimes displayed even though the user had thanked the post
##
## 2006-10-22 - Version 0.2.4
## - Removes the thanks button from posts that the user has already thanked
##
## 2006-10-21 - Version 0.2.3
## - Updated the way "Thanked 2 Times in 1 Posts" is displayed. Posts are now referred to the total number of posts that were thanked by other users instead of the user's total posts.
##
## 2006-10-19 - Version 0.2.2
## - Bug Fix: Adjusted Thanked by row in viewtopic to wrap the users who thanked the post
##
## 2006-10-19 - Version 0.2.1
## - Bug Fix: Moved Thanks icon back next to quote icon since the ICQ icon gets displayed over the thanks icon if the user has an ICQ number set (couldn't find a reasonable solution)
##
## 2006-09-27 - Version 0.2.0
## - Moved Thanks icon to right hand side of where Profile, PM, links are displayed
## - Made the username of people who thanked a user link to their profile
## - Be able to select whether the thanks should popup or be displayed on the same page
##
## 2006-09-12 - Version 0.1.1
## - Bug Fix: Thanks received wasn't updating correctly
##
## 2006-09-11 - Version 0.1.0
## - Initial Release (for phpBB 2.0.21)
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]------------------------------------------
# Use your SQL tool to create the following table
# Change phpbb_forums to your forums table
#
CREATE TABLE `phpbb_thanksmod` (
`post_id` mediumint(8) unsigned NOT NULL default '0',
`thanked_user` mediumint(8) NOT NULL default '0',
`thanks_by` mediumint(8) NOT NULL default '0',
`thanked_time` int(10) NOT NULL default '0'
);
ALTER TABLE `phpbb_forums` ADD `thanks_enabled` SMALLINT( 1 ) NOT NULL ;
#
#-----[ COPY ]------------------------------------------
#
copy root/thanks.php to thanks.php
copy root/templates/subSilver/thanks.tpl to templates/subSilver/thanks.tpl
copy root/templates/subSilver/thanks_popup.tpl to templates/subSilver/thanks_popup.tpl
copy root/templates/subSilver/images/lang_english/icon_thank.gif to templates/subSilver/images/lang_english/icon_thank.gif
#
#-----[ OPEN ]------------------------------------------
#
modcp.php
#
#-----[ FIND ]------------------------------------------
#
$post_id_sql .= ( ( $post_id_sql != '' ) ? ', ' : '' ) . intval($row['post_id']);
#
#-----[ AFTER ADD ]------------------------------------------
#
//
// Start Thank Post by User Mod
//
// Delete all thanks which match the post id
$sqldel = "DELETE FROM
phpbb_thanksmod
WHERE post_id = '" . intval($row['post_id']) . "'";
if ( !($resultdel = $db->sql_query($sqldel)) ) {
message_die(GENERAL_ERROR, "Could not remove thanks from thanks table", '', __LINE__, __FILE__, $sql);
}
//
// End Thank Post by User Mod
//
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
$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 . "
#
#-----[ IN-LINE FIND ]------------------------------------------
#
f.auth_attachments
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, f.thanks_enabled
#
#-----[ FIND ]------------------------------------------
#
$forum_id = intval($forum_topic_data['forum_id']);
#
#-----[ AFTER, ADD ]------------------------------------------
#
$thanks_forum_enabled = intval($forum_topic_data['thanks_enabled']);
#
#-----[ FIND ]------------------------------------------
#
$pagination = ( $highlight != '' ) ? generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order&highlight=$highlight", $total_replies, $board_config['posts_per_page'], $start) : generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order", $total_replies, $board_config['posts_per_page'], $start);
#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// Start Thank Post by User Mod
//
// Set to 1 if you wish to use pop-ups instead of using the same window
$popup_enabled = 0;
if ($popup_enabled == 1) {
$thanks_javascript ='<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=400,height=225');");
}
// End -->
</script>';
}
//
// End Thank Post by User Mod
//
#
#-----[ FIND ]------------------------------------------
#
'FORUM_ID' => $forum_id,
#
#-----[ BEFORE, ADD ]------------------------------------------
#
'THANKS_JAVASCRIPT' => $thanks_javascript,
#
#-----[ FIND ]------------------------------------------
#
$search = '<a href="' . $temp_url . '">' . sprintf($lang['Search_user_posts'], $postrow[$i]['username']) . '</a>';
#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// Start Thank Post by User Mod
//
$thanks_img = '';
// If the user is logged in, the user is not the poster, the poster is not anonymous and thanks is enabled on this fourm
if ( ($userdata['session_logged_in']) && ($userdata['user_id'] != $poster_id) && ($poster_id != ANONYMOUS) && ($thanks_forum_enabled == 1) ) {
// Posts SQL
$sql = "SELECT thanks_by
FROM phpbb_thanksmod
WHERE post_id = '" . $postrow[$i]['post_id'] . "'
AND thanks_by = '" . $userdata['user_id'] . "'";
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain thanks information", '', __LINE__, __FILE__, $sql);
}
$post_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// If the user hasn't thanked this post
if (!$post_row) {
$temp_url = append_sid("thanks.$phpEx?p=" . $postrow[$i]['post_id']);
if ($popup_enabled == 1) {
$thanks_img = '<a href="javascript:popUp('' . $temp_url . '')"><img src="' . $images['icon_thank'] . '" alt="' . $lang['Thanks_text'] . '" title="' . $lang['Thanks_text'] . '" border="0" /></a>';
}
else {
$thanks_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_thank'] . '" alt="' . $lang['Thanks_text'] . '" title="' . $lang['Thanks_text'] . '" border="0" /></a>';
}
}
}
//
// End Thank Post by User Mod
//
#
#-----[ FIND ]------------------------------------------
#
$template->assign_block_vars('postrow', array(
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//
// Start Thank Post by User Mod
//
// If the user isn't anonymous then show the user's thanks given and thanks received
if ($postrow[$i]['user_id'] != ANONYMOUS) {
// Thanks by
$sql = "SELECT COUNT(thanks_by) AS thanks_by
FROM phpbb_thanksmod
WHERE thanks_by = " . $postrow[$i]['user_id'];
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain thanks information", '', __LINE__, __FILE__, $sql);
}
$thanks_by_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// Thanked user
$sql = "SELECT post_id, thanked_user
FROM phpbb_thanksmod
WHERE thanked_user = '" . $postrow[$i]['user_id'] . "'
ORDER BY post_id";
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain thanks information", '', __LINE__, __FILE__, $sql);
}
// Calculate the user's thanks given and thanks received
$thanked_count = 0;
$thanked_posts = 0;
$old_post_id = 0;
while ($row = mysql_fetch_array($result)) {
if ($row['post_id'] != $old_post_id) {
$thanked_posts++;
}
$old_post_id = $row['post_id'];
$thanked_count++;
}
$thanks_given = $lang['Thanks_thanks'] . ': ' . $thanks_by_row['thanks_by'];
$thanks_received = $lang['Thanks_thanked_1'] . ' ' . $thanked_count . ' ' . $lang['Thanks_thanked_2'] . ' ' . $thanked_posts . ' ' . $lang['Thanks_thanked_3'];
}
else {
$thanks_given = '';
$thanks_received = '';
}
//
// End Thank Post by User Mod
//
#
#-----[ FIND ]------------------------------------------
#
'POSTER_FROM' => $poster_from,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'POSTER_THANKS_GIVEN' => $thanks_given,
'POSTER_THANKS_RECEIVED' => $thanks_received,
#
#-----[ FIND ]------------------------------------------
#
'EDIT' => $edit,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'THANKS_IMG' => $thanks_img,
#
#-----[ FIND ]------------------------------------------
#
}
$template->pparse('body');
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//
// Start Thank Post by User Mod
//
// If the user isn't anonymous and thanks on this fourm is enabled
if ($postrow[$i]['user_id'] != ANONYMOUS && $thanks_forum_enabled == 1) {
$thanked_by = '';
// Thanked post
$sql = "SELECT thanks_by
FROM phpbb_thanksmod
WHERE post_id = '" . $postrow[$i]['post_id'] . "'
ORDER BY thanked_time ASC";
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql);
}
$x = 0;
while ($row = mysql_fetch_array($result)) {
// Users SQL
$users_sql = "SELECT user_id, username
FROM " . USERS_TABLE . "
WHERE user_id = '" . $row['thanks_by'] . "'";
if ( !($users_result = $db->sql_query($users_sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $users_sql);
}
$user_row = $db->sql_fetchrow($users_result);
$db->sql_freeresult($users_result);
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>';
$x++;
}
if ($thanked_by) {
$template->assign_block_vars('postrow.thanks', array(
'L_THANKS_TEXT' => $lang['Thanks_thanked_by'],
'THANKS_USERS' => $thanked_by)
);
}
}
//
// End Thank Post by User Mod
//
#
#-----[ OPEN ]---------------------------------
#
admin/admin_forums.php
#
#-----[ FIND ]---------------------------------
#
case 'forum_sync':
sync('forum', intval($HTTP_GET_VARS[POST_FORUM_URL]));
$show_index = TRUE;
break;
#
#-----[ AFTER, ADD ]---------------------------------
#
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 thanks to enabled", "", __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 thanks to disabled", "", __LINE__, __FILE__, $sql);
}
$show_index = TRUE;
break;
#
#-----[ FIND ]---------------------------------
#
$template->assign_block_vars("catrow.forumrow",
#
#-----[ BEFORE, ADD ]---------------------------------
#
$thanks_enabled = 'Yes';
$thanks_disabled = '<b>No</b>';
if ($forum_rows[$j]['thanks_enabled'] == 1) {
$thanks_enabled = '<b>Yes</b>';
$thanks_disabled = 'No';
}
#
#-----[ FIND ]---------------------------------
#
'U_FORUM_MOVE_DOWN' => append_sid("admin_forums.$phpEx?mode=forum_order&move=15&" . POST_FORUM_URL . "=$forum_id"),
#
#-----[ AFTER, ADD ]---------------------------------
#
'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"),
#
#-----[ OPEN ]---------------------------------
#
admin/admin_users.php
#
#-----[ FIND ]---------------------------------
#
$message = $lang['User_deleted'] . '<br /><br />' . sprintf($lang['Click_return_useradmin'], '<a href="' . append_sid("admin_users.$phpEx") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid("index.$phpEx?pane=right") . '">', '</a>');
#
#-----[ BEFORE, ADD ]---------------------------------
#
// Delete users thanks from phpbb_thanksmod table
$sql = "DELETE FROM phpbb_thanksmod
WHERE thanked_user = '" . $user_id . "'
OR thanks_by = '" . $user_id . "'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not delete thanks for this user', '', __LINE__, __FILE__, $sql);
}
#
#-----[ OPEN ]---------------------------------
#
includes/functions_post.php
#
#-----[ FIND ]---------------------------------
#
function delete_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id)
{
global $board_config, $lang, $db, $phpbb_root_path, $phpEx;
global $userdata, $user_ip;
#
#-----[ AFTER, ADD ]---------------------------------
#
//
// Start Thank Post by User Mod
//
// Delete all thanks which match the post id
$sql = "DELETE FROM
phpbb_thanksmod
WHERE post_id = '$post_id'";
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not remove thanks from thanks table", '', __LINE__, __FILE__, $sql);
}
//
// End Thank Post by User Mod
//
#
#-----[ OPEN ]---------------------------------
#
includes/usercp_viewprofile.php
#
#-----[ FIND ]---------------------------------
#
$avatar_img = '';
#
#-----[ BEFORE, ADD ]---------------------------------
#
//
// Start Thank Post by User Mod
//
// Thanks by
$sql = "SELECT COUNT(thanks_by) AS thanks_by
FROM phpbb_thanksmod
WHERE thanks_by = '" . $profiledata['user_id'] . "'";
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain thanks information", '', __LINE__, __FILE__, $sql);
}
$thanks_by_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// Thanked user
$sql = "SELECT post_id, thanked_user
FROM phpbb_thanksmod
WHERE thanked_user = '" . $profiledata['user_id'] . "'
ORDER BY post_id";
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain thanks information", '', __LINE__, __FILE__, $sql);
}
// Calculate the user's thanks given and thanks received
$thanked_count = 0;
$thanked_posts = 0;
$old_post_id = 0;
while ($row = mysql_fetch_array($result)) {
if ($row['post_id'] != $old_post_id) {
$thanked_posts++;
}
$old_post_id = $row['post_id'];
$thanked_count++;
}
$thanks_given = $thanks_by_row['thanks_by'];
$thanks_received = $thanked_count . ' ' . $lang['Thanks_thanked_2'] . ' ' . $thanked_posts . ' ' . $lang['Thanks_thanked_3'];
//
// End Thank Post by User Mod
//
#
#-----[ FIND ]---------------------------------
#
'L_INTERESTS' => $lang['Interests'],
#
#-----[ AFTER, ADD ]---------------------------------
#
'L_THANKS' => $lang['Thanks_thanks'],
'L_THANKED' => $lang['Thanks_thanked_1'],
'THANKS' => $thanks_given,
'THANKED' => $thanks_received,
#
#-----[ OPEN ]---------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]---------------------------------
#
?>
#
#-----[ BEFORE, ADD ]---------------------------------
#
//
// Start Thank Post by User Mod
//
$lang['Thanks_title'] = 'Thank User for Post';
$lang['Thanks_text'] = 'Thank this user for their post';
$lang['Thanks_thanked_by'] = 'Thanked by';
$lang['Thanks_thanks'] = 'Thanks';
$lang['Thanks_thanked_1'] = 'Thanked';
$lang['Thanks_thanked_2'] = 'Times in';
$lang['Thanks_thanked_3'] = 'Posts';
$lang['Thanks_not_logged_in'] = 'You aren't logged in.';
$lang['Thanks_no_post_specified'] = 'No post was specified.';
$lang['Thanks_no_such_post'] = 'Post doesn't exist.';
$lang['Thanks_anonymous'] = 'You can't thank an anonymous post.';
$lang['Thanks_self'] = 'You can't thank your own post.';
$lang['Thanks_already_thanked'] = 'You have already thanked this post.';
$lang['Thanks_success_1'] = 'Post by';
$lang['Thanks_success_2'] = 'in thread';
$lang['Thanks_success_3'] = 'has successfully been thanked.';
$lang['Thanks_success_back'] = 'Click here if you can't wait or if redirection is not supported by your browser';
$lang['Thanks_success_redirect'] = 'Redirecting to the topic/post you came from in 5 seconds.';
//
// End Thank Post by User Mod
//
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_view_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_TOTAL_POSTS}: </span></td>
<td valign="top"><b><span class="gen">{POSTS}</span></b><br /><span class="genmed">[{POST_PERCENT_STATS} / {POST_DAY_STATS}]</span> <br /><span class="genmed"><a href="{U_SEARCH_USER}" class="genmed">{L_SEARCH_USER_POSTS}</a></span></td>
</tr>
#
#-----[ AFTER, ADD ]---------------------------------
#
<tr>
<td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_THANKS}: </span></td>
<td valign="top"><b><span class="gen">{THANKS}</span></b></td>
</tr>
<tr>
<td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_THANKED}: </span></td>
<td valign="top"><b><span class="gen">{THANKED}</span></b></td>
</tr>
#
#-----[ OPEN ]---------------------------------
#
templates/subSilver/subSilver.cfg
#
#-----[ FIND ]---------------------------------
#
$images['icon_edit'] = "$current_template_images/{LANG}/icon_edit.gif";
#
#-----[ AFTER, ADD ]---------------------------------
#
$images['icon_thank'] = "$current_template_images/{LANG}/icon_thank.gif";
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<table width="100%" cellspacing="2" cellpadding="2" border="0">
#
#-----[ BEFORE, ADD ]---------------------------------
#
{THANKS_JAVASCRIPT}
#
#-----[ FIND ]------------------------------------------
#
{postrow.ROW_CLASS}
#
#-----[ IN-LINE FIND ]------------------------------------------
#
{postrow.POSTER_POSTS}<br />
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
<br />{postrow.POSTER_THANKS_GIVEN}<br />{postrow.POSTER_THANKS_RECEIVED}<br /><br />
#
#-----[ FIND ]------------------------------------------
#
{postrow.QUOTE_IMG}
#
#-----[ IN-LINE FIND ]------------------------------------------
#
{postrow.QUOTE_IMG}
#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
{postrow.QUOTE_IMG} {postrow.THANKS_IMG}
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="spaceRow" colspan="2" height="1"><img src="templates/subSilver/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<!-- BEGIN thanks -->
<tr>
<td colspan="2" class="{postrow.ROW_CLASS}" width="100%" valign="bottom"><table cellspacing="0" cellpadding="0" border="0" height="18">
<tr>
<td valign="middle"><span class="gen">{postrow.thanks.L_THANKS_TEXT}: {postrow.thanks.THANKS_USERS}</span></td>
</tr>
</table></td>
</tr>
<!-- END thanks -->
#
#-----[ OPEN ]---------------------------------
#
templates/subSilver/admin/forum_admin_body.tpl
#
#-----[ FIND ]---------------------------------
#
<th class="thHead" colspan="{%:1}">{L_FORUM_TITLE}</th>
#
#-----[ INCREMENT ]-------------------------------------
#
%:1
#
#-----[ FIND ]---------------------------------
#
<td class="catRight" align="center" valign="middle"><span class="gen"> </span></td>
#
#-----[ REPLACE WITH ]---------------------------------
#
<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>
#
#-----[ FIND ]---------------------------------
#
<td class="row2" align="center" valign="middle"><span class="gen"><a href="{catrow.forumrow.U_FORUM_RESYNC}">{L_RESYNC}</a></span></td>
#
#-----[ AFTER, ADD ]---------------------------------
#
<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>
#
#-----[ FIND ]---------------------------------
#
<td colspan="{%:1}" 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>
#
#-----[ INCREMENT ]-------------------------------------
#
%:1
#
#-----[ FIND ]---------------------------------
#
<td colspan="{%:1}" height="1" class="spaceRow"><img src="../templates/subSilver/images/spacer.gif" alt="" width="1" height="1" /></td>
#
#-----[ INCREMENT ]-------------------------------------
#
%:1
#
#-----[ FIND ]---------------------------------
#
<td colspan="{%:1}" class="catBottom"><input class="post" type="text" name="categoryname" /> <input type="submit" class="liteoption" name="addcategory" value="{L_CREATE_CATEGORY}" /></td>
#
#-----[ INCREMENT ]-------------------------------------
#
%:1
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Subject: Re: Question, Regarding Thanks Option
Well I can't get to show me "thanks" image in post. So problem might be in viewtopic_body.tpl
Subject: Re: Question, Regarding Thanks Option
My template is milky way.
I done it. Not fully, but "thanks" image is shown, and users can thank.
There are few more features which aren't working, but I'll fix them tomorrow.
And if someone is interested in this mod I'll modify the installation file and post it.
So, just say if someone needs this mod
Scott wrote: [View Post]What template are you using?
My template is milky way.
I done it. Not fully, but "thanks" image is shown, and users can thank.
There are few more features which aren't working, but I'll fix them tomorrow.
And if someone is interested in this mod I'll modify the installation file and post it.
So, just say if someone needs this mod
Subject: Re: Question, Regarding Thanks Option
It doesn't seem to work properly on this site either. I have a version that shows the users number of thanks he received in the viewtopic profile area.
Subject: Re: Question, Regarding Thanks Option
Mod I'm trying to install also shows number of thanks in posts, and how many times thank have been given. And shows user who thanked under post.
But I'm having some problem with that showing users in viewtopic
This line of code should display users who thanked. Right?
It's not working for me. Only ":" apears, {postrow.thanks.L_THANKS_TEXT} and {postrow.thanks.THANKS_USERS} are empty.
Does anyone knows why??
Scott wrote: [View Post]It doesn't seem to work properly on this site either. I have a version that shows the users number of thanks he received in the viewtopic profile area.
Mod I'm trying to install also shows number of thanks in posts, and how many times thank have been given. And shows user who thanked under post.
But I'm having some problem with that showing users in viewtopic
This line of code should display users who thanked. Right?
<!-- BEGIN thanks -->
<tr>
<td colspan="2" class="{postrow.ROW_CLASS}" width="100%" valign="bottom"><table cellspacing="0" cellpadding="0" border="0" height="18">
<tr>
<td valign="middle"><span class="gen">{postrow.thanks.L_THANKS_TEXT}: {postrow.thanks.THANKS_USERS}</span></td>
</tr>
</table></td>
</tr>
<!-- END thanks -->
<tr>
<td colspan="2" class="{postrow.ROW_CLASS}" width="100%" valign="bottom"><table cellspacing="0" cellpadding="0" border="0" height="18">
<tr>
<td valign="middle"><span class="gen">{postrow.thanks.L_THANKS_TEXT}: {postrow.thanks.THANKS_USERS}</span></td>
</tr>
</table></td>
</tr>
<!-- END thanks -->
It's not working for me. Only ":" apears, {postrow.thanks.L_THANKS_TEXT} and {postrow.thanks.THANKS_USERS} are empty.
Does anyone knows why??
Subject: Re: Question, Regarding Thanks Option
Almost everything is working like it should. Except one thing in admin_forums.php
In instalation says:
So this piece should go somewhere in here
I understood this piece of code like, checking is or is not thank enabled in this forum.
Also I believe that this code should be modified, that "$forum_rows[$j]" doesn't look right to me.
Any idea how to solve this, I would really appreciate
In instalation says:
$template->assign_block_vars('catrow.forumrow',
#
#-----[ BEFORE, ADD ]---------------------------------
#
$thanks_enabled = 'Yes';
$thanks_disabled = '<b>No</b>';
if ($forum_rows[$j]['thanks_enabled'] == 1) {
$thanks_enabled = '<b>Yes</b>';
$thanks_disabled = 'No';
}
#
#-----[ BEFORE, ADD ]---------------------------------
#
$thanks_enabled = 'Yes';
$thanks_disabled = '<b>No</b>';
if ($forum_rows[$j]['thanks_enabled'] == 1) {
$thanks_enabled = '<b>Yes</b>';
$thanks_disabled = 'No';
}
So this piece should go somewhere in here
Spoiler: [ Show ]
Spoiler: [ Hide ]
// add indentation to the display
for ($k=1; $k <= $level; $k++)
{
$template->assign_block_vars('catrow.cathead.inc', array());
}
}
// forum header row
if ($tree['type'][$CH_this] == POST_FORUM_URL)
{
$forum = $tree['data'][$CH_this];
$forum_id = $tree['id'][$CH_this];
$forum_link_img = '';
if (!empty($tree['data'][$CH_this]['forum_link']))
{
$forum_link_img = '<img src="' . $phpbb_root_path . $images['acp_link'] . '" />';
}
else
{
$sub = (isset($tree['sub'][POST_FORUM_URL . $forum_id]));
$forum_link_img = '<img src="' . $phpbb_root_path . (($sub) ? $images['acp_category'] : $images['acp_forum']) . '" />';
if ($tree['data'][$CH_this]['forum_status'] == FORUM_LOCKED)
{
$forum_link_img = '<img src="' . $phpbb_root_path . (($sub) ? $images['acp_category_locked'] : $images['acp_forum_locked']) . '" />';
}
}
$forum_name = $forum['forum_name'];
$forum_name_trad = get_object_lang(POST_FORUM_URL . $forum_id, 'name');
if ($forum_name != $forum_name_trad) $forum_name = '(' . $forum_name . ') ' . $forum_name_trad;
$forum_desc = $forum['forum_desc'];
$forum_desc_trad = get_object_lang(POST_FORUM_URL . $forum_id, 'desc');
if ($forum_desc != $forum_desc_trad) $forum_desc = '(' . $forum_desc . ') ' . $forum_desc_trad;
$template->assign_block_vars('catrow', array());
$template->assign_block_vars('catrow.forumrow', array(
for ($k=1; $k <= $level; $k++)
{
$template->assign_block_vars('catrow.cathead.inc', array());
}
}
// forum header row
if ($tree['type'][$CH_this] == POST_FORUM_URL)
{
$forum = $tree['data'][$CH_this];
$forum_id = $tree['id'][$CH_this];
$forum_link_img = '';
if (!empty($tree['data'][$CH_this]['forum_link']))
{
$forum_link_img = '<img src="' . $phpbb_root_path . $images['acp_link'] . '" />';
}
else
{
$sub = (isset($tree['sub'][POST_FORUM_URL . $forum_id]));
$forum_link_img = '<img src="' . $phpbb_root_path . (($sub) ? $images['acp_category'] : $images['acp_forum']) . '" />';
if ($tree['data'][$CH_this]['forum_status'] == FORUM_LOCKED)
{
$forum_link_img = '<img src="' . $phpbb_root_path . (($sub) ? $images['acp_category_locked'] : $images['acp_forum_locked']) . '" />';
}
}
$forum_name = $forum['forum_name'];
$forum_name_trad = get_object_lang(POST_FORUM_URL . $forum_id, 'name');
if ($forum_name != $forum_name_trad) $forum_name = '(' . $forum_name . ') ' . $forum_name_trad;
$forum_desc = $forum['forum_desc'];
$forum_desc_trad = get_object_lang(POST_FORUM_URL . $forum_id, 'desc');
if ($forum_desc != $forum_desc_trad) $forum_desc = '(' . $forum_desc . ') ' . $forum_desc_trad;
$template->assign_block_vars('catrow', array());
$template->assign_block_vars('catrow.forumrow', array(
I understood this piece of code like, checking is or is not thank enabled in this forum.
Also I believe that this code should be modified, that "$forum_rows[$j]" doesn't look right to me.
Any idea how to solve this, I would really appreciate
Page 1 of 1
You cannot post new topicsYou cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events
This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by Icy Phoenix based on phpBB
Generation Time: 0.1522s (PHP: 15% SQL: 85%)
SQL queries: 14 - Debug Off - GZIP Enabled