View file modules/top_rating_sites/plugins/list.php

File size: 2.19Kb
<?php

$trs_data = db::get_string("SELECT `HOST`,`HIT` FROM `TRS_DATA` WHERE `DATE` = ? AND `SITE_ID` = ? LIMIT 1", [$date, $list['ID']]);

if (!isset($trs_data['HOST'])) {
  
  $trs_data['HOST'] = 0;
  $trs_data['HIT'] = 0;
  
}

$menu = null;  
if (user('ID') > 0 && MANAGEMENT == 1 || user('ID') > 0 && user('ID') == $list['USER_ID']) {
  
  $menu = "<br /><a href='/m/top_rating_sites/show/?id=".$list['ID']."' class='btn'>".icons('gear', 15, 'fa-fw')." ".lg('Управление')."</a>";
  
}

if (isset($rnum)) {
  
  $trs_list = "
  <div class='list-menu' style='position: relative'>
  <a style='position: absolute; right: 12px; top: 25px' href='/m/top_rating_sites/statistic/?id=".$list['ID']."'>".icons('line-chart', 20)."</a>
  <div style='display: inline-block; width: 45px; vertical-align: top'>
  <span class='count' style='background-color: #4D5B61; position: relative; top: 7px; left: 5px'>".$rnum."</span>
  </div>
  <div style='display: inline-block; width: 70%; vertical-align: top'>
  <a href='".tabs($list['DOMAIN'])."' ajax='no'>
  <img src='https://www.google.com/s2/favicons?domain=".tabs($list['DOMAIN'])."' style='position: relative; top: 3px; right: 1px'> <b style='font-size: 13px; color: #657990'>".tabs($list['NAME'])."</b> <span class='info green'>".$trs_data['HOST']."/".$trs_data['HIT']."</span><br />
  <small>".tabs($list['DOMAIN'])."</small>
  </a>
  <div style='margin-top: 10px'>
  ".crop_text(tabs($list['MESSAGE']), 0, 40)."
  </div>
  ".$menu."
  </div>
  </div>
  ";
  
}else{
  
  $trs_list = "
  <div class='list-menu' style='position: relative'>
  <a style='position: absolute; right: 12px; top: 25px' href='/m/top_rating_sites/statistic/?id=".$list['ID']."'>".icons('line-chart', 20)."</a>
  <a href='".tabs($list['DOMAIN'])."' ajax='no'>
  <img src='https://www.google.com/s2/favicons?domain=".tabs($list['DOMAIN'])."' style='position: relative; top: 3px; right: 1px'> <b style='font-size: 13px; color: #657990'>".tabs($list['NAME'])."</b> <span class='info green'>".$trs_data['HOST']."/".$trs_data['HIT']."</span><br />
  <small>".tabs($list['DOMAIN'])."</small>
  </a>
  <div style='margin-top: 10px'>
  ".crop_text(tabs($list['MESSAGE']), 0, 40)."
  </div>
  ".$menu."
  </div>
  ";
  
}