[ Index ]
 

Code source de phpMyVisites 2.3

Accdez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/plugins/clickheat/libs/ -> view.php (source)

   1  <?php
   2  /**
   3   * ClickHeat : Fichier de résultats / Results file
   4   * 
   5   * @author Yvan Taviaud - LabsMedia - www.labsmedia.com
   6   * @since 27/10/2006
   7  **/
   8  
   9  /** Direct call forbidden */
  10  if (!defined('CLICKHEAT_LANGUAGE'))
  11  {
  12      exit;
  13  }
  14  
  15  /** List of available groups */
  16  $groups = array();
  17  $d = dir($clickheatConf['logPath']);
  18  while (($dir = $d->read()) !== false)
  19  {
  20      if ($dir === '.' || $dir === '..' || !is_dir($d->path.$dir)) continue;
  21      $pos = strpos($dir, ',');
  22      if ($pos !== false)
  23      {
  24          $site = substr($dir, 0, $pos);
  25      }
  26      else
  27      {
  28          $site = '';
  29      }
  30      if (IS_PHPMV_MODULE === true)
  31      {
  32          if ($site !== PHPMV_SELECTED_SITE)
  33          {
  34              continue;
  35          }
  36          $site = '';
  37      }
  38      if (!isset($groups[$site]))
  39      {
  40          $groups[$site] = array();
  41      }
  42      $groups[$site][] = '<option value="'.$dir.'">'.($pos === false ? $dir : substr($dir, $pos + 1)).'</option>';
  43  }
  44  $d->close();
  45  /** Sort groups in alphabetical order */
  46  ksort($groups);
  47  $__selectGroups = '';
  48  foreach ($groups as $key => $options)
  49  {
  50      sort($options);
  51      if ($key !== '')
  52      {
  53          $__selectGroups .= '<optgroup label="'.$key.'">';
  54      }
  55      $__selectGroups .= implode("\n", $options);
  56      if ($key !== '')
  57      {
  58          $__selectGroups .= '</optgroup>';
  59      }
  60  }
  61  
  62  asort($__screenSizes);
  63  /** Screen sizes */
  64  $__selectScreens = '';
  65  for ($i = 0; $i < count($__screenSizes); $i++)
  66  {
  67      $__selectScreens .= '<option value="'.$__screenSizes[$i].'">'.($__screenSizes[$i] === 0 ? LANG_ALL : $__screenSizes[$i].'px').'</option>';
  68  }
  69  
  70  /** Browsers */
  71  $__selectBrowsers = '';
  72  foreach ($__browsersList as $label => $name)
  73  {
  74      $__selectBrowsers .= '<option value="'.$label.'">'.($label === 'all' ? LANG_ALL : ($label === 'unknown' ? LANG_UNKNOWN : $name)).'</option>';
  75  }
  76  
  77  /** Date */
  78  $date = isset($_GET['date']) ? strtotime($_GET['date']) : ($clickheatConf['yesterday'] === true ? mktime(0, 0, 0, date('m'), date('d') - 1, date('Y')) : false);
  79  if ($date === false)
  80  {
  81      $date = time();
  82  }
  83  $__day = (int) date('d', $date);
  84  $__month = (int) date('m', $date);
  85  $__year = (int) date('Y', $date);
  86  ?>
  87  <div id="adminPanel"><span class="float-right">
  88  <a href="http://www.labsmedia.<?php echo CLICKHEAT_LANGUAGE === 'fr' ? 'fr' : 'com' ?>/clickheat/index.html"><img src="<?php echo CLICKHEAT_PATH ?>images/logo170.png" width="170" height="35" alt="ClickHeat" /></a><br />
  89  <a href="#" onclick="adminCookie(); return false;"><?php echo LANG_LOG_MY_CLICKS ?></a>
  90  <?php if (CLICKHEAT_ADMIN === true) echo '<a href="', CLICKHEAT_INDEX_PATH, 'action=config">', LANG_CONFIG, '</a> <a href="#" onclick="showJsCode(); return false;">Javascript</a> <a href="#" onclick="showLatestVersion(); return false;">', LANG_LATEST_CHECK, '</a> '; ?>
  91  <a href="<?php echo CLICKHEAT_INDEX_PATH ?>action=logout"><?php echo LANG_LOGOUT ?></a><br />
  92  <a href="<?php echo CLICKHEAT_INDEX_PATH ?>language=en">English</a> <a href="<?php echo CLICKHEAT_INDEX_PATH ?>language=fr">Français</a> <a href="<?php echo CLICKHEAT_INDEX_PATH ?>language=ru">Русский</a> <a href="<?php echo CLICKHEAT_INDEX_PATH ?>language=uk">Українська</a><br />
  93  <span id="cleaner">&nbsp;</span></span>
  94  <form action="<?php echo CLICKHEAT_INDEX_PATH ?>" method="get" onsubmit="return false;" id="clickForm">
  95  <table cellpadding="0" cellspacing="1" border="0" id="clickTable">
  96  <tr>
  97      <th><?php echo LANG_SITE ?> &amp; <?php echo LANG_GROUP ?></th><td><select name="group" id="formGroup" onchange="hideGroupLayout(); loadIframe();"><?php echo $__selectGroups ?></select><?php if (CLICKHEAT_ADMIN === true) echo ' <a href="#" onclick="showGroupLayout(); return false;"><img src="', CLICKHEAT_PATH, 'images/layout.png" width="16" height="16" align="absmiddle" alt="Layout" /></a>'; ?> <a href="#" onclick="updateHeatmap(); return false;"><img src="<?php echo CLICKHEAT_PATH ?>images/reload.png" width="16" height="16" align="absmiddle" alt="Refresh" /></a></td>
  98      <td rowspan="4">
  99  <?php
 100  $__calendar = '<table cellpadding="0" cellspacing="0" border="0" class="clickheat-calendar"><tr>';
 101  $clickheatConf['start'] = 'm';
 102  $days = explode(',', LANG_DAYS);
 103  for ($d = 0; $d < 7; $d++)
 104  {
 105      $D = $d + ($clickheatConf['start'] === 'm' ? 0 : 6);
 106      if ($D > 6)
 107      {
 108          $D -= 7;
 109      }
 110      $__calendar .= '<th>'.$days[$D].'</th>';
 111  }
 112  $__calendar .= '</tr><tr>';
 113  $before = date('w', mktime(0, 0, 0, $__month, 1, $__year)) - ($clickheatConf['start'] === 'm' ? 1 : 0);
 114  if ($before < 0)
 115  {
 116      $before += 7;
 117  }
 118  $__lastDayOfMonth = date('t', mktime(0, 0, 0, $__month - 1, 1, $__year));
 119  for ($d = 1; $d <= $before; $d++)
 120  {
 121      $__calendar .= '<td id="clickheat-calendar-10'.$d.'">'.($__lastDayOfMonth - $before + $d).'</td>';
 122  }
 123  $cols = $before - 1;
 124  $__js = 'var weekDays = [';
 125  for ($d = 1, $days = date('t', $date); $d <= $days; $d++)
 126  {
 127      $D = mktime(0, 0, 0, $__month, $d, $__year);
 128      if (++$cols === 7)
 129      {
 130          $__calendar .= '</tr><tr>';
 131          $cols = 0;
 132      }
 133      $__calendar .= '<td id="clickheat-calendar-'.$d.'"><a href="#" onclick="updateCalendar('.$d.'); return false;">'.$d.'</a></td>';
 134      $__js .= ','.(date('W', $D) + (date('w', $D) == 0 && $clickheatConf['start'] === 's' ? 1 : 0));
 135  }
 136  $__js .= '];';
 137  for ($d = 1; $cols < 6; $cols++, $d++)
 138  {
 139      $__calendar .= '<td id="clickheat-calendar-11'.$d.'">'.$d.'</td>';
 140  }
 141  $__calendar .= '</tr></table>';
 142  $ranges = explode(',', LANG_RANGE);
 143  $months = explode(',', LANG_MONTHS);
 144  echo $__calendar;
 145  ?>
 146      </td>
 147      <td rowspan="4">
 148          <table cellpadding="1" cellspacing="0" border="0" class="clickheat-calendar">
 149              <tr>
 150                  <th><a href="#" onclick="url = window.location.href.replace(/&?date=\d+-\d+-\d+/,''); if (url.search(/\?/) == -1) url += '?'; url += '&date=<?php echo ($__month == '1' ? $__year - 1 : $__year), '-', ($__month == '1' ? '12' : sprintf('%02d', $__month - 1)) ?>-01'; window.location.href = url; return false;"><img src="<?php echo CLICKHEAT_PATH ?>images/previous.png" width="16" height="16" align="absmiddle" alt="Previous" /></a><?php echo $months[$__month] ?><a href="#" onclick="url = window.location.href.replace(/&?date=\d+-\d+-\d+/,''); if (url.search(/\?/) == -1) url += '?'; url += '&date=<?php echo ($__month == '12' ? $__year + 1 : $__year), '-', ($__month == '12' ? '01' : sprintf('%02d', $__month + 1)) ?>-01'; window.location.href = url; return false;"><img src="<?php echo CLICKHEAT_PATH ?>images/next.png" width="16" height="16" align="absmiddle" alt="Next" /></a></th>
 151              </tr>
 152              <tr>
 153                  <td id="clickheat-calendar-d"><a href="#" onclick="currentRange = 'd'; this.blur(); updateCalendar(); return false;"><?php echo $ranges[0] ?></a></td>
 154              </tr>
 155              <tr>
 156                  <td id="clickheat-calendar-w"><a href="#" onclick="currentRange = 'w'; this.blur(); updateCalendar(); return false;"><?php echo $ranges[1] ?></a></td>
 157              </tr>
 158              <tr>
 159                  <td id="clickheat-calendar-m"><a href="#" onclick="currentRange = 'm'; this.blur(); updateCalendar(); return false;"><?php echo $ranges[2] ?></a></td>
 160              </tr>
 161          </table>
 162      </td>
 163  </tr>
 164  <tr>
 165      <th><?php echo LANG_BROWSER ?></th><td><select name="browser" id="formBrowser" onchange="updateHeatmap();"><?php echo $__selectBrowsers ?></select></td>
 166  </tr>
 167  <tr>
 168      <th><?php echo LANG_HEATMAP ?></th><td><input type="checkbox" id="formHeatmap" name="heatmap" onclick="updateHeatmap();"<?php if ($clickheatConf['heatmap'] === true) echo ' checked="checked"'; ?> /><span id="alphaSelector"></span></td>
 169  </tr>
 170  <tr>
 171      <th><?php echo LANG_SCREENSIZE ?></th><td><select name="screen" id="formScreen" onchange="resizeDiv(); updateHeatmap();"><?php echo $__selectScreens ?></select></td>
 172  </tr>
 173  </table>
 174  </form>
 175  </div>
 176  <div id="divPanel" onmouseover="showPanel();" onclick="hidePanel();"><img src="<?php echo CLICKHEAT_PATH ?>images/arrow-up.png" width="11" height="6" alt="" /></div>
 177  <script type="text/javascript" src="<?php echo CLICKHEAT_PATH ?>js/admin.js"></script>
 178  <div id="overflowDiv">
 179      <div id="layoutDiv"></div>
 180      <div id="pngDiv"></div>
 181      <p><iframe src="<?php echo CLICKHEAT_PATH ?>clickempty.html" id="webPageFrame" onload="cleanIframe();" frameborder="0" scrolling="no" width="50" height="0"></iframe></p>
 182  </div>
 183  <script type="text/javascript">
 184  <?php echo $__js ?>
 185  pleaseWait = '<?php echo str_replace('\'', '\\\'', LANG_ERROR_LOADING); ?>';
 186  cleanerRunning = '<?php echo str_replace('\'', '\\\'', LANG_CLEANER_RUNNING); ?>';
 187  isJsOkay = '<?php echo CLICKHEAT_ADMIN === true ? '<a href="#" onclick="showJsCode(); return false;">'.str_replace('\'', '\\\'', LANG_ERROR_JAVASCRIPT).'</a>' : '' ?>';
 188  jsAdminCookie = '<?php echo str_replace('\'', '\\\'', LANG_JAVASCRIPT_ADMIN_COOKIE) ?>';
 189  hideIframes = <?php echo $clickheatConf['hideIframes'] === true ? 'true' : 'false' ?>;
 190  hideFlashes = <?php echo $clickheatConf['hideFlashes'] === true ? 'true' : 'false' ?>;
 191  scriptPath = 'http://<?php echo $_SERVER['HTTP_HOST'].CLICKHEAT_PATH ?>';
 192  scriptIndexPath = '<?php echo CLICKHEAT_INDEX_PATH ?>';
 193  lastDayOfMonth = <?php echo $__lastDayOfMonth ?>;
 194  currentDate = [<?php echo $__day, ',', $__month, ',', $__year, ',', $__month, ',', $__year ?>];
 195  currentAlpha = <?php echo $clickheatConf['alpha'] ?>;
 196  
 197  /** Draw the alpha selector */
 198  drawAlphaSelector('alphaSelector', 30);
 199  
 200  /** Resize the main div */
 201  resizeDiv();
 202  
 203  /** Load iframe (which will load the heatmap once the info is okay) */
 204  loadIframe();
 205  
 206  /** Run cleaner */
 207  runCleaner();
 208  </script>


Gnr le : Mon Nov 26 14:10:01 2007 par Balluche grce PHPXref 0.7
  Clicky Web Analytics