1 sayfadan 1. sayfa

[BETA] - OptimizeBB Light

İletiTarih: 17.08.2006, 00:34
sabri ünal
alfa seviyesi bir moddur... sunucuya binen veritabanı yükünün hafifletmeyi hedefler... henüz testler devam etmektedir. sizin de bu testte bize yardımcı olmanızı bekliyoruz...

orjinal hali 3 saatlik olan modun light hale getirilmiş ilk denemesidir...


Kod: Tümünü seç
########################################
## MOD Title: OptimizeBB Light
## MOD Author: Oyo < oyo@u-web.org > (n/a) http://u-web.org
## MOD Author2: yakusha < yakusha@tnn.net > (sabri ünal) http://www.yakusha.net
##
## MOD Description:
## İlgili modun light hale getirilmiş halidir... Bu mod sunucuya binen veritabanı yükünü
## hafifletmeye yardımcı olmaktır. Verilen satır numaraları 2.0.18 sürümü içindir. sonraki sürümlerle
## uyuşmayabilir.
## MOD Version: 1.0.3
##
## Installation Level: İleri
## Installation Time: ~ 60 Dakika
## Files To Edit: (sayılmadı)
## --- liste eksik :common.php, ---
## Included Files: (n/a)
##
#########################################
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
#########################################
## Author Notes:## Bir faydası olduğu kanıtlanmamıştır. teorik olarak çalışması gerekmektedir fakat sunucu üstünde
## bunu test edecek bir deneme yapılmamıştır...
########################################
## MOD History:
##
##   2006-08-18 - Version 1.0.2
##      - Light Version by yakusha - beta
##
##   2006-08-15 - Version 1.0.2
##      - Light Version by yakusha - Alfa
##
##   2006-05-12 - Version 1.0.0
##      - Première Version
##
#########################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#########################################
#
#-----[ OPEN ]---------------------------------------------
#
common.php, modcp.php, viewforum.php
#
#-----[ FIND ]---------------------------------------------
# Line 24
   die("Hacking attempt");
}

//
#
#-----[ REPLACE WITH ]---------------------------------------------
#
   die('Hacking attempt');
}

//
#
#-----[ FIND ]---------------------------------------------
# Line 28
error_reporting  (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables
set_magic_quotes_runtime(0); // Disable magic_quotes_runtime

// The following code (unsetting globals)
// Thanks to Matt Kavanagh and Stefan Esser for providing feedback as well as patch files
#
#-----[ AFTER, ADD ]---------------------------------------------
#
@ini_set('register_globals',0);
@ini_set('variables_order','GPC');
@ini_set('register_argc_argv',0);
@ini_set('expose_php',0);
@ini_set('default_socket_timeout',10);
@ini_set('allow_url_fopen',0);
//@ini_set('display_errors','Off');
#
#-----[ FIND ]---------------------------------------------
# Line 52
if (isset($HTTP_POST_VARS['GLOBALS']) || isset($HTTP_POST_FILES['GLOBALS']) || isset($HTTP_GET_VARS['GLOBALS']) || isset($HTTP_COOKIE_VARS['GLOBALS']))
{
   die("Hacking attempt");
}

// Protect against HTTP_SESSION_VARS tricks
if (isset($HTTP_SESSION_VARS) && !is_array($HTTP_SESSION_VARS))
{
   die("Hacking attempt");
}

#
#-----[ REPLACE WITH ]---------------------------------------------
#
if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS']))
{
   die("Hacking attempt");
}
// Protect against _SESSION tricks
if (isset($_SESSION) && !is_array($_SESSION))
{
   die("Hacking attempt");
}
#
#-----[ FIND ]---------------------------------------------
# Line 216

while ( $row = $db->sql_fetchrow($result) )
{
   $board_config[$row['config_name']] = $row['config_value'];
}
#
#-----[ AFTER, ADD ]---------------------------------------------
#
$db->sql_freeresult($result);
#
#-----[ OPEN ]---------------------------------------------
#
modcp.php
#
#-----[ FIND ]---------------------------------------------
# Line 128
   if ( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
   }
   $topic_row = $db->sql_fetchrow($result);
#
#-----[ AFTER, ADD ]---------------------------------------------
#
   $db->sql_freeresult($result);
#
#-----[ OPEN ]---------------------------------------------
#
viewforum.php
#
#-----[ FIND ]---------------------------------------------
# Line 128
         WHERE forum_id = $forum_id";
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
      }
#
#-----[ AFTER, ADD ]---------------------------------------------
#
      $db->sql_freeresult($result);
#
#-----[ FIND ]---------------------------------------------
# Line 199
{
   message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql);
}
#
#-----[ AFTER, ADD ]---------------------------------------------
#
$db->sql_freeresult($result);
#
#-----[ FIND ]---------------------------------------------
# Line 220
{
   message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql);
}
#
#-----[ AFTER, ADD ]---------------------------------------------
#
$db->sql_freeresult($result);
#
#-----[ FIND ]---------------------------------------------
# Line 252
   if ( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, 'Could not obtain limited topics count information', '', __LINE__, __FILE__, $sql);
   }
   $row = $db->sql_fetchrow($result);
#
#-----[ AFTER, ADD ]---------------------------------------------
#
   $db->sql_freeresult($result);
#
#-----[ OPEN ]---------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]---------------------------------------------
# Line 81
               LIMIT 1";
            if ( !($result = $db->sql_query($sql)) )
            {
               message_die(GENERAL_ERROR, 'Could not obtain newer/older topic information', '', __LINE__, __FILE__, $sql);
            }
#
#-----[ AFTER, ADD ]---------------------------------------------
#
            $db->sql_freeresult($result);
#
#-----[ FIND ]---------------------------------------------
# Line 123
         message_die(GENERAL_ERROR, "Could not obtain newer/older topic information", '', __LINE__, __FILE__, $sql);
      }

#
#-----[ REPLACE WITH ]---------------------------------------------
#
         message_die(GENERAL_ERROR, 'Could not obtain newer/older topic information', '', __LINE__, __FILE__, $sql);
      }
      $db->sql_freeresult($result);
#
#-----[ FIND ]---------------------------------------------
# Line 166
//
#
#-----[ REPLACE WITH ]---------------------------------------------
#
$db->sql_freeresult($result);
//
#
#-----[ FIND ]---------------------------------------------
# Line 221
      message_die(GENERAL_ERROR, "Could not obtain topic watch information", '', __LINE__, __FILE__, $sql);
   }

#
#-----[ REPLACE WITH ]---------------------------------------------
#
      message_die(GENERAL_ERROR, 'Could not obtain topic watch information', '', __LINE__, __FILE__, $sql);
   }
   $db->sql_freeresult($result);
#
#-----[ FIND ]---------------------------------------------
# Line 238
               message_die(GENERAL_ERROR, "Could not delete topic watch information", '', __LINE__, __FILE__, $sql);
            }
         }

#
#-----[ REPLACE WITH ]---------------------------------------------
#
               message_die(GENERAL_ERROR, 'Could not delete topic watch information', '', __LINE__, __FILE__, $sql);
            }
            $db->sql_freeresult($result);
         }
#
#-----[ FIND ]---------------------------------------------
# Line 262
               message_die(GENERAL_ERROR, "Could not update topic watch information", '', __LINE__, __FILE__, $sql);
            }
         }
      }
   }
#
#-----[ REPLACE WITH ]---------------------------------------------
#
               message_die(GENERAL_ERROR, 'Could not update topic watch information', '', __LINE__, __FILE__, $sql);
            }
            $db->sql_freeresult($result);
         }
      }
   }
#
#-----[ FIND ]---------------------------------------------
# Line 280
               message_die(GENERAL_ERROR, "Could not insert topic watch information", '', __LINE__, __FILE__, $sql);
            }
         }

#
#-----[ REPLACE WITH ]---------------------------------------------
#
               message_die(GENERAL_ERROR, 'Could not insert topic watch information', '', __LINE__, __FILE__, $sql);
            }
            $db->sql_freeresult($result);
         }
#
#-----[ FIND ]---------------------------------------------
# Line 333
      message_die(GENERAL_ERROR, "Could not obtain limited topics count information", '', __LINE__, __FILE__, $sql);
   }

#
#-----[ REPLACE WITH ]---------------------------------------------
#
      message_die(GENERAL_ERROR, 'Could not obtain limited topics count information', '', __LINE__, __FILE__, $sql);
   }
   $db->sql_freeresult($result);


/**** includes klasörleri **********/

#
#-----[ OPEN ]---------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]---------------------------------------------
# Line 52
   {
      return false;
   }

   $row = $db->sql_fetchrow($result);
#
#-----[ AFTER, ADD ]---------------------------------------------
#
   $db->sql_freeresult($result);
#
#-----[ FIND ]---------------------------------------------
# Line 217
   $category_rows = array();
   while ( $row = $db->sql_fetchrow($result) )
   {
      $category_rows[] = $row;
   }
#
#-----[ AFTER, ADD ]---------------------------------------------
#
   $db->sql_freeresult($result);
#
#-----[ FIND ]---------------------------------------------
# Line 227
         ORDER BY cat_id, forum_order";
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
      }
#
#-----[ AFTER, ADD ]---------------------------------------------
#
      $db->sql_freeresult($result);
#
#-----[ FIND ]---------------------------------------------
# Line 413
            WHERE themes_id = ' . $board_config['default_style'];
         if ( !($result = $db->sql_query($sql)) )
         {
            message_die(CRITICAL_ERROR, 'Could not query database for theme info');
         }


//bende aşağıdaki gibi geçiyor o kısım
/***********************************
         WHERE themes_id = ' . (int) $board_config['default_style'];
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(CRITICAL_ERROR, 'Could not query database for theme info');
      }
**************************************/
#
#-----[ AFTER, ADD ]---------------------------------------------
#
         $db->sql_freeresult($result);
#
#-----[ FIND ]---------------------------------------------
# Line 426
            if ( !($result = $db->sql_query($sql)) )
            {
               message_die(CRITICAL_ERROR, 'Could not update user theme info');
            }
#
#-----[ AFTER, ADD ]---------------------------------------------
#
            $db->sql_freeresult($result);
#
#-----[ FIND ]---------------------------------------------
# Line 634
      {
         $orig_word[] = '#\b(' . str_replace('\*', '\w*?', preg_quote($row['word'], '#')) . ')\b#i';
         $replacement_word[] = $row['replacement'];
      }
      while ( $row = $db->sql_fetchrow($result) );
#
#-----[ AFTER, ADD ]---------------------------------------------
#
      $db->sql_freeresult($result);
#
#-----[ OPEN ]---------------------------------------------
#
includes/functions_admin.php
#
#-----[ FIND ]---------------------------------------------
# Line 73

         while( $row = $db->sql_fetchrow($result) )
         {
            sync('forum', $row['forum_id']);
         }
#
#-----[ AFTER, ADD ]---------------------------------------------
#
         $db->sql_freeresult($result);
#
#-----[ FIND ]---------------------------------------------
# Line 87

         while( $row = $db->sql_fetchrow($result) )
         {
            sync('topic', $row['topic_id']);
         }
#
#-----[ AFTER, ADD ]---------------------------------------------
#
         $db->sql_freeresult($result);
#
#-----[ FIND ]---------------------------------------------
# Line 180
               }

               $db->sql_freeresult($result);
            }
         }
#
#-----[ AFTER, ADD ]---------------------------------------------
#
         $db->sql_freeresult($result);

/********** admin klasörleri *************/

#
#-----[ OPEN ]---------------------------------------------
#
admin/admin_disallow.php
#
#-----[ FIND ]---------------------------------------------
# Line 116
      $disallow_select .= '<option value="' . $disallowed[$i]['disallow_id'] . '">' . $disallowed[$i]['disallow_username'] . '</option>';
   }
}

$disallow_select .= '</select>';
#
#-----[ AFTER, ADD ]---------------------------------------------
#
$db->sql_freeresult($result);
#
#-----[ OPEN ]---------------------------------------------
#
admin/admin_forums.php
#
#-----[ FIND ]---------------------------------------------
# Line 99
   $sql = "SELECT *
      FROM $table
      WHERE $idfield = $id";

#
#-----[ REPLACE WITH ]---------------------------------------------
#
   $db->sql_freeresult($result);

   $sql = 'SELECT *
      FROM '.$table.'
      WHERE '.$idfield.' = '.$id;
#
#-----[ FIND ]---------------------------------------------
# Line 105
#
#-----[ FIND ]---------------------------------------------
# Line 112

   $return = $db->sql_fetchrow($result);
   $return['number'] = $count;
#
#-----[ AFTER, ADD ]---------------------------------------------
#
   $db->sql_freeresult($result);
#
#-----[ FIND ]---------------------------------------------
# Line 159
      {
         $s = " selected=\"selected\"";
      }
      $catlist .= "<option value=\"$row[$idfield]\"$s>" . $row[$namefield] . "</option>\n";
   }
#
#-----[ AFTER, ADD ]---------------------------------------------
#
   $db->sql_freeresult($result);
#
#-----[ FIND ]---------------------------------------------
# Line 282
         }
#
#-----[ FIND ]---------------------------------------------
# Line 285
         }
#
#-----[ FIND ]---------------------------------------------
# Line 290
         }
#
#-----[ REPLACE WITH ]---------------------------------------------
#
            $db->sql_freeresult($result);
         }
#
#-----[ FIND ]---------------------------------------------
# Line 494
         $row = $db->sql_fetchrow($result);

         $max_order = $row['max_order'];
         $next_order = $max_order + 10;
#
#-----[ AFTER, ADD ]---------------------------------------------
#
         $db->sql_freeresult($result);
#
#-----[ FIND ]---------------------------------------------
# Line 784
            }
            else
            {
               $select_to = $lang['Nowhere_to_move'];
            }
#
#-----[ AFTER, ADD ]---------------------------------------------
#
            $db->sql_freeresult($result);
#
#-----[ OPEN ]---------------------------------------------
#
admin/admin_groups.php
#
#-----[ FIND ]---------------------------------------------
# Line 384
      do
      {
         $select_list .= '<option value="' . $row['group_id'] . '">' . $row['group_name'] . '</option>';
      }
      while ( $row = $db->sql_fetchrow($result) );
#
#-----[ AFTER, ADD ]---------------------------------------------
#
      $db->sql_freeresult($result);
#
#-----[ OPEN ]---------------------------------------------
#
admin/admin_smilies.php
#
#-----[ FIND ]---------------------------------------------
# Line 526

   $smilies = $db->sql_fetchrowset($result);
#
#-----[ AFTER, ADD ]---------------------------------------------
#
   $db->sql_freeresult($result);
#
#-----[ OPEN ]---------------------------------------------
#
admin/admin_ug_auth.php
#
#-----[ FIND ]---------------------------------------------
# Line 966
         do
         {
            $select_list .= '<option value="' . $row['group_id'] . '">' . $row['group_name'] . '</option>';
         }
         while ( $row = $db->sql_fetchrow($result) );
#
#-----[ AFTER, ADD ]---------------------------------------------
#
         $db->sql_freeresult($result);
#
#-----[ OPEN ]---------------------------------------------
#
admin/admin_users.php
#
#-----[ FIND ]---------------------------------------------
# Line 992
         $rank_id = $row['rank_id'];

         $selected = ( $this_userdata['user_rank'] == $rank_id ) ? ' selected="selected"' : '';
         $rank_select_box .= '<option value="' . $rank_id . '"' . $selected . '>' . $rank . '</option>';
      }
#
#-----[ AFTER, ADD ]---------------------------------------------
#
      $db->sql_freeresult($result);
#
#-----[ SAVE/CLOSE ALL FILES ]---------------------------------------------
#
#EOM

--------------[ OPTIONALS ]-----------------------------------------------
#
#-----[ OPEN ]---------------------------------------------
# open all php files in your forum's

root/*.*.php

#
#-----[ FIND ]---------------------------------------------
#

Couldn't

#
#-----[ REPLACE ]---------------------------------------------
#

Could not

#
#-----[ SAVE/CLOSE ALL FILES ]---------------------------------------------
#
#EOM

Cvp: [Alfa] - OptimizeBB Light

İletiTarih: 17.08.2006, 01:04
moonlight
Keşki eskiden olasaydı denerdim. Ama şu an bir formum bile kalmadı :( :( :(

İletiTarih: 17.08.2006, 11:11
zuper19
bu modun orjinal halinede koyabilirmisin_?

İletiTarih: 17.08.2006, 11:14
sabri ünal
modun orjinali 180 dakika da ancak kuruluyor ve teknik hatalar içeriyor...

bunun yanında modun orjinali FIRANSIZCA ve test edilmemiş durumda... şu an localde bunun beta sürümünü hazırlamaya çalışıyorum ve çalışmayan kimi yerlerini çıkarıyorum...

İletiTarih: 17.08.2006, 12:55
moonlight
İzninizle 3 tanecik sorum olacak..

1-Bu mod nasıl bir işlem yaparak bunu sağlıyor.
2-vbultende vardı. Çok fazla yük bindiginde sayfa açmıyordu. Bu öyle bişey mi?
3-Sitemde aşırı yükleme yapıldıgında siteyi durduracak bir mod var mı?

Cevap verirseniz sevinirim
Saygılar..

İletiTarih: 17.08.2006, 19:21
sabri ünal
öyle bir sistem phpbb 3 üstünde var, fakat phpbb 2 için görmedim... fakat o kısmı inceleyip aktarmak istiyorum...

bu mod, spl sorgusu kullanıldıktan sonra ve işi bittikten sonra onu hafızadan kazıyor... böylece daha az hafıza alanı kullanılmış oluyor...

İletiTarih: 19.08.2006, 20:24
sabri ünal
mod güncellendi, mod artık beta ve gönül rahatlığıyla kullanılabilir...

İletiTarih: 20.08.2006, 23:13
Sergeant Orion
modun orjinalindense, sabri abinin hazırladığını kullanmanızı tavsiye ederim. çünkü bazı modlarda,
$sql= "SELECT FROM.. gibi kodlar aramanızı istiyor bu mod ise o kodları $sql= 'SELECT FROM.. şekline getiriyor. bu modu turkiyeBB'ye kurdum (orjinalini) ama sonra kaldırdım, ama biraz sonra burdakini kurmayı düşünüyorum.

İletiTarih: 21.08.2006, 03:02
sabri ünal
orjinalinin işlenmiş dosyaları var, bence premod vs yapanlar ordan başlarlarsa çok işlerine yarar, ben bu mantığı sevdim ve ilerde kullanacağım fakat şu bir gerçek: bu modun light sürümü olmalıydı ve yapıldı...

arada modun orjinali 1.0.0 -> 1.0.1 olmuş, bizi bağlayan bir değişiklik var mı henüz bulamadım...