Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Related Question Stats - Sidebar #998

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open

Related Question Stats - Sidebar #998

wants to merge 5 commits into from

Conversation

rxchun
Copy link

@rxchun rxchun commented May 22, 2024

This adds an Answer Counter to the Related Questions widget, on the sidebar.
Screenshot: https://i.ibb.co/vsYqgtZ/z496.jpg

If people don't want to display stats, they can simply comment out the new added line in:
qa-include/plugins/qa-widget-related-qs.php

Line to comment out:
rxchun@f0ddb7f#diff-49b7248c15fca491a6271afeff134615cc8323afbe63706402ae6369ea32c6adR75

This adds an Answer Counter to the Related Questions widget, on the sidebar.
Screenshot: https://i.ibb.co/vsYqgtZ/z496.jpg
@@ -65,8 +65,14 @@ public function output_widget($region, $place, $themeobject, $template, $request
$themeobject->output('<ul class="qa-related-q-list">');

foreach ($questions as $question) {
$selectedClass = isset($question['selchildid']) ? ' qa-a-count-selected' : '';
$qaLangACountArray = ($question['acount'] == 1) ? qa_lang_html_sub_split('main/1_answer', '1', '1')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using qa_lang_html_sub instead of qa_lang_html_sub_split should simplify the code a little bit.

BTW, you can keep the same PR and either add a new commit or amend the current one and force push it in the same branch

This adds an Answer Counter to the Related Questions widget, on the sidebar.
Screenshot: https://i.ibb.co/vsYqgtZ/z496.jpg
Using `qa_lang_html_sub` instead of `qa_lang_html_sub_split`
Removed `qa_format_number()` as this shouldn't be necessary for answers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants