Color groups kald1rsak ?

phpBB 2.0.x sürümleri için MODlar hakkında ihtiyacınız olan desteği buradan sorarak alabilirsiniz.
Kilitli
Kullanıcı avatarı
by-keskin
Kayıtlı Kullanıcı
Mesajlar: 425
Kayıt: 10.10.2006, 21:09
İletişim:

Color groups kald1rsak ?

Mesaj gönderen by-keskin »

arkadaslar plusdaki color groups modunu kaldirsak forum biraz hizlanir mi yoksa pek bi_ey farketmez mi ?
Kullanıcı avatarı
Dn_35
Kayıtlı Kullanıcı
Mesajlar: 3400
Kayıt: 08.04.2006, 22:02
İletişim:

Mesaj gönderen Dn_35 »

renk grupları modu çok fazla sql sorgusu yapıyor ama sorgusunu azaltan bir fix var onu bir dene istersen, fix forumda mevcut...
Kullanıcı avatarı
bekirrr
Kayıtlı Kullanıcı
Mesajlar: 50
Kayıt: 14.10.2006, 20:54
İletişim:

Mesaj gönderen bekirrr »

color groups forumu yavaşlatır
phpmod
Kayıtlı Kullanıcı
Mesajlar: 158
Kayıt: 12.11.2006, 21:15
İletişim:

Mesaj gönderen phpmod »

Dn_35 in söylediği gibi fix var.

Kod: Tümünü seç

#
#-----[ AÇ ]-----
#

includes/functions_color_groups.php

#
#-----[ BUL ]-----
#

function color_group_colorize_name($user_id, $no_profile = false)
{
   global $board_config, $phpEx, $db, $phpbb_root_path;
   
   static $cacheUsers;
   
   // First see if the user is Anon
   if ($user_id != ANONYMOUS)
   {
      if (!isset($cacheUsers[$user_id]))
      {
         // Get the user info and see if they are assigned a color_group //
         $sql = 'SELECT u.user_color_group, u.username, c.* FROM ' . USERS_TABLE . ' u, ' . COLOR_GROUPS_TABLE . " c
         WHERE u.user_id = $user_id
         AND u.user_color_group = c.group_id";
         $result = $db->sql_query($sql);
         $row = $db->sql_fetchrow($result);
         if (!isset($row['username']))
         {
            //If there was a problem before, we don't want a blank username!
            $sql = 'SELECT username FROM ' . USERS_TABLE . "
               WHERE user_id = $user_id";
            $result = $db->sql_query($sql);
            $row = $db->sql_fetchrow($result);
         }
         $cacheUsers[$user_id]['username'] = $row['username'];

         if (isset($row['group_color']))
         {
            // WE found the highest level color, head out now //
            $cacheUsers[$user_id]['group_color'] = stripslashes($row['group_color']);
         }
         else
         {
            // Now start looking for user group memberships //
            $sql = 'SELECT c.* FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . ' u, ' . COLOR_GROUPS_TABLE . ' c, ' . GROUPS_TABLE . ' g
            WHERE ug.user_id = ' . $user_id . '
            AND u.user_id = ug.user_id
            AND ug.group_id = g.group_id
            AND g.group_color_group = c.group_id
            AND g.group_single_user = 0
            ORDER BY c.order_num ASC LIMIT 1';
            //print $sql;
            $result = $db->sql_query($sql);
            $curr = 10000000000000;
            $style_color = '';
            while ($row = $db->sql_fetchrow($result))
            {
               // If our new group in the list is a higher order number, it's color takes precedence //
               if ($row['order_num'] < $curr)
               {
                  $curr = $row['order_num'];
                  $cacheUsers[$user_id]['group_color'] = stripslashes($row['group_color']);
               }
            }
         }
      }
     
     
      $style_color = 'style="font-weight:bold;color:' . $cacheUsers[$user_id]['group_color'] . '"';
      $username = $cacheUsers[$user_id]['username'];
      // Make the profile link or no and return it //
      if ($no_profile)
      {
         $user_link = "<span $style_color>$username</span>";
      }
      else
      {
         $user_link = '<a href="' . append_sid($phpbb_root_path."profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id") . '"' . $style_color .'>' . $username . '</a>';
      }
      return($user_link);
   }
   else
   {
      return false;
   }
}

#
#-----[ BUNUNLA DEGISTIR ]-----
#

function color_group_colorize_name($user_id, $no_profile = false)
{
   global $board_config, $phpEx, $db, $phpbb_root_path, $colorusers, $coloruname, $colorgroup;
   
   // First see if the user is Anon
   if ($user_id != ANONYMOUS)
   {
      $username = $coloruname[$user_id];
      if ( $colorusers[$user_id] != 0 )
      {
         // Get the user info and see if they are assigned a color_group //
         $sql = 'SELECT u.user_color_group, u.username, c.* FROM ' . USERS_TABLE . ' u, ' . COLOR_GROUPS_TABLE . " c
            WHERE u.user_id = $user_id
            AND u.user_color_group = c.group_id";
         $result = $db->sql_query($sql);
         $row = $db->sql_fetchrow($result);

      }
     
      if (isset($row['group_color']))
      {
         // WE found the highest level color, head out now //
         $style_color = 'style="font-weight:bold;color:' . $row['group_color'] . '"';
      }
      else
      {
         if ( in_array($user_id, $colorgroup) )
         {
            // Now start looking for user group memberships //
            $sql = 'SELECT c.* FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . ' u, ' . COLOR_GROUPS_TABLE . ' c, ' . GROUPS_TABLE . ' g
               WHERE ug.user_id = ' . $user_id . '
               AND u.user_id = ug.user_id
               AND ug.group_id = g.group_id
               AND g.group_color_group = c.group_id
               AND g.group_single_user = 0';
            //print $sql;
               $result = $db->sql_query($sql);
               $curr = 10000000000000;
               $style_color = '';
               while ($row = $db->sql_fetchrow($result))
               {
                  // If our new group in the list is a higher order number, it's color takes precedence //
                  if ($row['order_num'] < $curr)
                  {
                     $curr = $row['order_num'];
                     $style_color = 'style="font-weight:bold;color:' . $row['group_color'] . '"';
                  }
               }
         }
      }
     
      // Make the profile link or no and return it //
      if ($no_profile)
      {
         $user_link = "<span $style_color>$username</span>";
      }
      else
      {
         $user_link = '<a href="' . append_sid($phpbb_root_path."profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id") . '"' . $style_color .'>' . $username . '</a>';
      }
      return($user_link);
   }
   else
   {
      $username = $coloruname[$user_id];
      if ($no_profile)
      {
         $user_link = "<span $style_color>$username</span>";
      }
      else
      {
         $user_link = '<a href="' . append_sid($phpbb_root_path."profile.php?mode=viewprofile&" . POST_USERS_URL . "=$user_id") . '"' . $style_color .'>' . $username . '</a>';
      }
      return $username;
   }
}

#
#-----[ AÇ ]-----
#

common.php
 
#
#-----[ BUL ]-----
#

//
// Show 'Board is disabled' message if needed.
//

#
#-----[ ÖNCESINE EKLE ]-----
#

$sql = "SELECT user_id, user_color_group, username FROM " . USERS_TABLE;
if( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, 'Could not read user color groups', '', __LINE__, __FILE__, $sql);
}

$colorusers = array();
$coloruname = array();
while ( $row = $db->sql_fetchrow($result) )
{
   $userid = $row['user_id'];
   $colorusers[$userid] = $row['user_color_group'];
   $coloruname[$userid] = $row['username'];
}

$colorgroup = array();

$sql = "SELECT ug.user_id FROM " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g
   WHERE g.group_single_user = 0
   AND g.group_id = ug.group_id
   GROUP BY ug.user_id
   ORDER BY ug.user_id";
if( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, 'Could not read user color groups', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
   $colorgroup[] = $row['user_id'];
}

#
#-----[ TÜM DOSYALARI KAPAT/LAYDET ]-----
#
SoN
al sana kolaylık olsun :wink:
Kullanıcı avatarı
by-keskin
Kayıtlı Kullanıcı
Mesajlar: 425
Kayıt: 10.10.2006, 21:09
İletişim:

Mesaj gönderen by-keskin »

tamamen kaldırmanın bir yolu yok mu bence bu mod anlamsız ve yavaşlatıcı ?

saygılar...
Kullanıcı avatarı
Dn_35
Kayıtlı Kullanıcı
Mesajlar: 3400
Kayıt: 08.04.2006, 22:02
İletişim:

Mesaj gönderen Dn_35 »

istersen kurulumun tersini yaparak kaldırabilirsin ama fix'i uygulayınca sql sorguları normale dönüyor,

Forumu hızlandırmak istiyorsan XS mod ve Cached Generation modunu kurabilirsin.
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 »

color group modunu açıp geri alacaksınız..
kaldırmanızı şiddetle tavsiye ederim..
not sql tarafını kaldırmanıza gerek yok.
sadece ftp yi kaldırın
Kullanıcı avatarı
reissinan
Kayıtlı Kullanıcı
Mesajlar: 61
Kayıt: 14.11.2006, 04:45
İletişim:

Mesaj gönderen reissinan »

PEki Arkadaslar Color Groups Mod v1.2.0 mod unu
bulabılcegim yer varmı
tesekkürler.
Kullanıcı avatarı
phpBB-TR
Kayıtlı Kullanıcı
Mesajlar: 588
Kayıt: 24.12.2006, 13:34
Konum: İstanbul
İletişim:

Mesaj gönderen phpBB-TR »

v1.2.0 eski sürüm plus kullanıyorum ama diğer forum premod değil color groups v1.2.1 kurulu hiç fark göremedim herhalde bugları kapatmışlardır..

http://www.phpbbturkey.com/downloads.ph ... etail&id=6

buradan güncel sürüm v1.2.1'i indirebilirsin :wink:
Kullanıcı avatarı
reissinan
Kayıtlı Kullanıcı
Mesajlar: 61
Kayıt: 14.11.2006, 04:45
İletişim:

Mesaj gönderen reissinan »

tesekkürler
Kilitli

“2.0.x MOD Destek” sayfasına dön

Kimler çevrimiçi

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