~george-edison55/stack2rss/trunk

« back to all changes in this revision

Viewing changes to src/converters/question_converter.php

  • Committer: Nathan Osman
  • Date: 2011-11-09 18:39:41 UTC
  • Revision ID: admin@quickmediasolutions.com-20111109183941-7vfjl7xqshn11kz9
Added tags to question body, added 'closed' to question titles where appropriate, and added compatibility with IIS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
{
11
11
    protected function GetTitle($json_item)
12
12
    {
13
 
        return $json_item['title'];
 
13
        $title = $json_item['title'];
 
14
        
 
15
        // Check for closed questions
 
16
        if(isset($json_item['closed_date']))
 
17
            $title .= ' [closed]';
 
18
        
 
19
        return $title;
14
20
    }
15
21
    
16
22
    protected function GetDescription($json_item)
17
23
    {
18
24
        $question_content = (isset($json_item['body']))?$json_item['body']:'<i>No content.</i>';
19
25
        $accepted         = (isset($json_item['accepted_answer_id']))?'yes':'no';
 
26
        $tags             = implode(', ', $json_item['tags']);
20
27
        
21
 
        return "<b>Answers:</b> {$json_item['answer_count']}<br /><b>Accepted answer:</b> {$accepted}<br /><br />{$question_content}";
 
28
        return "<b>Answers:</b> {$json_item['answer_count']}<br /><b>Accepted answer:</b> {$accepted}<br /><br />{$question_content}<br /><br /><b>Tags:</b> $tags";
22
29
    }
23
30
    
24
31
    protected function GetLink($json_item)