randomling: Tegan Jovanka (of Doctor Who). (tegan)
Lee ([personal profile] randomling) wrote in [site community profile] dw_dev_training2012-08-27 08:25 pm

Displaying the people who posted comments!

Hi guys,

I'm working on bug 4242 - including the poster of the comment in the preview page (helpful for people who might be posting comments as the wrong user, not noticed they're not logged in, wanted to use their OpenID, whatever).

I've managed to display the commenter's username - as long as they're actually a logged-in user of DW. However, anon and OpenID comments break the preview page now, because I haven't figured out how to display anon and OpenID there yet.

I was hoping to take my lead from the actual comments pages of entries, which show them just fine. But while I can find the page that deals with the comments page (/htdocs/talkread.bml) I can't actually find the place where it displays the username. It's a forest of code!

I wonder if anyone could show me the place where that happens? A copy/paste, line number, or thing to search the file for would really help me to get started.

Thanks!

ETA: Look, [staff profile] denise, I asked for help!
momijizukamori: Grey tabby cat with paws on keyboard and mouse. The text reads 'code cat is on the job', lolcats-style (CODE CAT)

[personal profile] momijizukamori 2012-08-27 09:13 pm (UTC)(link)
Hmm. Do you know what styles the preview page? I can point you to the S2 code for username printing (which hopefully I will be replacing talkread with very soon), but I don't know the bml/tt version
momijizukamori: Green icon with white text - 'I do believe in phosphorylation! I do!' with a string of DNA basepairs on the bottom (Default)

[personal profile] momijizukamori 2012-08-27 09:20 pm (UTC)(link)
Curses. I'm no help then XD
denise: Image: Me, facing away from camera, on top of the Castel Sant'Angelo in Rome (Default)

[staff profile] denise 2012-08-27 09:21 pm (UTC)(link)
You should be able to do something like (pseudocode, off the top of my head and might be wrong)

check if $remote is a user object ? $remote->ljuser_display : show as anonymous

(ljuser_display is almost certainly the name of the function but double check that. it does handle OpenID though)

You are probably going to be looking at weblib.pl for what builds the comment headers but it might be somewhere in Talk.pm instead.
denise: Image: Me, facing away from camera, on top of the Castel Sant'Angelo in Rome (Default)

[staff profile] denise 2012-08-27 09:29 pm (UTC)(link)
Weird! I could've sworn it knew what to do with those.

Meanwhile, I've skim-read the code a bit, and I think you are better off looking in Talk.pm -- if you get stuck and nobody else can point you more closely, ping me tomorrow and I'll try to turn up something more specific.
foxfirefey: A guy looking ridiculous by doing a fashionable posing with a mouse, slinging the cord over his shoulders. (geek)

[personal profile] foxfirefey 2012-08-27 09:31 pm (UTC)(link)
I am positive ljuser_display knows what to do with OpenID, so some more description on the problem being encountered would help!
yvi: Kaylee half-smiling, looking very pretty (Default)

[personal profile] yvi 2012-08-28 04:59 pm (UTC)(link)
If it helps any, the jungle that is talkread/talkpost/talkpost_do/Talk.pm/weblib.pl is really not easy to navigate...
Edited 2012-08-28 17:00 (UTC)