Struktura forum

0

Nie wiem, ja forum działa obecnie, ale zrobiłem plan struktury, na której mogłoby działać:

  1. Podstawowy poziom to sekcje główne przechowywane w takiej oto tabeli:

CREATE TABLE coyote_f_sections (
section_id int(5) NOT NULL auto_increment,
section_user int(8) NOT NULL default '0',
section_name varchar(128) NOT NULL default '',
section_mod_time datetime NOT NULL default '0000-00-00 0000',
section_description varchar(250) NOT NULL default '',
section_topic_counter smallint(5) NOT NULL default '0',
section_msg_counter smallint(5) NOT NULL default '0',
UNIQUE KEY id (section_id),
) TYPE=MyISAM;

id - identyfikator
user - użytkownik, który ostatnio coś wpisał
name - nazwa sekcji
mod_time - czas ostatniej modyfikacji
description - któtki opisik (jeszcze nie wymyśliłem, gdzie mógłby być, ale mam zarysy pomysłu)
topic_counter - liczba tematów
msg_counter - liczba wiadomości

to miało by być coś takiego, jak poział na stronie głównej forum - programowanie, inne, developer itp. - wszystkie wyświetlone na jednej stronie

  1. Podsekcje (tak jak teraz "Delphi", "C++") w takiej tabeli:

CREATE TABLE coyote_f_subsections (
subsection_id int(5) NOT NULL auto_increment,
subsection_sec_id int(5) NOT NULL,
subsection_user int(8) NOT NULL default '0',
subsection_name varchar(128) NOT NULL default '',
subsection_mod_time datetime NOT NULL default '0000-00-00 0000',
subsection_description varchar(250) NOT NULL default '',
subsection_topic_counter smallint(5) NOT NULL default '0',
subsection_msg_counter smallint(5) NOT NULL default '0',
UNIQUE KEY id (subsection_id),
) TYPE=MyISAM;

sec_id - id sekcji, w której znajduje się podsekcja.

  1. Tematy, w takiej tabeli:

CREATE TABLE coyote_f_topics (
topic_id int(5) NOT NULL auto_increment,
topic_subsec_id int(5) NOT NULL,
topic_user_cr int(8) NOT NULL default '0',
topic_user int(8) NOT NULL default '0',
topic_name varchar(128) NOT NULL default '',
topic_mod_time datetime NOT NULL default '0000-00-00 0000',
topic_msg_counter smallint(5) NOT NULL default '0',
UNIQUE KEY id (topic_id),
) TYPE=MyISAM;

subsec_id - id podsekcji, w której jest temat
user_cr - użytkownik, który utworzył temat

  1. Wiadomości/posty (jak kto woli), w tej tabeli:

CREATE TABLE coyote_f_messages (
message_id int(5) NOT NULL auto_increment,
message_user int(8) NOT NULL default '0',
message_topic_id int(5) NOT NULL,
message_content text NOT NULL,
message_time datetime NOT NULL default '0000-00-00 0000',
message_ip varchar(30) NOT NULL default '',
UNIQUE KEY id (message_id),
FULLTEXT KEY title (message_subject,message_content)
) TYPE=MyISAM;

topic_id - id tematu, w którym jest wiadomość
content - treść

  1. Budowa forum:

potrzebny do działania forum parametr pliku (chociażby forumcmd) jest tylko jeden, mający np. następującą postać:

pusty parametr albo jego brak - ma zostać otwarta główna strona forum
S4 - ma zostać otwarta lista tematów podsekcji nr. 4
T468 - ma zostać otwarty temat nr. 468

NT5 - tworzenie nowego temat w sekcji nr. 5
NM1260 - tworzenie nowej wiadomości w temacie nr. 1260

To tylko propozycja, ale myślę że sensowna, bo znacznie uprości pracę - nie trzeba kilku parametrów, tylko jeden, który przekazuje potrzebne informacje. Przedrostki literowe których użyłem to też tylko propozycje, gdyby ten system się wam spodobał, trzeba by na pewno uzgodnić dokładną składnię poleceń.

0

Oto moja propozycja (btw: ustalilismy, ze nie bedzie juz w bazie pol typu datetime, tylko int):

Struktura tabeli dla coyote_forum

CREATE TABLE coyote_forum (
forum_id smallint(2) NOT NULL auto_increment,
forum_title char(128) default NULL,
forum_description char(255) default NULL,
forum_threads int(6) NOT NULL default '0',
forum_posts int(6) NOT NULL default '0',
forum_user char(30) NOT NULL default '0',
forum_time int(11) NOT NULL default '0',
forum_status tinyint(1) NOT NULL default '0',
forum_separator char(255) NOT NULL default '',
UNIQUE KEY id (forum_id)
) TYPE=MyISAM;

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

Kolumny:

  • forum_title - tytul konkrtenego forum
  • forum_description - opis forum
  • forum_threads - ilosc watkow na forum
  • forum_posts - ilosc postow
  • forum_time - czas napisania ostatniego postu
  • forum_status - status forum (publiczne, dla moderatorow itp)
  • forum_separator - dzieki tej kolumnie da sie uniknac tworzenia kolejnej tabeli z grupami

Taka tabela jak powyzej dziala w obecnej wersji forum. Po prostu forum_separator zawiera kod HTML, ktory powoduje wyswietlenie separatora pomiedzy forami - Programowanie, Inne, Developer

Struktura tabeli dla coyote_post

CREATE TABLE coyote_post (
post_id int(7) NOT NULL auto_increment,
post_post text,
post_topic int(10) default NULL,
post_user varchar(30) NOT NULL default '',
post_time int(11) NOT NULL default '0',
post_emoticon tinyint(1) NOT NULL default '1',
post_ip varchar(255) NOT NULL default '',
UNIQUE KEY id (post_id)
) TYPE=MyISAM;

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

Kolumny:

  • post_post - tresc postu
  • post_topic - id topicu
  • post_user - uzytkownik, ktory napisal post
  • post_time - czas napisania
  • post_emoticon - wyswietlac emoticony?
  • post_ip - ip uzytkownika, ktory napisal post

Struktura tabeli dla coyote_topic

CREATE TABLE coyote_topic (
topic_id int(10) NOT NULL auto_increment,
topic_subject varchar(125) NOT NULL default '',
topic_user varchar(30) NOT NULL default '',
topic_counter smallint(5) NOT NULL default '0',
topic_time int(11) NOT NULL default '0',
topic_reply smallint(3) NOT NULL default '0',
topic_last_time int(11) default NULL,
topic_forum tinyint(2) default '0',
topic_type tinyint(1) NOT NULL default '0',
topic_last_user int(8) default NULL,
topic_reply_me tinyint(1) NOT NULL default '1',
UNIQUE KEY id (topic_id)
) TYPE=MyISAM;

Kolumny:

  • topic_subject - temat
  • topic_user - id usera, ktory napisal temat
  • topic_counter - licznik odwiedzin
  • topic_time - czas napisania
  • topic_reply - ilosc odpowiedzi
  • topic_last_time - czas napisania ostatniego postu
  • topic_forum - forum, do ktorego nalezy topic
  • topic_type - typ tematu (ogloszenie, przyklejony itp)
  • topic_last_user - uztrkownik, ktory napisal ostatni post
  • topic_reply_me - okresla, czy tresc odpowiedzi bedzie przeslana uzytkownikowi na e-maila

1 użytkowników online, w tym zalogowanych: 0, gości: 1