mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
Added post subject to postgres schema. Updated viewtopic query to include group by for the auth forums table when linking after posting
git-svn-id: file:///svn/phpbb/trunk@389 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
3ed50ce0b7
commit
09e7aef120
2 changed files with 3 additions and 2 deletions
|
@ -182,10 +182,10 @@ CREATE INDEX _phpbb_forum_mods_index ON phpbb_forum_mods (forum_id, user_id);
|
|||
-------------------------------------------------------- */
|
||||
CREATE TABLE phpbb_forums (
|
||||
forum_id int4 DEFAULT nextval('phpbb_forums_id_seq'::text) NOT NULL,
|
||||
cat_id int4,
|
||||
forum_name varchar(150),
|
||||
forum_desc text,
|
||||
forum_access int2,
|
||||
cat_id int4,
|
||||
forum_order int4 DEFAULT '1' NOT NULL,
|
||||
forum_type int2,
|
||||
forum_posts int4 DEFAULT '0' NOT NULL,
|
||||
|
@ -234,6 +234,7 @@ CREATE INDEX topic_id_phpbb_posts_index ON phpbb_posts (topic_id);
|
|||
-------------------------------------------------------- */
|
||||
CREATE TABLE phpbb_posts_text (
|
||||
post_id int4 DEFAULT '0' NOT NULL,
|
||||
post_subject varchar(255),
|
||||
post_text text,
|
||||
CONSTRAINT phpbb_posts_text_pkey PRIMARY KEY (post_id)
|
||||
);
|
||||
|
|
|
@ -136,7 +136,7 @@ else
|
|||
$join_sql_table = (!isset($post_id)) ? "" : "".POSTS_TABLE." p, ".POSTS_TABLE." p2,";
|
||||
$join_sql = (!isset($post_id)) ? "t.topic_id = $topic_id" : "p.post_id = $post_id AND t.topic_id = p.topic_id AND p2.topic_id = p.topic_id AND p2.post_id <= $post_id";
|
||||
$count_sql = (!isset($post_id)) ? "" : ", COUNT(p2.post_id) AS prev_posts";
|
||||
$order_sql = (!isset($post_id)) ? "" : "GROUP BY fm.user_id, p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, f.forum_name, f.forum_id, u.username, u.user_id, fa.auth_read ORDER BY p.post_id ASC";
|
||||
$order_sql = (!isset($post_id)) ? "" : "GROUP BY fa.forum_id, fa.auth_view, fa.auth_post, fa.auth_reply, fa.auth_edit, fa.auth_delete, fa.auth_vote, fa.auth_votecreate, fm.user_id, p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, f.forum_name, f.forum_id, u.username, u.user_id, fa.auth_read ORDER BY p.post_id ASC";
|
||||
|
||||
$sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, f.forum_name, f.forum_id, u.username, u.user_id, fa.*".$count_sql."
|
||||
FROM $join_sql_table ".TOPICS_TABLE." t, ".FORUMS_TABLE." f, ".FORUM_MODS_TABLE." fm, ".USERS_TABLE." u, ".AUTH_FORUMS_TABLE." fa
|
||||
|
|
Loading…
Add table
Reference in a new issue