Topic on Project:Support desk

how to get creator/owner of the created article

8
2401:7400:C800:32AC:EDB1:E392:C63B:A9C0 (talkcontribs)

Hi all,

I would like to ask is it possible to get the author/owner/creator of the article created? Is it to use wgUser?

Any advise is appreciated!!

Thanks all for your kind assistance and time!!!!

88.130.81.112 (talkcontribs)

Hi!

When you speak of the "creator" of an article, I guess that you then mean the user, who created the first revision of that article, right?

When and where do you want to get that information? Somewhere inside PHP obviously... But where should it be used? Maybe you find an according method inside the article object...

Anyhowputx (talkcontribs)

Hi,

I really appreciated your response! Yes, you are correct. I want to get the user who created the first revision of that article. I have already retrieved the title but I am not sure on how to retrieve the user (http://postimg.org/image/oj3ybel2x/) . I want it to be displayed like that.

Just to add on, the "Requests:" is a namespace and the title is displayed on the main page using the newestpage extension. I used Special:Newestpages/Requests/5

I tried to look at the link you provided but could not see any documentation that would aid me in getting the creator.

Please advise and tell me if you need anymore information. Thank You!!!!!

Ciencia Al Poder (talkcontribs)

You need to access a WikiPage class for that page and use the getOldestRevision method. It returns a Revision class that you can use to get the user. You can navigate the documentation for this.

Anyhowputx (talkcontribs)

Thanks for your advise!!

I managed to get the author of the article but I am facing another issue now. :(

Right now, I am retrieving the content of the article and displayed on my main page. But it is giving me the html format instead. (As seen in this picture: http://i62.tinypic.com/99mlvd.png) It is showing me == (text here) == instead of the header.

I have my full code here (https://dpaste.de/ro3r#L329). I've tried to output $wgOut->addWikiText on line 197, but it is giving me weird characters as shown here (http://i60.tinypic.com/eslrhy.png)

I have also tried implementing parser as seen in line 133 but it is not going into that function. Why is that so?

Really really appreciated your response and time and help and everything!!!!! Thank you so much!!!!!!!

Ciencia Al Poder (talkcontribs)

As said in QINU fix, apparently you need to use the method recursiveTagParse of the parser

Anyhowputx (talkcontribs)

Hi,

I have tried using the link you provided. But it is not going into my function (as seen from the echo, i did not see anything output to the screen when I tried to test it)

https://dpaste.de/P7QN (This is the code link which I put the parser, from line 14 - line 30)

Please advise. Thank you so much!!!!!

Ciencia Al Poder (talkcontribs)

Do not echo anything from PHP code. It breaks any attempt to modify headers (like setting cookies, expiration, etc) and may result in a Blank page.

Reply to "how to get creator/owner of the created article"