Simple subforums - problem

Jeśli masz problem z nie autoryzowaną modyfikacją, nie możesz jej zainstalować lub występują błędy po jej instalacji to pisz w tym dziale.
pcw291
Posty: 47
Rejestracja: 14 sierpnia 2008, 19:29

Simple subforums - problem

Post autor: pcw291 » 31 października 2008, 22:22

Witam

Dziś instalowałem modyfikację simple subforums, mam jednak problem z wyświetlaniem działów, otóz na stronie głównej wygląda to tak:
Obrazek
Dział subfora powinien być "przyklejony" pod dział "test mod", jednak jest jakby osobnym forum, chociaz ikonka "+" jest dodana do głównego działu.

W środku, wygląda wszystko tak jak powinno, podejrzewam więc, że problem jest z plikiem index_body.tpl, mam rację?

Obrazek

Awatar użytkownika
daroPL
Zasłużony
Posty: 4564
Rejestracja: 24 czerwca 2005, 13:36
Lokalizacja: Poznań
Kontakt:

Re: Simple subforums - problem

Post autor: daroPL » 01 listopada 2008, 00:02

Przeanalizuj jak wykonałeś instrukcję dla pliku index.php.

pcw291
Posty: 47
Rejestracja: 14 sierpnia 2008, 19:29

Re: Simple subforums - problem

Post autor: pcw291 » 01 listopada 2008, 10:01

OK, wiem z czym jest problem, nie mogę znaleźć kodu:

Kod: Zaznacz cały


$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>';
Gdybyś mógł spojrzeć, tutaj plik index.php, a tutaj instrukcja dla tego pliku.

Kod: Zaznacz cały

#
#-----[ OPEN ]------------------------------------------
#
index.php


#
#-----[ FIND ]------------------------------------------
#
while ($row = $db->sql_fetchrow($result))
{
	$category_rows[] = $row;
}
$db->sql_freeresult($result);


#
#-----[ AFTER, ADD ]------------------------------------------
#

// Begin Simple Subforums MOD
$subforums_list = array();
// End Simple Subforums MOD


#
#-----[ FIND ]------------------------------------------
#
		'L_FORUM' => $lang['Forum'],

	
#
#-----[ AFTER, ADD ]------------------------------------------
#

		// Begin Simple Subforums MOD
		'L_SUBFORUMS' => $lang['Subforums'],
		// End Simple Subforums MOD

	
#
#-----[ FIND ]------------------------------------------
#
								$folder_image = $images['forum_locked']; 
								$folder_alt = $lang['Forum_locked'];

	
#
#-----[ AFTER, ADD ]------------------------------------------
#	

								// 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


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


#
#-----[ AFTER, ADD ]------------------------------------------
#	

								// 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


#
#-----[ FIND ]------------------------------------------
#
								$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>';


#
#-----[ AFTER, ADD ]------------------------------------------
#

								// 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


#
#-----[ FIND ]------------------------------------------
#
								$last_post = $lang['No_Posts'];


#
#-----[ AFTER, ADD ]------------------------------------------
#

								// 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


#
#-----[ FIND ]------------------------------------------
#
								$moderator_list = '&nbsp;';


#
#-----[ IN-LINE FIND ]------------------------------------------
#
'&nbsp;';


#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
'';


#
#-----[ FIND ]------------------------------------------
#
								'L_FORUM_FOLDER_ALT' => $folder_alt, 


#
#-----[ AFTER, ADD ]------------------------------------------
#

								// 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


#
#-----[ FIND ]------------------------------------------
#
								'U_VIEWFORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"))
							);


#
#-----[ AFTER, ADD ]------------------------------------------
#

							// 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


#
#-----[ FIND ]------------------------------------------
#
else
{
	message_die(GENERAL_MESSAGE, $lang['No_forums']);
}


#
#-----[ AFTER, ADD ]------------------------------------------
#

// 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

Awatar użytkownika
daroPL
Zasłużony
Posty: 4564
Rejestracja: 24 czerwca 2005, 13:36
Lokalizacja: Poznań
Kontakt:

Re: Simple subforums - problem

Post autor: daroPL » 01 listopada 2008, 13:03

W takim razie znajdź
$last_post .=
i po tym (w następnej linii) dodaj wskazany w instrukcji kod.

pcw291
Posty: 47
Rejestracja: 14 sierpnia 2008, 19:29

Re: Simple subforums - problem

Post autor: pcw291 » 01 listopada 2008, 23:56

Niestety - bez rezultatu.

shunkiano
Posty: 126
Rejestracja: 17 czerwca 2008, 07:47
Lokalizacja: Gdańsk
Kontakt:

Re: Simple subforums - problem

Post autor: shunkiano » 02 listopada 2008, 09:31

Popróbuj poznajdywać kawałki z całego kodu który masz znaleźć np.

Kod: Zaznacz cały

$lang['View_latest_post']

pcw291
Posty: 47
Rejestracja: 14 sierpnia 2008, 19:29

Re: Simple subforums - problem

Post autor: pcw291 » 02 listopada 2008, 11:00

Problem w tym, że ani w index.php, ani w index_body.tpl nie mam więcej problemów, aby znaleźć kod, wstawilem ten, o którym mówił Daro, jednak zostało wszystko tak, jak zostało.

znalazłem na forum kilka tematów (tu i na form konkurencji) o tym problemie, jednak nie ma żadnej wartościowej odpowiedzi.

Awatar użytkownika
daroPL
Zasłużony
Posty: 4564
Rejestracja: 24 czerwca 2005, 13:36
Lokalizacja: Poznań
Kontakt:

Re: Simple subforums - problem

Post autor: daroPL » 02 listopada 2008, 19:14

Wstaw gdzieś na serwer ten plik (index.php) i podaj ścieżkę do pobrania. Spojrzę :).

pcw291
Posty: 47
Rejestracja: 14 sierpnia 2008, 19:29

Re: Simple subforums - problem

Post autor: pcw291 » 02 listopada 2008, 22:07

Jejku, miałem go już wstawić w poprzednim poście i zapomniałem o najważniejszym - linku :D

Tutaj adres: http://www.speedyshare.com/595767150.html

Z góry dzięki

Awatar użytkownika
daroPL
Zasłużony
Posty: 4564
Rejestracja: 24 czerwca 2005, 13:36
Lokalizacja: Poznań
Kontakt:

Re: Simple subforums - problem

Post autor: daroPL » 03 listopada 2008, 16:08

Po pierwsze to nie wykonałeś wszystkich instrukcji na pliku index.php i dlatego nie działa.
Po drugie to kod z wstawieniem, którego miałeś problem dodajesz po:

Kod: Zaznacz cały

								$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : cr($forum_data[$j], USERNAME_AUTO);

pcw291
Posty: 47
Rejestracja: 14 sierpnia 2008, 19:29

Re: Simple subforums - problem

Post autor: pcw291 » 03 listopada 2008, 16:57

OK, zrobiłem to co podałeś + jeszcze raz instrukcja z instalki i nadal nie działa...

http://www.speedyshare.com/379343970.html - obecny plik index.php

Awatar użytkownika
daroPL
Zasłużony
Posty: 4564
Rejestracja: 24 czerwca 2005, 13:36
Lokalizacja: Poznań
Kontakt:

Re: Simple subforums - problem

Post autor: daroPL » 06 listopada 2008, 09:06

Ten plik wygląda ok, więc pewnie w innym plikach masz coś źle zmodyfikowane lub niezmodyfikowane. Radzę zainstalować moda ponownie, bo on na pewno działa.

Zablokowany

Wróć do „Pomoc”