Mysql

Table structure for table forumCatagories

CREATE TABLE forumCatagories (
catagoryID int(11) NOT NULL auto_increment,
title varchar(50) default NULL,
displayOrder int(11) default ‘0’,
PRIMARY KEY (catagoryID)
) TYPE=MyISAM;

--------------------------------------------------------

Table structure for table forumForums

CREATE TABLE forumForums (
forumID int(11) NOT NULL auto_increment,
catagoryID int(11) default NULL,
title varchar(40) default NULL,
displayOrder int(11) default ‘0’,
threadCount int(11) default ‘0’,
lastPost int(11) default ‘0’,
description varchar(100) default NULL,
lastUserID int(11) default NULL,
postNewLevel tinyint(4) default ‘0’,
postReplyLevel tinyint(4) default ‘0’,
PRIMARY KEY (forumID)
) TYPE=MyISAM;

--------------------------------------------------------

Table structure for table forumPosts

CREATE TABLE forumPosts (
postID int(11) NOT NULL auto_increment,
threadID int(11) default NULL,
userID int(11) default NULL,
message mediumtext,
posted int(11) default NULL,
notify tinyint(4) NOT NULL default ‘0’,
addsig tinyint(4) NOT NULL default ‘0’,
topic varchar(255) default NULL,
PRIMARY KEY (postID),
FULLTEXT KEY topic (topic,message)
) TYPE=MyISAM;

--------------------------------------------------------

Table structure for table forumThreads

CREATE TABLE forumThreads (
threadID int(11) NOT NULL auto_increment,
userID int(11) default NULL,
topic varchar(100) default NULL,
replies int(11) default ‘0’,
lastPost int(11) default NULL,
sticky tinyint(4) default ‘0’,
forumID int(11) NOT NULL default ‘0’,
announcement tinyint(4) default ‘0’,
PRIMARY KEY (threadID)
) TYPE=MyISAM;

--------------------------------------------------------

Table structure for table forumUsers

CREATE TABLE forumUsers (
userID int(11) NOT NULL auto_increment,
username varchar(20) default NULL,
password varchar(40) default NULL,
title varchar(30) default NULL,
email varchar(255) default NULL,
userLevel tinyint(11) default ‘0’,
signature tinytext,
postCount int(11) default ‘0’,
PRIMARY KEY (userID)
) TYPE=MyISAM;

this is the one i used and paste so where do edit here or add command for the topics ?

eyezberg where are you?

@ work, lol…
get back to ya later…

<?

// Include dBase file
include('common.php');

// Connect to database
$link = dbConnect();

// If connection failed...
if (!$link) {
    // Inform user of error and quit
    print "Couldn't connect to database server";
    exit;
}

// Attempt to select database
print "Attempting to select database $dbName <br>
";
if(!@mysql_select_db($dbName)) {
    // Inform user of error and exit
    print "# Couldn't select database <br>
";
    exit;
} else {
    // Inform user of success
    print "# Database selected successfully <br>
";
}

//create demo catagories ***********************
query = "INSERT INTO forumCatagories (catagoryID, title, displayOrder) VALUES (1, 'General [Read only!]', 1)";
$result = @mysql_query($query);
if (!$result) {
    // Inform user of error
    print "# Error inserting General<br>
";
    print mysql_error();
} else {
    // Inform user of success
    print "# General catagory created<br>
";
}
$query = "INSERT INTO forumCatagories (catagoryID, title, displayOrder) VALUES (2, 'Development Help', 2)";
$result = @mysql_query($query);
if (!$result) {
    // Inform user of error
    print "# Error inserting Development<br>
";
    print mysql_error();
} else {
    // Inform user of success
    print "# Development catagory created<br>
";

//etc..., change the title to what you want, add as many as needed, incrementing the catagoryID...

//create demo forums ******************************
//carefull to use the catID where you want the forum to show up!
//all you really need to change here is:
//-the number of forums/queries you want
//-the title
//-the description
//-the forumID

//catID 1 of 4
$query1 = "INSERT INTO forumForums (forumID, catagoryID, title, description, displayOrder, threadCount, lastPost,  postNewLevel, postReplyLevel, lastUserID) VALUES (1, 1, 'Announcements', 'If I need to tell ya something, it\'ll be here!', 1, 0, 0, 0, 0, NULL)";
$result = @mysql_query($query1);
if (!$result) {
    // Inform user of error
    print "# Error inserting Announcements forum<br>
";
    print mysql_error();
} else {
    // Inform user of success
    print "# Announcements forum created -ID = 1<br>
";
}

//etc..as many for each catagory as you want...

//insert the admin user***************
$pass = md5('YOURPASSWORDHERE');
$reginfo = time();

print "# Inserting admin user - ID=2<br>
";

$query15 = "INSERT INTO forumUsers (userID, username, password, title, email, userLevel, signature, postCount, reginfo) VALUES (2, bongbox, '".$pass."', 'admin', '[email protected]', 5, 'YOURSIGNATURE', 0, '".$reginfo."')";
$result = @mysql_query($query15);
if (!$result) {
    // Inform user of error
    print "# Error creating admin account<br>
";
    print mysql_error();
} else {
    // Inform user of success
    print "# admin user ready to go<br>
";
	print "# admin user is:<br>name:".$username."
";
	print "# End of default users<br>
";
}

// Close link to database server 
mysql_close($link);

print "End of setup / link closed";

?>

save as “setup.php”, read the //comments!!!, change the vars in CAPS for admin user (you), add desired catagories & forums queries, run in browser and you’re set…

so ill save it up setup.php and then change vars in CAPs
what do you mean by vars in caps and how do i add categories
sorry if i pick up to slow

ok i get the admin user caps vars only the one to add categories

categories inserted at beginning, 2 are ready, if you want more, copy this part

query = “INSERT INTO forumCatagories (catagoryID, title, displayOrder) VALUES (1, ‘General [Read only!]’, 1)”;
$result = @mysql_query($query);
if (!$result) {
// Inform user of error
print “# Error inserting General<br>
”;
print mysql_error();
} else {
// Inform user of success
print “# General catagory created<br>
”;
}

as many times as needed and change the values.
Same with forums: add as many blocks of

$query1 = “INSERT INTO forumForums (forumID, catagoryID, title, description, displayOrder, threadCount, lastPost, postNewLevel, postReplyLevel, lastUserID) VALUES (1, 1, ‘Announcements’, ‘If I need to tell ya something, it’ll be here!’, 1, 0, 0, 0, 0, NULL)”;
$result = @mysql_query($query1);
if (!$result) {
// Inform user of error
print “# Error inserting Announcements forum<br>
”;
print mysql_error();
} else {
// Inform user of success
print “# Announcements forum created -ID = 1<br>
”;
}

and change values as needed…read the comments…

where exactly in the beginning? lets say i wanna add general discusion as an example

eyezberg did you get my email

yes, and replied…
don’t forget i’m in europe, so there’s quite some time difference… :wink:

lol ok

all set up, check it out & your mail too…

**** you, joke lol, your good tnx a lot

if you want to remove the dummy stuff i inserted, just display/browse the forumForums table, and check the ones you don’t want, click delete…

any other help, mail or post…
:wink:

i am trying to register when i register it always giving a warning that the email is wrong…you could try it yourself try to register and see what happen

i cant get the registration working always alerting the the email is invalid what seems to be the probles?