Simple Subforums

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
196
61%
Very Good
59
18%
Good
34
11%
Fair
7
2%
Poor
26
8%
 
Total votes: 322

User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Re: Simple Subforums

Post by D¡cky »

Ghostrider4444 wrote: I've got this error when trying to create a subforum:

Couldn't get order number from forums table

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3

SELECT MAX(forum_order) AS max_order FROM phpbb_forums WHERE cat_id = ,

Line : 446
File : admin_forums.php
Your code is a complete mess. You have code in there twice, code in the wrong place and other code in there I have no idea where it came from. I suggest that you get your backup copy and do the code edits again.
Have you hugged someone today?
realwarrior
Registered User
Posts: 16
Joined: Sat Mar 24, 2007 12:01 am

Re: Simple Subforums

Post by realwarrior »

D¡cky wrote:
silentfall wrote: I'm attempted to install this on the Solaris theme and I'm having abnormally bad luck.

Is there, by any chance, a copy available to download with pre-modified files as some other modifications have?

Thank you for your time :D
There are no pre-modified files. Even if there were, they would only be for the subSilver template. It is impossible to do pre-modified files for every single style out there.
To modify your templates, look for the variables first to get to the correct line. The variables are the words in capital letters and surrounded by curly braces. Then look for the html tags and use good judgement to insert the code.

realwarrior wrote: Now, my problem is the simple subforum does not work? I do not see any changes in my admin even after uploaded the simplesubforum files. I still cant add subforum under main forum?? :cry:
Did you read the FAQS?



I read the FAQ, but I still having problem....as I read teh faq:
FAQs
Q. Okay, I got this installed, how do I make a subforum? There's no option!
A. Yes there is. You just need to go to your admin admin panel->Forum Admin->Management. From there, click on the "Edit" link next to a forum, and select the parent (main) forum from the "Category / Forum" dropdown box. That's all!


The problem is I dont see any parent forum to move to...it is only Categaory...mean you only can move a forum to another category but not to the 'parent/main ' forum
debragrant
Registered User
Posts: 9
Joined: Tue Mar 20, 2007 8:44 am

Re: Simple Subforums

Post by debragrant »

debragrant wrote: install file - my simple_subforums_1.0.0_RC2.txt file:

Code: Select all

#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/forum_admin_body.tpl


#
#-----[ FIND ]------------------------------------------
#
		<td class="row2"><span class="gen"><a href="{catrow.forumrow.U_VIEWFORUM}"


#
#-----[ IN-LINE FIND ]------------------------------------------
#
"row2"


#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
{catrow.forumrow.STYLE}
you mean do that? I don't know what other files you could mean.

so I edited it to:

Code: Select all

<td class="row2"{catrow.forumrow.STYLE}><span class="gen"><a href="{catrow.forumrow.U_VIEWFORUM}" 
and got the error:

Code: Select all

FIND FAILED: In file [templates/subSilver/admin/forum_admin_body.tpl] could not find:

<td class="row2"><span class="gen"><a href="{catrow.forumrow.U_VIEWFORUM}"
have I edited it wrong?


can no one help?
NewHandN
Registered User
Posts: 1
Joined: Sat Mar 24, 2007 5:46 am

Re: Simple Subforums

Post by NewHandN »

why my Easymod cannot find this mod >??? - -"
Ghostrider4444
Registered User
Posts: 7
Joined: Tue Sep 05, 2006 5:50 pm

Re: Simple Subforums

Post by Ghostrider4444 »

D¡cky wrote:
Ghostrider4444 wrote: I've got this error when trying to create a subforum:

Couldn't get order number from forums table

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3

SELECT MAX(forum_order) AS max_order FROM phpbb_forums WHERE cat_id = ,

Line : 446
File : admin_forums.php
Your code is a complete mess. You have code in there twice, code in the wrong place and other code in there I have no idea where it came from. I suggest that you get your backup copy and do the code edits again.



Ok, thanks for your help, I'm using in admin_forums.php 2 mods: Simple Subforums 1.0.2 and Forum ID in Admin Panel
User avatar
bonelifer
Community Team Member
Community Team Member
Posts: 3510
Joined: Wed Oct 27, 2004 11:35 pm
Name: William
Contact:

Re: Simple Subforums

Post by bonelifer »

Forum ID in ACP as far as I know is incompatible with SS. I tried it. I got it to partially work for the main forums, but it wouldn't for the subforums. It's really not worth the hassle it causes.
Knowledge Base | phpBB Board Rules | Search Customisation Database
Image
Please don't contact me via PM or email for phpBB support .
Ghostrider4444
Registered User
Posts: 7
Joined: Tue Sep 05, 2006 5:50 pm

Re: Simple Subforums

Post by Ghostrider4444 »

thanks boneliner, now I'm having some other problems with same file, I'll try to redo it again, I'm working with the .xml-file, does anybody have a premodified admin_forums.php for me? I'm using the latest stable version. I'll try to integrate Forums ID as well, but you don't have to do that for me. If I don't have the premodified file tomorrow, you don't have to do this, by then I've made it by myself. :? , greetz, Ghostrider4444
alphared
Registered User
Posts: 30
Joined: Tue Mar 27, 2007 10:39 pm

Re: Simple Subforums

Post by alphared »

Okay, I'm new to phpBB and modding, although I have successfully placed several mods on my boards in the last few days.

I quite frankly require subforums on my board, so I am trying to install 'simple subforums'. I also do not have the time to read 150+ reply to find out if my problem is common or unique as I have hopes of opening my boards to the public by the 1st. Simply put I need this mod but I will drop it if I can't get it to work.

Here is my problem:

I installed simple subforums manually (as I do not know how to use MODX and I have quickly discovered easyMod is a letter short of scrap). When I went to my ACP instead of the left frame (menu) I had this message;

Parse error: syntax error, unexpected '.', expecting ')' in /home/.leonard/masterhiro/public_html/forum/admin/admin_forums.php on line 408

I do not have a program that lets me which line is '408', if I did I wouldn't know what to do about it except change a . for a ) which I know could be the wrong thing to do.

my admin_forum.php looks like this:

Code: Select all

<?php
/***************************************************************************
 *                             

admin_forums.php
 *                            -------------------
 *   begin                : Thursday, Jul 12, 2001
 *   

copyright            : (C) 2001 The phpBB Group
 *   email                : support@phpbb.com
 *
 *   $Id: admin_forums.php,v 

1.40.2.13 2006/03/09 21:55:09 grahamje 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', 1);

if( !empty($setmodules) )
{
	

$file = basename(__FILE__);
	$module['Forums']['Manage'] = $file;
	return;
}

//
// Load default header
//
$phpbb_root_path = 

"./../";
require($phpbb_root_path . 'extension.inc');
require('./pagestart.' . $phpEx);
include($phpbb_root_path . 

'includes/functions_admin.'.$phpEx);

$forum_auth_ary = array(
	"auth_view" => AUTH_ALL, 
	"auth_read" => AUTH_ALL, 
	

"auth_post" => AUTH_REG, 
	"auth_reply" => AUTH_REG, 
	"auth_edit" => AUTH_REG, 
	"auth_delete" => AUTH_REG, 
	

"auth_sticky" => AUTH_MOD, 
	"auth_announce" => AUTH_MOD, 
	"auth_vote" => AUTH_REG, 
	"auth_pollcreate" => AUTH_REG
);

//
// Mode setting
//
if( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) )
{
	$mode = ( isset

($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
	$mode = htmlspecialchars($mode);
}
else
{
	$mode 

= "";
}

// ------------------
// Begin function block
//
function get_info($mode, $id)
{
	global $db;

	switch($mode)
	{
	

	case 'category':
			$table = CATEGORIES_TABLE;
			$idfield = 'cat_id';
		

	$namefield = 'cat_title';
			break;

		case 'forum':
			$table = 

FORUMS_TABLE;
			$idfield = 'forum_id';
			$namefield = 'forum_name';
			

break;

		default:
			message_die(GENERAL_ERROR, "Wrong mode for generating select list", "", 

__LINE__, __FILE__);
			break;
	}
	$sql = "SELECT count(*) as total
		FROM $table";
	if( 

!$result = $db->sql_query($sql) )
	{
		message_die(GENERAL_ERROR, "Couldn't get Forum/Category information", 

"", __LINE__, __FILE__, $sql);
	}
	$count = $db->sql_fetchrow($result);
	$count = $count['total'];

	$sql = 

"SELECT *
		FROM $table
		WHERE $idfield = $id"; 

	if( !$result = $db->sql_query($sql) )
	{
		

message_die(GENERAL_ERROR, "Couldn't get Forum/Category information", "", __LINE__, __FILE__, $sql);
	}

	if( $db-

>sql_numrows($result) != 1 )
	{
		message_die(GENERAL_ERROR, "Forum/Category doesn't exist or multiple 

forums/categories with ID $id", "", __LINE__, __FILE__);
	}

	$return = $db->sql_fetchrow($result);
	$return

['number'] = $count;
	return $return;
}

function get_list($mode, $id, $select)
{
	global $db;

	switch($mode)
	{
		

case 'category':
			$table = CATEGORIES_TABLE;
			$idfield = 'cat_id';
			

$namefield = 'cat_title';
			break;

		case 'forum':
			$table = FORUMS_TABLE;
		

	$idfield = 'forum_id';
			$namefield = 'forum_name';
			break;

		default:
	

		message_die(GENERAL_ERROR, "Wrong mode for generating select list", "", __LINE__, __FILE__);
			

break;
	}

	$sql = "SELECT *
		FROM $table";
	if( $select == 0 )
	{
		$sql .= " WHERE 

$idfield <> $id";
	}

	if( !$result = $db->sql_query($sql) )
	{
		message_die(GENERAL_ERROR, "Couldn't 

get list of Categories/Forums", "", __LINE__, __FILE__, $sql);
	}

	$cat_list = "";

	while( $row = $db->sql_fetchrow

($result) )
	{
		$s = "";
		if ($row[$idfield] == $id)
		{
			$s = 

" selected=\"selected\"";
		}
		$catlist .= "<option value=\"$row[$idfield]\"$s>" . $row[$namefield] 

. "</option>\n";
	}

	return($catlist);
}// Begin Simple Subforums MOD
function get_list_cat($id, $parent, $forum_id)
{
	global $db;

	// Get categories
	$sql = 'SELECT * FROM ' . CATEGORIES_TABLE . ' ORDER BY cat_order ASC';

if( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, "Couldn't get list of categories", '', 

__LINE__, __FILE__, $sql);
	}
	
	$cat_list = array();
	
	while( $row = $db->sql_fetchrow($result) )
	

{
		$cat_list[] = $row;
	}

	$db->sql_freeresult($result);

	// Get all forums and check if forum has 

subforums
	$has_sub = false;
	$sql = 'SELECT forum_id, cat_id, forum_name, forum_parent FROM ' . FORUMS_TABLE . ' 

ORDER BY forum_order ASC';
	
	if( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 

"Couldn't get list of forums", '', __LINE__, __FILE__, $sql);
	}
	
	$forums_list = array();
	
	while( $row = 

$db->sql_fetchrow($result) )
	{
		if( $row['forum_parent'] > 0 && $row['forum_parent'] == $forum_id )
		

{
			$has_sub = true;
		}
		
		if( !$row['forum_parent'] )
		

{
			$forums_list[] = $row;
		}
	}
	$db->sql_freeresult($result);

	// Generate select
	

for( $i = 0; $i < count($cat_list); $i++ )
	{
		$cat_id = $cat_list[$i]['cat_id'];
		$selected = ( 

$id == $cat_id && $parent == 0 ) ? ' selected="selected"' : '';
		$str .= '<option value="' . $cat_id . '"' . $selected 

. '>' . $cat_list[$i]['cat_title'] . '</option>';
		
		if( !$has_sub )
		{
			

for( $j = 0; $j < count($forums_list); $j++)
			{
				if( $forums_list[$j]

['cat_id'] == $cat_id && $forums_list[$j]['forum_id'] != $forum_id )
				{
				

	$forum_id2 = $forums_list[$j]['forum_id'];
					$selected = ( $id == $cat_id && 

$parent == $forum_id2 ) ? ' selected="selected"' : '';
					$str .= '<option value="' . $cat_id . 

',' . $forum_id2 . '"' . $selected . '>- ' . $forums_list[$j]['forum_name'] . '</option>';
				}
	

		}
		}
	}
	return $str;
}
// End Simple Subforums MOD

function renumber_order($mode, $cat = 

0)
{
	global $db;

	switch($mode)
	{
		case 'category':
			$table = CATEGORIES_TABLE;
	

		$idfield = 'cat_id';
			$orderfield = 'cat_order';
			$cat = 0;
		

	break;

		case 'forum':
			$table = FORUMS_TABLE;
			$idfield = 'forum_id';
		

	$orderfield = 'forum_order';
			$catfield = 'cat_id';
			break;

		default:
	

		message_die(GENERAL_ERROR, "Wrong mode for generating select list", "", __LINE__, __FILE__);
			

break;
	}

	$sql = "SELECT * FROM $table";
	if( $cat != 0)
	{
		$sql .= " WHERE $catfield = $cat";
	}
	

$sql .= " ORDER BY $orderfield ASC";


	if( !$result = $db->sql_query($sql) )
	{
		message_die(GENERAL_ERROR, 

"Couldn't get list of Categories", "", __LINE__, __FILE__, $sql);
	}

	$i = 10;
	$inc = 10;

	while( $row = 

$db->sql_fetchrow($result) )
	{
		$sql = "UPDATE $table
			SET $orderfield = $i
			

WHERE $idfield = " . $row[$idfield];
		if( !$db->sql_query($sql) )
		{
			message_die

(GENERAL_ERROR, "Couldn't update order fields", "", __LINE__, __FILE__, $sql);
		}
		$i += 10;
	}

}
//
// End function block
// ------------------

//
// Begin program proper
//
if( isset($HTTP_POST_VARS['addforum']) || isset

($HTTP_POST_VARS['addcategory']) )
{
	$mode = ( isset($HTTP_POST_VARS['addforum']) ) ? "addforum" : "addcat";

	if( $mode == 

"addforum" )
	{
		list($cat_id) = each($HTTP_POST_VARS['addforum']);
		$cat_id = intval($cat_id);
	

	// 
		// stripslashes needs to be run on this because slashes are added when the forum name is posted
		

//
		$forumname = stripslashes($HTTP_POST_VARS['forumname'][$cat_id]);
	}
}

if( !empty($mode) ) 
{
	switch($mode)
	

{
		case 'addforum':
		case 'editforum':
			//
			// Show form 

to create/modify a forum
			//
			if ($mode == 'editforum')
			{
	

			// $newmode determines if we are going to INSERT or UPDATE after posting?

				

$l_title = $lang['Edit_forum'];
				$newmode = 'modforum';
				$buttonvalue = $lang

['Update'];

				$forum_id = intval($HTTP_GET_VARS[POST_FORUM_URL]);

				$row 

= get_info('forum', $forum_id);

				$cat_id = $row['cat_id'];
// Begin Simple Subforums MOD
			

	$parent_id = $row['forum_parent'];
				// End Simple Subforums MOD				

$forumname = $row['forum_name'];
				$forumdesc = $row['forum_desc'];
				

$forumstatus = $row['forum_status'];

				//
				// start forum prune stuff.
	

			//
				if( $row['prune_enable'] )
				{
		

			$prune_enabled = "checked=\"checked\"";
					$sql = "SELECT *
              

 			FROM " . PRUNE_TABLE . "
               			WHERE forum_id = $forum_id";
			

		if(!$pr_result = $db->sql_query($sql))
					{
					

	 message_die(GENERAL_ERROR, "Auto-Prune: Couldn't read auto_prune table.", __LINE__, __FILE__);
        			

}

					$pr_row = $db->sql_fetchrow($pr_result);
				}
		

		else
				{
					$prune_enabled = '';
			

	}
			}
			else
			{
				$l_title = 

$lang['Create_forum'];
				$newmode = 'createforum';
				$buttonvalue = $lang

['Create_forum'];

				$forumdesc = '';
				$forumstatus = 

FORUM_UNLOCKED;
				$forum_id = ''; 
				$prune_enabled = '';
	// Begin 

Simple Subforums MOD
				$parent_id = 0;
				// End Simple Subforums MOD		

}

			// Begin Simple Subforums MOD
			$catlist = get_list_cat($cat_id, $parent_id, 

$forum_id);
			// End Simple Subforums MOD

			$forumstatus == ( FORUM_LOCKED ) ? 

$forumlocked = "selected=\"selected\"" : $forumunlocked = "selected=\"selected\"";

// These two options ($lang['Status_unlocked'] and $lang['Status_locked']) seem to be missing from
			// 

the language files.
			$lang['Status_unlocked'] = isset($lang['Status_unlocked']) ? $lang['Status_unlocked'] 

: 'Unlocked';
			$lang['Status_locked'] = isset($lang['Status_locked']) ? $lang['Status_locked'] : 'Locked';

$statuslist = "<option value=\"" . FORUM_UNLOCKED . "\" $forumunlocked>" . $lang

['Status_unlocked'] . "</option>\n";
			$statuslist .= "<option value=\"" . FORUM_LOCKED . "\" $forumlocked>" 

. $lang['Status_locked'] . "</option>\n"; 

			$template->set_filenames(array(
				

"body" => "admin/forum_edit_body.tpl")
			);

			$s_hidden_fields = '<input type="hidden" 

name="mode" value="' . $newmode .'" /><input type="hidden" name="' . POST_FORUM_URL . '" value="' . $forum_id . '" />';

		

	$template->assign_vars(array(
				'S_FORUM_ACTION' => append_sid("admin_forums.$phpEx"),
		

		'S_HIDDEN_FIELDS' => $s_hidden_fields,
				'S_SUBMIT_VALUE' => $buttonvalue, 
		

		'S_CAT_LIST' => $catlist,
				'S_STATUS_LIST' => $statuslist,
				

'S_PRUNE_ENABLED' => $prune_enabled,

				'L_FORUM_TITLE' => $l_title, 
				

'L_FORUM_EXPLAIN' => $lang['Forum_edit_delete_explain'], 
				'L_FORUM_SETTINGS' => $lang

['Forum_settings'], 
				'L_FORUM_NAME' => $lang['Forum_name'], 
				'L_CATEGORY' 

=> $lang['Category'], . ' / ' . $lang['Forum']

'L_FORUM_DESCRIPTION' => $lang['Forum_desc'],
		

		'L_FORUM_STATUS' => $lang['Forum_status'],
				'L_AUTO_PRUNE' => $lang

['Forum_pruning'],
				'L_ENABLED' => $lang['Enabled'],
				

'L_PRUNE_DAYS' => $lang['prune_days'],
				'L_PRUNE_FREQ' => $lang['prune_freq'],
				

'L_DAYS' => $lang['Days'],

				'PRUNE_DAYS' => ( isset($pr_row['prune_days']) ) ? $pr_row

['prune_days'] : 7,
				'PRUNE_FREQ' => ( isset($pr_row['prune_freq']) ) ? $pr_row['prune_freq'] : 1,
	

			'FORUM_NAME' => $forumname,
				'DESCRIPTION' => $forumdesc)
			

);
			$template->pparse("body");
			break;

		case 'createforum':
			

//
			// Create a forum in the DB
			//
			if( trim($HTTP_POST_VARS

['forumname']) == "" )
			{
				message_die(GENERAL_ERROR, "Can't create a forum 

without a name");
			}

			$sql = "SELECT MAX(forum_order) AS max_order
			

	FROM " . FORUMS_TABLE . "
				WHERE cat_id = " . intval($HTTP_POST_VARS[POST_CAT_URL]);
	

		if( !$result = $db->sql_query($sql) )
			{
				message_die

(GENERAL_ERROR, "Couldn't get order number from forums table", "", __LINE__, __FILE__, $sql);
			}
		

	$row = $db->sql_fetchrow($result);

			$max_order = $row['max_order'];
			$next_order = 

$max_order + 10;
			
			$sql = "SELECT MAX(forum_id) AS max_id
				

FROM " . FORUMS_TABLE;
			if( !$result = $db->sql_query($sql) )
			{
				

message_die(GENERAL_ERROR, "Couldn't get order number from forums table", "", __LINE__, __FILE__, $sql);
			

}
			$row = $db->sql_fetchrow($result);

			$max_id = $row['max_id'];
			

$next_id = $max_id + 1;

			//
			// Default permissions of public :: 
			//
	

		$field_sql = "";
			$value_sql = "";
			while( list($field, $value) = 

each($forum_auth_ary) )
			{
				$field_sql .= ", $field";
				

$value_sql .= ", $value";

			}

			// There is no problem having duplicate forum names 

so we won't check for it.
		// Begin Simple Subforums MOD
			$list = explode(',', $HTTP_POST_VARS

[POST_CAT_URL]);
			$new_cat = ( count($list) ) ? intval($list[0]) : intval($HTTP_POST_VARS

[POST_CAT_URL]);
			$new_parent = ( isset($list[1]) ) ? intval($list[1]) : 0;
			// 

End Simple Subforums MOD	$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_parent, 

forum_desc, forum_order, forum_status, prune_enable" . $field_sql . ")
				VALUES ('" . $next_id . "', 

'" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . $new_cat . ', ' . $new_parent . ", '" . str_replace

("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval

($HTTP_POST_VARS['prune_enable']) . $value_sql . ")";
			if( !$result = $db->sql_query($sql) )
			

{
				message_die(GENERAL_ERROR, "Couldn't insert row in forums table", "", __LINE__, __FILE__, 

$sql);
			}

			if( $HTTP_POST_VARS['prune_enable'] )
			{

			

	if( $HTTP_POST_VARS['prune_days'] == "" || $HTTP_POST_VARS['prune_freq'] == "")
				{
		

			message_die(GENERAL_MESSAGE, $lang['Set_prune_data']);
				}

			

	$sql = "INSERT INTO " . PRUNE_TABLE . " (forum_id, prune_days, prune_freq)
					

VALUES('" . $next_id . "', " . intval($HTTP_POST_VARS['prune_days']) . ", " . intval($HTTP_POST_VARS['prune_freq']) . ")";
	

			if( !$result = $db->sql_query($sql) )
				{
					

message_die(GENERAL_ERROR, "Couldn't insert row in prune table", "", __LINE__, __FILE__, $sql);
				}
	

		}

			$message = $lang['Forums_updated'] . "<br /><br />" . sprintf($lang

['Click_return_forumadmin'], "<a href=\"" . append_sid("admin_forums.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf

($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");

			

message_die(GENERAL_MESSAGE, $message);

			break;

		case 'modforum':
// Begin Simple Subforums MOD
		

	$forum_id = intval($HTTP_POST_VARS[POST_FORUM_URL]);
			$row = get_info('forum', $forum_id);
		

	$list = explode(',', $HTTP_POST_VARS[POST_CAT_URL]);
			$new_cat = ( count($list) ) ? intval($list

[0]) : intval($HTTP_POST_VARS[POST_CAT_URL]);
			$new_parent = ( isset($list[1]) ) ? intval($list[1]) : 0;

if( !$row['forum_parent'] && $row['cat_id'] !== $new_cat )
			{
	

			// Move subforums to new category
				$sql = "UPDATE " . FORUMS_TABLE . " 

SET cat_id='$new_cat' WHERE forum_parent='$forum_id'";
				$db->sql_query($sql);
			}
	

		// End Simple Subforums MOD			// Modify a forum in the DB
			if( isset

($HTTP_POST_VARS['prune_enable']))
			{
				if( $HTTP_POST_VARS['prune_enable'] 

!= 1 )
				{
					$HTTP_POST_VARS['prune_enable'] = 0;
			

	}
			}

			$sql = "UPDATE " . FORUMS_TABLE . "
				SET 

forum_name = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', cat_id = $new_cat, forum_parent = $new_parent, 

forum_desc = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', forum_status = " . intval($HTTP_POST_VARS

['forumstatus']) . ", prune_enable = " . intval($HTTP_POST_VARS['prune_enable']) . "
				WHERE 

forum_id = " . intval($HTTP_POST_VARS[POST_FORUM_URL]);
			if( !$result = $db->sql_query($sql) )
			

{
				message_die(GENERAL_ERROR, "Couldn't update forum information", "", __LINE__, __FILE__, 

$sql);
			}

			if( $HTTP_POST_VARS['prune_enable'] == 1 )
			{
		

		if( $HTTP_POST_VARS['prune_days'] == "" || $HTTP_POST_VARS['prune_freq'] == "" )
				

{
					message_die(GENERAL_MESSAGE, $lang['Set_prune_data']);
				}

	

			$sql = "SELECT *
					FROM " . PRUNE_TABLE . "
			

		WHERE forum_id = " . intval($HTTP_POST_VARS[POST_FORUM_URL]);
				if( !$result = $db-

>sql_query($sql) )
				{
					message_die(GENERAL_ERROR, "Couldn't 

get forum Prune Information","",__LINE__, __FILE__, $sql);
				}

				if( 

$db->sql_numrows($result) > 0 )
				{
					$sql = "UPDATE " . 

PRUNE_TABLE . "
						SET	prune_days = " . intval($HTTP_POST_VARS['prune_days']) . ",	

prune_freq = " . intval($HTTP_POST_VARS['prune_freq']) . "
				 		WHERE forum_id = " . 

intval($HTTP_POST_VARS[POST_FORUM_URL]);
				}
				else
			

	{
					$sql = "INSERT INTO " . PRUNE_TABLE . " (forum_id, prune_days, prune_freq)
	

					VALUES(" . intval($HTTP_POST_VARS[POST_FORUM_URL]) . ", " . intval($HTTP_POST_VARS

['prune_days']) . ", " . intval($HTTP_POST_VARS['prune_freq']) . ")";
				}

				

if( !$result = $db->sql_query($sql) )
				{
					message_die

(GENERAL_ERROR, "Couldn't Update Forum Prune Information","",__LINE__, __FILE__, $sql);
				}
		

	}

			$message = $lang['Forums_updated'] . "<br /><br />" . sprintf($lang

['Click_return_forumadmin'], "<a href=\"" . append_sid("admin_forums.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf

($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");

			

message_die(GENERAL_MESSAGE, $message);

			break;
			
		case 'addcat':
			

// Create a category in the DB
			if( trim($HTTP_POST_VARS['categoryname']) == '')
			{
	

			message_die(GENERAL_ERROR, "Can't create a category without a name");
			}

		

	$sql = "SELECT MAX(cat_order) AS max_order
				FROM " . CATEGORIES_TABLE;
			

if( !$result = $db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, "Couldn't 

get order number from categories table", "", __LINE__, __FILE__, $sql);
			}
			$row = $db-

>sql_fetchrow($result);

			$max_order = $row['max_order'];
			$next_order = $max_order + 10;

		

	//
			// There is no problem having duplicate forum names so we won't check for it.
			

//
			$sql = "INSERT INTO " . CATEGORIES_TABLE . " (cat_title, cat_order)
				

VALUES ('" . str_replace("\'", "''", $HTTP_POST_VARS['categoryname']) . "', $next_order)";
			if( !$result 

= $db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, "Couldn't insert 

row in categories table", "", __LINE__, __FILE__, $sql);
			}

			$message = $lang

['Forums_updated'] . "<br /><br />" . sprintf($lang['Click_return_forumadmin'], "<a href=\"" . append_sid

("admin_forums.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . 

append_sid("index.$phpEx?pane=right") . "\">", "</a>");

			message_die(GENERAL_MESSAGE, $message);

			

break;
			
		case 'editcat':
			//
			// Show form to edit a 

category
			//
			$newmode = 'modcat';
			$buttonvalue = $lang

['Update'];

			$cat_id = intval($HTTP_GET_VARS[POST_CAT_URL]);

			$row = get_info('category', 

$cat_id);
			$cat_title = $row['cat_title'];

			$template->set_filenames(array(
			

	"body" => "admin/category_edit_body.tpl")
			);

			$s_hidden_fields = '<input 

type="hidden" name="mode" value="' . $newmode . '" /><input type="hidden" name="' . POST_CAT_URL . '" value="' . $cat_id . '" 

/>';

			$template->assign_vars(array(
				'CAT_TITLE' => $cat_title,

			

	'L_EDIT_CATEGORY' => $lang['Edit_Category'], 
				'L_EDIT_CATEGORY_EXPLAIN' => $lang

['Edit_Category_explain'], 
				'L_CATEGORY' => $lang['Category'], 

				

'S_HIDDEN_FIELDS' => $s_hidden_fields, 
				'S_SUBMIT_VALUE' => $buttonvalue, 
				

'S_FORUM_ACTION' => append_sid("admin_forums.$phpEx"))
			);

			$template->pparse("body");
	

		break;

		case 'modcat':
			// Modify a category in the DB
			$sql = 

"UPDATE " . CATEGORIES_TABLE . "
				SET cat_title = '" . str_replace("\'", "''", $HTTP_POST_VARS

['cat_title']) . "'
				WHERE cat_id = " . intval($HTTP_POST_VARS[POST_CAT_URL]);
			

if( !$result = $db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, "Couldn't 

update forum information", "", __LINE__, __FILE__, $sql);
			}

			$message = $lang

['Forums_updated'] . "<br /><br />" . sprintf($lang['Click_return_forumadmin'], "<a href=\"" . append_sid

("admin_forums.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . 

append_sid("index.$phpEx?pane=right") . "\">", "</a>");

			message_die(GENERAL_MESSAGE, $message);

			

break;
			
		case 'deleteforum':
			// Show form to delete a forum
			

$forum_id = intval($HTTP_GET_VARS[POST_FORUM_URL]);

			$select_to = '<select name="to_id">';
			

$select_to .= "<option value=\"-1\"$s>" . $lang['Delete_all_posts'] . "</option>\n";
			$select_to .= 

get_list('forum', $forum_id, 0);
			$select_to .= '</select>';

			$buttonvalue = $lang

['Move_and_Delete'];

			$newmode = 'movedelforum';

			$foruminfo = get_info('forum', 

$forum_id);
			$name = $foruminfo['forum_name'];

			$template->set_filenames(array(
		

		"body" => "admin/forum_delete_body.tpl")
			);

			$s_hidden_fields = 

'<input type="hidden" name="mode" value="' . $newmode . '" /><input type="hidden" name="from_id" value="' . $forum_id . '" 

/>';

			$template->assign_vars(array(
				'NAME' => $name, 

				

'L_FORUM_DELETE' => $lang['Forum_delete'], 
				'L_FORUM_DELETE_EXPLAIN' => $lang

['Forum_delete_explain'], 
				'L_MOVE_CONTENTS' => $lang['Move_contents'], 
				

'L_FORUM_NAME' => $lang['Forum_name'], 

				"S_HIDDEN_FIELDS" => $s_hidden_fields,
				

'S_FORUM_ACTION' => append_sid("admin_forums.$phpEx"), 
				'S_SELECT_TO' => $select_to,
			

	'S_SUBMIT_VALUE' => $buttonvalue)
			);

			$template->pparse("body");
		

	break;

		case 'movedelforum':
			//
			// Move or delete a forum in the DB
	

		//
			$from_id = intval($HTTP_POST_VARS['from_id']);
			$to_id = intval

($HTTP_POST_VARS['to_id']);
			$delete_old = intval($HTTP_POST_VARS['delete_old']);

			// 

Either delete or move all posts in a forum
			if($to_id == -1)
			{
			

	// Delete polls in this forum
				$sql = "SELECT v.vote_id 
					

FROM " . VOTE_DESC_TABLE . " v, " . TOPICS_TABLE . " t 
					WHERE t.forum_id = $from_id 
		

				AND v.topic_id = t.topic_id";
				if (!($result = $db->sql_query

($sql)))
				{
					message_die(GENERAL_ERROR, "Couldn't obtain 

list of vote ids", "", __LINE__, __FILE__, $sql);
				}

				if ($row = 

$db->sql_fetchrow($result))
				{
					$vote_ids = '';
			

		do
					{
						$vote_ids = 

(($vote_ids != '') ? ', ' : '') . $row['vote_id'];
					}
					

while ($row = $db->sql_fetchrow($result));

					$sql = "DELETE FROM " . VOTE_DESC_TABLE . " 
	

					WHERE vote_id IN ($vote_ids)";
					$db->sql_query($sql);

	

				$sql = "DELETE FROM " . VOTE_RESULTS_TABLE . " 
						WHERE 

vote_id IN ($vote_ids)";
					$db->sql_query($sql);

					$sql 

= "DELETE FROM " . VOTE_USERS_TABLE . " 
						WHERE vote_id IN ($vote_ids)";
		

			$db->sql_query($sql);
				}
				$db->sql_freeresult

($result);
				
				include($phpbb_root_path . "includes/prune.$phpEx");
	

			prune($from_id, 0, true); // Delete everything from forum
			}
			

else
			{
				$sql = "SELECT *
					FROM " . 

FORUMS_TABLE . "
					WHERE forum_id IN ($from_id, $to_id)";
				if( 

!$result = $db->sql_query($sql) )
				{
					message_die

(GENERAL_ERROR, "Couldn't verify existence of forums", "", __LINE__, __FILE__, $sql);
				}

		

		if($db->sql_numrows($result) != 2)
				{
					

message_die(GENERAL_ERROR, "Ambiguous forum ID's", "", __LINE__, __FILE__);
				}
			

	$sql = "UPDATE " . TOPICS_TABLE . "
					SET forum_id = $to_id
				

	WHERE forum_id = $from_id";
				if( !$result = $db->sql_query($sql) )
				

{
					message_die(GENERAL_ERROR, "Couldn't move topics to other forum", "", __LINE__, 

__FILE__, $sql);
				}
				$sql = "UPDATE " . POSTS_TABLE . "
		

			SET	forum_id = $to_id
					WHERE forum_id = $from_id";
		

		if( !$result = $db->sql_query($sql) )
				{
					

message_die(GENERAL_ERROR, "Couldn't move posts to other forum", "", __LINE__, __FILE__, $sql);
				}
	

			sync('forum', $to_id);
			}

			// Alter Mod level if appropriate - 

2.0.4
			$sql = "SELECT ug.user_id 
				FROM " . AUTH_ACCESS_TABLE . " a, " . 

USER_GROUP_TABLE . " ug 
				WHERE a.forum_id <> $from_id 
					AND 

a.auth_mod = 1
					AND ug.group_id = a.group_id";
			if( !$result = $db-

>sql_query($sql) )
			{
				message_die(GENERAL_ERROR, "Couldn't obtain moderator 

list", "", __LINE__, __FILE__, $sql);
			}

			if ($row = $db->sql_fetchrow($result))
		

	{
				$user_ids = '';
				do
				{
		

			$user_ids .= (($user_ids != '') ? ', ' : '' ) . $row['user_id'];
				}
	

			while ($row = $db->sql_fetchrow($result));

				$sql = "SELECT ug.user_id 
	

				FROM " . AUTH_ACCESS_TABLE . " a, " . USER_GROUP_TABLE . " ug 
					

WHERE a.forum_id = $from_id 
						AND a.auth_mod = 1 
					

	AND ug.group_id = a.group_id
						AND ug.user_id NOT IN ($user_ids)";
		

		if( !$result2 = $db->sql_query($sql) )
				{
					

message_die(GENERAL_ERROR, "Couldn't obtain moderator list", "", __LINE__, __FILE__, $sql);
				}

if ($row = $db->sql_fetchrow($result2))
				

{
					$user_ids = '';
					do
					

{
						$user_ids .= (($user_ids != '') ? ', ' : '' ) . $row['user_id'];
		

			}
					while ($row = $db->sql_fetchrow($result2));

			

		$sql = "UPDATE " . USERS_TABLE . " 
						SET user_level = " . USER . " 
						WHERE user_id IN ($user_ids) 
							

AND user_level <> " . ADMIN;
					$db->sql_query($sql);
				}
		

		$db->sql_freeresult($result);

			}
			$db->sql_freeresult($result2);

		

	$sql = "DELETE FROM " . FORUMS_TABLE . "
				WHERE forum_id = $from_id";
			

if( !$result = $db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, "Couldn't 

delete forum", "", __LINE__, __FILE__, $sql);
			}
		// Begin Simple Subforums MOD
			

// Move subforums to category
			$sql = "UPDATE " . FORUMS_TABLE . " SET forum_parent = '0' WHERE forum_parent 

= '$from_id'";
			$db->sql_query($sql);
			// End Simple Subforums MOD

	
			$sql = "DELETE FROM " . AUTH_ACCESS_TABLE . "
				WHERE forum_id = 

$from_id";
			if( !$result = $db->sql_query($sql) )
			{
				

message_die(GENERAL_ERROR, "Couldn't delete forum", "", __LINE__, __FILE__, $sql);
			}
			
			$sql = "DELETE FROM " . PRUNE_TABLE . "
				WHERE forum_id = $from_id";
		

	if( !$result = $db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, 

"Couldn't delete forum prune information!", "", __LINE__, __FILE__, $sql);
			}

			

$message = $lang['Forums_updated'] . "<br /><br />" . sprintf($lang['Click_return_forumadmin'], "<a href=\"" . append_sid

("admin_forums.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . 

append_sid("index.$phpEx?pane=right") . "\">", "</a>");

			message_die(GENERAL_MESSAGE, $message);

			

break;
			
		case 'deletecat':
			//
			// Show form to 

delete a category
			//
			$cat_id = intval($HTTP_GET_VARS[POST_CAT_URL]);

			

$buttonvalue = $lang['Move_and_Delete'];
			$newmode = 'movedelcat';
			$catinfo = 

get_info('category', $cat_id);
			$name = $catinfo['cat_title'];

			if ($catinfo['number'] == 1)
	

		{
				$sql = "SELECT count(*) as total
					FROM 

". FORUMS_TABLE;
				if( !$result = $db->sql_query($sql) )
				{
		

			message_die(GENERAL_ERROR, "Couldn't get Forum count", "", __LINE__, __FILE__, $sql);
			

	}
				$count = $db->sql_fetchrow($result);
				$count = $count

['total'];

				if ($count > 0)
				{
					

message_die(GENERAL_ERROR, $lang['Must_delete_forums']);
				}
				else
	

			{
					$select_to = $lang['Nowhere_to_move'];
				

}
			}
			else
			{
				$select_to = '<select 

name="to_id">';
				$select_to .= get_list('category', $cat_id, 0);
				$select_to .= 

'</select>';
			}

			$template->set_filenames(array(
				"body" => 

"admin/forum_delete_body.tpl")
			);

			$s_hidden_fields = '<input type="hidden" name="mode" 

value="' . $newmode . '" /><input type="hidden" name="from_id" value="' . $cat_id . '" />';

			$template-

>assign_vars(array(
				'NAME' => $name, 

				'L_FORUM_DELETE' => $lang

['Forum_delete'], 
				'L_FORUM_DELETE_EXPLAIN' => $lang['Forum_delete_explain'], 
			

	'L_MOVE_CONTENTS' => $lang['Move_contents'], 
				'L_FORUM_NAME' => $lang['Forum_name'], 

'S_HIDDEN_FIELDS' => $s_hidden_fields,
				

'S_FORUM_ACTION' => append_sid("admin_forums.$phpEx"), 
				'S_SELECT_TO' => $select_to,
			

	'S_SUBMIT_VALUE' => $buttonvalue)
			);

			$template->pparse("body");
		

	break;

		case 'movedelcat':
			//
			// Move or delete a category in the 

DB
			//
			$from_id = intval($HTTP_POST_VARS['from_id']);
			$to_id = 

intval($HTTP_POST_VARS['to_id']);

			if (!empty($to_id))
			{
				

$sql = "SELECT *
					FROM " . CATEGORIES_TABLE . "
					WHERE 

cat_id IN ($from_id, $to_id)";
				if( !$result = $db->sql_query($sql) )
				{
	

				message_die(GENERAL_ERROR, "Couldn't verify existence of categories", "", __LINE__, __FILE__, 

$sql);
				}
				if($db->sql_numrows($result) != 2)
				

{
					message_die(GENERAL_ERROR, "Ambiguous category ID's", "", __LINE__, __FILE__);
		

		}

				$sql = "UPDATE " . FORUMS_TABLE . "
					SET 

cat_id = $to_id
					WHERE cat_id = $from_id";
				if( !$result = $db-

>sql_query($sql) )
				{
					message_die(GENERAL_ERROR, "Couldn't 

move forums to other category", "", __LINE__, __FILE__, $sql);
				}
			}

		

	$sql = "DELETE FROM " . CATEGORIES_TABLE ."
				WHERE cat_id = $from_id";

if( !$result = $db->sql_query($sql) )
			{
				

message_die(GENERAL_ERROR, "Couldn't delete category", "", __LINE__, __FILE__, $sql);
			}

			

$message = $lang['Forums_updated'] . "<br /><br />" . sprintf($lang['Click_return_forumadmin'], "<a href=\"" . append_sid

("admin_forums.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . 

append_sid("index.$phpEx?pane=right") . "\">", "</a>");

			message_die(GENERAL_MESSAGE, $message);

			

break;

		case 'forum_order':
			//
			// Change order of forums in the DB
		

	//
			$move = intval($HTTP_GET_VARS['move']);
			$forum_id = intval($HTTP_GET_VARS

[POST_FORUM_URL]);

			$forum_info = get_info('forum', $forum_id);

			$cat_id = 

$forum_info['cat_id'];

	// Begin Simple Subforums MOD
			if( !$forum_info['forum_parent'] )
			

{
				// Find previous/next forum
				if( $move > 0 )
				

{
					$sql = "SELECT forum_id, forum_order FROM " . FORUMS_TABLE . " WHERE cat_id = 

'$cat_id' AND forum_parent = '0' AND forum_order > '" . $forum_info['forum_order'] . "' ORDER BY forum_order ASC";
		

		}
				
				else
				{
		

			$sql = "SELECT forum_id, forum_order FROM " . FORUMS_TABLE . " WHERE cat_id = '$cat_id' AND 

forum_parent = '0' AND forum_order < '" . $forum_info['forum_order'] . "' ORDER BY forum_order DESC";
				

}
				
				if( !($result = $db->sql_query($sql)) )
				

{
					message_die(GENERAL_ERROR, "Couldn't change category order", '', __LINE__, __FILE__, 

$sql);
				}
				
				$row = $db->sql_fetchrow

($result);
				$db->sql_freeresult($result);
				if($row !== false)
		

		{
					// Swap forum orders
					$sql = 

"UPDATE " . FORUMS_TABLE . " SET forum_order = '" . $row['forum_order'] . "' WHERE forum_id = '$forum_id'";
			

		$db->sql_query($sql);
					
					$sql = 

"UPDATE " . FORUMS_TABLE . " SET forum_order = '" . $forum_info['forum_order'] . "' WHERE forum_id = " . $row['forum_id'];
	

				$db->sql_query($sql);
				}
			}
			
			else
			{
			// End Simple Subforums MOD

		$sql = "UPDATE " . FORUMS_TABLE . "
				SET forum_order = forum_order + $move
		

		WHERE forum_id = $forum_id";
			if( !$result = $db->sql_query($sql) )
			{
	

			message_die(GENERAL_ERROR, "Couldn't change category order", "", __LINE__, __FILE__, $sql);
		

	}

			renumber_order('forum', $forum_info['cat_id']);
	// Begin Simple Subforums MOD
			

}
			// End Simple Subforums MOD


		$show_index = TRUE;

			break;
			
		case 'cat_order':
			//
			// Change order of categories in the DB
		

	//
			$move = intval($HTTP_GET_VARS['move']);
			$cat_id = intval($HTTP_GET_VARS

[POST_CAT_URL]);

			$sql = "UPDATE " . CATEGORIES_TABLE . "
				SET cat_order = 

cat_order + $move
				WHERE cat_id = $cat_id";
			if( !$result = $db-

>sql_query($sql) )
			{
				message_die(GENERAL_ERROR, "Couldn't change category 

order", "", __LINE__, __FILE__, $sql);
			}

			renumber_order('category');
			

$show_index = TRUE;

			break;

		case 'forum_sync':
			sync('forum', intval

($HTTP_GET_VARS[POST_FORUM_URL]));
			$show_index = TRUE;

			break;

		default:
	

		message_die(GENERAL_MESSAGE, $lang['No_mode']);
			break;
	}

	if ($show_index != TRUE)
	

{
		include('./page_footer_admin.'.$phpEx);
		exit;
	}
}

//
// Start page proper
//
$template->set_filenames

(array(
	"body" => "admin/forum_admin_body.tpl")
);

$template->assign_vars(array(
	'S_FORUM_ACTION' => append_sid

("admin_forums.$phpEx"),
	'L_FORUM_TITLE' => $lang['Forum_admin'], 
	'L_FORUM_EXPLAIN' => $lang

['Forum_admin_explain'], 
	'L_CREATE_FORUM' => $lang['Create_forum'], 
	'L_CREATE_CATEGORY' => $lang

['Create_category'], 
	'L_EDIT' => $lang['Edit'], 
	'L_DELETE' => $lang['Delete'], 
	'L_MOVE_UP' => $lang['Move_up'], 
	

'L_MOVE_DOWN' => $lang['Move_down'],    'L_FORUMPERMISSION' => $lang['Permissions'],    'L_RESYNC' => $lang['Resync'])
);

$sql 

= "SELECT cat_id, cat_title, cat_order
	FROM " . CATEGORIES_TABLE . "
	ORDER BY cat_order";
if( !$q_categories = $db-

>sql_query($sql) )
{
	message_die(GENERAL_ERROR, "Could not query categories list", "", __LINE__, __FILE__, $sql);
}

if( 

$total_categories = $db->sql_numrows($q_categories) )
{
	$category_rows = $db->sql_fetchrowset($q_categories);

	$sql = 

"SELECT *
		FROM " . FORUMS_TABLE . "
		ORDER BY cat_id, forum_order";
	if(!$q_forums = $db-

>sql_query($sql))
	{
		message_die(GENERAL_ERROR, "Could not query forums information", "", __LINE__, 

__FILE__, $sql);
	}

	if( $total_forums = $db->sql_numrows($q_forums) )
	{
		$forum_rows = $db-

>sql_fetchrowset($q_forums);
	}

	//
	// Okay, let's build the index
	//
	$gen_cat = array();

	for($i = 0; 

$i < $total_categories; $i++)
	{
		$cat_id = $category_rows[$i]['cat_id'];

		$template->assign_block_vars

("catrow", array( 
			'S_ADD_FORUM_SUBMIT' => "addforum[$cat_id]", 
			'S_ADD_FORUM_NAME' => 

"forumname[$cat_id]", 

			'CAT_ID' => $cat_id,
			'CAT_DESC' => $category_rows[$i]

['cat_title'],

			'U_CAT_EDIT' => append_sid("admin_forums.$phpEx?mode=editcat&" . POST_CAT_URL . 

"=$cat_id"),
			'U_CAT_DELETE' => append_sid("admin_forums.$phpEx?mode=deletecat&" . POST_CAT_URL . 

"=$cat_id"),
			'U_CAT_MOVE_UP' => append_sid("admin_forums.$phpEx?mode=cat_order&move=-15&" . 

POST_CAT_URL . "=$cat_id"),
			'U_CAT_MOVE_DOWN' => append_sid("admin_forums.$phpEx?

mode=cat_order&move=15&" . POST_CAT_URL . "=$cat_id"),
			'U_VIEWCAT' => append_sid

($phpbb_root_path."index.$phpEx?" . POST_CAT_URL . "=$cat_id"))
		);

		for($j = 0; $j < $total_forums; $j++)
	

	{
			$forum_id = $forum_rows[$j]['forum_id'];
			
			if 

($forum_rows[$j]['cat_id'] == $cat_id && $forum_rows[$j]['forum_parent'] == 0


)
			{

				

$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_FORUMPERMISSION' 

=> append_sid("admin_forumauth.$phpEx?" .POST_FORUM_URL .  "=$forum_id"),
					

'U_FORUM_RESYNC' => append_sid("admin_forums.$phpEx?mode=forum_sync&" . POST_FORUM_URL . "=$forum_id"))
			

	);

	// Begin Simple Subforums MOD
				for( $k = 0; $k < $total_forums; $k++ )
			

	{
					$forum_id2 = $forum_rows[$k]['forum_id'];
					

if ( $forum_rows[$k]['forum_parent'] == $forum_id )
					{
					

	$template->assign_block_vars("catrow.forumrow",	array(
							'FORUM_NAME' 

=> $forum_rows[$k]['forum_name'],
							'FORUM_DESC' => $forum_rows[$k]

['forum_desc'],
							'ROW_COLOR' => $row_color,
					

		'NUM_TOPICS' => $forum_rows[$k]['forum_topics'],
							

'NUM_POSTS' => $forum_rows[$k]['forum_posts'],
							'STYLE' => ' style="padding-

left: 20px;" ',
	
							'U_VIEWFORUM' => append_sid

($phpbb_root_path."viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id2"),
							

'U_FORUM_EDIT' => append_sid("admin_forums.$phpEx?mode=editforum&" . POST_FORUM_URL . "=$forum_id2"),
			

				'U_FORUM_DELETE' => append_sid("admin_forums.$phpEx?mode=deleteforum&" . POST_FORUM_URL . 

"=$forum_id2"),
							'U_FORUM_MOVE_UP' => append_sid("admin_forums.$phpEx?

mode=forum_order&move=-15&" . POST_FORUM_URL . "=$forum_id2"),
							

'U_FORUM_MOVE_DOWN' => append_sid("admin_forums.$phpEx?mode=forum_order&move=15&" . POST_FORUM_URL . "=$forum_id2"),
	

						'U_FORUM_RESYNC' => append_sid("admin_forums.$phpEx?mode=forum_sync&" . 

POST_FORUM_URL . "=$forum_id2"))
						);

					}

} // for ... forums
				// End Simple 

Subforums MOD

		}// if ... forumid == catid
			
		} // for ... forums

	} // for ... 

categories

}// if ... total_categories

$template->pparse("body");

include('./page_footer_admin.'.$phpEx);

?>
sharonspsp
Registered User
Posts: 8
Joined: Wed Jan 24, 2007 7:17 pm

Re: Simple Subforums

Post by sharonspsp »

I have been trying to add the submod using easyMOD. I have 4 styles installed that are all clones of SubSilver. The error message I get is....

Warning

FIND FAILED: In file [templates/SUBBLACK/overall_header.tpl] could not find:

@import url("templates/SUBBLACK/formIE.css");

MOD script line #906 :: FAQ :: Report

========================================================================

Warning

FIND FAILED: In file [templates/SUBPINK/overall_header.tpl] could not find:

@import url("templates/SUBBLACK/formIE.css");

MOD script line #906 :: FAQ :: Report
========================================================================

Warning

FIND FAILED: In file [templates/subpurple/overall_header.tpl] could not find:

@import url("templates/SUBBLACK/formIE.css");

MOD script line #906 :: FAQ :: Report

I have opened up the files and made sure that line exists. But why is it always looking for @import url("templates/SUBBLACK/formIE.css");


I dont know how to proceed except to remove the other 3 styles and then try to install
coldclimber
Registered User
Posts: 17
Joined: Fri Apr 15, 2005 4:55 pm

Re: Simple Subforums

Post by coldclimber »

Hi after going through quite a few pages here gees not all 154 i am still stuck with a problem

my last forum is called "Get together" i have quite a few sub forums throughout my site and when i mouse over them they all give me a url like this /get-together-f12.html and get-together-f13.html ect ect why is this??

is there a way to fix this problem i have the SEO mod installed also
User avatar
bonelifer
Community Team Member
Community Team Member
Posts: 3510
Joined: Wed Oct 27, 2004 11:35 pm
Name: William
Contact:

Re: Simple Subforums

Post by bonelifer »

That's what the SEO mod does.
Knowledge Base | phpBB Board Rules | Search Customisation Database
Image
Please don't contact me via PM or email for phpBB support .
sharonspsp
Registered User
Posts: 8
Joined: Wed Jan 24, 2007 7:17 pm

Re: Simple Subforums

Post by sharonspsp »

actually that link said i was unauthorized to access it.
Krank
Registered User
Posts: 179
Joined: Wed Sep 06, 2006 4:50 pm

Re: Simple Subforums

Post by Krank »

hi i have Simple SubForums MOD installed, and its working just fine, i'm having a problem with another MOD, i was just hoping if you can help me with it to "work along with Simple SubForums"

"i just installed the Latest active topics on index today, and i have the Simple SubForums mod installed, when i add the part in index.php

Code: Select all

    //
    // 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']))
       );
    } 
it gives an error, not loading error, when you browse the forum with Internet Explorer at the status bar, it says "done with error" when i view the error its "all.documents.recent_topics is null" or something like that. anyone knows how to fix that?


[when i remove the latest topics mod, the error poof disappears, same thing if i remove the simple subforums and keep the latest topics mod, error gone, one of them installed, good, both gives error]
Image
phpBB3 Je t'adore: subSilver2 Based styles fan
proSilver, good, but too .... I don't know just too... :P
Musical frog
Registered User
Posts: 79
Joined: Fri Dec 29, 2006 11:31 pm

Re: Simple Subforums

Post by Musical frog »

Can you install subforums within subforums??

eg.


General talk forum-->Off-topic-->spam
|-->Polotics
|-->sports--->hockey
|--->Football
|basketball
Musical frog
Registered User
Posts: 79
Joined: Fri Dec 29, 2006 11:31 pm

Re: Simple Subforums

Post by Musical frog »

okay I need help! I installed the mod, but I never did anything with modx.subsilver.en or simple_subforums_1.0.2 should I have??? Also I cannot view the admin panel. The board is down, and so I can't put it back up or even try to create a sub-forum. PLEASE help thanks.

Respond here or preferbly AIM me my s/n in claptonesseman
Post Reply

Return to “[2.0.x] MOD Database Releases”