1. Reklam


    1. joysro
      ledas
      jungler
      keasro
      zeus
      karantina

Phpbb2 Most active in forum - in Profile / En Aktif Olduğu %


  1. Narqotic

    Narqotic Bilgiliyim rank8

    Kayıt:
    22 Nisan 2007
    Mesajlar:
    1.365
    Beğenilen Mesajlar:
    0
    Ödül Puanları:
    0
    Meslek:
    !!!
    Şehir:
    BeN SeNiN CaNıN İçİN ÖmRüMü BiR KiBRiTiN KaBıNDa T
    Bu mod sayesinde porfil.php sayfasında üyenin en aktif olduğu forum çıkmaktadır. Yani kullanıcı o forumda en çok nerede (konuda) aktif ise en çok nerede mesaj yazıyorsa orası en aktif olduğu forum oluyor. Kullanıcıların profillerine yani isimleri üstüne tıkladığınızda kullanıcı bilgileri çinde aktfik olduğu yer : PHPBB 2.X MODLAR gibi o konunun ismi yazıyor. Gayet güzel bir özellik ku7llanmanız tavsiye olunur.

    Kod:
    ##############################################################
    ## MOD İSMİ : Most active in forum - in Profile
    ## MOD YAPIMCISI: Kleopatra < admin@kleo.org > (Kathleen) http://www.kleo.org
    ## MOD TANIMI:   This hack displays a new field in profiles that displays
    ##               which forum the user has been the most active in and how
    ##               many posts he or she has in that forum.  
    ## MOD Version: 1.1
    ##
    ## KURULUM SEVİYESİ : BASİT
    ## KURULUM SÜRESİ 10 DK
    ## EDİTLENECEK DOSYALAR: includes/functions.php, includes/usercp_viewprofile.php,
    ##              templates/subSilver/profile_view_body.tpl,
    ##              language/lang_english/lang_main.php
    ##
    ## Included Files: n/a
    ##############################################################
    ## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
    ## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
    ## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
    ## in our MOD-Database, located at: http://www.phpbb.com/mods/
    ##############################################################
    ## Author Notes:
    ##
    ## This MOD is EasyMOD Friendly!
    ##  
    ##   Works with phpBB2.0.0 - 2.0.10
    ##
    ##   For lang_german replace in language/lang_german/lang_main.php
    ##   $lang['Most_active'] = 'Most Active in: ';
    ##  $lang['Most_active_posts'] = 'with %s posts';
    ##   with
    ##   $lang['Most_active'] = 'Am meisten aktiv in: ';
    ##   $lang['Most_active_posts'] = 'mit %s Beiträgen';
    ##
    ##############################################################
    ## MOD History:
    ##
    ##   2004-11-18 - Version 1.1
    ##      - add - users with no access for hidden forums, don't see it listed
    ##      - fix - displays wrong forum name on particular forums and members
    ##   2004-11-16 - Version 1.0
    ##      - first release
    ##
    ##############################################################
    ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
    ##############################################################
    #
    #-----[ AÇ]------------------------------------------------
    #
    includes/functions.php
    #
    #-----[ BUL ]------------------------------------------------
    #
    ?>
    #
    #-----[ ÖNCESİNE EKLE]------------------------------------------
    #
    function get_forummostactive($user)
    {
       global $db, $userdata;
     
       if (intval($user) == 0)
       {
          $user = trim(htmlspecialchars($user));
          $user = substr(str_replace("\\'", "'", $user), 0, 25);
          $user = str_replace("'", "\\'", $user);
       }
       else
       {
          $user = intval($user);
       }
     
       $sql_forum = "SELECT forum_id, forum_name
                FROM " . FORUMS_TABLE . "
                ORDER BY forum_id";
       if ( !($result = $db->sql_query($sql_forum)) )
       {
          message_die(GENERAL_ERROR, 'Could not obtain forums list', '', __LINE__, __FILE__, $sql_forum);
       }
       while ($line = mysql_fetch_array($result, MYSQL_ASSOC))
       {
          $mostactive_id[] = $line['forum_id'];
          $mostactive_name[$line['forum_id']] = $line['forum_name'];
       }
       $count_mostactive_id = count($mostactive_id);
     
       $mostactive_posts = 0;
       $num_result = 0;
     
       foreach($mostactive_id as $i)
       {
          $is_auth = auth(AUTH_VIEW, $i, $userdata);
          if ( $is_auth['auth_view'] == 1 )
          {
             $sql_most = "SELECT *
                FROM " . POSTS_TABLE . "
                WHERE forum_id = $i AND poster_id = $user";
             if ( !($result = $db->sql_query($sql_most)) )
             {
                message_die(GENERAL_ERROR, 'Tried obtaining data for a non-existent user', '', __LINE__, __FILE__, $sql_most);
             }
             $num_result = mysql_num_rows($result);
             if ($num_result > $mostactive_posts)
             {
                $mostactive_posts = $num_result;
                $mostactive_foren_id = $i;
                $mostactive_forum_name = $mostactive_name[$i];
             }
          }
       }
       return array($mostactive_foren_id, $mostactive_posts, $mostactive_forum_name);
    }
    #
    #-----[ AÇ ]------------------------------------------------
    #
    includes/usercp_viewprofile.php
    #
    #-----[ BUL ]------------------------------------------------
    #
    //
    // Generate page
    //
    #
    #-----[ ÖNCESİNE EKLE ]------------------------------------------
    #
    $user_mostactive = get_forummostactive($HTTP_GET_VARS[POST_USERS_URL]);
    $user_mostactive_forum = '<a href="' . append_sid("viewforum.$phpEx?f=" . urlencode($user_mostactive['0'])) . '" class="genmed">' . $user_mostactive['2'] . '</a>';
    $user_mostactive_posts = $user_mostactive['1'];
     
    #
    #-----[ BUL ]------------------------------------------------
    #
       'POST_PERCENT_STATS' => sprintf($lang['User_post_pct_stats'], $percentage),
    #
    #-----[ ARDINA EKLE ]------------------------------------------
    #
       'MOSTACTIVE_FORUM' => $user_mostactive_forum,
    #
    #-----[ BUL ]------------------------------------------------
    #
       'L_SEARCH_USER_POSTS' => sprintf($lang['Search_user_posts'], $profiledata['username']),
    #
    #-----[ ARDINA EKLE ]------------------------------------------
    #
       'L_MOST_ACTIVE' => $lang['Most_active'],
       'L_MOST_ACTIVE_POSTS' => sprintf($lang['Most_active_posts'], $user_mostactive_posts),
    #
    #-----[ AÇ ]------------------------------------------------
    #
    language/Kullandığınız dil/lang_main.php
    #
    #-----[ BUL ]------------------------------------------------
    #
    ?>
    #
    #-----[ ÖNCESİNE EKLE ]------------------------------------------
    #
    $lang['Most_active'] = 'En Aktif: ';
    $lang['Most_active_posts'] = 'En Aktif Üyeler %s posts';
    #
    #-----[ AÇ ]------------------------------------------------
    #
    templates/subSilver/profile_view_body.tpl
    #
    #-----[ BUL ]------------------------------------------------
    #
            <td valign="top"><b><span class="gen">{POSTS}</span></b><span class="genmed">[{POST_PERCENT_STATS} / {POST_DAY_STATS}]</span> <span class="genmed"><a href="{U_SEARCH_USER}" class="genmed">{L_SEARCH_USER_POSTS}</a></span></td>
          </tr>
    #
    #-----[ ARDINA EKLE ]------------------------------------------
    #
          <tr>
            <td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_MOST_ACTIVE}</span></td>
            <td valign="top"><b><span class="gen">{MOSTACTIVE_FORUM}</span></b><span class="genmed">{L_MOST_ACTIVE_POSTS}</span></td>
          </tr>
    #
    #-----[ KAYDET VE KAPAT ]--------------------------------
    Not:Değişiklikleri yapmadan önce dosyaların kopyasını alın...
     
    Son düzenleme yönetici tarafından yapıldı: 28 Ekim 2015
  2. Jigsaw

    Jigsaw Aileden rank8

    Kayıt:
    13 Mayıs 2007
    Mesajlar:
    8.951
    Beğenilen Mesajlar:
    0
    Ödül Puanları:
    0
    Şehir:
    Close enough to cut your throat...
    ## $lang['Most_active'] = 'En fazla aktif olduğu bölüm: ';
    ## $lang['Most_active_posts'] = '%s Mesajla';

    Türkçe kullanmak için bu satırların değiştirilmesi yeterli. (: