Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
731 views
in Q2A Core by
The question & answers rss doesn't have an author field.

I think it would make sense to put the name of the person who wrote the question or the answer as author...
by
Can anyone help me what I need to add to get the userid as the author in the feed. Using Q2A 1.7
by
This is overlap with Gideon's answer. Author field must be the author's e-mail of the article. However, you can contain any string in "description" field. If you want to display author of questions by catching Q2A feed at another (your main?) site, it might be able to get userid by embedding handle (or userid) in the end of description field. This is a mere idea of me, may be inaccurate.
by
Let me explain a little. We are using MailChimp rss to email to send a daily email to our users of all new stuff. The problem is that because the feed doesn't show the author MailChimp writes by each message Anonymous. We want it changed to the user id. So if we provide an auto tag with the user id that will be displayed instead.
by
why activate RSS ? who use them ? thank you

2 Answers

+1 vote
by

According to the RSS 2 specification, the <author> field should contain the email address of the author. This seems like a bad idea! In practice, do you know if the <author> field is also used for author usernames?

by
You are right. Stack Overflow uses ATOM rather than RSS, which has a more flexible author field.
So could you put it in the <dc:creator> field instead? This seems to be the standard e.g. in Wordpress or nytimes.com
0 votes
by

Here is what you need to change in order to get this.

 

Open the file qa_feed.php in qa-include folder.

Find 

      if (isset($question['opostid'])) {

            $time=$question['otime'];

            if ($full)
                $htmlcontent=qa_viewer_html($question['ocontent'], $question['oformat'], $options);

        } elseif (isset($question['postid'])) {
            $time=$question['created'];

            if ($full)
                $htmlcontent=qa_viewer_html($question['content'], $question['format'], $options);
        }

 

and replace with

           $Author==null;
                          if (isset($question['opostid'])) {
            $time=$question['otime'];
          $userid = $question['ouserid'];
            if ($full)
                $htmlcontent=qa_viewer_html($question['ocontent'], $question['oformat'], $options);

        } elseif (isset($question['postid'])) {
            $time=$question['created'];
        $userid = $question['userid'];
            if ($full)
                $htmlcontent=qa_viewer_html($question['content'], $question['format'], $options);
        }

     $useraccount=qa_db_select_with_pending(
               qa_db_user_account_selectspec($userid, true)
                  );
        $Author=@$useraccount['handle'];

 

 

 

Also add after

if (isset($htmlcontent))
            $lines[]='<description>'.qa_xml($htmlcontent).'</description>';

the following line

        if (isset($Author))
            $lines[]='<author>'.qa_xml($Author).'</author>';

 

 

...