Navigation

Pligg Support

Hi There, I know this question has been raised before;” individual category” most upvoted feature is not giving required result. Whenever I tried to use this feature it gives me most upvoted result from the entire category.
Even I tried to use this fix
https://github.com/Pligg/pligg-cms/commit/0f4d50f6f77048326eb777b37e018cf1f8e2001c
but it didn’t work for me. Can anyone please assistance me with this.

Possible Answers

    1- open libssearch.php

    2- go to line 189 or Look for:

    } else if($this->searchTerm == 'upvoted'){

    3- change this

    $usrclause = "";

    $group = "GROUP BY link_id";

    $this->sql = "SELECT DISTINCT * FROM " . table_links . ", " . table_votes . " WHERE ".$usrclause." vote_link_id=link_id AND vote_value > 0 AND (link_status='published' OR link_status='new') ".$group." ORDER BY link_votes DESC LIMIT $this->offset, $limit"; //link_date

    TO this

    $usrclause = "";

    $group = "GROUP BY link_id";

    if($catId) {

    $this->sql = "SELECT DISTINCT * FROM " . table_links . ", " . table_votes . " WHERE ".$usrclause." vote_link_id=link_id AND vote_value > 0 AND (link_status='published' OR link_status='new') AND link_category=$catId ".$group." ORDER BY link_votes DESC LIMIT $this->offset, $limit"; //link_date

    }else{

    $this->sql = "SELECT DISTINCT * FROM " . table_links . ", " . table_votes . " WHERE ".$usrclause." vote_link_id=link_id AND vote_value > 0 AND (link_status='published' OR link_status='new') ".$group." ORDER BY link_votes DESC LIMIT $this->offset, $limit"; //link_date

    }

    Do the same for the downvoted and commented.

    Or check the fix for the code to sort by category most upvoted/downvoted/commented

    [link]

    http://pastebin.com/Zr06MJNZ [/link]

    When you are in a specific Category and select most upvoted, it work fine and only select the upvoted/downvoted/commented links for the selected Category.

    When you are on the main page, a category is not selected therefore the most upvoted/downvoted/commented applies to all categories.

    | Posted 186 days ago | Permalink | Hide Replies

    Thanks @ redwine.

    I have tried this code and seems to work great when i am using up-voted from individual category However, when i am using Most Down-voted then nothing is showing. Can you please look into the code.

    Appreciate our assistance

    | Posted 185 days ago | Permalink | Hide Replies

    Is the "Negative votes to remove submission" set to 0 in the admin "Voting" section? If it is, then it should not change the reported stories status to "discard" and therefore they should still remain in the published stories.

    | Posted 184 days ago | Permalink | Hide Replies

    Hello Indicator,

    Yes this is what is happening with the downvoted, nothing shows up. I've looked into it and found that when you downvote a link, it is changed to 'discard' and will not show up any more. I will look into it furthermore to see how to fix it. Try to downvote a link and check the links table.

    But it is working like a charm on upvoted and commented!

    | Posted 185 days ago | Permalink | Hide Replies

    Thanks for your assistance

    | Posted 184 days ago | Permalink | Hide Replies

    Did the Most downvoted work? I mentioned yesterday about the "Negative votes to remove submission" set to 0 in the admin "Voting" section.

    | Posted 184 days ago | Permalink | Hide Replies

Who Upvoted this Story

Pligg.com's Support area is where you can ask questions and get answers. Just getting started with the Support area? This section describes tips for participating.

Submitting a Question or Comment

By taking a minute to research previous posts you may receive an answer much faster than waiting for a response to a new question. Begin by searching the support section for an answer. Sometimes you may even want to extend your search to the entire pligg.com domain.

If you are unable to find a relevant answer, submit a new question or comment here. Please provide a detailed description and, when necessary, debugging information such as your server environment (a link to a <?php phypinfo(); ?> .php page would be very helpful), your web browser, and any steps necessary to reproduce your issue.

Submitting an Answer

If you have an answer or useful response that you would like to add to a post, you can submit it as a comment which other users will then vote on. Answers are sorted by most popular to least, allowing the best information to climb to the top of the page.

Please read and vote for existing answers before submitting your own, as there may already be an acceptable answer provided. You can use the "Reply" link found within an answer to submit a response to it, in case you want to expand or comment on someone else's contribution.

Including Files or Code

Sometimes it is necessary for you to attach a file or include a snippet of code for others to reference in your response. In most cases, you can .zip up files and attach them to a question or answer using Pligg's file manager. At times though this may fail, and in these circumstances we recommend using a third party host. Below we are including a list of recommended websites where you can share easily share file uploads (or snippets of code) through the web.