Alexa Plugin

How to display a text in the list rank.
I want in every tot_pv_overall that is 0 will display a text "No link code attach in the owner site"

what code to put in rankings_compile_stats.php?
 

Basti

Administrator
Staff member
Code:
$TMPL['no_pageviews_text'] = '';
if ($TMPL['tot_pv_overall'] == 0) {
    $TMPL['no_pageviews_text'] = 'No link code attach in the owner site';
}
 
UPDATE:
Regarding the cron, it causes issue on the server. Is there any way to execute data once and not doing by cron?

SAMPLE ERROR LOG
[30-Apr-2019 06:00:01 UTC] PHP Warning: simplexml_load_file(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/mangyanb/public_html/member/plugins/AlexaFel/cron.php on line 28
[30-Apr-2019 06:00:01 UTC] PHP Warning: simplexml_load_file(http://data.alexa.com/data?cli=10&dat=snbamz&url=http://www.patchesoflifebyjessa.com/): failed to open stream: no suitable wrapper could be found in /home/mangyanb/public_html/member/plugins/AlexaFel/cron.php on line 28
[30-Apr-2019 06:00:01 UTC] PHP Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://data.alexa.com/data?cli=10&dat=snbamz&url=http://www.patchesoflifebyjessa.com/" in /home/mangyanb/public_html/member/plugins/AlexaFel/cron.php on line 28
 

Basti

Administrator
Staff member
You will need a cron. Else alexa not really makes much sense, you want it regulary updated.

Cron runs a different php version it looks like than your hosting site. And that error means you need to check your other php versions php.ini
If I remember correctly you can do that within cpanel -> manage php version or something similar.

Just enable allow_url_fopen for other php versions than the one for your site and all should be good.
 
You will need a cron. Else alexa not really makes much sense, you want it regulary updated.

Cron runs a different php version it looks like than your hosting site. And that error means you need to check your other php versions php.ini
If I remember correctly you can do that within cpanel -> manage php version or something similar.

Just enable allow_url_fopen for other php versions than the one for your site and all should be good.
Let me check on this ..Thanks
 
Id like to raise again the issue of this.
If I will enable the where clause

$where_extra .= " AND (tot_{$ranking_method}_overall > 0 OR alexa_rank > 0)";

the problem is that the site will be eliminated in the list even they have tot ranking but 0 alexa.
if disable the site that has 0 overall and alexa will display in the toplist not in the last..

if you can have a sql statement to fix this that all 0 alexa rank will be in the last thing to sort.

$order_by = "tot_{$ranking_method}_overall DESC,alexa_rank";

any idea ?

UPDATE:
I think this is working
$order_by = "tot_{$ranking_method}_overall DESC,alexa_rank=0,alexa_rank";
 
Last edited:

Basti

Administrator
Staff member
$where_extra .= " AND (tot_{$ranking_method}_overall > 0 OR alexa_rank > 0)";

the problem is that the site will be eliminated in the list even they have tot ranking but 0 alexa.
Thats not possible, i suspect you may have another plugin which modifies the where? That part if pretty clear and it will only select sites with tot_pv_overall > OR alexa_rank > 0

Im at my limit with helping from distance here, any more would need ftp/cpanel access to do some live testing
 
Thats not possible, i suspect you may have another plugin which modifies the where? That part if pretty clear and it will only select sites with tot_pv_overall > OR alexa_rank > 0

Im at my limit with helping from distance here, any more would need ftp/cpanel access to do some live testing
I already solve this using
$order_by = "tot_{$ranking_method}_overall DESC,alexa_rank=0,alexa_rank";
Our analyst wanted to display all but put last if 0 tot visits and alexa found.
 
Top