alıntı: phpbbmod.com
test için

mod butonununda yaptım :
indirdikten sonra ismini
icon_thank olarak değiştirin.
[ resmi görüntülemek için tıklayın ]
[ resmi görüntülemek için tıklayın ]
beta tartışma alanı
http://www.phpbb.com/phpBB/viewtopic.php?t=441758
modun indirme adresi:
http://www.uzzisoft.com/projects/thank_ ... v0.1.1.zip
türkçeleştirme cupra tarafından yapılmıştır
Kod: Tümünü seç
##############################################################
## 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.1.1
##
## Installation Level: Easy
## Installation Time: 10 Minutes
## Files To Edit: viewtopic.php
## language/lang_english/lang_main.php
## templates/subSilver/subSilver.cfg
## templates/subSilver/viewtopic_body.tpl
## Included Files: thanks.php
## 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 popup is displayed saying they have successfully thanked the user for their post.
## You can view the thanks given and thanks received by a user in the topic under their posts.
## You are also shown the users who have thanked the specific post.
##
##############################################################
## MOD History:
##
## 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 ]------------------------------------------
# Change phpbb_posts and phpbb_users to your tables
#
ALTER TABLE `phpbb_posts` ADD `thanks_count` MEDIUMINT( 8 ) NOT NULL DEFAULT '0';
ALTER TABLE `phpbb_posts` ADD `thanks_from_user_id` TEXT NULL ;
ALTER TABLE `phpbb_users` ADD `user_thanks_received` MEDIUMINT( 8 ) NOT NULL DEFAULT '0';
ALTER TABLE `phpbb_users` ADD `user_thanks_given` MEDIUMINT( 8 ) NOT NULL DEFAULT '0';
#
#-----[ COPY ]------------------------------------------
#
copy root/thanks.php to thanks.php
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 ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
$search = '<a href="' . $temp_url . '">' . sprintf($lang['Search_user_posts'], $postrow[$i]['username']) . '</a>';
#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// Start Thank Post by User Mod
//
if ( ($userdata['session_logged_in']) && ($userdata['user_id'] != $poster_id) ) {
$temp_url = append_sid("thanks.$phpEx?p=" . $postrow[$i]['post_id']);
$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 = '';
}
//
// 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
if ($postrow[$i]['user_id'] != -1) {
// From Users SQL
$sql = "SELECT user_posts, user_thanks_given, user_thanks_received
FROM " . USERS_TABLE . "
WHERE user_id = " . $postrow[$i]['user_id'];
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql);
}
$user_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$thanks_given = $lang['Thanks_thanks'] . ': ' . $user_row['user_thanks_given'];
$thanks_received = $lang['Thanks_thanked_1'] . ' ' . $user_row['user_thanks_received'] . ' ' . $lang['Thanks_thanked_2'] . ' ' . $user_row['user_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 ($postrow[$i]['thanks_count'] >= 1) {
$thanked_by = "";
$thanked_users = explode("|",$postrow[$i]['thanks_from_user_id']);
$thanked_count = $postrow[$i]['thanks_count'];
// Loop through all users who thanked the post
for ($x = 0; $x < $thanked_count; $x++) {
// Users SQL
$sql = "SELECT username
FROM " . USERS_TABLE . "
WHERE user_id = " . $thanked_users[$x];
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql);
}
$user_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($x >= 1) { $thanked_by .= ", "; }
// Add user to thanked by list
$thanked_by .= $user_row['username'];
}
$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 ]---------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]---------------------------------
#
//
// That's all, Folks!
#
#-----[ 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\' 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.';
//
// End Thank Post by User Mod
//
#
#-----[ 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 ]---------------------------------
#
<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>
#
#-----[ 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 BEFORE, ADD ]------------------------------------------
#
{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" nowrap="nowrap"><table cellspacing="0" cellpadding="0" border="0" height="18" width="18">
<tr>
<td valign="middle" nowrap="nowrap"><span class="gen">{postrow.thanks.L_THANKS_TEXT}: {postrow.thanks.THANKS_USERS}</span></td>
</tr>
</table></td>
</tr>
<!-- END thanks -->
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Kod: Tümünü seç
//
// Start Thank Post by User Mod by cupra
//
$lang['Thanks_title'] = 'Mesajı gönderen kullanıcılara Teşekkür';
$lang['Thanks_text'] = 'Bu kullanıcıya mesajı için Teşekkür';
$lang['Thanks_thanked_by'] = 'Bu mesaja Teşekkür eden kullanıcılar';
$lang['Thanks_thanks'] = 'Teşekkür Sayısı';
$lang['Thanks_thanked_1'] = 'Kendisine';
$lang['Thanks_thanked_2'] = 'kez teşekkür edildi, gönderdiği toplam mesaj';
$lang['Thanks_thanked_3'] = 'adettir.';
$lang['Thanks_not_logged_in'] = 'Foruma giriş yapmadınız.';
$lang['Thanks_no_post_specified'] = 'Mesaj belirlenemedi.';
$lang['Thanks_no_such_post'] = 'Mesaj mevcut değil.';
$lang['Thanks_anonymous'] = 'Misafir kullanıcılara teşekkür edilemez.';
$lang['Thanks_self'] = 'Kendi mesajınıza teşekkür edemezssiniz.';
$lang['Thanks_already_thanked'] = 'Bu mesaja daha önce teşekkür ettiniz.';
$lang['Thanks_success_1'] = 'Şu anda,';
$lang['Thanks_success_2'] = 'kullanıcısının bu başlıkta girmiş olduğu';
$lang['Thanks_success_3'] = 'mesajına başarıyla teşekkür ettiniz.';
//
// End Thank Post by User Mod by cupra
//