Alexa Plugin

Discussion in 'Tutorials' started by softdevsalon, Apr 9, 2019.

  1. softdevsalon
    • Licensed

    softdevsalon Member

    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?
  2. Basti
    • Staff

    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';
    }
    
  3. softdevsalon
    • Licensed

    softdevsalon Member

    Thanks
    Last edited: Apr 22, 2019
  4. softdevsalon
    • Licensed

    softdevsalon Member

    Also how to trigger the email now for those pv and alexa rank is 0?
  5. Basti
    • Staff

    Basti Administrator Staff Member

  6. softdevsalon
    • Licensed

    softdevsalon Member

    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
  7. Basti
    • Staff

    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.
  8. softdevsalon
    • Licensed

    softdevsalon Member

    Let me check on this ..Thanks
  9. softdevsalon
    • Licensed

    softdevsalon Member

    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: May 7, 2019
  10. Basti
    • Staff

    Basti Administrator Staff Member

    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
  11. softdevsalon
    • Licensed

    softdevsalon Member

    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.
    Basti likes this.
  12. Basti
    • Staff

    Basti Administrator Staff Member

    Good to hear, nice

Share This Page