git-svn-id: file:///svn/phpbb/trunk@977 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
James Atkinson 2001-09-03 08:04:26 +00:00
parent e515d617ed
commit 7d0d488f25
4 changed files with 74 additions and 64 deletions

View file

@ -34,8 +34,8 @@ function check_forum_name($forumname)
{
global $db;
$sql = "SELECT *
FROM " . FORUMS_TABLE . "
$sql = "SELECT *
FROM " . FORUMS_TABLE . "
WHERE forum_name = '$forumname'";
$result = $db->sql_query($sql);
if( !$result )
@ -110,7 +110,7 @@ function get_list($mode, $id, $select)
break;
}
$sql = "SELECT *
$sql = "SELECT *
FROM $table";
if( $select == 0 )
{
@ -180,8 +180,8 @@ function renumber_order($mode, $cat = 0)
while( $row = $db->sql_fetchrow($result) )
{
$sql = "UPDATE $table
SET $orderfield = $i
$sql = "UPDATE $table
SET $orderfield = $i
WHERE $idfield = " . $row[$idfield];
if( !$db->sql_query($sql) )
{
@ -246,6 +246,10 @@ if(isset($mode)) // Are we supposed to do something?
if( $HTTP_POST_VARS['prune_enable'] == TRUE )
{
$new_forum_id = $db->sql_nextid();
if($HTTP_POST_VARS['prune_days'] == "" || $HTTP_POST_VARS['prune_freq'] == "")
{
message_die(GENERAL_ERROR, $lang['Set_prune_data'], $lang['Error']);
}
$sql = "INSERT INTO " . PRUNE_TABLE . " (forum_id, prune_days, prune_freq)
VALUES($new_forum_id, " . $HTTP_POST_VARS['prune_days'] . ", " . $HTTP_POST_VARS['prune_freq'] . ")";
@ -263,7 +267,7 @@ if(isset($mode)) // Are we supposed to do something?
{
$HTTP_POST_VARS['prune_enable'] = 0;
}
$sql = "UPDATE " . FORUMS_TABLE . "
$sql = "UPDATE " . FORUMS_TABLE . "
SET forum_name = '" . $HTTP_POST_VARS['forumname'] . "', cat_id = " . $HTTP_POST_VARS['cat_id'] . ", forum_desc = '" . $HTTP_POST_VARS['forumdesc'] . "', forum_status = " . $HTTP_POST_VARS['forumstatus'] . ", prune_enable = " . $HTTP_POST_VARS['prune_enable'] . "
WHERE forum_id = ".$HTTP_POST_VARS['forum_id'];
if( !$result = $db->sql_query($sql) )
@ -273,7 +277,12 @@ if(isset($mode)) // Are we supposed to do something?
if($HTTP_POST_VARS['prune_enable'] == 1)
{
$sql = "SELECT *
if($HTTP_POST_VARS['prune_days'] == "" || $HTTP_POST_VARS['prune_freq'] == "")
{
message_die(GENERAL_ERROR, $lang['Set_prune_data'], $lang['Error']);
}
$sql = "SELECT *
FROM " . PRUNE_TABLE . "
WHERE forum_id = " . $HTTP_POST_VARS['forum_id'];
if( !$result = $db->sql_query($sql) )
@ -283,7 +292,7 @@ if(isset($mode)) // Are we supposed to do something?
if( $db->sql_numrows($result) > 0 )
{
$sql = "UPDATE " . PRUNE_TABLE . "
$sql = "UPDATE " . PRUNE_TABLE . "
SET prune_days = " . $HTTP_POST_VARS['prune_days'] . ", prune_freq = " . $HTTP_POST_VARS['prune_freq'] . "
WHERE forum_id = " . $HTTP_POST_VARS['forum_id'];
}
@ -302,7 +311,7 @@ if(isset($mode)) // Are we supposed to do something?
break;
case 'addcat':
$sql = "SELECT MAX(cat_order) AS max_order
$sql = "SELECT MAX(cat_order) AS max_order
FROM " . CATEGORIES_TABLE;
if( !$result = $db->sql_query($sql) )
{
@ -316,7 +325,7 @@ if(isset($mode)) // Are we supposed to do something?
//
// There is no problem having duplicate forum names so we won't check for it.
//
$sql = "INSERT INTO " . CATEGORIES_TABLE . " (cat_title, cat_order)
$sql = "INSERT INTO " . CATEGORIES_TABLE . " (cat_title, cat_order)
VALUES ('" . $HTTP_POST_VARS['catname'] . "', $next_order)";
if( !$result = $db->sql_query($sql) )
{
@ -347,9 +356,9 @@ if(isset($mode)) // Are we supposed to do something?
if( $row['prune_enable'] == 1 )
{
$prune_enabled = "checked=\"checked\"";
$sql = "SELECT *
$sql = "SELECT *
FROM " . PRUNE_TABLE . "
WHERE forum_id = $forum_id";
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__);
@ -419,8 +428,8 @@ if(isset($mode)) // Are we supposed to do something?
break;
case 'modcat':
$sql = "UPDATE " . CATEGORIES_TABLE . "
SET cat_title = '" . $HTTP_POST_VARS['cat_title'] . "'
$sql = "UPDATE " . CATEGORIES_TABLE . "
SET cat_title = '" . $HTTP_POST_VARS['cat_title'] . "'
WHERE cat_id = " . $HTTP_POST_VARS['cat_id'];
if( !$result = $db->sql_query($sql) )
{
@ -437,8 +446,8 @@ if(isset($mode)) // Are we supposed to do something?
print "move '$from_id' to '$to_id'";
$sql = "SELECT *
FROM " . FORUMS_TABLE . "
$sql = "SELECT *
FROM " . FORUMS_TABLE . "
WHERE forum_id IN ($from_id, $to_id)";
if( !$result = $db->sql_query($sql) )
{
@ -457,14 +466,14 @@ if(isset($mode)) // Are we supposed to do something?
}
else
{
$sql = "UPDATE " . TOPICS_TABLE . "
$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 . "
$sql = "UPDATE " . POSTS_TABLE . "
SET forum_id = $to_id
WHERE forum_id = $from_id";
if( !$result = $db->sql_query($sql) )
@ -489,8 +498,8 @@ if(isset($mode)) // Are we supposed to do something?
$to_id = $HTTP_POST_VARS['to_id'];
print "move '$from_id' to '$to_id'";
$sql = "SELECT *
FROM " . CATEGORIES_TABLE . "
$sql = "SELECT *
FROM " . CATEGORIES_TABLE . "
WHERE cat_id IN ($from_id, $to_id)";
if( !$result = $db->sql_query($sql) )
{
@ -501,7 +510,7 @@ if(isset($mode)) // Are we supposed to do something?
message_die(GENERAL_ERROR, "Ambiguous category ID's", "", __LINE__, __FILE__);
}
$sql = "UPDATE " . FORUMS_TABLE . "
$sql = "UPDATE " . FORUMS_TABLE . "
SET cat_id = $to_id
WHERE cat_id = $from_id";
if( !$result = $db->sql_query($sql) )
@ -509,7 +518,7 @@ if(isset($mode)) // Are we supposed to do something?
message_die(GENERAL_ERROR, "Couldn't move forums to other category", "", __LINE__, __FILE__, $sql);
}
$sql = "DELETE FROM " . CATEGORIES_TABLE ."
$sql = "DELETE FROM " . CATEGORIES_TABLE ."
WHERE cat_id = $from_id";
if( !$result = $db->sql_query($sql) )
{
@ -569,8 +578,8 @@ if(isset($mode)) // Are we supposed to do something?
$move = $HTTP_GET_VARS['move'];
$cat_id = $HTTP_GET_VARS['cat_id'];
$sql = "UPDATE " . CATEGORIES_TABLE . "
SET cat_order = cat_order + $move
$sql = "UPDATE " . CATEGORIES_TABLE . "
SET cat_order = cat_order + $move
WHERE cat_id = $cat_id";
if( !$result = $db->sql_query($sql) )
{
@ -586,8 +595,8 @@ if(isset($mode)) // Are we supposed to do something?
$forum_info = get_info('forum', $forum_id);
$cat_id = $forum_info['cat_id'];
$sql = "UPDATE " . FORUMS_TABLE . "
SET forum_order = forum_order + $move
$sql = "UPDATE " . FORUMS_TABLE . "
SET forum_order = forum_order + $move
WHERE forum_id = $forum_id";
if( !$result = $db->sql_query($sql) )
{
@ -626,7 +635,7 @@ if($total_categories = $db->sql_numrows($q_categories))
{
$category_rows = $db->sql_fetchrowset($q_categories);
$sql = "SELECT *
$sql = "SELECT *
FROM " . FORUMS_TABLE . "
ORDER BY cat_id, forum_order";
if(!$q_forums = $db->sql_query($sql))

View file

@ -23,7 +23,7 @@ CREATE TABLE phpbb_auth_access (
auth_votecreate tinyint(1) DEFAULT '0' NOT NULL,
auth_attachments tinyint(1) DEFAULT '0' NOT NULL,
auth_vote tinyint(1) DEFAULT '0' NOT NULL,
auth_mod tinyint(1) DEFAULT '0' NOT NULL,
auth_mod tinyint(1) DEFAULT '0' NOT NULL,
KEY group_id (group_id),
KEY forum_id (forum_id)
);
@ -36,7 +36,7 @@ DROP TABLE IF EXISTS phpbb_user_group;
CREATE TABLE phpbb_user_group (
group_id int(11) DEFAULT '0' NOT NULL,
user_id int(11) DEFAULT '0' NOT NULL,
user_pending tinyint(1),
user_pending tinyint(1),
KEY group_id (group_id),
KEY user_id (user_id)
);
@ -47,12 +47,12 @@ CREATE TABLE phpbb_user_group (
DROP TABLE IF EXISTS phpbb_groups;
CREATE TABLE phpbb_groups (
group_id int(11) NOT NULL auto_increment,
group_type tinyint(4) DEFAULT '1' NOT NULL,
group_type tinyint(4) DEFAULT '1' NOT NULL,
group_name varchar(40) NOT NULL,
group_description varchar(255) NOT NULL,
group_moderator int(11) DEFAULT '0' NOT NULL,
group_single_user tinyint(1) DEFAULT '0' NOT NULL,
PRIMARY KEY (group_id),
PRIMARY KEY (group_id),
KEY group_single_user (group_single_user)
);
@ -66,7 +66,7 @@ CREATE TABLE phpbb_banlist (
ban_userid int(11) NOT NULL,
ban_ip char(8) NOT NULL,
ban_email varchar(255),
PRIMARY KEY (ban_id),
PRIMARY KEY (ban_id),
KEY ban_ip_user_id (ban_ip, ban_userid)
);
@ -80,7 +80,7 @@ CREATE TABLE phpbb_categories (
cat_id int(11) NOT NULL auto_increment,
cat_title varchar(100),
cat_order int(11) NOT NULL,
PRIMARY KEY (cat_id),
PRIMARY KEY (cat_id),
KEY cat_order (cat_order)
);
@ -92,46 +92,46 @@ CREATE TABLE phpbb_categories (
DROP TABLE IF EXISTS phpbb_config;
CREATE TABLE phpbb_config (
config_id int(11) NOT NULL auto_increment,
board_disable tinyint(1) DEFAULT '0' NOT NULL,
board_startdate int(11),
board_disable tinyint(1) DEFAULT '0' NOT NULL,
board_startdate int(11),
sitename varchar(100),
cookie_name char(20),
cookie_path char(25),
cookie_domain char(50),
cookie_secure tinyint(1),
session_length int(11),
cookie_domain char(50),
cookie_secure tinyint(1),
session_length int(11),
allow_html tinyint(1),
allow_html_tags char(255) DEFAULT 'b,u,i,pre,font color' NOT NULL,
allow_html_tags char(255) DEFAULT 'b,u,i,pre,font color' NOT NULL,
allow_bbcode tinyint(1),
allow_smilies tinyint(1),
allow_sig tinyint(1),
allow_namechange tinyint(1),
allow_theme_create tinyint(1),
allow_avatar_local tinyint(1) DEFAULT '0' NOT NULL,
allow_avatar_remote tinyint(1) DEFAULT '0' NOT NULL,
allow_avatar_local tinyint(1) DEFAULT '0' NOT NULL,
allow_avatar_remote tinyint(1) DEFAULT '0' NOT NULL,
allow_avatar_upload tinyint(1) DEFAULT '0' NOT NULL,
override_themes tinyint(3),
posts_per_page int(11),
topics_per_page int(11),
hot_threshold int(11),
email_sig varchar(255),
email_from varchar(100),
smtp_delivery smallint(1) DEFAULT '0' NOT NULL,
smtp_host varchar(50),
require_activation tinyint(1) DEFAULT '0' NOT NULL,
email_from varchar(100),
smtp_delivery smallint(1) DEFAULT '0' NOT NULL,
smtp_host varchar(50),
require_activation tinyint(1) DEFAULT '0' NOT NULL,
flood_interval int(4) NOT NULL,
avatar_filesize int(11) DEFAULT '6144' NOT NULL,
avatar_max_width smallint(6) DEFAULT '70' NOT NULL,
avatar_max_height smallint(6) DEFAULT '70' NOT NULL,
avatar_max_width smallint(6) DEFAULT '70' NOT NULL,
avatar_max_height smallint(6) DEFAULT '70' NOT NULL,
avatar_path varchar(255) DEFAULT 'images/avatars' NOT NULL,
smilies_path char(100) DEFAULT 'images/smiles' NOT NULL,
smilies_path char(100) DEFAULT 'images/smiles' NOT NULL,
default_theme int(11) DEFAULT '1' NOT NULL,
default_lang varchar(255),
default_dateformat varchar(14) DEFAULT 'd M Y H:i' NOT NULL,
system_timezone int(11) DEFAULT '0' NOT NULL,
sys_template varchar(100) DEFAULT 'Default' NOT NULL,
prune_enable tinyint(1) DEFAULT '1' NOT NULL,
gzip_compress tinyint(1) DEFAULT '0' NOT NULL,
prune_enable tinyint(1) DEFAULT '0' NOT NULL,
gzip_compress tinyint(1) DEFAULT '0' NOT NULL,
PRIMARY KEY (config_id)
);
@ -172,7 +172,7 @@ CREATE TABLE phpbb_forums (
cat_id int(11) NOT NULL,
forum_name varchar(150),
forum_desc text,
forum_status tinyint(4) DEFAULT '0' NOT NULL,
forum_status tinyint(4) DEFAULT '0' NOT NULL,
forum_order int(11) DEFAULT '1' NOT NULL,
forum_posts int(11) DEFAULT '0' NOT NULL,
forum_topics tinyint(4) DEFAULT '0' NOT NULL,
@ -193,7 +193,7 @@ CREATE TABLE phpbb_forums (
PRIMARY KEY (forum_id),
KEY forum_id (forum_id),
KEY forums_order (forum_order),
KEY cat_id (cat_id),
KEY cat_id (cat_id),
KEY forum_last_post_id (forum_last_post_id)
);
@ -210,8 +210,8 @@ CREATE TABLE phpbb_posts (
forum_id int(11) DEFAULT '0' NOT NULL,
poster_id int(11) DEFAULT '0' NOT NULL,
post_time int(11) DEFAULT '0' NOT NULL,
poster_ip char(8) NOT NULL,
post_username varchar(30),
poster_ip char(8) NOT NULL,
post_username varchar(30),
enable_bbcode smallint(1) DEFAULT '1' NOT NULL,
enable_html smallint(1) DEFAULT '0' NOT NULL,
enable_smilies smallint(1) DEFAULT '1' NOT NULL,
@ -255,7 +255,7 @@ CREATE TABLE phpbb_privmsgs (
privmsgs_enable_bbcode smallint(1) DEFAULT '1' NOT NULL,
privmsgs_enable_html smallint(1) DEFAULT '0' NOT NULL,
privmsgs_enable_smilies smallint(1) DEFAULT '1' NOT NULL,
privmsgs_bbcode_uid char(10) DEFAULT '0' NOT NULL,
privmsgs_bbcode_uid char(10) DEFAULT '0' NOT NULL,
PRIMARY KEY (privmsgs_id),
KEY privmsgs_from_userid (privmsgs_from_userid),
KEY privmsgs_to_userid (privmsgs_to_userid)
@ -287,7 +287,7 @@ CREATE TABLE phpbb_ranks (
rank_max int(11) DEFAULT '0' NOT NULL,
rank_special tinyint(1) DEFAULT '0',
rank_image varchar(255),
PRIMARY KEY (rank_id)
PRIMARY KEY (rank_id)
);
@ -299,7 +299,7 @@ CREATE TABLE phpbb_ranks (
# this table a type HEAP. This type of table is stored
# within system memory and therefore for big busy boards
# is likely to be noticeably faster than continually
# writing to disk ...
# writing to disk ...
#
# I must admit I read about this type on vB's board.
# Hey, I never said you cannot get basic ideas from
@ -460,7 +460,7 @@ CREATE TABLE phpbb_topics_watch (
user_id int(11) NOT NULL DEFAULT '0',
notify_status tinyint(1) NOT NULL default '0',
KEY topic_id (topic_id),
KEY user_id (user_id),
KEY user_id (user_id),
KEY notify_status (notify_status)
);
@ -487,12 +487,12 @@ CREATE TABLE phpbb_users (
user_attachsig tinyint(1),
user_allowhtml tinyint(1),
user_allowbbcode tinyint(1),
user_allowsmile tinyint(1),
user_allowavatar tinyint(1) DEFAULT '1' NOT NULL,
user_allow_pm tinyint(1) DEFAULT '1' NOT NULL,
user_allow_viewonline tinyint(1) DEFAULT '1' NOT NULL,
user_allowsmile tinyint(1),
user_allowavatar tinyint(1) DEFAULT '1' NOT NULL,
user_allow_pm tinyint(1) DEFAULT '1' NOT NULL,
user_allow_viewonline tinyint(1) DEFAULT '1' NOT NULL,
user_notify tinyint(1) DEFAULT '1' NOT NULL,
user_notify_pm tinyint(1) DEFAULT '1' NOT NULL,
user_notify_pm tinyint(1) DEFAULT '1' NOT NULL,
user_regdate int(11) DEFAULT '0' NOT NULL,
user_rank int(11) DEFAULT '0',
user_avatar varchar(100),

View file

@ -125,7 +125,7 @@ CREATE TABLE phpbb_config (
smilies_path varchar(50) DEFAULT 'images/smiles' NOT NULL,
override_themes int2 NOT NULL,
flood_interval int NOT NULL,
prune_enable int2 DEFAULT '1' NOT NULL,
prune_enable int2 DEFAULT '0' NOT NULL,
gzip_compress int2 DEFAULT '0' NOT NULL,
CONSTRAINT phpbb_config_pkey PRIMARY KEY (config_id)
);

View file

@ -843,6 +843,7 @@ $lang['reset_group_changes'] = "Reset Changes";
$lang['prune_days'] = 'Remove topics that haven\'t been posted to in';
$lang['prune_freq'] = 'Check for topic age every';
$lang['days'] = 'Days';
$lang['Set_prune_data'] = "You have turned on auto-prune for this forum but did not set a frequency or number of days to prune, please go back and do so";
//
// Word censor