vBulletin Style Latest Post - Easy Sub-Forums MOD Cakismasi?

phpBB 2.0.x sürümleri için MODlar hakkında ihtiyacınız olan desteği buradan sorarak alabilirsiniz.
Kilitli
Kullanıcı avatarı
EsKiYa
Kayıtlı Kullanıcı
Mesajlar: 34
Kayıt: 04.10.2006, 19:57
Konum: Ankara
İletişim:

vBulletin Style Latest Post - Easy Sub-Forums MOD Cakismasi?

Mesaj gönderen EsKiYa »

forumumda Easy Sub-Forums MOD kurulu ve ben vBulletin Style Latest Post modunu kurdum çalıştı fakat alt forumları görmüyo aslında gösterio ama tıkladımı gitmiyo forum altındaki ilk msj gidiyo yardım lütfen

basit bişeye benziyo ama kimse yapamıyo index burda lütfen yardım

Kod: Tümünü seç

<?php
//-- mod : Avatar on index -------------------------------------------------------------------------
/***************************************************************************
 *                                index.php
 *                            -------------------
 *   begin                : Saturday, Feb 13, 2001
 *   copyright            : (C) 2001 The phpBB Group
 *   email                : support@phpbb.com
 *
 *   $Id: index.php,v 1.99.2.6 2005/10/30 15:17:13 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);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//

$forum_id = ( isset($HTTP_POST_VARS[POST_FORUM_URL]) ) ? intval($HTTP_POST_VARS[POST_FORUM_URL]) : intval($HTTP_GET_VARS[POST_FORUM_URL]);
$forum_link = ( isset($HTTP_POST_VARS['forum_link']) ) ? intval($HTTP_POST_VARS['forum_link']) : intval($HTTP_GET_VARS['forum_link']);

if ( $forum_link == 1 && $forum_id != 0 )
{
	$sql = "UPDATE " . FORUMS_TABLE . "
		SET forum_link_count = forum_link_count + 1
		WHERE forum_id = $forum_id";
	if ( !$db->sql_query($sql) )
	{
		message_die(GENERAL_ERROR, 'Could not update link counter', '', __LINE__, __FILE__, $sql);
	}

	$sql = "SELECT weblink FROM " . FORUMS_TABLE . "
		WHERE forum_id = $forum_id";
	if ( !$result = $db->sql_query($sql) )
	{
		message_die(GENERAL_ERROR, 'Could not read forum weblink', '', __LINE__, __FILE__, $sql);
	}

	while ( $row = $db->sql_fetchrow($result) )
	{
		$forum_weblink = $row['weblink'];
	}

	header("Location: ".$forum_weblink);
	exit;
}

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_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'];
}

if ( $board_config['global_enable']== 1  && $board_config['marquee_disable']== 0  ) 
{ 
   $template->assign_block_vars('switch_disable_global_marquee', array()); 
} 
else if ( $board_config['global_enable']== 1  &&  $board_config['marquee_disable']== 1  ) 
{ 
   $template->assign_block_vars('switch_enable_global_marquee', array()); 
} 

//
// 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)) )
{
	message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql);
}

$category_rows = array();
while( $category_rows[] = $db->sql_fetchrow($result) );
$db->sql_freeresult($result);

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:
   // Modified by Easy Sub-Forums MOD

			$sql = "SELECT f.*, p.post_time, p.post_username,  u.username, u.user_id, t.topic_id, t.topic_title
				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 )
				LEFT JOIN " . TOPICS_TABLE . " t ON t.topic_last_post_id = f.forum_last_post_id)
				GROUP BY f.forum_id ORDER BY f.cat_id, f.forum_order";
   // END Modified by Easy Sub-Forums MOD
			break;
	}
*/
   
   /**
    * MOD: vBulletin Style Latest Post
    *
    * @package      phpbb
    * @subpackage   vb_style_last_post
    * @author      Dean Newman <webmaster@auscoder.com>
    * @link      http://phpbbmodders.org/viewtopic.php?t=758
    */
   switch(SQL_LAYER)
   {
      case 'postgresql':
         $sql = "SELECT f.*, t.topic_id, t.topic_title, p.post_time, p.post_username, u.username, u.user_id
            FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u
            WHERE p.post_id = f.forum_last_post_id
               AND t.topic_id = p.topic_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.*, t.topic_id, t.topic_title, p.post_time, p.post_username, u.username, u.user_id
            FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u
            WHERE p.post_id = f.forum_last_post_id(+)
               AND t.topic_id = p.topic_id(+)
               AND u.user_id = p.poster_id(+)
            ORDER BY f.cat_id, f.forum_order";
         break;

      default:
         $sql = "SELECT f.*, t.topic_id, t.topic_title, 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 " . TOPICS_TABLE . " t ON t.topic_id = p.topic_id )
            LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id )
            ORDER BY f.cat_id, f.forum_order";
         break;
   }

   //
   // Define censored words
   //
   $orig_word = array();
   $replacement_word = array();
   obtain_word_list($orig_word, $replacement_word);
   
   /**
    * END ADD
    */
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
	}

	$forum_data = array();
	while( $row = $db->sql_fetchrow($result) )
	{
		$forum_data[] = $row;
	}
   // Added by Easy Sub-Forums MOD
	
	$attach=$forum_data;
   // END Added by Easy Sub-Forums MOD
	$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)) )
	{
		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)) )
	{
		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);

// 
// 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']))
	); 
} 

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

//-- mod : Avatar on index -------------------------------------------------------------------------
//-- add
	if( $userdata['session_logged_in'] )
	{
		$sql = "SELECT u.user_avatar, u.user_avatar_type, u.user_id, u.user_allowavatar, u.username
			FROM " . USERS_TABLE . " u
			WHERE u.user_id = " . $userdata['user_id'] ;
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'Could not query user information', '', __LINE__, __FILE__, $sql);
		}
			$avatarrow = $db->sql_fetchrow($result);

		if ( $avatarrow['user_avatar_type'] && $userdata['user_id'] != ANONYMOUS && $avatarrow['user_allowavatar'] )
		{
			switch( $avatarrow['user_avatar_type'] )
			{
				case USER_AVATAR_UPLOAD:
					$user_avatar = ( $board_config['allow_avatar_upload'] ) ? $board_config['avatar_path'] . '/' . $avatarrow['user_avatar'] : '';
					break;
				case USER_AVATAR_REMOTE:
					$user_avatar = ( $board_config['allow_avatar_remote'] ) ? $avatarrow['user_avatar'] : '';
					break;
				case USER_AVATAR_GALLERY:
					$user_avatar = ( $board_config['allow_avatar_local'] ) ? $board_config['avatar_gallery_path'] . '/' . $avatarrow['user_avatar'] : '';
					break;
			}
			$user_avatar = '<a href="' . append_sid($phpbb_root_path.'search.'.$phpEx.'?search_id=egosearch') .
					'"><img src="' . $user_avatar . '" alt="' . $avatarrow['username'] . '" border="0" /></a><br>';
		}
		$user_name = '<a href="' . append_sid($phpbb_root_path.'profile.'.$phpEx.'?mode=editprofile') .
				'"><b>' . $avatarrow['username'] . '</b></a>';

		$sql = "SELECT COUNT(post_id) as tot
			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);
			$user_newposts = '<a href="' . append_sid($phpbb_root_path.'search.'.$phpEx.'?search_id=newposts') .
						'" class="gensmall">' . $lang['Search_new'] . ' (' . $row['tot'] .')</a>';
		}
	}
	else
	{
		$user_avatar = '';
	}
//-- end : Avatar on index -------------------------------------------------------------------------

	$template->set_filenames(array(
		'body' => 'index_body.tpl')
	);
// Shoutbox mod
	$shoutbox_config['banned_user_id_view'] = $GLOBALS['shoutbox_config']['banned_user_id_view'];
	if( strstr($shoutbox_config['banned_user_id_view'], ',') )
	{
		$fids = explode(',', $shoutbox_config['banned_user_id_view']);
	while( list($foo, $id) = each($fids) )
		{
			$fid[] = intval( trim($id) );
		}
	}
	else
	{
		$fid[] = intval( trim($shoutbox_config['banned_user_id_view']) );
	}
	reset($fid);

	if ( $shoutbox_config['shoutbox_on'] && in_array($userdata['user_id'], $fid) == false )
	{
		include($phpbb_root_path . 'shoutbox_body.'.$phpEx);
	}

	$template->assign_vars(array(
//
// START MOD: TOP 'X' USERS (AbelaJohnB)
//
// PLEASE SEE THE INSTALL FILE FOR FURTHER INFORMATION ON WHAT TO DISPLAY AND HOW MANY TO DISPLAY.
//
'TOP_POSTERS' => top_posters('10', 1, 1), // Replace This Line If You Want Alternative Settings Displayed
'L_TOP_POSTERS' => $lang['Top_Posters'],
//
// END MOD: TOP 'X' USERS (AbelaJohnB)
//
		'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
		'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
		'NEWEST_USER' => sprintf($lang['Newest_user'], '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$newest_uid") . '">', $newest_user, '</a>'), 

//+MOD: DHTML Collapsible Forum Index MOD
		'U_CFI_JSLIB'			=> $phpbb_root_path . 'templates/collapsible_forum_index.js',
		'CFI_COOKIE_NAME'		=> get_cfi_cookie_name(),
		'COOKIE_PATH'			=> $board_config['cookie_path'],
		'COOKIE_DOMAIN'			=> $board_config['cookie_domain'],
		'COOKIE_SECURE'			=> $board_config['cookie_secure'],
		'L_CFI_OPTIONS'			=> str_replace(array("'",' '), array("\'",'&nbsp;'), $lang['CFI_options']),
		'L_CFI_OPTIONS_EX'		=> str_replace(array("'",' '), array("\'",'&nbsp;'), $lang['CFI_options_ex']),
		'L_CFI_CLOSE'			=> str_replace(array("'",' '), array("\'",'&nbsp;'), $lang['CFI_close']),
		'L_CFI_DELETE'			=> str_replace(array("'",' '), array("\'",'&nbsp;'), $lang['CFI_delete']),
		'L_CFI_RESTORE'			=> str_replace(array("'",' '), array("\'",'&nbsp;'), $lang['CFI_restore']),
		'L_CFI_SAVE'			=> str_replace(array("'",' '), array("\'",'&nbsp;'), $lang['CFI_save']),
		'L_CFI_EXPAND_ALL'		=> str_replace(array("'",' '), array("\'",'&nbsp;'), $lang['CFI_Expand_all']),
		'L_CFI_COLLAPSE_ALL'	=> str_replace(array("'",' '), array("\'",'&nbsp;'), $lang['CFI_Collapse_all']),
		'IMG_UP_ARROW'			=> $phpbb_root_path . $images['up_arrow'],
		'IMG_DW_ARROW'			=> $phpbb_root_path . $images['down_arrow'],
		'IMG_PLUS'				=> $phpbb_root_path . $images['icon_sign_plus'],
		'IMG_MINUS'				=> $phpbb_root_path . $images['icon_sign_minus'],
		'SPACER'				=> $phpbb_root_path . 'images/spacer.gif',
//-MOD: DHTML Collapsible Forum Index MOD

'GLOBAL_TITLE' => $board_config['global_title'], 
      'GLOBAL_ANNOUNCEMENT' => str_replace(array('<br />', '<br>'), "", $board_config['global_announcement']),

		'FORUM_IMG' => $images['forum'],
		'FORUM_NEW_IMG' => $images['forum_new'],
		'FORUM_LOCKED_IMG' => $images['forum_locked'],
//-- mod : Avatar on index -------------------------------------------------------------------------
//-- add
		'USER_AVATAR' => $user_avatar,
		'USER_NAME' => $user_name,
		'USER_NEWPOSTS' => $user_newposts,
//-- end : Avatar on index -------------------------------------------------------------------------

		'L_FORUM' => $lang['Forum'],
		'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'], 
/**
       * MOD: vBulletin Style Latest Post
       *
       * @package      phpbb
       * @subpackage   vb_style_last_post
       * @author      Dean Newman <webmaster@auscoder.com>
       * @link      http://phpbbmodders.org/viewtopic.php?t=758
       */
      'L_BY' => $lang['By'],
      'L_NO_POSTS' => $lang['No_Posts'],

      /**
       * END ADD
       */

		'L_MODERATOR' => $lang['Moderators'], 
		'L_FORUM_LOCKED' => $lang['Forum_is_locked'],
		'L_MARK_FORUMS_READ' => $lang['Mark_all_forums'], 

		'U_MARK_READ' => append_sid("index.$phpEx?mark=forums"))
	);

//------------------------------------------------------------------------ 
// 
// Get forum auth information to insure privacy of hidden topics 
$topics_auth = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata); 
$topics_auth_sql = ''; 
foreach($topics_auth as $k=>$v) 
{ 
if( $v['auth_view'] && $v['auth_read'] ) 
{ 
$topics_auth_sql .= (( empty($topics_auth_sql) ) ? '': ', ') . $k; 
} 
} 
// 
// Okay, let's build the topic recent and popular 
// 
$active_topics_sql = 'SELECT t.topic_id, t.topic_title, t.topic_replies, t.topic_views, t.topic_last_post_id 
FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE. ' f 
WHERE t.forum_id IN (' . $topics_auth_sql . ') 
AND f.forum_id = t.forum_id 
ORDER BY %1$s DESC 
LIMIT 0,10'; 
$active_topics_sql_a = sprintf($active_topics_sql, 'topic_last_post_id'); 
$active_topics_sql_b = sprintf($active_topics_sql, 'topic_replies'); 
$active_topics_sql_c = sprintf($active_topics_sql, 'topic_views'); 
$recent_row = $popular_row = $viewed_row = array(); 

if( !$active_topics_a = $db->sql_query($active_topics_sql_a)) 
{ 
message_die(GENERAL_ERROR, 'Could not retrieve recent topics', '', __LINE__, __FILE__, $active_topics_sql_a); 
} 
$recent_row = $db->sql_fetchrowset($active_topics_a); 
$db->sql_freeresult($active_topics_a); 

if( !$active_topics_b = $db->sql_query($active_topics_sql_b)) 
{ 
message_die(GENERAL_ERROR, 'Could not retrieve popular topics', '', __LINE__, __FILE__, $active_topics_sql_b); 
} 
$popular_row = $db->sql_fetchrowset($active_topics_b); 
$db->sql_freeresult($active_topics_b); 

if( !$active_topics_c = $db->sql_query($active_topics_sql_c)) 
{ 
message_die(GENERAL_ERROR, 'Could not retrieve most viewed topics', '', __LINE__, __FILE__, $active_topics_sql_c); 
} 
$viewed_row = $db->sql_fetchrowset($active_topics_c); 
$db->sql_freeresult($active_topics_c); 

$template->assign_vars(array( 
'L_TOPICSRECENT' => $lang['TopicsRecent'], 
'L_TOPICSPOPULAR' => $lang['TopicsPopular'], 
'L_TOPICSPOPULARVIEW' => $lang['TopicsPopularView']) 
); 

for( $i = 0; $i < 10; $i++ ) 
{ 
$recent_topic_title = $recent_row[$i]['topic_title']; 
$popular_topic_title = $popular_row[$i]['topic_title']; 
$viewed_topic_title = $viewed_row[$i]['topic_title']; 

if( strlen($recent_topic_title) > 40 ) 
{ 
$recent_topic_title = substr($recent_topic_title, 0, 40) . '...'; 
} 

if( strlen($popular_topic_title) > 40 ) 
{ 
$popular_topic_title = substr($popular_topic_title, 0, 40) . '...'; 
} 

if( strlen($viewed_topic_title) > 40 ) 
{ 
$viewed_topic_title = substr($viewed_topic_title, 0, 40) . '...'; 
} 

$recent_post = '<a href="viewtopic.php?' . POST_TOPIC_URL . '=' . $recent_row[$i]['topic_id'] . '" title="' . $recent_row[$i]['topic_title'] . '">' . $recent_topic_title . '</a>'; 
$popular_post = '<a href="viewtopic.php?' . POST_TOPIC_URL . '=' . $popular_row[$i]['topic_id'] . '" title="' . $popular_row[$i]['topic_title'] . '">' . $popular_topic_title . '</a>'; 
$popular_total_replies = $popular_row[$i]['topic_replies']; 
$viewed_post = '<a href="viewtopic.php?' . POST_TOPIC_URL . '=' . $viewed_row[$i]['topic_id'] . '" title="' . $viewed_row[$i]['topic_title'] . '">' . $viewed_topic_title . '</a>'; 
$viewed_total_replies = $viewed_row[$i]['topic_views']; 

$template->assign_block_vars('topicrecentpopular', array( 
'TOPICSPOPULAR' => $popular_post, 
'TOPICSPOPULARC' => $popular_total_replies, 
'TOPICSPOPULARVIEW' => $viewed_post, 
'TOPICSPOPULARVIEWC' => $viewed_total_replies, 
'TOPICSRECENT' => $recent_post) 
); 
} 
// 
//------------------------------------------------------------------------ 	

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

		//
		// Should we display this category/forum set?
		//
		$display_forums = false;
		for($j = 0; $j < $total_forums; $j++)
		{
			if ( $is_auth_ary[$forum_data[$j]['forum_id']]['auth_view'] && $forum_data[$j]['cat_id'] == $cat_id )
			{
				$display_forums = true;
			}
		}

		//
		// Yes, we should, so first dump out the category
		// title, then, if appropriate the forum list
		//
		if ( $display_forums )
		{
			$template->assign_block_vars('catrow', array(
//+MOD: DHTML Collapsible Forum Index MOD
				'DISPLAY' => (is_category_collapsed($cat_id) ? '' : 'none'),
//-MOD: DHTML Collapsible Forum Index MOD
				'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'];

   // Added by Easy Sub-Forums MOD

   $attached_id = $forum_data[$j]['attached_forum_id'];
						if ( $is_auth_ary[$forum_id]['auth_view'] && $attached_id == -1 )
						{
							$attached_forums = array();
							foreach ($attach as $key => $value)
							{
								$sub_forum_id = $value['forum_id'];
								if ($value['attached_forum_id']==$forum_id && $is_auth_ary[$sub_forum_id]['auth_view'])
								{
									//combining topic and post count for forum and subforums
									$forum_data[$j]['forum_posts']=$forum_data[$j]['forum_posts']+$value['forum_posts'];
									$forum_data[$j]['forum_topics']=$forum_data[$j]['forum_topics']+$value['forum_topics'];
									//END combining topic and post count

									//Last post link - check if any of subforums have newest posts and link to them instead
									if ($value['post_time']>$forum_data[$j]['post_time'])
									{
										$forum_data[$j]['user_id'] = $value['user_id'];
										$forum_data[$j]['post_username'] = $value['post_username'];
										$forum_data[$j]['forum_last_post_id'] = $value['forum_last_post_id'];
										$forum_data[$j]['post_time'] = $value['post_time'];
										$forum_data[$j]['username'] = $value['username'];
										$forum_data[$j]['topic_title'] = $value['topic_title'];
									}
									// END last post check

									$unread_topics = false;
									if ( $userdata['session_logged_in'] )
									{
										if (check_unread($value['forum_id']))
										{
											$attach_img = $images['icon_minipost_new'];
											$l_attach_img = $lang['New_posts'];
										}
										else
										{
											$attach_img = $images['icon_minipost'];
											$l_attach_img = $lang['No_new_posts'];
										}
									}
									else
									{
										$attach_img = $images['icon_minipost'];
										$l_attach_img = $lang['No_new_posts'];
									}

									$attached_forums[] = array(
										'sub_img'=>$attach_img,
										'sub_alt'=>$l_attach_img,
										'sub_name'=>$value['forum_name'],
										'sub_url'=>append_sid ('viewforum.php?f=' . $value['forum_id'] )
										);
								}
							}
							
// END Added by Easy Sub-Forums MOD

						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'];
							}
							else
							{
								$unread_topics = false;
								if ( $userdata['session_logged_in'] )
								{
   // Added by Easy Sub-Forums MOD
$unread_topics=check_unread($forum_id);
   // END Added by Easy Sub-Forums MOD
								}

								$folder_image = ( $unread_topics ) ? $images['forum_new'] : $images['forum']; 
								$folder_alt = ( $unread_topics ) ? $lang['New_posts'] : $lang['No_new_posts']; 
							}

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

							if ( $forum_data[$j]['forum_last_post_id'] )
							{
   // Modified by Easy Sub-Forums MOD

								if (strlen($forum_data[$j]['topic_title'])>=25)
								{
									$forum_data[$j]['topic_title']=substr($forum_data[$j]['topic_title'],0,25). "...";
								}

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

								$last_post = '' . $last_post_time . '' . '<br />';
								
								$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '='  . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> <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>';
   // END Modified by Easy Sub-Forums MOD
							}
							else
							{
								$last_post = $lang['No_Posts'];
							}
/**
                      * MOD: vBulletin Style Latest Post
                      *
                      * @package      phpbb
                      * @subpackage   vb_style_last_post
                      * @author      Dean Newman <webmaster@auscoder.com>
                      * @link      http://phpbbmodders.org/viewtopic.php?t=758
                      */
                     $last_post_icon = $last_post_link = $last_post_time = $last_post_user = '';
                     if ( $forum_data[$j]['forum_last_post_id'] )
                     {
                        $topic_title   = ( strlen($forum_data[$j]['topic_title']) > 30 ) ? substr($forum_data[$j]['topic_title'], 0, 30) . '...' : $forum_data[$j]['topic_title'];
                        $last_post_time   = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);
                        $last_post_user   = ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '='  . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a>';
                        $last_post_icon   = '<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>';
                        $last_post_link   = '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $forum_data[$j]['topic_id']) . '" class="topictitle">' . ( ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_title) : $topic_title ) . '</a>';
                     }

                     /**
                      * END 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
							{
   // Modified by Easy Sub-Forums MOD

								$l_moderators = '';
								$moderator_list = '';
   // END Modified by Easy Sub-Forums MOD
							}

							$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(
//+MOD: DHTML Collapsible Forum Index MOD
								'FORUM_ID' => $forum_id,
								'DISPLAY' => (is_category_collapsed($cat_id) ? 'none' : ''),
//-MOD: DHTML Collapsible Forum Index MOD
								'ROW_COLOR' => '#' . $row_color,
								'ROW_CLASS' => $row_class,
								'FORUM_FOLDER_IMG' => ( $forum_data[$j]['title_is_link'] == 1 && $forum_data[$j]['forum_link_icon'] != '' ) ? $forum_data[$j]['forum_link_icon'] : $folder_image,
								'FORUM_LINK_COUNT' => ( $forum_data[$j]['title_is_link'] == 1 ) ? sprintf($lang['Forum_link_count'], $forum_data[$j]['forum_link_count']) : '', 
								'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,

                        /**
                         * MOD: vBulletin Style Latest Post
                         *
                         * @package      phpbb
                         * @subpackage   vb_style_last_post
                         * @author      Dean Newman <webmaster@auscoder.com>
                         * @link      http://phpbbmodders.org/viewtopic.php?t=758
                         */
                        'LASTPOST_TIME' => $last_post_time,
                        'LASTPOST_USER' => $last_post_user,
                        'LASTPOST_ICON' => $last_post_icon,
                        'LASTPOST_LINK' => $last_post_link,

                        /**
                         * END ADD
                         */
								'MODERATORS' => $moderator_list,

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

								'U_VIEWFORUM' => ( $forum_data[$j]['title_is_link'] == 1 ) ? append_sid("index.$phpEx?" . POST_FORUM_URL . "=$forum_id&forum_link=1") : append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"))

							);
 /**
                      * MOD: vBulletin Style Latest Post
                      *
                      * @package      phpbb
                      * @subpackage   vb_style_last_post
                      * @author      Dean Newman <webmaster@auscoder.com>
                      * @link      http://phpbbmodders.org/viewtopic.php?t=758
                      */
                     $template->assign_block_vars('catrow.forumrow.switch_lastpost' . ( ( $forum_data[$j]['forum_last_post_id'] ) ? '' : '_else' ), array());

                     /**
                      * END ADD
                      */

							if ( $forum_data[$j]['title_is_link'] == 1 )
							{
								$template->assign_block_vars('catrow.forumrow.switch_forum_link_on', array());
							}
							else
							{
								$template->assign_block_vars('catrow.forumrow.switch_forum_link_off', array());
							}
   // Added by Easy Sub-Forums MOD
                     $attached_forum_count = count($attached_forums);
                     if($attached_forum_count)
                     {
                       
					   $template->assign_block_vars('catrow.forumrow.switch_attached_forums', array(
                        'L_ATTACHED_FORUMS' => ($attached_forum_count ==1)? $lang['Attached_forum']: $lang['Attached_forums']
						));
						if (count($forum_moderators[$forum_id]) > 0 )
						{
						   $template->assign_block_vars('catrow.forumrow.switch_attached_forums.br', array());
						}
                        for($k = 0; $k < $attached_forum_count; $k++)
                        {
                           $template->assign_block_vars('catrow.forumrow.switch_attached_forums.attached_forums', array(
                              'FORUM_IMAGE' => $attached_forums[$k]['sub_img'],
                              'FORUM_NAME' => $attached_forums[$k]['sub_name'],
                              'L_FORUM_IMAGE' => $attached_forums[$k]['sub_alt'],
                              'U_VIEWFORUM' => $attached_forums[$k]['sub_url']
                           ));

                        }
                     }
   // END added by Easy Sub-Forums MOD
						}
					}
				}
			}
		}
	} // for ... categories
}

}// if ... total_categories
else
{
	message_die(GENERAL_MESSAGE, $lang['No_forums']);
}

//
// Generate the page
//
$template->pparse('body');

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

?>
http://www.kanka-m.com Banner Link Takas Yapılı
00.04.2007 Tam anlamı ile http://www.hepsikorsan.net olarak açtık ve 01.01.2008 isim değiştirdik hala phpbb3 gecemedik :S
06.10.2007 Pagerank 2 Toplam Toplam üye sayısı: 2645
msn : ferhats102@hotmail.com
Kilitli

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

Kimler çevrimiçi

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