Username in forum posts

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
frosin
Posts: 6
Joined: Sun 4. Jun 2006, 20:00
Location: Stockholm, Sweden

Username in forum posts

Post 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 :)
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Post 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
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
frosin
Posts: 6
Joined: Sun 4. Jun 2006, 20:00
Location: Stockholm, Sweden

Post by frosin »

Ok, thanks alot!
frosin
Posts: 6
Joined: Sun 4. Jun 2006, 20:00
Location: Stockholm, Sweden

Post 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!
Mmmarkus
Posts: 25
Joined: Sun 8. Jan 2006, 17:59

Post by Mmmarkus »

hi frosin! thanks a lot!

it works for 50% :lol:

Overview Thread:
Image

Posting:
Image

Any ideas?
Mmmarkus
Posts: 25
Joined: Sun 8. Jan 2006, 17:59

Post by Mmmarkus »

Update:

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

Image
phalancs
Posts: 793
Joined: Thu 19. Feb 2004, 05:09
Location: Germany

update

Post 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.
2008
Post Reply