[DISC] Improved pseudo sub-forums MOD 1.0.6

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Locked
niekas
Registered User
Posts: 562
Joined: Sun Sep 23, 2001 7:34 am

Post by niekas »

Homeskillet wrote: Thanks niekas and merri...

Rats though...Unfortunately the Image image next to the subforum name on index is just too small...and my members are complaining that they don't know when new things have been posted. They are so used to looking at the folder images...I would even be willing to pay a reasonable amount to someone to provide me the code to do this or unfortunately I will probably have to remove this mod.

Thanks again, I appreciate all the help ... great MOD.


It is very simple [index.php]:

after

Code: Select all

									if (check_unread($value['forum_id']))
										{
add this

Code: Select all

$sub_new_topics[$forum_id]=TRUE;
then

after

Code: Select all

$unread_topics=check_unread($forum_id);
add this:

Code: Select all

if (!$unread_topics && $sub_new_topics[$forum_id])
{
$unread_topics=TRUE;
}

Homeskillet
Registered User
Posts: 231
Joined: Thu Oct 07, 2004 5:00 am
Contact:

Post by Homeskillet »

Wow,
Image this was exactly what I wanted. Image


Image


Your check's in the mail. :lol: :wink:
...

User avatar
B€RN@RD
Registered User
Posts: 89
Joined: Mon Dec 30, 2002 10:25 am
Location: maisons laffitte / france

Post by B€RN@RD »

hello niekas,

great mod , I installed realease 1.06 ==>works fine !

good job!

but by the way could you make also update files to avoid to have to check the full mod for updating.

I know it need time of work...


again....great mod :lol:

regards
b€rn@rd

chesster
Registered User
Posts: 37
Joined: Tue Apr 05, 2005 3:25 am

Post by chesster »

darn, I just installed version 1.05.

Could you show me how to "upgrade" to 1.06?

Thanks.

chesster
Registered User
Posts: 37
Joined: Tue Apr 05, 2005 3:25 am

Post by chesster »

Actually, I stored the files before installing version 1.05. Does this mean that if I just modify those files (+ others required by 1.06) according to the 1.06 version and upload those to replace the old ones, will that work?

Thansk.

User avatar
B€RN@RD
Registered User
Posts: 89
Joined: Mon Dec 30, 2002 10:25 am
Location: maisons laffitte / france

Post by B€RN@RD »

hello,

me too yesterday evenning....lol

this morning I checked the full mod tu update to 1.06 (added or replaced some code + update of extra files from my previous 1.05 install)

by the way I founded a small missing " } "

dans index_body.tpl
{catrow.forumrow.switch_attached_forums.attached_forums.L_FORUM_IMAGE"


code should be like this
{catrow.forumrow.switch_attached_forums.attached_forums.L_FORUM_IMAGE}"


bye
b€rn@rd

chesster
Registered User
Posts: 37
Joined: Tue Apr 05, 2005 3:25 am

Post by chesster »

I just installed 1.06. Everything works fine except ....... The parent of a subforum doesn't show in the viewforum when the forum is PRIVATE and HIDDEN, or MODERATOR and HIDDEN.


Any quick fix ???? ?Thanks.

User avatar
B€RN@RD
Registered User
Posts: 89
Joined: Mon Dec 30, 2002 10:25 am
Location: maisons laffitte / france

Post by B€RN@RD »

hello,

could it be possible to show in the sub_forums list the moderators of the sub_forums like in the index.

thks

regards
b€rn@rd

User avatar
Orphée
Registered User
Posts: 86
Joined: Sun Nov 10, 2002 9:31 pm
Location: France
Contact:

Post by Orphée »

chesster wrote: darn, I just installed version 1.05.

Could you show me how to "upgrade" to 1.06?

Thanks.

Code: Select all

#
#-----[ SQL ]-------------------------------------------------
#

ALTER  TABLE  `phpbb_topics`  ADD  INDEX (topic_last_post_id);
	
#
#-----[ OPEN ]------------------------------------------------
#

admin/admin_forums.php

#
#-----[ FIND ]------------------------------------------------
#
	if( $total_forums = $db->sql_numrows($q_forums) )
	{
		$forum_rows = $db->sql_fetchrowset($q_forums);
	}

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

	$subforum_rows=$forum_rows;


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

				$template->assign_block_vars("catrow.forumrow",	array(
					'FORUM_NAME' => $forum_rows[$j]['forum_name'].(($forum_rows[$j]['attached_forum_id'] !=-1)?'  <sup>['. $lang['Attached_forum'].']</sup>':''),
					'FORUM_DESC' => $forum_rows[$j]['forum_desc'],
					'ROW_COLOR' => $row_color,
					'NUM_TOPICS' => $forum_rows[$j]['forum_topics'],
					'NUM_POSTS' => $forum_rows[$j]['forum_posts'],

					'U_VIEWFORUM' => append_sid($phpbb_root_path."viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"),
					'U_FORUM_EDIT' => append_sid("admin_forums.$phpEx?mode=editforum&" . POST_FORUM_URL . "=$forum_id"),
					'U_FORUM_DELETE' => append_sid("admin_forums.$phpEx?mode=deleteforum&" . POST_FORUM_URL . "=$forum_id"),
					'U_FORUM_MOVE_UP' => append_sid("admin_forums.$phpEx?mode=forum_order&move=-15&" . POST_FORUM_URL . "=$forum_id"),
					'U_FORUM_MOVE_DOWN' => append_sid("admin_forums.$phpEx?mode=forum_order&move=15&" . POST_FORUM_URL . "=$forum_id"),
					'U_FORUM_RESYNC' => append_sid("admin_forums.$phpEx?mode=forum_sync&" . POST_FORUM_URL . "=$forum_id"))
				);

#
#-----[ REPLACE WITH ]----------------------------------------
#
				$sub_error=false;
				$do_template=false;
				if ($forum_rows[$j]['attached_forum_id'] !=-1)
				{
				$ok='';
					for($k = 0; $k < $total_forums; $k++)
					{
						$subforum_id = $subforum_rows[$k]['forum_id'];

						if ($subforum_id == $forum_rows[$j]['attached_forum_id'] && $forum_rows[$k]['attached_forum_id']==-1)
						{
							$ok=TRUE;//normal parent found
						}
					}
					if ($forum_rows[$j]['attached_forum_id']==$forum_id) $ok=FALSE; //attached to itself
					if ($forum_rows[$j]['attached_forum_id']==0) $ok=FALSE; //invalid parent
					if (!$ok)
					{
						$do_template=TRUE;
						$sub_error=true;
					}
				}
				else
				{
					$do_template=true;
				}//attached_forum_id'] ==-1


				if ($do_template)
				{
					$template->assign_block_vars("catrow.forumrow",	array(
						'FORUM_NAME' => $forum_rows[$j]['forum_name'],
						'FORUM_DESC' => $forum_rows[$j]['forum_desc'],
						'ROW_COLOR' => $row_color,
						'NUM_TOPICS' => $forum_rows[$j]['forum_topics'],
						'NUM_POSTS' => $forum_rows[$j]['forum_posts'],

						'U_VIEWFORUM' => append_sid($phpbb_root_path."viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"),
						'U_FORUM_EDIT' => append_sid("admin_forums.$phpEx?mode=editforum&" . POST_FORUM_URL . "=$forum_id"),
						'U_FORUM_DELETE' => append_sid("admin_forums.$phpEx?mode=deleteforum&" . POST_FORUM_URL . "=$forum_id"),
						'U_FORUM_MOVE_UP' => append_sid("admin_forums.$phpEx?mode=forum_order&move=-15&" . POST_FORUM_URL . "=$forum_id"),
						'U_FORUM_MOVE_DOWN' => append_sid("admin_forums.$phpEx?mode=forum_order&move=15&" . POST_FORUM_URL . "=$forum_id"),
						'U_FORUM_RESYNC' => append_sid("admin_forums.$phpEx?mode=forum_sync&" . POST_FORUM_URL . "=$forum_id"))
					);
					if ($sub_error)
					{
						$template->assign_block_vars ('catrow.forumrow.switch_error',array());
					}

					for($k = 0; $k < $total_forums; $k++)
					{
						$subforum_id = $subforum_rows[$k]['forum_id'];
						if ($subforum_rows[$k]['attached_forum_id'] == $forum_id)
						{
							$template->assign_block_vars("catrow.forumrow",	array(
								'FORUM_NAME' => $subforum_rows[$k]['forum_name'],
								'FORUM_DESC' => $subforum_rows[$k]['forum_desc'],
								'ROW_COLOR' => $row_color,
								'NUM_TOPICS' => $subforum_rows[$k]['forum_topics'],
								'NUM_POSTS' => $subforum_rows[$k]['forum_posts'],

								'U_VIEWFORUM' => append_sid($phpbb_root_path."viewforum.$phpEx?" . POST_FORUM_URL . "=$subforum_id"),
								'U_FORUM_EDIT' => append_sid("admin_forums.$phpEx?mode=editforum&" . POST_FORUM_URL . "=$subforum_id"),
								'U_FORUM_DELETE' => append_sid("admin_forums.$phpEx?mode=deleteforum&" . POST_FORUM_URL . "=$subforum_id"),
								'U_FORUM_MOVE_UP' => append_sid("admin_forums.$phpEx?mode=forum_order&move=-15&" . POST_FORUM_URL . "=$subforum_id"),
								'U_FORUM_MOVE_DOWN' => append_sid("admin_forums.$phpEx?mode=forum_order&move=15&" . POST_FORUM_URL . "=$subforum_id"),
								'U_FORUM_RESYNC' => append_sid("admin_forums.$phpEx?mode=forum_sync&" . POST_FORUM_URL . "=$subforum_id"))
							);
							$template->assign_block_vars ('catrow.forumrow.switch_attached_forum',array());
						}
					}
				}


#
#-----[ OPEN ]------------------------------------------------
#

index.php

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

   $attached_id = $forum_data[$j]['attached_forum_id'];
						if ( $is_auth_ary[$forum_id]['auth_view'] && $attached_id == -1 )
						{

						$url_row2='';
						$list_of_attached='';
						$a=0;
						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']))
										{
											$url_row2 = '&nbsp;<img src="' . $images['icon_minipost_new'] . '" border="0" alt="' . $lang['New_posts'] . '" title="' . $lang['New_posts'] . '" />';
										}
										else
										{
											$url_row2 = '&nbsp;<img src="' . $images['icon_minipost'] . '" border="0" alt="' . $lang['No_new_posts'] . '" title="' . $lang['No_new_posts'] . '" />';

										}
									}
									else
									{
											$url_row2 = '&nbsp;<img src="' . $images['icon_minipost'] . '" border="0" alt="' . $lang['No_new_posts'] . '" title="' . $lang['No_new_posts'] . '" />';
									}

									$url_row2 .= '<a href="' . append_sid ('viewforum.php?f=' . $value['forum_id'] ) . '">' . $value['forum_name'] . '</a>' ;
									$list_of_attached = $list_of_attached . $url_row2 ;
									$a++;

						   }
						}
						if ($a == 1)
						{
							$list_of_attached = '<span class="genmed">'. $lang['Attached_forum'] . ':'.$list_of_attached.'</span>';
						}
						else if ($a > 1)
						{
							$list_of_attached = '<span class="genmed">'. $lang['Attached_forums'] . ':'.$list_of_attached.'</span>';
						}
						else
						{
							$list_of_attached = '';
						}
						if ( count($forum_moderators[$forum_id]) > 0 && $list_of_attached)
						{
							$list_of_attached = '<br>'.$list_of_attached;

						}

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

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


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

								$last_post .= ' '.$last_post_time;
#
#-----[ AFTER, ADD ]--------------------------------------------								
								$last_post .= '<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> ';
#
#-----[ FIND ]------------------------------------------------
#
								'U_VIEWFORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"))
							);

#
#-----[ AFTER, ADD ]------------------------------------------
#
                     $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']
                           ));
                        }
                     }
#
#-----[ OPEN ]------------------------------------------------
#

viewforum.php

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

if ($attachments)
{

		//
		// Obtain a list of topic ids which contain
		// posts made since user last visited
		//
		if ( $userdata['session_logged_in'] )
		{
			$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'];
			}
		}

		$sql2 = "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)
			WHERE attached_forum_id = " . $forum_id . "
			GROUP by f.forum_id ORDER BY f.forum_order";

		$result2 = $db->sql_query ($sql2);
		if (!$result2 )
		{
			message_die ('Could not gather attached forum info', __LINE__, __FILE__, $sql2);
		}

		if ($db->sql_numrows ($result2) != 0)
		{
			while( $row = $db->sql_fetchrow($result2) )
			{
				$forum_data[] = $row;
			}
			$is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data);

			$x=0;
			foreach ($forum_data as $row2 => $value)
			{
				if ($is_auth_ary[$value['forum_id']]['auth_view'])
				{
					$x++;
					if ($x==1)
					{
						$template->assign_block_vars ('switch_attached_list',
								   array( 'L_ATTACHED_FORUM' => $lang['Attached_forums'],
										 'L_ATTACHED_TOPICS' => $lang['Topics'],
										 'L_ATTACHED_POSTS' => $lang['Posts'],
										 'L_LAST_POST'=>$lang['Last_Post']
									   )
									);

					}
					$attach_forum_name = '<a href="' . append_sid('viewforum.php?f=' . $value['forum_id']) . '">' . $value['forum_name'] . '</a>' ;
					$attach_forum_desc = '<br />' . $value['forum_desc'];
					$attach_forum_topics = $value['forum_topics'];
					$attach_forum_posts = $value['forum_posts'];
					$last_post_id = $value['forum_last_post_id'];

   					if ( $value['forum_status'] == FORUM_LOCKED )
					{
						$folder_image = $images['forum_locked'];
						$folder_alt = $lang['Forum_locked'];
					}
					else
					{
						$unread_topics = false;
						if ( $userdata['session_logged_in'] )
						{
							$unread_topics=check_unread($value['forum_id']);
						}

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

					if ( $value['forum_last_post_id'] )
					{

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

						$last_post_time = create_date($board_config['default_dateformat'], $value['post_time'], $board_config['board_timezone']);
						$last_post = '<a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $value['forum_last_post_id']) . '#' . $value['forum_last_post_id'] . '">'.$value['topic_title'].' <img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';

						$last_post .= '<br /> '; 
						$last_post .= ( $value['user_id'] == ANONYMOUS ) ? ( ($value['post_username'] != '' ) ? $value['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '='  . $value['user_id']) . '">' . $value['username'] . '</a> ';
						$last_post .= ' '.$last_post_time;								


					}
					else
					{
						$last_post = $lang['No_Posts'];
					}

$template->assign_block_vars ('switch_attached_list.switch_attached_present',
										 array
										 (
										'FORUM_FOLDER_IMG' => $folder_image,
										'L_FORUM_FOLDER_ALT' => $folder_alt,
										 'FORUM_NAME' => "$attach_forum_name",
										 'FORUM_DESC' => $attach_forum_desc,
										 'TOPICS' => $attach_forum_topics,
										 'POSTS' => $attach_forum_posts,
										 'LAST_POST_ID' => $last_post,
										 ));
				}
		}

	}
	   $db->sql_freeresult ($result2);
}

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

if ($attachments)
{

		//
		// Obtain a list of topic ids which contain
		// posts made since user last visited
		//
		if ( $userdata['session_logged_in'] )
		{
			$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'];
			}
		}

		$sql2 = "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)
			WHERE attached_forum_id = " . $forum_id . "
			GROUP by f.forum_id ORDER BY f.forum_order";

		$result2 = $db->sql_query ($sql2);
		if (!$result2 )
		{
			message_die ('Could not gather attached forum info', __LINE__, __FILE__, $sql2);
		}

		if ($db->sql_numrows ($result2) != 0)
		{
			while( $row = $db->sql_fetchrow($result2) )
			{
				$forum_data[] = $row;
			}
			$is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data);

			$x=0;
			foreach ($forum_data as $row2 => $value)
			{
				if ($is_auth_ary[$value['forum_id']]['auth_view'])
				{
					$x++;
					if ($x==1)
					{
						$template->assign_block_vars ('switch_attached_list',
								   array( 'L_ATTACHED_FORUM' => $lang['Attached_forums'],
										 'L_ATTACHED_TOPICS' => $lang['Topics'],
										 'L_ATTACHED_POSTS' => $lang['Posts'],
										 'L_LAST_POST'=>$lang['Last_Post']
									   )
									);

					}
					$attach_forum_link = append_sid('viewforum.php?f=' . $value['forum_id']);
					$attach_forum_name = '<a href="' . append_sid('viewforum.php?f=' . $value['forum_id']) . '">' . $value['forum_name'] . '</a>' ;
					$attach_forum_desc = $value['forum_desc'];
					$attach_forum_topics = $value['forum_topics'];
					$attach_forum_posts = $value['forum_posts'];
					$last_post_id = $value['forum_last_post_id'];

   					if ( $value['forum_status'] == FORUM_LOCKED )
					{
						$folder_image = $images['forum_locked'];
						$folder_alt = $lang['Forum_locked'];
					}
					else
					{
						$unread_topics = false;
						if ( $userdata['session_logged_in'] )
						{
							$unread_topics=check_unread($value['forum_id']);
						}

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

					if ( $value['forum_last_post_id'] )
					{

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

						$last_post_time = create_date($board_config['default_dateformat'], $value['post_time'], $board_config['board_timezone']);
						$last_post = '<a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $value['forum_last_post_id']) . '#' . $value['forum_last_post_id'] . '">'.$value['topic_title'].' <img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';

						$last_post .= '<br /> '; 
						$last_post .= ' '.$last_post_time;	
						$last_post .= '<br /> '; 
						$last_post .= ( $value['user_id'] == ANONYMOUS ) ? ( ($value['post_username'] != '' ) ? $value['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '='  . $value['user_id']) . '">' . $value['username'] . '</a> ';

}
					else
					{
						$last_post = $lang['No_Posts'];
					}

$template->assign_block_vars ('switch_attached_list.switch_attached_present',
										 array
										 (
											'FORUM_FOLDER_IMG' => $folder_image,
											'L_FORUM_FOLDER_ALT' => $folder_alt,
											'FORUM_NAME' => $attach_forum_name,
											'U_VIEWFORUM' => $attach_forum_link,
											'FORUM_DESC' => $attach_forum_desc,
											'TOPICS' => $attach_forum_topics,
											'POSTS' => $attach_forum_posts,
											'LAST_POST_ID' => $last_post,
										 ));
				}
		}

	}
	   $db->sql_freeresult ($result2);
}

#
#-----[ OPEN ]------------------------------------------------
#

templates/votre_template/admin/forum_admin_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
<td class="row2"><span class="gen"><a href="{catrow.forumrow.U_VIEWFORUM}" target="_new">{catrow.forumrow.FORUM_NAME}</a></span><br /><span class="gensmall">{catrow.forumrow.FORUM_DESC}</span></td>

#
#-----[ REPLACE WITH ]------------------------------------------
#
<td class="row2"><span class="gen">
	<!-- BEGIN switch_attached_forum -->
		&nbsp;&nbsp;|__
	<!-- END switch_attached_forum -->
	<!-- BEGIN switch_error -->
		ERROR
	<!-- END switch_error -->
<a href="{catrow.forumrow.U_VIEWFORUM}" target="_new">{catrow.forumrow.FORUM_NAME}</a></span><br />
<span class="gensmall">		
<!-- BEGIN switch_attached_forum -->
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!-- END switch_attached_forum -->
{catrow.forumrow.FORUM_DESC}</span></td>

#
#-----[ OPEN ]------------------------------------------------
#

templates/votre template/index_body.tpl


#
#-----[ FIND ]------------------------------------------------
#
	  </span><span class="gensmall">{catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS}</span>{catrow.forumrow.ATTACHED_FORUMS_LIST}</td> {catrow.forumrow.MODERATORS}</span></td>
#
#-----[ REPLACE WITH ]------------------------------------------------
#
	  </span><span class="gensmall">{catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS}</span>
	  <!-- BEGIN switch_attached_forums -->
	  <!-- BEGIN br -->
	  <br />
	  <!-- END br -->
	  <span class="genmed">{catrow.forumrow.switch_attached_forums.L_ATTACHED_FORUMS}:
	       <!-- BEGIN attached_forums -->
	        <a class="nav" href="{catrow.forumrow.switch_attached_forums.attached_forums.U_VIEWFORUM}"><img alt="{catrow.forumrow.switch_attached_forums.attached_forums.L_FORUM_IMAGE}" border="0" src="{catrow.forumrow.switch_attached_forums.attached_forums.FORUM_IMAGE}" title="{catrow.forumrow.switch_attached_forums.attached_forums.L_FORUM_IMAGE" />{catrow.forumrow.switch_attached_forums.attached_forums.FORUM_NAME}</a>
	       <!-- END attached_forums -->
	  <span class="genmed">
	  <!-- END switch_attached_forums -->
</td>
#
#-----[ OPEN ]------------------------------------------------
#

templates/votre_template/viewforum_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
<td class="row1" width="75%"><span class="forumlink">{switch_attached_list.switch_attached_present.FORUM_NAME}</span><span class="genmed">{switch_attached_list.switch_attached_present.FORUM_DESC}</span></td>
#
#-----[ REPLACE WITH ]-----------------------------------------
#
<td class="row1" width="75%"><span class="forumlink"><a class="forumlink" href="{switch_attached_list.switch_attached_present.U_VIEWFORUM}">{switch_attached_list.switch_attached_present.FORUM_NAME}</a></span><br /><span class="genmed">{switch_attached_list.switch_attached_present.FORUM_DESC}</span></td>
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM
thanks

User avatar
Orphée
Registered User
Posts: 86
Joined: Sun Nov 10, 2002 9:31 pm
Location: France
Contact:

Post by Orphée »

this is my changelog to french board...

replace

Code: Select all

votre_template
by

Code: Select all

your_template

EDIT : add this to the change log :
in posting.php

find

Code: Select all

make_jumpbox('viewforum.'.$phpEx);
Before add:

Code: Select all

if ($post_info[attached_forum_id]>0)
{
	$parent_lookup=$post_info[attached_forum_id];
}

In posting_body.tpl
find:

Code: Select all

		<!-- BEGIN switch_not_privmsg -->
before add:

Code: Select all

	  	  <!-- BEGIN switch_parent_link -->
	  	   -> <a class="nav" href="{PARENT_URL}">{PARENT_NAME}</a>
	  	  <!-- END switch_parent_link -->

in viewforum.php

find:

Code: Select all

make_jumpbox('viewforum.'.$phpEx);
before add

Code: Select all

if ($forum_row[attached_forum_id]>0)
{
	$parent_lookup=$forum_row[attached_forum_id];
}
in functions.php

find:

Code: Select all

function make_jumpbox($action, $match_forum_id = 0)
{
After add

Code: Select all

	global $parent_lookup;
find:

Code: Select all

					if ( $forum_rows[$j]['cat_id'] == $category_rows[$i]['cat_id'] && $forum_rows[$j]['auth_view'] <= AUTH_REG )
					{
after add

Code: Select all

						if ($parent_lookup==$forum_rows[$j]['forum_id'])
						{
							$template->assign_block_vars('switch_parent_link', array() );

							$template->assign_vars(array(
								'PARENT_NAME' => $forum_rows[$j]['forum_name'],
								'PARENT_URL'=>append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=" . $forum_rows[$j]['forum_id'])
								));
						}

Open viewforum_body.tpl

Find:

Code: Select all

<a href="{U_INDEX}" class="nav">{L_INDEX}</a>

After add (2 times - on top nav bar and on the bottom nav bar separately)

Code: Select all

	  <!-- BEGIN switch_parent_link -->
	   -> <a class="nav" href="{PARENT_URL}">{PARENT_NAME}</a>
	  <!-- END switch_parent_link -->
For viewtopic.php

find

Code: Select all

" . $count_sql . "
before add:

Code: Select all

, f.attached_forum_id
find

Code: Select all

make_jumpbox('viewforum.'.$phpEx, $forum_id);

Before add:

Code: Select all

if (intval($forum_topic_data['attached_forum_id'])>0)
{
	$parent_lookup=intval($forum_topic_data['attached_forum_id']);
}
Then in viewtopic_body.tpl (same like viewforum template)

Find:

Code: Select all

<a href="{U_INDEX}" class="nav">{L_INDEX}</a>


After add (2 times - on top nav bar and on the bottom nav bar separately)

Code: Select all

     <!-- BEGIN switch_parent_link -->
      -> <a class="nav" href="{PARENT_URL}">{PARENT_NAME}</a>
     <!-- END switch_parent_link --> 




I hope that it can help you :)
thanks

niekas
Registered User
Posts: 562
Joined: Sun Sep 23, 2001 7:34 am

Post by niekas »

chesster wrote: I just installed 1.06. Everything works fine except ....... The parent of a subforum doesn't show in the viewforum when the forum is PRIVATE and HIDDEN, or MODERATOR and HIDDEN.


Any quick fix ???? ?Thanks.


Fixed bug (this assumes that make_jumpbox() wasn't modified by the mod):

Code: Select all


#
#-----[ OPEN ]------------------------------------------------
#
   /includes/functions.php

#
#-----[ FIND ]------------------------------------------------
#
function make_jumpbox($action, $match_forum_id = 0)
{
	global $template, $userdata, $lang, $db, $nav_links, $phpEx, $SID;


#
#-----[ AFTER, ADD ]------------------------------------------
#
	global $parent_lookup;


#
#-----[ FIND ]------------------------------------------------
#
					if ( $forum_rows[$j]['cat_id'] == $category_rows[$i]['cat_id'] && $forum_rows[$j]['auth_view'] <= AUTH_REG )
					{


#
#-----[BEFORE, ADD ]------------------------------------------
#
						if ($parent_lookup==$forum_rows[$j]['forum_id'] && !$assigned)
						{
							$template->assign_block_vars('switch_parent_link', array() );

							$template->assign_vars(array(
								'PARENT_NAME' => $forum_rows[$j]['forum_name'],
								'PARENT_URL'=>append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=" . $forum_rows[$j]['forum_id'])
								));
							$assigned=TRUE;
						}

niekas
Registered User
Posts: 562
Joined: Sun Sep 23, 2001 7:34 am

Post by niekas »

chesster wrote: Actually, I stored the files before installing version 1.05. Does this mean that if I just modify those files (+ others required by 1.06) according to the 1.06 version and upload those to replace the old ones, will that work?

Thansk.


Just update admin files and files that add navigation link to parent forum (viewforum, viewtopic, posting, functions)

Below is code for navigation bar parent display (Admin files i would advise to do from scratch instead of modifying)

Code: Select all


#
#-----[ OPEN ]------------------------------------------------
#
   /includes/functions.php

#
#-----[ FIND ]------------------------------------------------
#
function make_jumpbox($action, $match_forum_id = 0)
{
	global $template, $userdata, $lang, $db, $nav_links, $phpEx, $SID;


#
#-----[ AFTER, ADD ]------------------------------------------
#
	global $parent_lookup;


#
#-----[ FIND ]------------------------------------------------
#
					if ( $forum_rows[$j]['cat_id'] == $category_rows[$i]['cat_id'] && $forum_rows[$j]['auth_view'] <= AUTH_REG )
					{


#
#-----[BEFORE, ADD ]------------------------------------------
#
						if ($parent_lookup==$forum_rows[$j]['forum_id'] && !$assigned)
						{
							$template->assign_block_vars('switch_parent_link', array() );

							$template->assign_vars(array(
								'PARENT_NAME' => $forum_rows[$j]['forum_name'],
								'PARENT_URL'=>append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=" . $forum_rows[$j]['forum_id'])
								));
							$assigned=TRUE;
						}

#
#-----[ OPEN ]------------------------------------------------
#
   viewforum.php

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

 make_jumpbox('viewforum.'.$phpEx);

#
#-----[ BEFORE, ADD ]------------------------------------------
#

   // Added by Attached Forums MOD

if ($forum_row[attached_forum_id]>0)
{
	$parent_lookup=$forum_row[attached_forum_id];
}
   // END Added by Attached Forums MOD

#
#-----[ OPEN ]------------------------------------------------
#
viewtopic.php

#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments" . $count_sql . "

#
#-----[ IN-LINE FIND ]---------------------------------
#

" . $count_sql . "

#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#

, f.attached_forum_id

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

make_jumpbox('viewforum.'.$phpEx, $forum_id);

#
#-----[ BEFORE, ADD ]------------------------------------------
#

if (intval($forum_topic_data['attached_forum_id'])>0)
{
	$parent_lookup=intval($forum_topic_data['attached_forum_id']);
}
#
#-----[ OPEN ]------------------------------------------------
#
posting.php


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

make_jumpbox('viewforum.'.$phpEx);

#
#-----[ BEFORE, ADD ]------------------------------------------
#

if ($post_info[attached_forum_id]>0)
{
	$parent_lookup=$post_info[attached_forum_id];
}


#
#-----[ OPEN ]------------------------------------------------
#
   /templates/subSilver/viewforum_body.tpl

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

	  <td align="left" valign="middle" class="nav" width="100%"><span class="nav">&nbsp;&nbsp;&nbsp;<a href="{U_INDEX}" class="nav">{L_INDEX}</a> -> <a class="nav" href="{U_VIEW_FORUM}">{FORUM_NAME}</a></span></td>

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

	  <td align="left" valign="middle" class="nav" width="100%"><span class="nav">&nbsp;&nbsp;&nbsp;<a href="{U_INDEX}" class="nav">{L_INDEX}</a>

	  	  <!-- BEGIN switch_parent_link -->
	  	   -> <a class="nav" href="{PARENT_URL}">{PARENT_NAME}</a>
	  	  <!-- END switch_parent_link -->
 -> <a class="nav" href="{U_VIEW_FORUM}">{FORUM_NAME}</a></span></td>


#
#-----[ FIND ]------------------------------------------------
#
	  <td align="left" valign="middle" width="100%"><span class="nav">&nbsp;&nbsp;&nbsp;<a href="{U_INDEX}" class="nav">{L_INDEX}</a> -> <a class="nav" href="{U_VIEW_FORUM}">{FORUM_NAME}</a></span></td>

#
#-----[ REPLACE WITH ]------------------------------------------------
#
	  <td align="left" valign="middle" width="100%"><span class="nav">&nbsp;&nbsp;&nbsp;<a href="{U_INDEX}" class="nav">{L_INDEX}</a>
	  	  <!-- BEGIN switch_parent_link -->
	  	   -> <a class="nav" href="{PARENT_URL}">{PARENT_NAME}</a>
	  	  <!-- END switch_parent_link -->
 -> <a class="nav" href="{U_VIEW_FORUM}">{FORUM_NAME}</a></span></td>


#
#-----[ OPEN ]------------------------------------------------
#
   /templates/subSilver/viewtopic_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
	<td align="left" valign="middle" width="100%"><span class="nav">&nbsp;&nbsp;&nbsp;<a href="{U_INDEX}" class="nav">{L_INDEX}</a> 
	  -> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>

#
#-----[ REPLACE WITH ]------------------------------------------------
#
	<td align="left" valign="middle" width="100%"><span class="nav">&nbsp;&nbsp;&nbsp;<a href="{U_INDEX}" class="nav">{L_INDEX}</a> 
	 
	  	  <!-- BEGIN switch_parent_link -->
 -> <a class="nav" href="{PARENT_URL}">{PARENT_NAME}</a>
	  	  <!-- END switch_parent_link -->
 -> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>
#
#-----[ FIND ]------------------------------------------------
#
	<td align="left" valign="middle" width="100%"><span class="nav">&nbsp;&nbsp;&nbsp;<a href="{U_INDEX}" class="nav">{L_INDEX}</a> 
	  -> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td> 
	  

#
#-----[ REPLACE WITH ]------------------------------------------------
#
	<td align="left" valign="middle" width="100%"><span class="nav">&nbsp;&nbsp;&nbsp;<a href="{U_INDEX}" class="nav">{L_INDEX}</a> 
	  	  <!-- BEGIN switch_parent_link -->
	  -> <a class="nav" href="{PARENT_URL}">{PARENT_NAME}</a>
	  	  <!-- END switch_parent_link -->
	  -> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td> 

#
#-----[ OPEN ]------------------------------------------------
#
   /templates/subSilver/posting_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
<td align="left"><span  class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a>
#
#-----[ AFTER, ADD ]------------------------------------------------
#
	  	  <!-- BEGIN switch_parent_link -->
	  -> <a class="nav" href="{PARENT_URL}">{PARENT_NAME}</a>
	  	  <!-- END switch_parent_link -->



niekas
Registered User
Posts: 562
Joined: Sun Sep 23, 2001 7:34 am

Post by niekas »

dans index_body.tpl

Quote:
{catrow.forumrow.switch_attached_forums.attached_forums.L_FORUM_IMAGE"


code should be like this

Quote:
{catrow.forumrow.switch_attached_forums.attached_forums.L_FORUM_IMAGE}"

Thanks B€RN@RD - fixed it.
B€RN@RD wrote: hello,

could it be possible to show in the sub_forums list the moderators of the sub_forums like in the index.

thks

regards
b€rn@rd


We alredy discussed this.

Maybe in the next version i'll add commented code to query moderators, so people could uncommented it to display moderators.

User avatar
B€RN@RD
Registered User
Posts: 89
Joined: Mon Dec 30, 2002 10:25 am
Location: maisons laffitte / france

Post by B€RN@RD »

hello,

for the display of sub_forums moderators ,it should be done as an addon to let the choice of installing or not this display


best regards
b€rn@rd

ArkServer
Registered User
Posts: 40
Joined: Thu May 05, 2005 11:52 pm

Post by ArkServer »

I got a problem with the index.php


http://arkserver.servehttp.com/forum/index.php

you see this:
0 Users active 0 Users active 0 Users active 0 Users active 0 Users active 0 Users active 0 Users active 0 Users active 0 Users active 0 Users active

at the top of the forums. :S any idea why?

Locked

Return to “[2.0.x] MODs in Development”