[BETA] Thank Post by User 0.1.1- Mesaja teşekkür

phpBB 2.0.x sürümleri için geliştirilen ve yapım aşamasındaki Alpha, Beta MODlar & PreMODlar.
Kullanıcı avatarı
cupra
Kayıtlı Kullanıcı
Mesajlar: 2505
Kayıt: 01.04.2006, 02:33
Konum: smyrna
İletişim:

[BETA] Thank Post by User 0.1.1- Mesaja teşekkür

Mesaj gönderen cupra »

gayet başarılı ve zahmetsiz bir teşekkür modifikasyonu..
alıntı: phpbbmod.com

test için :arrow: http://perfectstrangers.kayyo.com

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}&nbsp;

#
#-----[ 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
Türkçe dil düzenlemesi by cupra:

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
//
En son cupra tarafından 20.09.2006, 14:52 tarihinde düzenlendi, toplamda 1 kere düzenlendi.
Kullanıcı avatarı
cupra
Kayıtlı Kullanıcı
Mesajlar: 2505
Kayıt: 01.04.2006, 02:33
Konum: smyrna
İletişim:

Mesaj gönderen cupra »

subsilver için tr buton ilk mesaja eklendi
Kullanıcı avatarı
NEFRİT
Uzaklaştırıldı
Mesajlar: 1404
Kayıt: 28.01.2006, 04:15
Konum: DarkKingdom
İletişim:

Mesaj gönderen NEFRİT »

Teşekkürler sahidende teşekkürler butonu çok güzel olmuş elen sağlık.
(Bakın biz modlar bile birbirimize teşekkür ediyoruz sizde edin :D )
Özellerden kullanıcılara reklam yaptığım için sayın yöneticim beni uzaklaştırdı.
Kullanıcı avatarı
cupra
Kayıtlı Kullanıcı
Mesajlar: 2505
Kayıt: 01.04.2006, 02:33
Konum: smyrna
İletişim:

Mesaj gönderen cupra »

NEFRİT yazdı:Teşekkürler sahidende teşekkürler butonu çok güzel olmuş elen sağlık.
(Bakın biz modlar bile birbirimize teşekkür ediyoruz sizde edin :D )
evet çok teşekkürler :D

noT:

bir kullanıcımız plustada test etti ve çalıştı..
Kullanıcı avatarı
NEFRİT
Uzaklaştırıldı
Mesajlar: 1404
Kayıt: 28.01.2006, 04:15
Konum: DarkKingdom
İletişim:

Mesaj gönderen NEFRİT »

Vaybe kardeşim ne kadar hızlısınız daha program çıkalı 2 gün olmadı hemen sitelerinize entegre etmişsiniz.

Bu arada bu teşekkür V BULLETİN forumlarındaki teşekkürün aynısıdır.
Özellerden kullanıcılara reklam yaptığım için sayın yöneticim beni uzaklaştırdı.
Kullanıcı avatarı
er-13
Kayıtlı Kullanıcı
Mesajlar: 273
Kayıt: 02.08.2006, 04:52
Konum: /index.php
İletişim:

Mesaj gönderen er-13 »

cevap yazmaya üşenenler için güzel bi mod olur sitede :D

mod için teşekkürler... Elbet birgün kullanırım inşallah.
Kullanıcı avatarı
er-13
Kayıtlı Kullanıcı
Mesajlar: 273
Kayıt: 02.08.2006, 04:52
Konum: /index.php
İletişim:

Mesaj gönderen er-13 »

Profilde kaç tane teşekkür almış gösterme imkanımız var mı bide bu

Kod: Tümünü seç

Bu mesaja Teşekkür eden kullanıcılar: er-13
yazısını koyulaştırdım fakat rengini değiştiremedim nasıl değiştiririm.
Birde türkçe çeviride bir harf hatası var onu da değiştirirdim :D

Kod: Tümünü seç

$lang['Thanks_title'] = 'Mesajı gönderen kullanıcılara Teşekkür';
eline sağlık cupra teşekkürler...
Kullanıcı avatarı
RSNBK
Kayıtlı Kullanıcı
Mesajlar: 311
Kayıt: 11.05.2006, 22:08
Konum: zonguldak/Bartın
İletişim:

Mesaj gönderen RSNBK »

bende kurdum çok güzel oldu..sağol cupra..
Kullanıcı avatarı
cupra
Kayıtlı Kullanıcı
Mesajlar: 2505
Kayıt: 01.04.2006, 02:33
Konum: smyrna
İletişim:

Mesaj gönderen cupra »

ilk dil dosyası güncellendi.
rengini değiştirmek için dil dosyası üzerinde bir değişiklik yada kod üzerine ekleme yapılarak yapılır vaktim olursa gösteririm.

eğer, mesaj sayısı bilgisini kaldırmak istiyorsanız (2 defa gözüküyor) şu şekilde düzenleme yapabilirsiniz.




bul

Kod: Tümünü seç

$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'];
bununla değiştir

Kod: Tümünü seç

           $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'];
dil dosyasınıda şu şekilde düzenle

Kod: Tümünü seç

$lang['Thanks_thanked_2'] = 'kez teşekkür edildi.'; 
gamisaga
Kayıtlı Kullanıcı
Mesajlar: 23
Kayıt: 09.10.2006, 18:30
İletişim:

Mesaj gönderen gamisaga »

hocam ben yukledim eminim yanlışta yok ama bi türlü mesaja teşekkür edenler çıkmıo ya :( bana bi yardımcı olur musunuz?
gamisaga
Kayıtlı Kullanıcı
Mesajlar: 23
Kayıt: 09.10.2006, 18:30
İletişim:

Mesaj gönderen gamisaga »

tekrar mesaj atma nedenim bi önceki mesajı editleyememem 20dk beklicekmişim.sorun bende avatarın altında çıkanlar düzgün ancal bu teşekkür edenlerin adları çıkmıo
view.tpl dosyası

Kod: Tümünü seç

{postrow.thanks.L_THANKS_TEXT}: {postrow.thanks.THANKS_USERS}
yazan yerdeki : 2 nokta üst üste çıkıyor.

buda bu teşekkürlerin yazılanların gösterilmesi için gereken code sanırım



include($phpbb_root_path . 'quick_reply.'.$phpEx);
if($poster_id != ANONYMOUS and defined("KARMA")) {
$template->assign_block_vars('postrow.switch_showkarma', array());

Kod: Tümünü seç

 // 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
        //
}
$template->pparse('body');

bu kodun en altındakinde üste yapıştırın denilen yer ustekide bende olan yer.
zirve
Kayıtlı Kullanıcı
Mesajlar: 474
Kayıt: 28.04.2006, 10:26
İletişim:

Mesaj gönderen zirve »

benim buna benzer tsk modu vardı beyenmedin vievtopic.php den sildim mod var ama ordan sildim viewtopicden gözükmüyor yani bunu kursam bisiy olurmu
zirve
Kayıtlı Kullanıcı
Mesajlar: 474
Kayıt: 28.04.2006, 10:26
İletişim:

Mesaj gönderen zirve »

arkadaslar yardım edin mesaja tsk edenlerin ismi çıkmıyor öyle bi tablo yok ne yapacam nerde hata yaptım
zirve
Kayıtlı Kullanıcı
Mesajlar: 474
Kayıt: 28.04.2006, 10:26
İletişim:

Mesaj gönderen zirve »

bunu nereye yapıstırıcaz bi türlü bulamıyorum her yöntemi denedim olmadı lütfen yardım ediniz..

buda bu teşekkürlerin yazılanların gösterilmesi için gereken code sanırım


Kod: Tümünü seç

include($phpbb_root_path . 'quick_reply.'.$phpEx); 
if($poster_id != ANONYMOUS and defined("KARMA")) { 
$template->assign_block_vars('postrow.switch_showkarma', array()); 
zirve
Kayıtlı Kullanıcı
Mesajlar: 474
Kayıt: 28.04.2006, 10:26
İletişim:

Mesaj gönderen zirve »

arkadaslar
bu isareti kaldırarak tablo olustu ama isimler yazmıyor kimler tske etmis saat 9 dan beri uğrasıyorum olmadı
Kilitli

“2.0.x PreMODlar & Yapım aşamasındaki MODlar” sayfasına dön

Kimler çevrimiçi

Bu forumu görüntüleyen kullanıcılar: Hiç bir kayıtlı kullanıcı yok ve 17 misafir