Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Discussions (General)
 is there an alternative to strTablePrefix?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

e3stone
Average Member

USA
885 Posts

Posted - 13 October 2002 :  16:43:13  Show Profile  Send e3stone an AOL message
with the proper use of indexes, couldn't we add another table to the database called "SITE" and the admin could define all the sites he wanted. The admin would just change the site_id in the config file. Right now, if an admin wants 10 different sites, then he/she is going to have a ton of tables in the DB.

True, all the topics and replies for all the different sites would be stored in one table...that table would probably grow to a fairly large size, but if we index the site_id and topic_id, then would it degrade performance that much?

I'm only bringing this up because 1) I don't want a ton of tables and 2) I'd like to use stored procedures, but with the table prefix needed in each of the queries, it totally negates the performance advantage of sp's.

<-- Eric -->

GauravBhabu
Advanced Member

4288 Posts

Posted - 13 October 2002 :  17:07:25  Show Profile
You can set the strTablePrefix = ""
Go to Top of Page

e3stone
Average Member

USA
885 Posts

Posted - 13 October 2002 :  17:28:19  Show Profile  Send e3stone an AOL message
This is true, but for those who want multiple Snitz Forums, then we'd have to have some way to seperate the different cats/forums/topics/replies. Having a "SITE" table is the only way I can think of doing this if I get rid of the strTablePrefix variable.

I'm just wondering if there would be much performance loss if I did this. Since the site_id would be in the WHERE clause of all the queries, I would add it to the index of all the tables.

good idea? bad idea?

<-- Eric -->
Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 13 October 2002 :  17:51:02  Show Profile
quote:
Originally posted by GauravBhabu

You can set the strTablePrefix = ""


Oh, now I get it (took a couple of minutes).
GauravBhabu is right.

Set strTablePrefix to null and then you can write all of your sp without having to include the prefix. Oh well, too late for me.

The use of SITE_ID would work. If you include SITE_ID in the category, forum, topic, reply tables then it wouldn't be a big deal I wouldn't think. There'd be a lot of modifying you would have to do to support this, but I'm sure you're aware of this.

You could modify the CONFIG_NEW table and add SITE_ID so each site could have it's own configuration.

Downside, if the forums become active, that could be a lot of records. However since you're using SQL Server, that would have to be a LOT of records to become an issue.

Go to Top of Page

e3stone
Average Member

USA
885 Posts

Posted - 13 October 2002 :  18:27:06  Show Profile  Send e3stone an AOL message
I just thought....(I tend to do this on occation ) With this current setup, if someone has multiple forums(sites) and uses the same member table for all the different forums(sites), then there's no way of keeping track of how many posts the user has in a particular forum(site). It would give the total post count for all the forums(sites) combined. Am I accurate?

<-- Eric -->
Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 13 October 2002 :  18:53:30  Show Profile
By storing the SITE_ID in the topic,reply tables, then all you have to do is modify the query for total post count and add in the criteria of SITE_ID = x if you want the total for a specific forum/site.

You're idea is definitely possible, but like I said, it would require a bit of work to modify everything to implement the SITE_ID.
Go to Top of Page

alex042
Average Member

USA
631 Posts

Posted - 13 October 2002 :  21:04:43  Show Profile  Send alex042 an AOL message  Send alex042 a Yahoo! Message
You could use grouping for your sites. I had thought about this as an option since I couldn't think of anything else useful for the current grouping feature.
Go to Top of Page

e3stone
Average Member

USA
885 Posts

Posted - 13 October 2002 :  21:39:31  Show Profile  Send e3stone an AOL message
Well, I was actually thinking about the potential features of having a SITE table with a SITE_ID. You could actually have a Category named "Announcements" and have it referenced by all your sites and show up on all your sites. ...or have one poll question and have it answered by all your sites. Could you picture the buttons on the poll..."Vote","View Results", "See How Other Forums Are Voting" (might be a long button, but you get the point )

<-- Eric -->
Go to Top of Page

bjlt
Senior Member

1144 Posts

Posted - 13 October 2002 :  23:24:10  Show Profile
I'm really interested in the idea as I'm thinking how to build multiple sites. In this topic it's suggested to build independent forums.
http://forum.snitz.com/forum/topic.asp?TOPIC_ID=36816

Well, with a site_ID how do you customise each site (forum) then? I think we also need make new m_lev for this, at least a site_owner or a function to check a username with a site_ID.

Will you share your member table or not?

Edited by - bjlt on 13 October 2002 23:24:27
Go to Top of Page

e3stone
Average Member

USA
885 Posts

Posted - 13 October 2002 :  23:29:42  Show Profile  Send e3stone an AOL message
Ok, I guess I need to denormalize this design....check out this query to just get the post count from a particular site:

SELECT Count(POST.POST_ID) AS POST_COUNT
FROM (SITE INNER JOIN (((CATEGORY INNER JOIN FORUM ON CATEGORY.CAT_ID = FORUM.CAT_ID) INNER JOIN SITE_CATEGORY ON CATEGORY.CAT_ID = SITE_CATEGORY.CAT_ID) INNER JOIN TOPIC ON FORUM.FORUM_ID = TOPIC.FORUM_ID) ON SITE.SITE_ID = SITE_CATEGORY.SITE_ID) INNER JOIN POST ON TOPIC.TOPIC_ID = POST.TOPIC_ID
WHERE (((SITE.SITE_ID)=1));

This is coming from this design:

SITE
SITE_ID(PK)
SITE_NAME

SITE_CATEGORY
SITE_ID(PK)(FK)
CAT_ID(PK)(FK)

CATEGORY
CAT_ID(PK)
CAT_NAME

FORUM
FORUM_ID
FORUM_NAME
CAT_ID(FK)

TOPIC
TOPIC_ID(PK)
TOPIC_SUBJECT
LAST_POST_ID
FIRST_POST_ID
FORUM_ID(FK)

POST
POST_ID(PK)
POST_TEXT
TOPIC_ID(FK)

This is the design I came up with for the admin to be able to have multiple sites, but also be able to have a category be viewable on multiple sites, with members from all the sites being able to post on that category. So...I can't have SITE_ID in the post table. This might be a bigger headache than I want. I might just have it were admins can have multiple sites, but not be able to cross-post categories.

Please ignore me

<-- Eric -->
Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 14 October 2002 :  01:02:03  Show Profile
bjlt, personally I'd still recommend separate versions. I'm just participating in the discussion.

This is a really good idea if you can get it down. You'd have to have like a super-admin and then admins for each site. It would have to be locked down so that an admin for one site can't affect another site's forum.

Another consideration is the member's information, like email. Since once a member signs up for one site, he's probably going to have access to all of them, do you let the user know what sites he's signed at now? If any of the site admins can see any of the member records, then could that potentially be a problem. If a member signs up at Site A, does that give Site B the permission to include that member in emails? What if Site A and Site B are the ideologically opposite?

I like the idea for the case where an entity may have different types of content/subject matter and different sites could be created. Even though the sites/forums might be different, they're all owned by a single entity. In the case where you're providing this as a service and offer this to other companies, I think it could get complicated. Now you have the member, the service provider and the various companies all involved. How many privacy policies would you have to have?

Edited by - work mule on 14 October 2002 01:04:22
Go to Top of Page

@tomic
Senior Member

USA
1790 Posts

Posted - 14 October 2002 :  01:17:32  Show Profile  Visit @tomic's Homepage  Send @tomic an ICQ Message
So do you mean it's basically an EZBoard setup? Would you just have members join first with a general profile and then select what forums they would like to join(out of forums electing to accept membership that way). So editing of members probably wouldn't be done at the forum admin level. Unless there were fields specific to that forum's members that they could edit but those only. I would think members would select to accept email from forums they specifically elect to receive from. There would need to be a lot more options to everything. You would need a privacy policy that each forum's admin created. It sounds like a sickening amount of work. But it would be pretty sweet.

@tomic

SportsBettingAcumen.com
Go to Top of Page

e3stone
Average Member

USA
885 Posts

Posted - 14 October 2002 :  01:26:10  Show Profile  Send e3stone an AOL message
I think the members would have to be stored like this:

MEMBER
MEMBER_ID(PK)
MEMBER_NAME
MEMBER_USERNAME
MEMBER_PASSWORD

SITE
SITE_ID(PK)
SITE_NAME

SITE_MEMBER
SITE_ID(PK)
MEMBER_ID(PK)
MEMBER_POSTS
MEMBER_LASTHEREDATE

This way a member would have to register only once, but could add different sites to his "site list." Probably have a Super Admin (admin of all the sites) and a Site Admin for each individual site. Each individual site would function independently. Private messages would only be able to be sent to users within the same site. The only person who could send an email to everyone from every site in the DB would be the "Super Admin." So, if I were registered for Site A in my database, then Site B would not even know I existed, unless I included Site B in my "site list." So, one could easily setup a community like Delphi Forums (gosh, do you remember that topic when those people came over and asked about changing the format of Snitz to a Delphi-like look? WMII, didn't you throw a delphi-like Snitz together?)

I'm still toying around with all the possible things that could be done with having a SITE table. I think it might be a better design than having the strTablePrefix, but I'm not sure. I'll have to compare the performance of the two after I finish converting the code...which I haven't even started on yet. Might take a while, too.



<-- Eric -->
Go to Top of Page

bjlt
Senior Member

1144 Posts

Posted - 14 October 2002 :  02:39:21  Show Profile
I wonder how does MS passport.net work?
Go to Top of Page

VodkaFish
Average Member

USA
654 Posts

Posted - 14 October 2002 :  16:09:36  Show Profile  Send VodkaFish an AOL message  Send VodkaFish an ICQ Message  Send VodkaFish a Yahoo! Message
I do this now on my sites. Same users - and some of the same forums. After all, misc forums fit most sites, so why not share?

What I did was use the same tables, but 2 different config tables (and created strConfigTablePrefix). Let's you control different sites differently while not really effecting the forums much.

v ø d k â f ï § h
Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 14 October 2002 :  21:59:15  Show Profile
quote:
So, one could easily setup a community like Delphi Forums (gosh, do you remember that topic when those people came over and asked about changing the format of Snitz to a Delphi-like look? WMII, didn't you throw a delphi-like Snitz together?)


Yeah, I was working on implementing some of the things over at Delphi. I still have the code, but it was never completed. I wouldn't mind going back to work on it, but WM 2.0 isn't as ambitious as the previous version (WM 1.0).
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.42 seconds. Powered By: Snitz Forums 2000 Version 3.4.07