Page 1 of 1

Username in forum posts

Posted: Mon 5. Jun 2006, 16:39
by frosin
Hi there!

I've installed this wonderful aplication but have a question about the forum part. I've set it as to be visible only for users that are loged in, but then I want their usernames to be in the forum. How do I do that? Now, all I get is "guest" all the time, and it doesn't look that nice :)

Posted: Mon 5. Jun 2006, 17:04
by flip-flop
Hi frosin,

the forum is still under developement.
If you need one at this time, please use an other forum-prg. via IFrame.

Knut

Posted: Mon 5. Jun 2006, 17:16
by frosin
Ok, thanks alot!

Posted: Tue 6. Jun 2006, 19:06
by frosin
Hi again... There is another way :)

I've been looking around a bit in the code and found a way to make this possible. First I've installed the mod_login by markoehl wich you can find here: http://www.phpwcms.de/forum/viewtopic.php?t=9696

Here is how it's done:

Add a new row in table _phpwcms_forum
forum_user varchar(100) NULL = Yes Standard=NULL


in /include/inc_front/content/cnt53.article.inc.php

Add the following to row 175
$sql_topic .= "forum_user = '" .$_SESSION["wcs_user_name"] . "'";
and change row 174 to
$sql_topic .= "forum_text = '".aporeplace($content['forum']['topic']['message'])."', ";

change row 297
$CNT_TMP .= html_specialchars($GLOBALS['FE_USER'][$row_t['forum_uid']]['login']).'&nbsp;</span></td>'."\n";
to
$CNT_TMP .= $row_t["forum_user"].'&nbsp;</span></td>'."\n";


Add the following to row 367
$sql_reply .= "forum_user = '".$_SESSION["wcs_user_name"]."'";
and change row 366 to
$sql_reply .= "forum_text = '".aporeplace($content['forum']['reply']['message'])."', ";

change row 485
$CNT_TMP .= html_specialchars($GLOBALS['FE_USER'][$row_t['forum_uid']]['login'])."</td>\n";
to
$CNT_TMP .= $row_f["forum_user"]."</td>\n";

change row 511
$CNT_TMP .= html_specialchars($GLOBALS['FE_USER'][$row_p['forum_uid']]['login'])."</td>\n";
to
$CNT_TMP .= $row_p["forum_user"]."</td>\n";

If you instead want the username (not the users name) use $_SESSION["wcs_user"] instead of $_SESSION["wcs_user_name"]

Good luck!

Posted: Tue 21. Nov 2006, 02:27
by Mmmarkus
hi frosin! thanks a lot!

it works for 50% :lol:

Overview Thread:
Image

Posting:
Image

Any ideas?

Posted: Tue 21. Nov 2006, 02:47
by Mmmarkus
Update:

The 2nd Posting is still okay.....

Image

update

Posted: Sat 9. Dec 2006, 18:40
by phalancs
I did not know about this post.

I did it in a different way. It works (and a lot more too) :)
check this:

No database update is necessary!

http://www.phpwcms.de/forum/viewtopic.php?t=13134

P.S.: Your problems reason: the first post is the "topic post" this post is formatted somewhere else in the code: right above where you changed things.