Add Ranking Settings

Discussion in 'General Help' started by softdevsalon, Mar 13, 2019.

  1. softdevsalon
    • Licensed

    softdevsalon Member

    Hi , How to make or add a custom ranking settings in admin. ?
    Instead of daily pageviews in settings, I want to rank it by total page views or this tag {$tot_pv_overall}?
    Last edited: Mar 13, 2019
  2. Basti
    • Staff

    Basti Administrator Staff Member

    Are you sure you want to do that? That basicly leaves any new member FAR behind old members.

    We will not add a new ranking period setting. Once we add overall as method, but that caused all kind of issues with the code.
    So the easiest method, is to simply overwrite the $order_by tag in rankings.php via plugin file rankings_order_by.php

    Code:
        // Make ORDER BY clause
        $order_by = "tot_{$ranking_method}_overall DESC";
    And then use {$tot_pv_overall} in your table_*.html files
    In admin settings rank by this period and pageviews
  3. softdevsalon
    • Licensed

    softdevsalon Member

    How to do it via plugin? What folder to create or use?
  4. Mark
    • Staff

    Mark Administrator Staff Member

    create your rankings_order_by.php plugin file.

    Add the code basti pasted above to it.

    Code:
    // Make ORDER BY clause
    $order_by = "tot_{$ranking_method}_overall DESC";
    
    Create a plugin folder and info file for your new plugin and place you new file inside that folder:
    http://visiolist.com/community/threads/how-to-create-a-plugin.20/
    softdevsalon likes this.
  5. softdevsalon
    • Licensed

    softdevsalon Member

Share This Page