[MOD] The last Five and the Five popular / En son popüler...

[url=http://www.phpbbturkey.com/mods.html:34cnv4ga]phpBB 2.0.x MOD Veritabanımızda[/url:34cnv4ga] yayınlanan ve tarafınızca eklenen tüm yeni phpBB 2.0.x sürümleri için MODların duyuruları buradan yapılmaktadır. MODlar hakkında ihtiyacınız olan desteği lütfen [b:34cnv4ga]2.0.x MOD Destek[/b:34cnv4ga] forumuna başlık açarak sorunuz.
Kullanıcı avatarı
khan
Kayıtlı Kullanıcı
Mesajlar: 44
Kayıt: 25.01.2006, 15:49
Konum: Balıkesir
İletişim:

Mesaj gönderen khan »

MuhayyeL yazdı:
#-----[ BUL ]------------------------------------------
#

//
// That's all, Folks!
// -------------------------------------------------


#
#-----[ ÖNCESİNE EKLE ]------------------------------------------
#

//------------------------------------------------------------------------
// Top Topics on Index 1.1.0 - Begin Code Addition
//
$lang['TopicsRecent'] = "Recent Topics";
$lang['TopicsPopular'] = "Popular Topics (by reply)";
$lang['TopicsPopularView'] = "Popular Topics (by view)";
//
// Top Topics on Index 1.1.0 - End Code Addition
//------------------------------------------------------------------------
Bu kısımda "Recent Topics"; yerine "yeni başlıklar", "Popular Topics (by reply)" yerine "Popüler konular(okunma)" , "Popular Topics (by view)" yerine de "Popüler konular(cevaplanma)" olarak değiştirirsek daha türkçe oluyor sanki :D
Eline sağlık kardeş.
yukarıda yazdığım hata arkadaşımın söylediği değişikliği yapınca geliyor.....
MuhayyeL
Kayıtlı Kullanıcı
Mesajlar: 5
Kayıt: 03.05.2006, 14:20
İletişim:

Mesaj gönderen MuhayyeL »

Kardeş ben de hiç sorun çıkmadı. Sorun çıkacak bir değişiklik de söylemedim zaten. Büyük ihtmal lang_turkish klasörün içinde yazmamışsın
Kullanıcı avatarı
khan
Kayıtlı Kullanıcı
Mesajlar: 44
Kayıt: 25.01.2006, 15:49
Konum: Balıkesir
İletişim:

Mesaj gönderen khan »

lan turkksih/lan main.php
kullandığım dosya bu.Acaba türkçe karakterlermi sorun yaratıyor??
Kullanıcı avatarı
khan
Kayıtlı Kullanıcı
Mesajlar: 44
Kayıt: 25.01.2006, 15:49
Konum: Balıkesir
İletişim:

Mesaj gönderen khan »

sorunu çözdüm :roll:
lang maini tekrar yükledim ve türkçe halini yazdım modun kaydettim oldu...önceden ingilizce yi yazıp değiştirince olmuyordu.
Kullanıcı avatarı
tuanna
Kayıtlı Kullanıcı
Mesajlar: 48
Kayıt: 25.05.2006, 13:08
İletişim:

Mesaj gönderen tuanna »

Kod: Tümünü seç

// Topics to display (Default: 5) 
      $MAX_TOPICS = 5; 
          
      // 0 => users can see all topics including authorized issue(but they cant read the posts) 
      // 1 => users can see only authorized topics 
      $AUTH_SECRUITY = 1; 

      // Order by 
      // topic_last_post_id (Default) 
      // topic_replies 
      // topic_views 

      $sortby="topic_last_post_id"; 

   // 
   // Option of Toplist End 
   // 

   function cutStr($str) { 
      global $MAX_STR_LEN; 
      $str = (strlen($str) > $MAX_STR_LEN) ? (substr($str, 0, $MAX_STR_LEN - 1) . "...") : $str; 
      return $str; 
   } 

   // Find which forums are visible for this user 
   $is_auth_ary_top5 = array(); 
   $is_auth_ary_top5 = auth(AUTH_READ, AUTH_LIST_ALL, $userdata); 


   $auth_forum_ary_top5 = array(); 

   // Get forum info 
   $sql = "SELECT forum_id FROM " . FORUMS_TABLE; 

   if( !$q_forums = $db->sql_query($sql) ) 
   { 
      message_die(GENERAL_ERROR, 'Toplist ERROR: Fetch forum info fail', __LINE__, __FILE__, $sql); 
   } 

   // Authorized forums info 
   while( $forum_row = $db->sql_fetchrow($q_forums) ) 
   { 
      $forum_id1 = $forum_row['forum_id']; 

      if( $is_auth_ary_top5[$forum_id1]['auth_read'] == 1) 
      { 
         if(function_exists("array_push")) 
         { 
            array_push($auth_forum_ary_top5, $forum_id1); 
         } else { 
            $auth_id=count($auth_forum_ary_top5); 
            $auth_forum_ary_top5[$auth_id]=$forum_id1; 
         } 
      } 
   } 

   if( sizeOf($auth_forum_ary_top5) == 0 || !$AUTH_SECRUITY ) 
   { 
      $auth_forums_top5 = ""; 
   } 
   else 
   { 
      $auth_forums_top5 = 'AND f.forum_id IN('; 

      if(sizeOf($auth_forum_ary_top5) > 1) 
      { 
         $auth_forums_top5 .= implode (',', $auth_forum_ary_top5); 
      } 
      else 
      { 
         $auth_forums_top5 .= $auth_forum_ary_top5[0]; 
      } 

      $auth_forums_top5 .= ')'; 
   } 
ben burdaki 5 leri 10 yaptım oldu :lol:
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 »

Tebrikler son zamanlarda zeki birileri ile karşılaşmak ne kadarda hoş.
Özellerden kullanıcılara reklam yaptığım için sayın yöneticim beni uzaklaştırdı.
aykarama
Kayıtlı Kullanıcı
Mesajlar: 253
Kayıt: 18.05.2006, 01:39
İletişim:

Mesaj gönderen aykarama »

Kod: Tümünü seç

Could not retrieve recent topics

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND f.forum_id = t.forum_id ORDER BY topic_last_post_id DESC ' at line 3

SELECT t.topic_id, t.topic_title, t.topic_replies, t.topic_views, t.topic_last_post_id FROM kasif55_topics t, kasif55_forums f WHERE t.forum_id IN () AND f.forum_id = t.forum_id ORDER BY topic_last_post_id DESC LIMIT 0,10

Line : 670
File : index.php


bende kesinlikle kabul etmiyor ve bu hatayı veriyo index.php yide veriyimde nerde yanlışlık var bi bakın

Kod: Tümünü seç

<?php
/***************************************************************************
 *                                index.php
 *                            -------------------
 *   begin                : Saturday, Feb 13, 2001
 *   copyright            : (C) 2001 The phpBB Group
 *   email                : support@phpbb.com
 *
 *   $Id: index.php,v 1.99.2.7 2006/01/28 11:13:39 acydburn Exp $
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
function gen_login_key()
{
	$key = "";
	$max_length_login_key = 5;
	$chars = array(
		"0","1","2","3","4","5","6","7","8","9",
		"a","b","c","d","e","f","g","h","i","j","k","l","m",
		"n","o","p","q","r","s","t","u","v","w","x","y","z");

	$count = count($chars) - 1;

	srand((double)microtime()*1000000);

	for($i = 0; $i < $max_length_login_key; $i++)
	{
		$key .= $chars[rand(0, $count)];
	}

	return($key);
}

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
if( $userdata['session_logged_in'] ) 
{ 
	$sql = "SELECT COUNT(post_id) as total 
		FROM " . POSTS_TABLE . " 
		WHERE post_time >= " . $userdata['user_lastvisit'] . " 
		AND poster_id != " . $userdata['user_id']; 

	$result = $db->sql_query($sql); 
	if( $result ) 
	{ 
		$row = $db->sql_fetchrow($result); 
		$lang['Search_new'] = $lang['Search_new'] . " (" . $row['total'] . ")"; 
	}
}
include_once($phpbb_root_path.'includes/functions_color_groups.'.$phpEx);
color_groups_setup_list();
$viewcat = ( !empty($HTTP_GET_VARS[POST_CAT_URL]) ) ? $HTTP_GET_VARS[POST_CAT_URL] : -1;

if( isset($HTTP_GET_VARS['mark']) || isset($HTTP_POST_VARS['mark']) )
{
	$mark_read = ( isset($HTTP_POST_VARS['mark']) ) ? $HTTP_POST_VARS['mark'] : $HTTP_GET_VARS['mark'];
}
else
{
	$mark_read = '';
}

//
// Handle marking posts
//
if( $mark_read == 'forums' )
{
	if( $userdata['session_logged_in'] )
	{
		setcookie($board_config['cookie_name'] . '_f_all', time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
	}

	$template->assign_vars(array(
		"META" => '<meta http-equiv="refresh" content="3;url='  .append_sid("index.$phpEx") . '">')
	);

	$message = $lang['Forums_marked_read'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a> ');

	message_die(GENERAL_MESSAGE, $message);
}
//
// End handle marking posts
//

$tracking_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_t"]) : array();
$tracking_forums = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f"]) : array();

//
// If you don't use these stats on your index you may want to consider
// removing them
//
$total_topics = get_db_stat('topiccount');
$total_posts = get_db_stat('postcount');
$total_users = get_db_stat('usercount');
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
$newest_uid = $newest_userdata['user_id'];

if( $total_posts == 0 )
{
	$l_total_post_s = $lang['Posted_articles_zero_total'];
}
else if( $total_posts == 1 )
{
	$l_total_post_s = $lang['Posted_article_total'];
}
else
{
	$l_total_post_s = $lang['Posted_articles_total'];
}

if( $total_users == 0 )
{
	$l_total_user_s = $lang['Registered_users_zero_total'];
}
else if( $total_users == 1 )
{
	$l_total_user_s = $lang['Registered_user_total'];
}
else
{
	$l_total_user_s = $lang['Registered_users_total'];
}


//
// Start page proper
//
$sql = "SELECT c.cat_id, c.cat_title, c.cat_order
	FROM " . CATEGORIES_TABLE . " c 
	ORDER BY c.cat_order";
if( !($result = $db->sql_query($sql, false, true)) )
{
	message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql);
}

$category_rows = array();
while ($row = $db->sql_fetchrow($result))
{
	$category_rows[] = $row;
}
$db->sql_freeresult($result);
// Begin Simple Subforums MOD
$subforums_list = array();
// End Simple Subforums MOD

if( ( $total_categories = count($category_rows) ) )
{
	//
	// Define appropriate SQL
	//
	switch(SQL_LAYER)
	{
		case 'postgresql':
			$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id 
				FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u
				WHERE p.post_id = f.forum_last_post_id 
					AND u.user_id = p.poster_id  
					UNION (
						SELECT f.*, NULL, NULL, NULL, NULL
						FROM " . FORUMS_TABLE . " f
						WHERE NOT EXISTS (
							SELECT p.post_time
							FROM " . POSTS_TABLE . " p
							WHERE p.post_id = f.forum_last_post_id  
						)
					)
					ORDER BY cat_id, forum_order";
			break;

		case 'oracle':
			$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id 
				FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u
				WHERE p.post_id = f.forum_last_post_id(+)
					AND u.user_id = p.poster_id(+)
				ORDER BY f.cat_id, f.forum_order";
			break;

		default:
			$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
				FROM (( " . FORUMS_TABLE . " f
				LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )
				LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id )
				ORDER BY f.cat_id, f.forum_order";
			break;
	}
	if ( !($result = $db->sql_query($sql, false, 'posts_')) )
	{
		message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
	}

	$forum_data = array();
	while( $row = $db->sql_fetchrow($result) )
	{
		$forum_data[] = $row;
	}
	$db->sql_freeresult($result);

	if ( !($total_forums = count($forum_data)) )
	{
		message_die(GENERAL_MESSAGE, $lang['No_forums']);
	}

	//
	// Obtain a list of topic ids which contain
	// posts made since user last visited
	//
	if ($userdata['session_logged_in'])
	{
		// 60 days limit
		if ($userdata['user_lastvisit'] < (time() - 5184000))
		{
			$userdata['user_lastvisit'] = time() - 5184000;
		}

		$sql = "SELECT t.forum_id, t.topic_id, p.post_time 
			FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p 
			WHERE p.post_id = t.topic_last_post_id 
				AND p.post_time > " . $userdata['user_lastvisit'] . " 
				AND t.topic_moved_id = 0"; 
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'Could not query new topic information', '', __LINE__, __FILE__, $sql);
		}

		$new_topic_data = array();
		while( $topic_data = $db->sql_fetchrow($result) )
		{
			$new_topic_data[$topic_data['forum_id']][$topic_data['topic_id']] = $topic_data['post_time'];
		}
		$db->sql_freeresult($result);
	}

	//
	// Obtain list of moderators of each forum
	// First users, then groups ... broken into two queries
	//
	$sql = "SELECT aa.forum_id, u.user_id, u.username 
		FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g, " . USERS_TABLE . " u
		WHERE aa.auth_mod = " . TRUE . " 
			AND g.group_single_user = 1 
			AND ug.group_id = aa.group_id 
			AND g.group_id = aa.group_id 
			AND u.user_id = ug.user_id 
		GROUP BY u.user_id, u.username, aa.forum_id 
		ORDER BY aa.forum_id, u.user_id";
	if ( !($result = $db->sql_query($sql, false, true)) )

	{
		message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql);
	}

	$forum_moderators = array();
	while( $row = $db->sql_fetchrow($result) )
	{
		$forum_moderators[$row['forum_id']][] = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '">' . $row['username'] . '</a>';
	}
	$db->sql_freeresult($result);

	$sql = "SELECT aa.forum_id, g.group_id, g.group_name 
		FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g 
		WHERE aa.auth_mod = " . TRUE . " 
			AND g.group_single_user = 0 
			AND g.group_type <> " . GROUP_HIDDEN . "
			AND ug.group_id = aa.group_id 
			AND g.group_id = aa.group_id 
		GROUP BY g.group_id, g.group_name, aa.forum_id 
		ORDER BY aa.forum_id, g.group_id";
	if ( !($result = $db->sql_query($sql, false, true)) )

	{
		message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql);
	}

	while( $row = $db->sql_fetchrow($result) )
	{
		$forum_moderators[$row['forum_id']][] = '<a href="' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=" . $row['group_id']) . '">' . $row['group_name'] . '</a>';
	}
	$db->sql_freeresult($result);

	//
	// Find which forums are visible for this user
	//
	$is_auth_ary = array();
	$is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data);
        // 
// last 5 registered users by emrag 
// 
$last_5_users = $lang['Newest_users']; 

$sql = "SELECT user_id, username, user_regdate 
FROM " . USERS_TABLE . " 
WHERE 1 
ORDER BY user_regdate DESC LIMIT 5"; 

if( !($result = $db->sql_query($sql)) ) 
{ 
message_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql); 
} 

while( $row = $db->sql_fetchrow($result) ) 
{ 
if ( $last_5_users == $lang['Newest_users'] ) 
{ 
$last_5_users .= '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><b>' . $row['username'] . '</b></a>'; 
} 
else 
{ 
$last_5_users .= ', <a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><b>' . $row['username'] . '</b></a>'; 
} 
} 
// 
// last 5 registered users by emrag 
// 
//
// Obtain new post information for marquee
// of new posts
//
//
// Get Viewable Forums
//
// function to merge two auth arrays to one
function array_merge_replace($array, $newValues)
{
  foreach ($newValues as $key => $value)
    {
    if ( is_array($value) )
    {
      if ( !isset($array[$key]) )
      {
        $array[$key] = array();
      }
      $array[$key] = array_merge_replace($array[$key], $value);
    }
    else
    {
      if ( isset($array[$key]) && is_array($array[$key]) )
      {
        $array[$key][0] = $value;
      }
      else
      {
        if ( isset($array) && !is_array($array) )
        {
          $temp = $array;
          $array = array();
          $array[0] = $temp;
        }
        $array[$key] = $value;
      }
    }
  }
  return $array;
}
$ary = array();
$ary2 = array();
$ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data);
$ary2 = auth(AUTH_READ, AUTH_LIST_ALL, $userdata, $forum_data);
$is_auth_ary = array_merge_replace($ary, $ary2);
$auth_view_forum_sql = '';
for($i = 0; $i < $total_categories; $i++)
{
  $cat_id = $category_rows[$i]['cat_id'];
  $display_forums = false;
  for($j = 0; $j < $total_forums; $j++)
  {
    if ( $is_auth_ary[$forum_data[$j]['forum_id']]['auth_view'] && $is_auth_ary[$forum_data[$j]['forum_id']]['auth_read'] && $forum_data[$j]['cat_id'] == $cat_id )
    {
      $display_forums = true;
      $auth_view_forum_sql .= ($auth_view_forum_sql == '' ? '' : ', ' ) . $forum_data[$j]['forum_id'];
    }
  }
}
$auth_view_forum_sql = ($auth_view_forum_sql == '' ? '(0)' : '(' . $auth_view_forum_sql . ')');

//
// Get The Data
//
$template->assign_vars(array(
  'MARQUEE_TOPIC' => str_replace("%s",$board_config['topics_on_index'],$lang['marquee_topic']) )
);

$sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, t.topic_type, t.topic_status, p.post_id, p.poster_id,
  p.post_time, u.user_id, u.username, u.user_lastvisit
  FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u
  WHERE t.forum_id IN " . $auth_view_forum_sql . " AND t.topic_id = p.topic_id
  AND f.forum_id = t.forum_id
  AND t.topic_status <> 2
  AND p.post_id = t.topic_last_post_id
  AND p.poster_id = u.user_id
  ORDER BY t.topic_last_post_id DESC";

if ( !($result = $db->sql_query($sql)) )
{
  message_die(GENERAL_ERROR, 'Could not query recent posts marquee information', '', __LINE__, __FILE__, $sql);
}

if ($row = $db->sql_fetchrowset($result))
{
  $db->sql_freeresult($result);
}

if( count($row) <= $board_config['topics_on_index'] )
{
  $topics = count($row);
}
else
{
  $topics = $board_config['topics_on_index'];
}

for($i = 0; $i < $topics; $i++)
{
  $mar_title = $row[$i]["topic_title"];
  $mar_url = $phpbb_root_path . 'viewtopic.'.$phpEx.'?'.POST_TOPIC_URL.'='.$row[$i]["topic_id"];
  $mar_user = $row[$i]["username"];
  if ( $row[$i]["topic_status"] == TOPIC_LOCKED )
  {
    if ( $row[$i]["post_time"] > $row[$i]["user_lastvisit"] )
    {
      $pic = $images['folder_locked_new'];
    }
    else
    {
      $pic = $images['folder_locked'];
    }
  }
  else
  {
    if ( $row[$i]["topic_type"] == POST_GLOBAL_ANNOUNCE )
    {
      if ( $row[$i]["post_time"] > $row[$i]["user_lastvisit"] )
      {
        $pic = $images['folder_global_announce_new'];
      }
      else
      {
        $pic = $images['folder_global_announce'];
      }
    }
    else if ( $row[$i]["topic_type"] == POST_ANNOUNCE )
    {
      if ( $row[$i]["post_time"] > $row[$i]["user_lastvisit"] )
      {
        $pic = $images['folder_announce_new'];
      }
      else
      {
        $pic = $images['folder_announce'];
      }
    }
    else if ( $row[$i]["topic_type"] == POST_STICKY )
    {
      if ( $row[$i]["post_time"] > $row[$i]["user_lastvisit"] )
      {
        $pic = $images['folder_sticky_new'];
      }
      else
      {
      $pic = $images['folder_sticky'];
      }
    }
    else { if ( $row[$i]["post_time"] > $userdata['user_lastvisit'] )
    {
      $pic = $images['folder_new']; }else{ $pic = $images['folder'];
    }
  }
}
$template->assign_block_vars('marqueerow', array(
  'FOLD_URL' => $pic,
  'TOPIC_TITLE' => $row[$i]["topic_title"],
  'TOPIC_URL' => append_sid($phpbb_root_path . 'viewtopic.'.$phpEx.'?'.POST_TOPIC_URL.'='.$row[$i]["topic_id"]),
  'USERNAME' => $row[$i]["username"],
  'USER_PROF' => append_sid($phpbb_root_path . 'profile.'.$phpEx.'?mode=viewprofile$amp;u='.$row[$i]["user_id"]),
  'POST_DATE' => create_date($board_config['default_dateformat'], $row[$i]["post_time"], $board_config['board_timezone']))
  );
}
// 
// last 5 registered users by emrag 
// 
$last_5_users = $lang['Newest_users']; 

$sql = "SELECT user_id, username, user_regdate 
FROM " . USERS_TABLE . " 
WHERE 1 
ORDER BY user_regdate DESC LIMIT 5"; 

if( !($result = $db->sql_query($sql)) ) 
{ 
message_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql); 
} 

while( $row = $db->sql_fetchrow($result) ) 
{ 
if ( $last_5_users == $lang['Newest_users'] ) 
{ 
$last_5_users .= '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><b>' . $row['username'] . '</b></a>'; 
} 
else 
{ 
$last_5_users .= ', <a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><b>' . $row['username'] . '</b></a>'; 
} 
} 
// 
// last 5 registered users by emrag 
// 

	//
	// Start output of page
	//
	define('SHOW_ONLINE', true);
	$page_title = $lang['Index'];
	include($phpbb_root_path . 'includes/page_header.'.$phpEx);

	$template->set_filenames(array(
		'body' => 'index_body.tpl')
	);
if ($userdata['user_id'] != '-1') 
{ 
    $welcome_name = '<a href="' . append_sid("profile.$phpEx?mode=editprofile&" . $userdata['user_id']) . '">' . $userdata['username'] . '</a>'; 
} 
else 
{ 
    $welcome_name = '<a href="' . append_sid("profile.$phpEx?mode=register&") . '">' . $lang['Guest'] . '</a>'; 
} 
        $boarddays = ( time() - $board_config['board_startdate'] ) / 86400; 
        $posts_per_day = sprintf("%.2f", $total_posts / $boarddays); 
        $topics_per_day = sprintf("%.2f", $total_topics / $boarddays); 
        $users_per_day = sprintf("%.2f", $total_users / $boarddays); 
        $posts_per_user = sprintf("%.2f", $total_posts / $total_users);
if($posts_per_day > $total_posts) 
   { 
      $posts_per_day = $total_posts; 
   } 

   if($topics_per_day > $total_topics) 
   { 
      $topics_per_day = $total_topics; 
   } 

   if($users_per_day > $total_users) 
   { 
      $users_per_day = $total_users; 
   } 

   if($posts_per_user > $total_posts) 
   { 
      $posts_per_user = $total_posts; 
   } 
//
	// Anti Robotic Login 
	if ($board_config['allow_anti_robotic_login'])
	{
		$sql = "DELETE FROM " . ANTI_ROBOT_LOGIN_TABLE . " WHERE timestamp < '" . (time() - 3600) . "' OR session_id = '" . $userdata['session_id'] . "'";
		if( !$result = $db->sql_query($sql) )
		{
				message_die(GENERAL_ERROR, 'Could not delete security code key', '', __LINE__, __FILE__, $sql);
		}

		$login_key = gen_login_key();

		$sql = "INSERT INTO ". ANTI_ROBOT_LOGIN_TABLE . " VALUES ('" . $userdata['session_id'] . "', '" . $login_key . "', '" . time() . "')";
		if( !$result = $db->sql_query($sql) )
		{
				message_die(GENERAL_ERROR, 'Could not check login information', '', __LINE__, __FILE__, $sql);
		}
	} 
	//-----------------------
	//
	$template->assign_vars(array(
      "POSTS_PER_DAY" => $posts_per_day, 
      "POSTS_PER_USER" => $posts_per_user, 
      "TOPICS_PER_DAY" => $topics_per_day, 
      "USERS_PER_DAY" => $users_per_day, 
      "TOTAL_TOPICCOUNT" => $total_topics, 
      "L_TOTAL_TOPICCOUNT" => $lang['total_topiccount'], 
      "L_POSTS_PER_DAY" => $lang['Posts_per_day'], 
      "L_TOPICS_PER_DAY" => $lang['Topics_per_day'], 
      "L_USERS_PER_DAY" => $lang['Users_per_day'], 
      "L_POSTS_PER_USER" => $lang['Posts_per_user'],
                
		'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
		'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
		/* Original phpBB code for newest user - commented out for replace last registered user with last 5 registered users 
                'NEWEST_USER' => sprintf($lang['Newest_user'], '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$newest_uid") . '">', $newest_user, '</a>'), 
                */ 
                'NEWEST_USER' => $last_5_users, 
		'FORUM_IMG' => $images['forum'],
		'FORUM_NEW_IMG' => $images['forum_new'], 
                'FORUM_LOCKED_IMG' => $images['forum_locked'], 
                'L_NAME_WELCOME' => $lang['Welcome'], 
                'U_WELCOME_NAME' => $welcome_name, 
       // Start add - Fully integrated shoutbox MOD
                'U_SHOUTBOX' => append_sid("shoutbox.$phpEx"),
                'L_SHOUTBOX' => $lang['Shoutbox'],
                'U_SHOUTBOX_MAX' => append_sid("shoutbox_max.$phpEx"),
      // End add - Fully integrated shoutbox MOD
  
		'L_FORUM' => $lang['Forum'],
      // Begin Simple Subforums MOD
                'L_SUBFORUMS' => $lang['Subforums'],
      // End Simple Subforums MOD
		'L_TOPICS' => $lang['Topics'],
		'L_REPLIES' => $lang['Replies'],
		'L_VIEWS' => $lang['Views'],
		'L_POSTS' => $lang['Posts'],
		'L_LASTPOST' => $lang['Last_Post'], 
		'L_NO_NEW_POSTS' => $lang['No_new_posts'],
		'L_NEW_POSTS' => $lang['New_posts'],
		'L_NO_NEW_POSTS_LOCKED' => $lang['No_new_posts_locked'], 
		'L_NEW_POSTS_LOCKED' => $lang['New_posts_locked'], 
		'L_ONLINE_EXPLAIN' => $lang['Online_explain'], 
		'L_MODERATOR' => $lang['Moderators'], 
		'L_FORUM_LOCKED' => $lang['Forum_is_locked'],
		'L_MARK_FORUMS_READ' => $lang['Mark_all_forums'], 

		// Anti Robotic Login
		'L_SECURITY_CODE' => $lang['Security_code'],
		'S_ANTI_ROBOT1' => append_sid('antirobot_pic_login.'.$phpEx.'?id=1'),
		'S_ANTI_ROBOT2' => append_sid('antirobot_pic_login.'.$phpEx.'?id=2'),
		'S_ANTI_ROBOT3' => append_sid('antirobot_pic_login.'.$phpEx.'?id=3'),
		'S_ANTI_ROBOT4' => append_sid('antirobot_pic_login.'.$phpEx.'?id=4'),
		'S_ANTI_ROBOT5' => append_sid('antirobot_pic_login.'.$phpEx.'?id=5'),
		'U_MARK_READ' => append_sid("index.$phpEx?mark=forums"))
	);

	//
	// Let's decide which categories we should display
	//
	$display_categories = array();

	for ($i = 0; $i < $total_forums; $i++ )
	{
		if ($is_auth_ary[$forum_data[$i]['forum_id']]['auth_view'])
		{
			$display_categories[$forum_data[$i]['cat_id']] = true;
		}
	}

	//
	// Okay, let's build the index
	//
	for($i = 0; $i < $total_categories; $i++)
	{
		$cat_id = $category_rows[$i]['cat_id'];

		//
		// Yes, we should, so first dump out the category
		// title, then, if appropriate the forum list
		//
		if (isset($display_categories[$cat_id]) && $display_categories[$cat_id])
		{
			$template->assign_block_vars('catrow', array(
				'CAT_ID' => $cat_id,
				'CAT_DESC' => $category_rows[$i]['cat_title'],
				'U_VIEWCAT' => append_sid("index.$phpEx?" . POST_CAT_URL . "=$cat_id"))
			);

			if ( $viewcat == $cat_id || $viewcat == -1 )
			{
				for($j = 0; $j < $total_forums; $j++)
				{
					if ( $forum_data[$j]['cat_id'] == $cat_id )
					{
						$forum_id = $forum_data[$j]['forum_id'];

						if ( $is_auth_ary[$forum_id]['auth_view'] )
						{
							if ( $forum_data[$j]['forum_status'] == FORUM_LOCKED )
							{
								$folder_image = $images['forum_locked']; 
								$folder_alt = $lang['Forum_locked'];
								// Begin Simple Subforums MOD
                $unread_topics = false;
                $folder_images = array(
                  'default'  => $folder_image,
                  'new'    => $images['forum_locked'],
                  'sub'    => ( isset($images['forums_locked']) ) ? $images['forums_locked'] : $images['forum_locked'],
                  'subnew'  => ( isset($images['forums_locked']) ) ? $images['forums_locked'] : $images['forum_locked'],
                  'subalt'  => $lang['Forum_locked'],
                  'subaltnew'  => $lang['Forum_locked'],
                  );
                // End Simple Subforums MOD
							}
							else
							{
								$unread_topics = false;
								if ( $userdata['session_logged_in'] )
								{
									if ( !empty($new_topic_data[$forum_id]) )
									{
										$forum_last_post_time = 0;

										while( list($check_topic_id, $check_post_time) = @each($new_topic_data[$forum_id]) )
										{
											if ( empty($tracking_topics[$check_topic_id]) )
											{
												$unread_topics = true;
												$forum_last_post_time = max($check_post_time, $forum_last_post_time);

											}
											else
											{
												if ( $tracking_topics[$check_topic_id] < $check_post_time )
												{
													$unread_topics = true;
													$forum_last_post_time = max($check_post_time, $forum_last_post_time);
												}
											}
										}

										if ( !empty($tracking_forums[$forum_id]) )
										{
											if ( $tracking_forums[$forum_id] > $forum_last_post_time )
											{
												$unread_topics = false;
											}
										}

										if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )
										{
											if ( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] > $forum_last_post_time )
											{
												$unread_topics = false;
											}
										}

									}
								}

								$folder_image = ( $unread_topics ) ? $images['forum_new'] : $images['forum']; 
								$folder_alt = ( $unread_topics ) ? $lang['New_posts'] : $lang['No_new_posts']; 
								// Begin Simple Subforums MOD
                $folder_images = array(
                  'default'  => $folder_image,
                  'new'    => $images['forum_new'],
                  'sub'    => ( isset($images['forums']) ) ? $images['forums'] : $images['forum'],
                  'subnew'  => ( isset($images['forums_new']) ) ? $images['forums_new'] : $images['forum_new'],
                  'subalt'  => $lang['No_new_posts'],
                  'subaltnew'  => $lang['New_posts'],
                  );
                // End Simple Subforums MOD
							}

							$posts = $forum_data[$j]['forum_posts'];
							$topics = $forum_data[$j]['forum_topics'];

							if ( $forum_data[$j]['forum_last_post_id'] )
							{
								$last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);

								// OLD
								// $last_post = $last_post_time . '<br />';
								//
								// MOD - TODAY AT - BEGIN
								//
								if ( $board_config['time_today'] < $forum_data[$j]['post_time'])
								{ 
									$last_post = sprintf($lang['Today_at'], create_date($board_config['default_timeformat'], $forum_data[$j]['post_time'], $board_config['board_timezone'])) . '<br />'; 
								}
								else if ( $board_config['time_yesterday'] < $forum_data[$j]['post_time'])
								{ 
									$last_post = sprintf($lang['Yesterday_at'], create_date($board_config['default_timeformat'], $forum_data[$j]['post_time'], $board_config['board_timezone'])) . '<br />'; 
								}
								else
								{ 
									$last_post = $last_post_time . '<br />'; 
								} 
								// MOD - TODAY AT - END
                                                                $sql = "SELECT DISTINCT f.forum_id, f.forum_last_post_id, p.topic_id, t.topic_title
									FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t
									WHERE t.topic_id = p.topic_id
										AND t.topic_last_post_id = " . $forum_data[$j]['forum_last_post_id'];

								if ( !($result = $db->sql_query($sql)) )
								{
									message_die(GENERAL_ERROR, 'Could not select info from post/topic table', '', __LINE__, __FILE__, $sql);
								}

								$last_topic_data = $db->sql_fetchrow($result);
								$ltid = $last_topic_data['topic_id'];
								$lttitle = $last_topic_data['topic_title'];

								// append first 25 characters of topic title to last topic data
								if (strlen($lttitle) > 25)
								{
									$last_post .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$ltid") . '">' . substr($lttitle, 0, 25) . '...</a><br />';
								}
								else
								{
									$last_post .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$ltid") . '">' . substr($lttitle, 0, 25) . '</a><br />';
								}

								$db->sql_freeresult($result);


								$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : color_group_colorize_name($forum_data[$j]['user_id']);
								
								$last_post .= '<a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';
							
							// Begin Simple Subforums MOD
                $last_post_sub = '<a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . ($unread_topics ? $images['icon_newest_reply'] : $images['icon_latest_reply']) . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';
                $last_post_time = $forum_data[$j]['post_time'];
                // End Simple Subforums MOD
							}
							else
							{
								$last_post = $lang['No_Posts'];
								// Begin Simple Subforums MOD
                $last_post_sub = '<img src="' . $images['icon_minipost'] . '" border="0" alt="' . $lang['No_Posts'] . '" title="' . $lang['No_Posts'] . '" />';
                $last_post_time = 0;
                // End Simple Subforums MOD
							}

							if ( count($forum_moderators[$forum_id]) > 0 )
							{
								$l_moderators = ( count($forum_moderators[$forum_id]) == 1 ) ? $lang['Moderator'] : $lang['Moderators'];
								$moderator_list = implode(', ', $forum_moderators[$forum_id]);
							}
							else
							{
								$l_moderators = '&nbsp;';
								$moderator_list = '';
							}

							$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
							$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

							$template->assign_block_vars('catrow.forumrow',	array(
								'ROW_COLOR' => '#' . $row_color,
								'ROW_CLASS' => $row_class,
								'FORUM_FOLDER_IMG' => $folder_image, 
								'FORUM_NAME' => $forum_data[$j]['forum_name'],
								'FORUM_DESC' => $forum_data[$j]['forum_desc'],
								'POSTS' => $forum_data[$j]['forum_posts'],
								'TOPICS' => $forum_data[$j]['forum_topics'],
								'LAST_POST' => $last_post,
								'MODERATORS' => $moderator_list,

								'L_MODERATOR' => $l_moderators, 
								'L_FORUM_FOLDER_ALT' => $folder_alt, 

// Begin Simple Subforums MOD
                'FORUM_FOLDERS' => serialize($folder_images),
                'HAS_SUBFORUMS' => 0,
                'PARENT' => $forum_data[$j]['forum_parent'],
                'ID' => $forum_data[$j]['forum_id'],
                'UNREAD' => intval($unread_topics),
                'TOTAL_UNREAD' => intval($unread_topics),
                'TOTAL_POSTS' => $forum_data[$j]['forum_posts'],
                'TOTAL_TOPICS' => $forum_data[$j]['forum_topics'],
                'LAST_POST_FORUM' => $last_post,
                'LAST_POST_TIME' => $last_post_time,
                'LAST_POST_TIME_FORUM' => $last_post_time,
                // End Simple Subforums MOD
								'U_VIEWFORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"))
							);
							// Begin Simple Subforums MOD
              if( $forum_data[$j]['forum_parent'] )
              {
                $subforums_list[] = array(
                  'forum_data'  => $forum_data[$j],
                  'folder_image'  => $folder_image,
                  'last_post'    => $last_post,
                  'last_post_sub'  => $last_post_sub,
                  'moderator_list'  => $moderator_list,
                  'unread_topics'  => $unread_topics,
                  'l_moderators'  => $l_moderators,
                  'folder_alt'  => $folder_alt,
                  'last_post_time'  => $last_post_time,
                  'desc'      => $forum_data[$j]['forum_desc'],
                  );
              }
              // End Simple Subforums MOD
						}
					}
				}
			}
		}
	} // for ... categories

}// if ... total_categories
else
{
	message_die(GENERAL_MESSAGE, $lang['No_forums']);
}
// Begin Simple Subforums MOD
unset($data);
unset($item);
unset($cat_item);
unset($row_item);
for( $i = 0; $i < count($subforums_list); $i++ )
{
  $forum_data = $subforums_list[$i]['forum_data'];
  $parent_id = $forum_data['forum_parent'];

  // Find parent item
  if( isset($template->_tpldata['catrow.']) )
  {
    $data = &$template->_tpldata['catrow.'];
    $count = count($data);
    for( $j = 0; $j < $count; $j++)
    {
      $cat_item = &$data[$j];
      $row_item = &$cat_item['forumrow.'];
      $count2 = count($row_item);
      for( $k = 0; $k < $count2; $k++)
      {
        if( $row_item[$k]['ID'] == $parent_id )
        {
          $item = &$row_item[$k];
          break;
        }
      }
      if( isset($item) )
      {
        break;
      }
    }
  }

  if( isset($item) )
  {
    if( isset($item['sub.']) )
    {
      $num = count($item['sub.']);
      $data = &$item['sub.'];
    }
    else
    {
      $num = 0;
      $item[] = 'sub.';
      $data = &$item['sub.'];
    }

    // Append new entry
    $data[] = array(
      'NUM' => $num,
      'FORUM_FOLDER_IMG' => $subforums_list[$i]['folder_image'],
      'FORUM_NAME' => $forum_data['forum_name'],
      'FORUM_DESC' => $forum_data['forum_desc'],
      'FORUM_DESC_HTML' => htmlspecialchars(preg_replace('@<[\/\!]*?[^<>]*?>@si', '', $forum_data['forum_desc'])),
      'POSTS' => $forum_data['forum_posts'],
      'TOPICS' => $forum_data['forum_topics'],
      'LAST_POST' => $subforums_list[$i]['last_post'],
      'LAST_POST_SUB' => $subforums_list[$i]['last_post_sub'],
      'LAST_TOPIC' => $forum_data['topic_title'],
      'MODERATORS' => $subforums_list[$i]['moderator_list'],
      'PARENT' => $forum_data['forum_parent'],
      'ID' => $forum_data['forum_id'],
      'UNREAD' => intval($subforums_list[$i]['unread_topics']),

      'L_MODERATOR' => $subforums_list[$i]['l_moderators'],
      'L_FORUM_FOLDER_ALT' => $subforums_list[$i]['folder_alt'],

      'U_VIEWFORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $forum_data['forum_id'])
    );
    $item['HAS_SUBFORUMS'] ++;
    $item['TOTAL_UNREAD'] += intval($subforums_list[$i]['unread_topics']);
    // Change folder image
    $images = unserialize($item['FORUM_FOLDERS']);
    $item['FORUM_FOLDER_IMG'] = $item['TOTAL_UNREAD'] ? $images['subnew'] : $images['sub'];
    $item['L_FORUM_FOLDER_ALT'] = $item['TOTAL_UNREAD'] ? $images['subaltnew'] : $images['subalt'];
    // Check last post
    if( $item['LAST_POST_TIME'] < $subforums_list[$i]['last_post_time'] )
    {
      $item['LAST_POST'] = $subforums_list[$i]['last_post'];
      $item['LAST_POST_TIME'] = $subforums_list[$i]['last_post_time'];
    }
    if( !$item['LAST_POST_TIME_FORUM'] )
    {
      $item['LAST_POST_FORUM'] = $item['LAST_POST'];
    }
    // Add topics/posts
    $item['TOTAL_POSTS'] += $forum_data['forum_posts'];
    $item['TOTAL_TOPICS'] += $forum_data['forum_topics'];
  }
  unset($item);
  unset($data);
  unset($cat_item);
  unset($row_item);
}
// End Simple Subforums MOD
//
// Generate the page
//
$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>
[/quote]
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 »

arkadaşlar iki sorum olacak
1.bunu forum ile kimler online arasına nasıl alırım.
2.bu yeni başlıklar sütununu nasıl kaybedebilirim. yani sadece popüle okuma ve popüler cevaplama sütunları kalsın istiyorum.

şimdiden teşekkürler...
hellrider
Kayıtlı Kullanıcı
Mesajlar: 11
Kayıt: 14.05.2006, 01:53
İletişim:

Mesaj gönderen hellrider »

cok teşekkür ederim arkadaşim ben yaptim birde
lang_main.php dosyasinin içinde yani ana sayfamizda gözüken ingilizce yazilarida kendime göre şekillendirip türkçeleştirdim belki arkadaşlarimiz yapmiştir örnek olsun diye bende vermek istedim.

Kod: Tümünü seç

//------------------------------------------------------------------------ 
// Top Topics on Index 1.1.0 - Begin Code Addition 
// 
$lang['TopicsRecent'] = " .::. Yeni Konular .::. "; 
$lang['TopicsPopular'] = " .::. Ençok Cevaplanan Konular .::. "; 
$lang['TopicsPopularView'] = ".::. Ençok Okunan Konular .::. "; 
// 
// Top Topics on Index 1.1.0 - End Code Addition 
//------------------------------------------------------------------------ 
http://www.banauzaksin.com sitesindende örneği görebilirsiniz.

saygilarimla.
hellrider
Kayıtlı Kullanıcı
Mesajlar: 11
Kayıt: 14.05.2006, 01:53
İletişim:

Mesaj gönderen hellrider »

aykarama yazdı:

Kod: Tümünü seç

Could not retrieve recent topics

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND f.forum_id = t.forum_id ORDER BY topic_last_post_id DESC ' at line 3

SELECT t.topic_id, t.topic_title, t.topic_replies, t.topic_views, t.topic_last_post_id FROM kasif55_topics t, kasif55_forums f WHERE t.forum_id IN () AND f.forum_id = t.forum_id ORDER BY topic_last_post_id DESC LIMIT 0,10

Line : 670
File : index.php


bende kesinlikle kabul etmiyor ve bu hatayı veriyo index.php yide veriyimde nerde yanlışlık var bi bakın

Kod: Tümünü seç

<?php
/***************************************************************************
 *                                index.php
 *                            -------------------
 *   begin                : Saturday, Feb 13, 2001
 *   copyright            : (C) 2001 The phpBB Group
 *   email                : support@phpbb.com
 *
 *   $Id: index.php,v 1.99.2.7 2006/01/28 11:13:39 acydburn Exp $
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
function gen_login_key()
{
	$key = "";
	$max_length_login_key = 5;
	$chars = array(
		"0","1","2","3","4","5","6","7","8","9",
		"a","b","c","d","e","f","g","h","i","j","k","l","m",
		"n","o","p","q","r","s","t","u","v","w","x","y","z");

	$count = count($chars) - 1;

	srand((double)microtime()*1000000);

	for($i = 0; $i < $max_length_login_key; $i++)
	{
		$key .= $chars[rand(0, $count)];
	}

	return($key);
}

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
if( $userdata['session_logged_in'] ) 
{ 
	$sql = "SELECT COUNT(post_id) as total 
		FROM " . POSTS_TABLE . " 
		WHERE post_time >= " . $userdata['user_lastvisit'] . " 
		AND poster_id != " . $userdata['user_id']; 

	$result = $db->sql_query($sql); 
	if( $result ) 
	{ 
		$row = $db->sql_fetchrow($result); 
		$lang['Search_new'] = $lang['Search_new'] . " (" . $row['total'] . ")"; 
	}
}
include_once($phpbb_root_path.'includes/functions_color_groups.'.$phpEx);
color_groups_setup_list();
$viewcat = ( !empty($HTTP_GET_VARS[POST_CAT_URL]) ) ? $HTTP_GET_VARS[POST_CAT_URL] : -1;

if( isset($HTTP_GET_VARS['mark']) || isset($HTTP_POST_VARS['mark']) )
{
	$mark_read = ( isset($HTTP_POST_VARS['mark']) ) ? $HTTP_POST_VARS['mark'] : $HTTP_GET_VARS['mark'];
}
else
{
	$mark_read = '';
}

//
// Handle marking posts
//
if( $mark_read == 'forums' )
{
	if( $userdata['session_logged_in'] )
	{
		setcookie($board_config['cookie_name'] . '_f_all', time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
	}

	$template->assign_vars(array(
		"META" => '<meta http-equiv="refresh" content="3;url='  .append_sid("index.$phpEx") . '">')
	);

	$message = $lang['Forums_marked_read'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a> ');

	message_die(GENERAL_MESSAGE, $message);
}
//
// End handle marking posts
//

$tracking_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_t"]) : array();
$tracking_forums = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f"]) : array();

//
// If you don't use these stats on your index you may want to consider
// removing them
//
$total_topics = get_db_stat('topiccount');
$total_posts = get_db_stat('postcount');
$total_users = get_db_stat('usercount');
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
$newest_uid = $newest_userdata['user_id'];

if( $total_posts == 0 )
{
	$l_total_post_s = $lang['Posted_articles_zero_total'];
}
else if( $total_posts == 1 )
{
	$l_total_post_s = $lang['Posted_article_total'];
}
else
{
	$l_total_post_s = $lang['Posted_articles_total'];
}

if( $total_users == 0 )
{
	$l_total_user_s = $lang['Registered_users_zero_total'];
}
else if( $total_users == 1 )
{
	$l_total_user_s = $lang['Registered_user_total'];
}
else
{
	$l_total_user_s = $lang['Registered_users_total'];
}


//
// Start page proper
//
$sql = "SELECT c.cat_id, c.cat_title, c.cat_order
	FROM " . CATEGORIES_TABLE . " c 
	ORDER BY c.cat_order";
if( !($result = $db->sql_query($sql, false, true)) )
{
	message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql);
}

$category_rows = array();
while ($row = $db->sql_fetchrow($result))
{
	$category_rows[] = $row;
}
$db->sql_freeresult($result);
// Begin Simple Subforums MOD
$subforums_list = array();
// End Simple Subforums MOD

if( ( $total_categories = count($category_rows) ) )
{
	//
	// Define appropriate SQL
	//
	switch(SQL_LAYER)
	{
		case 'postgresql':
			$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id 
				FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u
				WHERE p.post_id = f.forum_last_post_id 
					AND u.user_id = p.poster_id  
					UNION (
						SELECT f.*, NULL, NULL, NULL, NULL
						FROM " . FORUMS_TABLE . " f
						WHERE NOT EXISTS (
							SELECT p.post_time
							FROM " . POSTS_TABLE . " p
							WHERE p.post_id = f.forum_last_post_id  
						)
					)
					ORDER BY cat_id, forum_order";
			break;

		case 'oracle':
			$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id 
				FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u
				WHERE p.post_id = f.forum_last_post_id(+)
					AND u.user_id = p.poster_id(+)
				ORDER BY f.cat_id, f.forum_order";
			break;

		default:
			$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
				FROM (( " . FORUMS_TABLE . " f
				LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )
				LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id )
				ORDER BY f.cat_id, f.forum_order";
			break;
	}
	if ( !($result = $db->sql_query($sql, false, 'posts_')) )
	{
		message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
	}

	$forum_data = array();
	while( $row = $db->sql_fetchrow($result) )
	{
		$forum_data[] = $row;
	}
	$db->sql_freeresult($result);

	if ( !($total_forums = count($forum_data)) )
	{
		message_die(GENERAL_MESSAGE, $lang['No_forums']);
	}

	//
	// Obtain a list of topic ids which contain
	// posts made since user last visited
	//
	if ($userdata['session_logged_in'])
	{
		// 60 days limit
		if ($userdata['user_lastvisit'] < (time() - 5184000))
		{
			$userdata['user_lastvisit'] = time() - 5184000;
		}

		$sql = "SELECT t.forum_id, t.topic_id, p.post_time 
			FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p 
			WHERE p.post_id = t.topic_last_post_id 
				AND p.post_time > " . $userdata['user_lastvisit'] . " 
				AND t.topic_moved_id = 0"; 
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'Could not query new topic information', '', __LINE__, __FILE__, $sql);
		}

		$new_topic_data = array();
		while( $topic_data = $db->sql_fetchrow($result) )
		{
			$new_topic_data[$topic_data['forum_id']][$topic_data['topic_id']] = $topic_data['post_time'];
		}
		$db->sql_freeresult($result);
	}

	//
	// Obtain list of moderators of each forum
	// First users, then groups ... broken into two queries
	//
	$sql = "SELECT aa.forum_id, u.user_id, u.username 
		FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g, " . USERS_TABLE . " u
		WHERE aa.auth_mod = " . TRUE . " 
			AND g.group_single_user = 1 
			AND ug.group_id = aa.group_id 
			AND g.group_id = aa.group_id 
			AND u.user_id = ug.user_id 
		GROUP BY u.user_id, u.username, aa.forum_id 
		ORDER BY aa.forum_id, u.user_id";
	if ( !($result = $db->sql_query($sql, false, true)) )

	{
		message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql);
	}

	$forum_moderators = array();
	while( $row = $db->sql_fetchrow($result) )
	{
		$forum_moderators[$row['forum_id']][] = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '">' . $row['username'] . '</a>';
	}
	$db->sql_freeresult($result);

	$sql = "SELECT aa.forum_id, g.group_id, g.group_name 
		FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g 
		WHERE aa.auth_mod = " . TRUE . " 
			AND g.group_single_user = 0 
			AND g.group_type <> " . GROUP_HIDDEN . "
			AND ug.group_id = aa.group_id 
			AND g.group_id = aa.group_id 
		GROUP BY g.group_id, g.group_name, aa.forum_id 
		ORDER BY aa.forum_id, g.group_id";
	if ( !($result = $db->sql_query($sql, false, true)) )

	{
		message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql);
	}

	while( $row = $db->sql_fetchrow($result) )
	{
		$forum_moderators[$row['forum_id']][] = '<a href="' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=" . $row['group_id']) . '">' . $row['group_name'] . '</a>';
	}
	$db->sql_freeresult($result);

	//
	// Find which forums are visible for this user
	//
	$is_auth_ary = array();
	$is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data);
        // 
// last 5 registered users by emrag 
// 
$last_5_users = $lang['Newest_users']; 

$sql = "SELECT user_id, username, user_regdate 
FROM " . USERS_TABLE . " 
WHERE 1 
ORDER BY user_regdate DESC LIMIT 5"; 

if( !($result = $db->sql_query($sql)) ) 
{ 
message_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql); 
} 

while( $row = $db->sql_fetchrow($result) ) 
{ 
if ( $last_5_users == $lang['Newest_users'] ) 
{ 
$last_5_users .= '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><b>' . $row['username'] . '</b></a>'; 
} 
else 
{ 
$last_5_users .= ', <a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><b>' . $row['username'] . '</b></a>'; 
} 
} 
// 
// last 5 registered users by emrag 
// 
//
// Obtain new post information for marquee
// of new posts
//
//
// Get Viewable Forums
//
// function to merge two auth arrays to one
function array_merge_replace($array, $newValues)
{
  foreach ($newValues as $key => $value)
    {
    if ( is_array($value) )
    {
      if ( !isset($array[$key]) )
      {
        $array[$key] = array();
      }
      $array[$key] = array_merge_replace($array[$key], $value);
    }
    else
    {
      if ( isset($array[$key]) && is_array($array[$key]) )
      {
        $array[$key][0] = $value;
      }
      else
      {
        if ( isset($array) && !is_array($array) )
        {
          $temp = $array;
          $array = array();
          $array[0] = $temp;
        }
        $array[$key] = $value;
      }
    }
  }
  return $array;
}
$ary = array();
$ary2 = array();
$ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data);
$ary2 = auth(AUTH_READ, AUTH_LIST_ALL, $userdata, $forum_data);
$is_auth_ary = array_merge_replace($ary, $ary2);
$auth_view_forum_sql = '';
for($i = 0; $i < $total_categories; $i++)
{
  $cat_id = $category_rows[$i]['cat_id'];
  $display_forums = false;
  for($j = 0; $j < $total_forums; $j++)
  {
    if ( $is_auth_ary[$forum_data[$j]['forum_id']]['auth_view'] && $is_auth_ary[$forum_data[$j]['forum_id']]['auth_read'] && $forum_data[$j]['cat_id'] == $cat_id )
    {
      $display_forums = true;
      $auth_view_forum_sql .= ($auth_view_forum_sql == '' ? '' : ', ' ) . $forum_data[$j]['forum_id'];
    }
  }
}
$auth_view_forum_sql = ($auth_view_forum_sql == '' ? '(0)' : '(' . $auth_view_forum_sql . ')');

//
// Get The Data
//
$template->assign_vars(array(
  'MARQUEE_TOPIC' => str_replace("%s",$board_config['topics_on_index'],$lang['marquee_topic']) )
);

$sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, t.topic_type, t.topic_status, p.post_id, p.poster_id,
  p.post_time, u.user_id, u.username, u.user_lastvisit
  FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u
  WHERE t.forum_id IN " . $auth_view_forum_sql . " AND t.topic_id = p.topic_id
  AND f.forum_id = t.forum_id
  AND t.topic_status <> 2
  AND p.post_id = t.topic_last_post_id
  AND p.poster_id = u.user_id
  ORDER BY t.topic_last_post_id DESC";

if ( !($result = $db->sql_query($sql)) )
{
  message_die(GENERAL_ERROR, 'Could not query recent posts marquee information', '', __LINE__, __FILE__, $sql);
}

if ($row = $db->sql_fetchrowset($result))
{
  $db->sql_freeresult($result);
}

if( count($row) <= $board_config['topics_on_index'] )
{
  $topics = count($row);
}
else
{
  $topics = $board_config['topics_on_index'];
}

for($i = 0; $i < $topics; $i++)
{
  $mar_title = $row[$i]["topic_title"];
  $mar_url = $phpbb_root_path . 'viewtopic.'.$phpEx.'?'.POST_TOPIC_URL.'='.$row[$i]["topic_id"];
  $mar_user = $row[$i]["username"];
  if ( $row[$i]["topic_status"] == TOPIC_LOCKED )
  {
    if ( $row[$i]["post_time"] > $row[$i]["user_lastvisit"] )
    {
      $pic = $images['folder_locked_new'];
    }
    else
    {
      $pic = $images['folder_locked'];
    }
  }
  else
  {
    if ( $row[$i]["topic_type"] == POST_GLOBAL_ANNOUNCE )
    {
      if ( $row[$i]["post_time"] > $row[$i]["user_lastvisit"] )
      {
        $pic = $images['folder_global_announce_new'];
      }
      else
      {
        $pic = $images['folder_global_announce'];
      }
    }
    else if ( $row[$i]["topic_type"] == POST_ANNOUNCE )
    {
      if ( $row[$i]["post_time"] > $row[$i]["user_lastvisit"] )
      {
        $pic = $images['folder_announce_new'];
      }
      else
      {
        $pic = $images['folder_announce'];
      }
    }
    else if ( $row[$i]["topic_type"] == POST_STICKY )
    {
      if ( $row[$i]["post_time"] > $row[$i]["user_lastvisit"] )
      {
        $pic = $images['folder_sticky_new'];
      }
      else
      {
      $pic = $images['folder_sticky'];
      }
    }
    else { if ( $row[$i]["post_time"] > $userdata['user_lastvisit'] )
    {
      $pic = $images['folder_new']; }else{ $pic = $images['folder'];
    }
  }
}
$template->assign_block_vars('marqueerow', array(
  'FOLD_URL' => $pic,
  'TOPIC_TITLE' => $row[$i]["topic_title"],
  'TOPIC_URL' => append_sid($phpbb_root_path . 'viewtopic.'.$phpEx.'?'.POST_TOPIC_URL.'='.$row[$i]["topic_id"]),
  'USERNAME' => $row[$i]["username"],
  'USER_PROF' => append_sid($phpbb_root_path . 'profile.'.$phpEx.'?mode=viewprofile$amp;u='.$row[$i]["user_id"]),
  'POST_DATE' => create_date($board_config['default_dateformat'], $row[$i]["post_time"], $board_config['board_timezone']))
  );
}
// 
// last 5 registered users by emrag 
// 
$last_5_users = $lang['Newest_users']; 

$sql = "SELECT user_id, username, user_regdate 
FROM " . USERS_TABLE . " 
WHERE 1 
ORDER BY user_regdate DESC LIMIT 5"; 

if( !($result = $db->sql_query($sql)) ) 
{ 
message_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql); 
} 

while( $row = $db->sql_fetchrow($result) ) 
{ 
if ( $last_5_users == $lang['Newest_users'] ) 
{ 
$last_5_users .= '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><b>' . $row['username'] . '</b></a>'; 
} 
else 
{ 
$last_5_users .= ', <a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><b>' . $row['username'] . '</b></a>'; 
} 
} 
// 
// last 5 registered users by emrag 
// 

	//
	// Start output of page
	//
	define('SHOW_ONLINE', true);
	$page_title = $lang['Index'];
	include($phpbb_root_path . 'includes/page_header.'.$phpEx);

	$template->set_filenames(array(
		'body' => 'index_body.tpl')
	);
if ($userdata['user_id'] != '-1') 
{ 
    $welcome_name = '<a href="' . append_sid("profile.$phpEx?mode=editprofile&" . $userdata['user_id']) . '">' . $userdata['username'] . '</a>'; 
} 
else 
{ 
    $welcome_name = '<a href="' . append_sid("profile.$phpEx?mode=register&") . '">' . $lang['Guest'] . '</a>'; 
} 
        $boarddays = ( time() - $board_config['board_startdate'] ) / 86400; 
        $posts_per_day = sprintf("%.2f", $total_posts / $boarddays); 
        $topics_per_day = sprintf("%.2f", $total_topics / $boarddays); 
        $users_per_day = sprintf("%.2f", $total_users / $boarddays); 
        $posts_per_user = sprintf("%.2f", $total_posts / $total_users);
if($posts_per_day > $total_posts) 
   { 
      $posts_per_day = $total_posts; 
   } 

   if($topics_per_day > $total_topics) 
   { 
      $topics_per_day = $total_topics; 
   } 

   if($users_per_day > $total_users) 
   { 
      $users_per_day = $total_users; 
   } 

   if($posts_per_user > $total_posts) 
   { 
      $posts_per_user = $total_posts; 
   } 
//
	// Anti Robotic Login 
	if ($board_config['allow_anti_robotic_login'])
	{
		$sql = "DELETE FROM " . ANTI_ROBOT_LOGIN_TABLE . " WHERE timestamp < '" . (time() - 3600) . "' OR session_id = '" . $userdata['session_id'] . "'";
		if( !$result = $db->sql_query($sql) )
		{
				message_die(GENERAL_ERROR, 'Could not delete security code key', '', __LINE__, __FILE__, $sql);
		}

		$login_key = gen_login_key();

		$sql = "INSERT INTO ". ANTI_ROBOT_LOGIN_TABLE . " VALUES ('" . $userdata['session_id'] . "', '" . $login_key . "', '" . time() . "')";
		if( !$result = $db->sql_query($sql) )
		{
				message_die(GENERAL_ERROR, 'Could not check login information', '', __LINE__, __FILE__, $sql);
		}
	} 
	//-----------------------
	//
	$template->assign_vars(array(
      "POSTS_PER_DAY" => $posts_per_day, 
      "POSTS_PER_USER" => $posts_per_user, 
      "TOPICS_PER_DAY" => $topics_per_day, 
      "USERS_PER_DAY" => $users_per_day, 
      "TOTAL_TOPICCOUNT" => $total_topics, 
      "L_TOTAL_TOPICCOUNT" => $lang['total_topiccount'], 
      "L_POSTS_PER_DAY" => $lang['Posts_per_day'], 
      "L_TOPICS_PER_DAY" => $lang['Topics_per_day'], 
      "L_USERS_PER_DAY" => $lang['Users_per_day'], 
      "L_POSTS_PER_USER" => $lang['Posts_per_user'],
                
		'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
		'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
		/* Original phpBB code for newest user - commented out for replace last registered user with last 5 registered users 
                'NEWEST_USER' => sprintf($lang['Newest_user'], '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$newest_uid") . '">', $newest_user, '</a>'), 
                */ 
                'NEWEST_USER' => $last_5_users, 
		'FORUM_IMG' => $images['forum'],
		'FORUM_NEW_IMG' => $images['forum_new'], 
                'FORUM_LOCKED_IMG' => $images['forum_locked'], 
                'L_NAME_WELCOME' => $lang['Welcome'], 
                'U_WELCOME_NAME' => $welcome_name, 
       // Start add - Fully integrated shoutbox MOD
                'U_SHOUTBOX' => append_sid("shoutbox.$phpEx"),
                'L_SHOUTBOX' => $lang['Shoutbox'],
                'U_SHOUTBOX_MAX' => append_sid("shoutbox_max.$phpEx"),
      // End add - Fully integrated shoutbox MOD
  
		'L_FORUM' => $lang['Forum'],
      // Begin Simple Subforums MOD
                'L_SUBFORUMS' => $lang['Subforums'],
      // End Simple Subforums MOD
		'L_TOPICS' => $lang['Topics'],
		'L_REPLIES' => $lang['Replies'],
		'L_VIEWS' => $lang['Views'],
		'L_POSTS' => $lang['Posts'],
		'L_LASTPOST' => $lang['Last_Post'], 
		'L_NO_NEW_POSTS' => $lang['No_new_posts'],
		'L_NEW_POSTS' => $lang['New_posts'],
		'L_NO_NEW_POSTS_LOCKED' => $lang['No_new_posts_locked'], 
		'L_NEW_POSTS_LOCKED' => $lang['New_posts_locked'], 
		'L_ONLINE_EXPLAIN' => $lang['Online_explain'], 
		'L_MODERATOR' => $lang['Moderators'], 
		'L_FORUM_LOCKED' => $lang['Forum_is_locked'],
		'L_MARK_FORUMS_READ' => $lang['Mark_all_forums'], 

		// Anti Robotic Login
		'L_SECURITY_CODE' => $lang['Security_code'],
		'S_ANTI_ROBOT1' => append_sid('antirobot_pic_login.'.$phpEx.'?id=1'),
		'S_ANTI_ROBOT2' => append_sid('antirobot_pic_login.'.$phpEx.'?id=2'),
		'S_ANTI_ROBOT3' => append_sid('antirobot_pic_login.'.$phpEx.'?id=3'),
		'S_ANTI_ROBOT4' => append_sid('antirobot_pic_login.'.$phpEx.'?id=4'),
		'S_ANTI_ROBOT5' => append_sid('antirobot_pic_login.'.$phpEx.'?id=5'),
		'U_MARK_READ' => append_sid("index.$phpEx?mark=forums"))
	);

	//
	// Let's decide which categories we should display
	//
	$display_categories = array();

	for ($i = 0; $i < $total_forums; $i++ )
	{
		if ($is_auth_ary[$forum_data[$i]['forum_id']]['auth_view'])
		{
			$display_categories[$forum_data[$i]['cat_id']] = true;
		}
	}

	//
	// Okay, let's build the index
	//
	for($i = 0; $i < $total_categories; $i++)
	{
		$cat_id = $category_rows[$i]['cat_id'];

		//
		// Yes, we should, so first dump out the category
		// title, then, if appropriate the forum list
		//
		if (isset($display_categories[$cat_id]) && $display_categories[$cat_id])
		{
			$template->assign_block_vars('catrow', array(
				'CAT_ID' => $cat_id,
				'CAT_DESC' => $category_rows[$i]['cat_title'],
				'U_VIEWCAT' => append_sid("index.$phpEx?" . POST_CAT_URL . "=$cat_id"))
			);

			if ( $viewcat == $cat_id || $viewcat == -1 )
			{
				for($j = 0; $j < $total_forums; $j++)
				{
					if ( $forum_data[$j]['cat_id'] == $cat_id )
					{
						$forum_id = $forum_data[$j]['forum_id'];

						if ( $is_auth_ary[$forum_id]['auth_view'] )
						{
							if ( $forum_data[$j]['forum_status'] == FORUM_LOCKED )
							{
								$folder_image = $images['forum_locked']; 
								$folder_alt = $lang['Forum_locked'];
								// Begin Simple Subforums MOD
                $unread_topics = false;
                $folder_images = array(
                  'default'  => $folder_image,
                  'new'    => $images['forum_locked'],
                  'sub'    => ( isset($images['forums_locked']) ) ? $images['forums_locked'] : $images['forum_locked'],
                  'subnew'  => ( isset($images['forums_locked']) ) ? $images['forums_locked'] : $images['forum_locked'],
                  'subalt'  => $lang['Forum_locked'],
                  'subaltnew'  => $lang['Forum_locked'],
                  );
                // End Simple Subforums MOD
							}
							else
							{
								$unread_topics = false;
								if ( $userdata['session_logged_in'] )
								{
									if ( !empty($new_topic_data[$forum_id]) )
									{
										$forum_last_post_time = 0;

										while( list($check_topic_id, $check_post_time) = @each($new_topic_data[$forum_id]) )
										{
											if ( empty($tracking_topics[$check_topic_id]) )
											{
												$unread_topics = true;
												$forum_last_post_time = max($check_post_time, $forum_last_post_time);

											}
											else
											{
												if ( $tracking_topics[$check_topic_id] < $check_post_time )
												{
													$unread_topics = true;
													$forum_last_post_time = max($check_post_time, $forum_last_post_time);
												}
											}
										}

										if ( !empty($tracking_forums[$forum_id]) )
										{
											if ( $tracking_forums[$forum_id] > $forum_last_post_time )
											{
												$unread_topics = false;
											}
										}

										if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )
										{
											if ( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] > $forum_last_post_time )
											{
												$unread_topics = false;
											}
										}

									}
								}

								$folder_image = ( $unread_topics ) ? $images['forum_new'] : $images['forum']; 
								$folder_alt = ( $unread_topics ) ? $lang['New_posts'] : $lang['No_new_posts']; 
								// Begin Simple Subforums MOD
                $folder_images = array(
                  'default'  => $folder_image,
                  'new'    => $images['forum_new'],
                  'sub'    => ( isset($images['forums']) ) ? $images['forums'] : $images['forum'],
                  'subnew'  => ( isset($images['forums_new']) ) ? $images['forums_new'] : $images['forum_new'],
                  'subalt'  => $lang['No_new_posts'],
                  'subaltnew'  => $lang['New_posts'],
                  );
                // End Simple Subforums MOD
							}

							$posts = $forum_data[$j]['forum_posts'];
							$topics = $forum_data[$j]['forum_topics'];

							if ( $forum_data[$j]['forum_last_post_id'] )
							{
								$last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);

								// OLD
								// $last_post = $last_post_time . '<br />';
								//
								// MOD - TODAY AT - BEGIN
								//
								if ( $board_config['time_today'] < $forum_data[$j]['post_time'])
								{ 
									$last_post = sprintf($lang['Today_at'], create_date($board_config['default_timeformat'], $forum_data[$j]['post_time'], $board_config['board_timezone'])) . '<br />'; 
								}
								else if ( $board_config['time_yesterday'] < $forum_data[$j]['post_time'])
								{ 
									$last_post = sprintf($lang['Yesterday_at'], create_date($board_config['default_timeformat'], $forum_data[$j]['post_time'], $board_config['board_timezone'])) . '<br />'; 
								}
								else
								{ 
									$last_post = $last_post_time . '<br />'; 
								} 
								// MOD - TODAY AT - END
                                                                $sql = "SELECT DISTINCT f.forum_id, f.forum_last_post_id, p.topic_id, t.topic_title
									FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t
									WHERE t.topic_id = p.topic_id
										AND t.topic_last_post_id = " . $forum_data[$j]['forum_last_post_id'];

								if ( !($result = $db->sql_query($sql)) )
								{
									message_die(GENERAL_ERROR, 'Could not select info from post/topic table', '', __LINE__, __FILE__, $sql);
								}

								$last_topic_data = $db->sql_fetchrow($result);
								$ltid = $last_topic_data['topic_id'];
								$lttitle = $last_topic_data['topic_title'];

								// append first 25 characters of topic title to last topic data
								if (strlen($lttitle) > 25)
								{
									$last_post .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$ltid") . '">' . substr($lttitle, 0, 25) . '...</a><br />';
								}
								else
								{
									$last_post .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$ltid") . '">' . substr($lttitle, 0, 25) . '</a><br />';
								}

								$db->sql_freeresult($result);


								$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : color_group_colorize_name($forum_data[$j]['user_id']);
								
								$last_post .= '<a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';
							
							// Begin Simple Subforums MOD
                $last_post_sub = '<a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . ($unread_topics ? $images['icon_newest_reply'] : $images['icon_latest_reply']) . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';
                $last_post_time = $forum_data[$j]['post_time'];
                // End Simple Subforums MOD
							}
							else
							{
								$last_post = $lang['No_Posts'];
								// Begin Simple Subforums MOD
                $last_post_sub = '<img src="' . $images['icon_minipost'] . '" border="0" alt="' . $lang['No_Posts'] . '" title="' . $lang['No_Posts'] . '" />';
                $last_post_time = 0;
                // End Simple Subforums MOD
							}

							if ( count($forum_moderators[$forum_id]) > 0 )
							{
								$l_moderators = ( count($forum_moderators[$forum_id]) == 1 ) ? $lang['Moderator'] : $lang['Moderators'];
								$moderator_list = implode(', ', $forum_moderators[$forum_id]);
							}
							else
							{
								$l_moderators = '&nbsp;';
								$moderator_list = '';
							}

							$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
							$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

							$template->assign_block_vars('catrow.forumrow',	array(
								'ROW_COLOR' => '#' . $row_color,
								'ROW_CLASS' => $row_class,
								'FORUM_FOLDER_IMG' => $folder_image, 
								'FORUM_NAME' => $forum_data[$j]['forum_name'],
								'FORUM_DESC' => $forum_data[$j]['forum_desc'],
								'POSTS' => $forum_data[$j]['forum_posts'],
								'TOPICS' => $forum_data[$j]['forum_topics'],
								'LAST_POST' => $last_post,
								'MODERATORS' => $moderator_list,

								'L_MODERATOR' => $l_moderators, 
								'L_FORUM_FOLDER_ALT' => $folder_alt, 

// Begin Simple Subforums MOD
                'FORUM_FOLDERS' => serialize($folder_images),
                'HAS_SUBFORUMS' => 0,
                'PARENT' => $forum_data[$j]['forum_parent'],
                'ID' => $forum_data[$j]['forum_id'],
                'UNREAD' => intval($unread_topics),
                'TOTAL_UNREAD' => intval($unread_topics),
                'TOTAL_POSTS' => $forum_data[$j]['forum_posts'],
                'TOTAL_TOPICS' => $forum_data[$j]['forum_topics'],
                'LAST_POST_FORUM' => $last_post,
                'LAST_POST_TIME' => $last_post_time,
                'LAST_POST_TIME_FORUM' => $last_post_time,
                // End Simple Subforums MOD
								'U_VIEWFORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"))
							);
							// Begin Simple Subforums MOD
              if( $forum_data[$j]['forum_parent'] )
              {
                $subforums_list[] = array(
                  'forum_data'  => $forum_data[$j],
                  'folder_image'  => $folder_image,
                  'last_post'    => $last_post,
                  'last_post_sub'  => $last_post_sub,
                  'moderator_list'  => $moderator_list,
                  'unread_topics'  => $unread_topics,
                  'l_moderators'  => $l_moderators,
                  'folder_alt'  => $folder_alt,
                  'last_post_time'  => $last_post_time,
                  'desc'      => $forum_data[$j]['forum_desc'],
                  );
              }
              // End Simple Subforums MOD
						}
					}
				}
			}
		}
	} // for ... categories

}// if ... total_categories
else
{
	message_die(GENERAL_MESSAGE, $lang['No_forums']);
}
// Begin Simple Subforums MOD
unset($data);
unset($item);
unset($cat_item);
unset($row_item);
for( $i = 0; $i < count($subforums_list); $i++ )
{
  $forum_data = $subforums_list[$i]['forum_data'];
  $parent_id = $forum_data['forum_parent'];

  // Find parent item
  if( isset($template->_tpldata['catrow.']) )
  {
    $data = &$template->_tpldata['catrow.'];
    $count = count($data);
    for( $j = 0; $j < $count; $j++)
    {
      $cat_item = &$data[$j];
      $row_item = &$cat_item['forumrow.'];
      $count2 = count($row_item);
      for( $k = 0; $k < $count2; $k++)
      {
        if( $row_item[$k]['ID'] == $parent_id )
        {
          $item = &$row_item[$k];
          break;
        }
      }
      if( isset($item) )
      {
        break;
      }
    }
  }

  if( isset($item) )
  {
    if( isset($item['sub.']) )
    {
      $num = count($item['sub.']);
      $data = &$item['sub.'];
    }
    else
    {
      $num = 0;
      $item[] = 'sub.';
      $data = &$item['sub.'];
    }

    // Append new entry
    $data[] = array(
      'NUM' => $num,
      'FORUM_FOLDER_IMG' => $subforums_list[$i]['folder_image'],
      'FORUM_NAME' => $forum_data['forum_name'],
      'FORUM_DESC' => $forum_data['forum_desc'],
      'FORUM_DESC_HTML' => htmlspecialchars(preg_replace('@<[\/\!]*?[^<>]*?>@si', '', $forum_data['forum_desc'])),
      'POSTS' => $forum_data['forum_posts'],
      'TOPICS' => $forum_data['forum_topics'],
      'LAST_POST' => $subforums_list[$i]['last_post'],
      'LAST_POST_SUB' => $subforums_list[$i]['last_post_sub'],
      'LAST_TOPIC' => $forum_data['topic_title'],
      'MODERATORS' => $subforums_list[$i]['moderator_list'],
      'PARENT' => $forum_data['forum_parent'],
      'ID' => $forum_data['forum_id'],
      'UNREAD' => intval($subforums_list[$i]['unread_topics']),

      'L_MODERATOR' => $subforums_list[$i]['l_moderators'],
      'L_FORUM_FOLDER_ALT' => $subforums_list[$i]['folder_alt'],

      'U_VIEWFORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $forum_data['forum_id'])
    );
    $item['HAS_SUBFORUMS'] ++;
    $item['TOTAL_UNREAD'] += intval($subforums_list[$i]['unread_topics']);
    // Change folder image
    $images = unserialize($item['FORUM_FOLDERS']);
    $item['FORUM_FOLDER_IMG'] = $item['TOTAL_UNREAD'] ? $images['subnew'] : $images['sub'];
    $item['L_FORUM_FOLDER_ALT'] = $item['TOTAL_UNREAD'] ? $images['subaltnew'] : $images['subalt'];
    // Check last post
    if( $item['LAST_POST_TIME'] < $subforums_list[$i]['last_post_time'] )
    {
      $item['LAST_POST'] = $subforums_list[$i]['last_post'];
      $item['LAST_POST_TIME'] = $subforums_list[$i]['last_post_time'];
    }
    if( !$item['LAST_POST_TIME_FORUM'] )
    {
      $item['LAST_POST_FORUM'] = $item['LAST_POST'];
    }
    // Add topics/posts
    $item['TOTAL_POSTS'] += $forum_data['forum_posts'];
    $item['TOTAL_TOPICS'] += $forum_data['forum_topics'];
  }
  unset($item);
  unset($data);
  unset($cat_item);
  unset($row_item);
}
// End Simple Subforums MOD
//
// Generate the page
//
$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>
[/quote]


arkadaşim ayni sorun bendede kaynaklandi direkman websitesinden kopyaladiğin kod'u eğer WordPad'a atarsan öyle sorunlar yapiyor karakterler karişiyor ama ilk baş Not Defterine kopyaliyip daha sonra wordPad'e atarsan hiç bir sorun olmuyor

başarilar.
aykarama
Kayıtlı Kullanıcı
Mesajlar: 253
Kayıt: 18.05.2006, 01:39
İletişim:

Mesaj gönderen aykarama »

yok kardeş bu ilk başta sorunsuz çalışıyorsu ama diğer modlar kurulunca kabul etmedi herhalde bir modla çakışıyor tam anlayamadım yinede sağoılun
Kullanıcı avatarı
MeQueR
Kayıtlı Kullanıcı
Mesajlar: 203
Kayıt: 28.07.2006, 00:22
Konum: Türkiye

Mesaj gönderen MeQueR »

phpbbturkey den aldığınız kodları wordpadde yapıştıracaksanız şu yolu izleyin

1-kodu kopyalayın

2-yapıştırın gerekli yere

3-eğer yapıştırdığınızda başında Ççö bilmemne gibi bikaç harf varsa bunları silin yoksa devam edin

4- ctrl+A yapın yazı tipinden courier new i yazı tipi boyutundan da 0 u seçin öyle kapatın



re5pect :wink:
Bu mesaj değiştirilmemiştir.... ayrıntılı bilgi için istediğiniz numarayı çevirin :) ..

NOT: cupranın numarasını çevirirseniz mesuliyet kabul edilmez :roll:

beklediğiniz gibi gelmedim ama olsun :P
Kullanıcı avatarı
kemal008
Kayıtlı Kullanıcı
Mesajlar: 52
Kayıt: 31.07.2006, 17:11
Konum: izmir
İletişim:

Mesaj gönderen kemal008 »

bende şu hatayı veriyor...

Parse error: syntax error, unexpected '[' in /usr/export/www/vhosts/funnetwork/hosting/siir/phpBB2/language/lang_turkish/lang_main.php on line 748
Kullanıcı avatarı
kemal008
Kayıtlı Kullanıcı
Mesajlar: 52
Kayıt: 31.07.2006, 17:11
Konum: izmir
İletişim:

Mesaj gönderen kemal008 »

neyse hallettim türkçekarakter yüzündenmiş... 8)
Kullanıcı avatarı
MUSA21
Kayıtlı Kullanıcı
Mesajlar: 20
Kayıt: 01.08.2006, 02:28
İletişim:

son mesaj

Mesaj gönderen MUSA21 »

selam arkadaslar bu islerde yeniyim ama vermis oldugunuz modlari ekledim boyle bir hata verdi acaba nerden duzeltebilirim bu hatayi forumu eski haline dondurdum ama bu modlari kurmak istiyorum simdiden tesekkurler


Could not retrieve recent topics

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND f.forum_id = t.forum_id ORDER BY topic_last_post_id DESC LIMIT 0,5' at line 3

SELECT t.topic_id, t.topic_title, t.topic_replies, t.topic_views, t.topic_last_post_id FROM phpbb_topics t, phpbb_forums f WHERE t.forum_id IN () AND f.forum_id = t.forum_id ORDER BY topic_last_post_id DESC LIMIT 0,5

Line : 354
File : index.php
Kilitli

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

Kimler çevrimiçi

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