HELP ME ABOUT - COUNTER VISIT

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?
 

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:

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
 
Thanks will try this.

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

Example
Category(13)
Category2(3)
Category3(1)
 

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
 

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
 

Attachments

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
Nice.. Thank you :)
 

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'
 

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_raw, 1);

    $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:
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_raw, 1);

    $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_overall} in {$TMPL['category']}";
}

It will also display in badge?
 
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?
 

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
 
Top