aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/index.php
diff options
context:
space:
mode:
authorJames Atkinson <thefinn@users.sourceforge.net>2001-06-11 00:58:08 +0000
committerJames Atkinson <thefinn@users.sourceforge.net>2001-06-11 00:58:08 +0000
commitcb44575d8ac73c719e252556c64572a6e84e4f7f (patch)
treecfa963e88c5e97a6ab7e765ce6cc6dcf924fe72d /phpBB/index.php
parentb71e098cdc39752a32c50a7147f893f582e86d26 (diff)
downloadforums-cb44575d8ac73c719e252556c64572a6e84e4f7f.tar
forums-cb44575d8ac73c719e252556c64572a6e84e4f7f.tar.gz
forums-cb44575d8ac73c719e252556c64572a6e84e4f7f.tar.bz2
forums-cb44575d8ac73c719e252556c64572a6e84e4f7f.tar.xz
forums-cb44575d8ac73c719e252556c64572a6e84e4f7f.zip
Posting preview done, ability for anonymous users to post with a username
git-svn-id: file:///svn/phpbb/trunk@463 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/index.php')
-rw-r--r--phpBB/index.php19
1 files changed, 13 insertions, 6 deletions
diff --git a/phpBB/index.php b/phpBB/index.php
index cb6ecb8e7a..cfdfe6c98a 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -136,7 +136,7 @@ if($total_categories)
{
case 'postgresql':
$limit_forums = ($viewcat != -1) ? "AND f.cat_id = $viewcat " : "";
- $sql = "SELECT f.*, t.topic_id, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, p.post_time
+ $sql = "SELECT f.*, t.topic_id, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, p.post_time, p.post_username
FROM ".FORUMS_TABLE." f, ".TOPICS_TABLE." t, ".POSTS_TABLE." p, ".USERS_TABLE." u, ".AUTH_FORUMS_TABLE." af
WHERE f.forum_last_post_id = p.post_id
AND p.post_id = t.topic_last_post_id
@@ -144,7 +144,7 @@ if($total_categories)
AND af.forum_id = f.forum_id
$limit_forums
UNION (
- SELECT f.*, NULL, NULL, NULL, NULL, NULL, NULL
+ SELECT f.*, NULL, NULL, NULL, NULL, NULL, NULL, NULL
FROM ".FORUMS_TABLE." f
WHERE NOT EXISTS (
SELECT p.post_time
@@ -158,7 +158,7 @@ if($total_categories)
case 'oracle':
$limit_forums = ($viewcat != -1) ? "AND f.cat_id = $viewcat " : "";
- $sql = "SELECT f.*, t.topic_id, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, p.post_time
+ $sql = "SELECT f.*, t.topic_id, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, p.post_time, p.post_username
FROM ".FORUMS_TABLE." f, ".POSTS_TABLE." p, ".TOPICS_TABLE." t, ".USERS_TABLE." u, ".AUTH_FORUMS_TABLE." af
WHERE f.forum_last_post_id = p.post_id(+)
AND p.post_id = t.topic_last_post_id(+)
@@ -180,7 +180,7 @@ if($total_categories)
$limit_forums
ORDER BY f.cat_id, f.forum_order";
*/
- $sql = "SELECT f.*, t.topic_id, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, p.post_time, af.auth_view, af.auth_read, af.auth_post, af.auth_reply, af.auth_edit, af.auth_delete, af.auth_votecreate, af.auth_vote
+ $sql = "SELECT f.*, t.topic_id, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, p.post_time, p.post_username, af.auth_view, af.auth_read, af.auth_post, af.auth_reply, af.auth_edit, af.auth_delete, af.auth_votecreate, af.auth_vote
FROM ((( ".FORUMS_TABLE." f
LEFT JOIN ".POSTS_TABLE." p ON f.forum_last_post_id = p.post_id )
LEFT JOIN ".TOPICS_TABLE." t ON p.post_id = t.topic_last_post_id )
@@ -282,11 +282,18 @@ if($total_categories)
if($forum_rows[$j]['username'] != "" && $forum_rows[$j]['post_time'] > 0)
{
-
+ if($forum_rows[$j]['user_id'] == ANONYMOUS && $forum_rows[$j]['post_username'] != '')
+ {
+ $last_poster = $forum_rows[$j]['post_username'];
+ }
+ else
+ {
+ $last_poster = $forum_rows[$j]['username'];
+ }
$last_post_time = create_date($board_config['default_dateformat'], $forum_rows[$j]['post_time'], $board_config['default_timezone']);
$last_post = $last_post_time . "<br />by ";
- $last_post .= "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $forum_rows[$j]['user_id']) . "\">" . $forum_rows[$j]['username'] . "</a>&nbsp;";
+ $last_post .= "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $forum_rows[$j]['user_id']) . "\">" . $last_poster . "</a>&nbsp;";
$last_post .= "<a href=\"" . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $forum_rows[$j]['topic_last_post_id']) . "#" . $forum_rows[$j]['topic_last_post_id'] . "\"><img src=\"" . $images['latest_reply'] . "\" width=\"20\" height=\"11\" border=\"0\" alt=\"View Latest Post\"></a>";