Example #1
0
function ra_q_title($post)
{
    echo '<a href="' . ra_post_link($post['raw']['postid']) . '" title="' . _ra_lang('bookmark this!') . '">' . htmlspecialchars($post['raw']['title']) . '</a>';
}
Example #2
0
function ra_user_post_list($handle, $type, $limit)
{
    $userid = qa_handle_to_userid($handle);
    require_once QA_INCLUDE_DIR . 'qa-app-posts.php';
    $post = qa_db_query_sub('SELECT * FROM ^posts WHERE ^posts.type=$ and ^posts.userid=# ORDER BY ^posts.created DESC LIMIT #', $type, $userid, $limit);
    $output = '<ul class="question-list users-widget">';
    while ($p = mysql_fetch_array($post)) {
        if ($type == 'Q') {
            $what = _ra_lang('asked');
        } elseif ($type == 'A') {
            $what = _ra_lang('answered');
        } elseif ('C') {
            $what = _ra_lang('commented');
        }
        $handle = qa_post_userid_to_handle($p['userid']);
        $output .= '<li id="q-list-' . $p['postid'] . '" class="question-item">';
        if ($type == 'Q') {
            $output .= '<div class="big-ans-count pull-left">' . $p['acount'] . '<span>' . _ra_lang('Ans') . '</span></div>';
        } elseif ($type == 'A') {
            $output .= '<div class="big-ans-count pull-left vote">' . $p['netvotes'] . '<span>' . _ra_lang('Vote') . '</span></div>';
        }
        $output .= '<div class="list-right">';
        if ($type == 'Q') {
            $output .= '<h5><a href="' . qa_q_path_html($p['postid'], $p['title']) . '" title="' . $p['title'] . '">' . qa_html($p['title']) . '</a></h5>';
        } elseif ($type == 'A') {
            $output .= '<h5><a href="' . ra_post_link($p['parentid']) . '#a' . $p['postid'] . '">' . substr(strip_tags($p['content']), 0, 50) . '</a></h5>';
        } else {
            $output .= '<h5><a href="' . ra_post_link($p['parentid']) . '#c' . $p['postid'] . '">' . substr(strip_tags($p['content']), 0, 50) . '</a></h5>';
        }
        $output .= '<div class="list-date"><span class="icon-calendar-2">' . date('d M Y', strtotime($p['created'])) . '</span>';
        $output .= '<span class="icon-chevron-up">' . $p['netvotes'] . ' ' . _ra_lang('votes') . '</span></div>';
        $output .= '</div>';
        $output .= '</li>';
    }
    $output .= '</ul>';
    echo $output;
}