function output_widget($region, $place, $themeobject, $template, $request, $qa_content) { $widget_opt = @$themeobject->current_widget['param']['options']; require_once QA_INCLUDE_DIR . 'qa-db-selects.php'; require_once QA_INCLUDE_DIR . 'qa-app-format.php'; require_once QA_INCLUDE_DIR . 'qa-app-q-list.php'; $categoryslugs = ''; $userid = qa_get_logged_in_userid(); // Get lists of recent activity in all its forms, plus category information list($questions1, $questions2, $questions3, $questions4) = qa_db_select_with_pending(qa_db_qs_selectspec($userid, 'created', 0, $categoryslugs, null, false, false, $qcount), qa_db_recent_a_qs_selectspec($userid, 0, $categoryslugs), qa_db_recent_c_qs_selectspec($userid, 0, $categoryslugs), qa_db_recent_edit_qs_selectspec($userid, 0, $categoryslugs)); // Prepare and return content for theme $content = qa_q_list_page_content(qa_any_sort_and_dedupe(array_merge($questions1, $questions2, $questions3, $questions4)), $qcount, 0, null, null, null, null, null, true, 'activity/', null, null, null, null); $content = $content['q_list']['qs']; if (@$themeobject->current_widget['param']['locations']['show_title']) { $themeobject->output('<h3 class="widget-title">' . qa_lang('cleanstrap/recent_activities') . ' <a href="' . qa_path_html('activity') . '">' . qa_lang('cleanstrap/view_all') . '</a></h3>'); } $themeobject->output('<div class="ra-question-activity-widget">'); $q_list = $content; $themeobject->output('<ul class="activity-list">'); foreach ($q_list as $list) { $themeobject->output('<li class="clearfix ' . (is_featured($list['raw']['postid']) ? ' featured' : '') . '"><span class="fav-star icon-heart' . (@$list['raw']['userfavoriteq'] ? ' active' : '') . '"></span><span class="post-status-c">' . cs_post_status($list) . '</span><a href="' . $list['url'] . '">' . $list['title'] . '<span class="time">' . implode(' ', $list['when']) . '</span><span class="ans-count total-' . $list['raw']['acount'] . '">' . $list['raw']['acount'] . '</span></a></li>'); } $themeobject->output('</ul>'); $themeobject->output('</div>'); }
function cs_ajax_set_question_featured() { require_once QA_INCLUDE_DIR . 'qa-db-metas.php'; $postid = @$this->content["q_view"]["raw"]["postid"]; if ($this->template == 'question' && qa_get_logged_in_level() >= QA_USER_LEVEL_ADMIN) { if (!is_featured($postid)) { qa_db_postmeta_set($postid, 'featured_question', true); } else { qa_db_postmeta_clear($postid, 'featured_question'); } } die; }
function showPhotoToString($currentPhoto) { global $featuredClass; global $currentpath; global $currentPhotoCounter; $num = $currentPhotoCounter + 1; //write out the html $output = '<a href="' . $currentpath . '/' . $currentPhoto . '" class="fancybox'; if (is_featured($currentPhoto)) { $output .= ' ' . $featuredClass; } $output .= '" rel="fancy-group" id="img' . $num . '">' . showThumb($currentPhoto) . '</a>' . "\n\t\t"; return $output; }