HELP ME ABOUT - COUNTER VISIT

Discussion in 'General Help' started by softdevsalon, Feb 21, 2019.

  1. softdevsalon
    • Licensed

    softdevsalon Member

    Supposed , I have attached a link to a site, How does the tracking work?
    It needs to be click ? or just when visiting the site with attach link code the sites pageviews will automatically updated?
  2. Basti
    • Staff

    Basti Administrator Staff Member

    You need to enable in your admin settings "Would you like to count pageviews on your members sites?"
    http://visiolist.com/docs/button-settings the first block of text on here.

    And they need to add the voting/backlink code they get after joining with their site.

    Our button codes link back to button.php, which handles the pageview counting and then serving an image.
    A click on the button, will lead to a "hits in", also known as vote
    Last edited: Feb 21, 2019
  3. softdevsalon
    • Licensed

    softdevsalon Member

    How can I change the button stats. Id like to see the views today only not that votes today.
  4. softdevsalon
    • Licensed

    softdevsalon Member

    Update

    I already found where to change it.
    Basti likes this.
  5. Basti
    • Staff

    Basti Administrator Staff Member

    Glad you got it solved :)
  6. softdevsalon
    • Licensed

    softdevsalon Member

    How do I add a category in the button badge? Not just the rank and the views today.
  7. Basti
    • Staff

    Basti Administrator Staff Member

    Same as the other stats, under this
    Code:
    imagestring($img, 5, 75 - ((strlen($TMPL['rank']) - 1) * 4), 50, $TMPL['rank'], $color2); // Rank Position
    
    add a new line and adjust the position, you can do this with any column from the VL_sites or VL_stats table
    Code:
    imagestring($img, 2, 80, 90, $TMPL['category'], $color1); // category
    
  8. softdevsalon
    • Licensed

    softdevsalon Member

    Thanks will try this.

    How about I want to display
    Category with number of sites in it.

    Example
    Category(13)
    Category2(3)
    Category3(1)
  9. Basti
    • Staff

    Basti Administrator Staff Member

    If your server can handle that extra load ( remember this means multiple queries for each and every pageload where the button is on ). I would personally advise against that, that could easily overload your MySQL server if you have many big websites listed

    Code:
    $category_1 = $DB->fetch("SELECT COUNT(*) FROM {$CONF['sql_prefix']}_sites WHERE category = 'My category'", __FILE__, __LINE__);
    $category_2 = $DB->fetch("SELECT COUNT(*) FROM {$CONF['sql_prefix']}_sites WHERE category = 'My other category'", __FILE__, __LINE__);
    
    Code:
    imagestring($img, 2, 80, 90, "({$category_1})", $color1); // category 1
    imagestring($img, 2, 80, 90, "({$category_1})", $color1); // category 2
    If you placed the category text itself on the image like Category 1, then adjust the positions again

    You can fetch the category name also and make it dynamic, but that would be even worse performance wise, its better to place the static text on the image itself
  10. softdevsalon
    • Licensed

    softdevsalon Member

    I mean to display it just for the sidebar not in the button..
  11. Basti
    • Staff

    Basti Administrator Staff Member

    Oh, that you would do via plugin, upload the attached zip via plugin manager and place {$category_list} in your wrapper where you want it to appear.
    The actual layout of that list is in the plugin called category_list.html and category_row.html

    Attached Files:

  12. softdevsalon
    • Licensed

    softdevsalon Member

    Nice.. Thank you :)
  13. softdevsalon
    • Licensed

    softdevsalon Member

    BTW, how is the rank position determine? by general or by category? in the badge?
  14. Basti
    • Staff

    Basti Administrator Staff Member

    by ranking method, period and overall. And then you go into category view it is the same, just that only same category members are displayed

    so if you rank monthly hits in the rank is determined
    on the main page - by the database column, unq_in_0_monthly highest first, and on tie takes the higher unq_in_overall
    on the category - by the database column, unq_in_0_monthly highest first, and on tie takes the higher unq_in_overall WHERE category = 'my category'
  15. softdevsalon
    • Licensed

    softdevsalon Member

    Is it possible to display the rank position in a badge by category?

    Example
    Rank # in Category.
  16. Basti
    • Staff

    Basti Administrator Staff Member

    Ye, in the plugin I gave you create a new file called rankings_compile_stats.php with the following content further below.

    It will display on category view: Rank # overall
    And on overall view will display: Rank # in category

    Place {$rank_overall} and {$rank_category} in the following files where you want the text to appear
    table_row.html, table_top_row.html, table_row_premium.html, table_top_row_premium.html

    PHP:
    // This tag is empty on overall ranking
    $TMPL['rank_overall'] = '';

    // This tag is empty on category ranking
    $TMPL['rank_category'] = '';

    if (
    $TMPL['cat_exist'])
    {
        
    // This code runs on category page
        
    $rank_overall 1;
        
    $rank_result $DB->query("SELECT sites.username FROM {$CONF['sql_prefix']}_sites sites, {$CONF['sql_prefix']}_stats stats WHERE sites.username = stats.username AND active = 1 ORDER BY {$order_by}"__FILE____LINE__);
        while (list(
    $username) = $DB->fetch_array($rank_result))
        {
            if(
    $username == $TMPL['username'])
            {
                break;
            }
            
    $rank_overall++;
        }

        
    $TMPL['rank_overall'] = "Rank {$rank_overall} overall";
    }
    else
    {
         
    // This code runs on the overall page

        // Escape users category
        
    $category_rank_sql $DB->escape($category_raw1);

        
    $rank_category 1;
        
    $rank_result $DB->query("SELECT sites.username FROM {$CONF['sql_prefix']}_sites sites, {$CONF['sql_prefix']}_stats stats WHERE sites.username = stats.username AND active = 1 AND category = '{$category_rank_sql}' ORDER BY {$order_by}"__FILE____LINE__);
        while (list(
    $username) = $DB->fetch_array($rank_result))
        {
            if(
    $username == $TMPL['username'])
            {
                break;
            }
            
    $rank_category++;
        }

        
    $TMPL['rank_category'] = "Rank {$rank_category} in {$TMPL['category']}";
    }
    Last edited: Feb 26, 2019
  17. softdevsalon
    • Licensed

    softdevsalon Member


    It will also display in badge?
  18. softdevsalon
    • Licensed

    softdevsalon Member

    Tried this and got
    Parse error: syntax error, unexpected '}' in \sources\rankings.php(539) : eval()'d code on line 43

    It will also display in badge?
  19. Basti
    • Staff

    Basti Administrator Staff Member

    It will display wherever you place it, want it in badge? place it there ;)

    See my post again, I updated code, category display was using wrong tag causing an error
  20. softdevsalon
    • Licensed

    softdevsalon Member

    In the badge it seems not working..
    How do you manage or how to do it?

Share This Page