[ Index ]

PHP Cross Reference of phpwcms V1.5.0 _r431 (28.01.12)

title

Body

[close]

/include/inc_module/mod_seolog/ -> backend.listing.php (source)

   1  <?php
   2  /*************************************************************************************
   3     Copyright notice
   4     
   5     (c) 2002-2012 Oliver Georgi <oliver@phpwcms.de> // All rights reserved.
   6   
   7     This script is part of PHPWCMS. The PHPWCMS web content management system is
   8     free software; you can redistribute it and/or modify it under the terms of
   9     the GNU General Public License as published by the Free Software Foundation;
  10     either version 2 of the License, or (at your option) any later version.
  11    
  12     The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html
  13     A copy is found in the textfile GPL.txt and important notices to the license 
  14     from the author is found in LICENSE.txt distributed with these scripts.
  15    
  16     This script is distributed in the hope that it will be useful, but WITHOUT ANY 
  17     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  18     PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  19   
  20     This copyright notice MUST APPEAR in all copies of the script!
  21  *************************************************************************************/
  22  
  23  // ----------------------------------------------------------------
  24  // obligate check for phpwcms constants
  25  if (!defined('PHPWCMS_ROOT')) {
  26     die("You Cannot Access This Script Directly, Have a Nice Day.");
  27  }
  28  // ----------------------------------------------------------------
  29  
  30  
  31  $_entry['query']            = '';
  32  
  33  // create pagination
  34  if(isset($_GET['c'])) {
  35      $_SESSION['list_user_count'] = $_GET['c'] == 'all' ? '99999' : intval($_GET['c']);
  36  }
  37  if(isset($_GET['page'])) {
  38      $_SESSION['seolog_page'] = intval($_GET['page']);
  39  }
  40  
  41  // set default values for paginating
  42  if(empty($_SESSION['list_user_count'])) {
  43      $_SESSION['list_user_count'] = 25;
  44  }
  45  
  46  // paginate and search form processing
  47  if(isset($_POST['do_pagination'])) {
  48  
  49      $_SESSION['list_active']    = empty($_POST['showactive']) ? 0 : 1;
  50      $_SESSION['list_inactive']    = empty($_POST['showinactive']) ? 0 : 1;
  51  
  52      $_SESSION['filter']            = clean_slweg($_POST['filter']);
  53      if(empty($_SESSION['filter'])) {
  54          unset($_SESSION['filter']);
  55      } else {
  56          $_SESSION['filter']    = convertStringToArray($_SESSION['filter'], ' ');
  57          $_POST['filter']    = $_SESSION['filter'];
  58      }
  59      
  60      $_SESSION['seolog_page'] = intval($_POST['page']);
  61  
  62  }
  63  
  64  if(empty($_SESSION['seolog_page'])) {
  65      $_SESSION['seolog_page'] = 1;
  66  }
  67  
  68  $_entry['list_active']        = isset($_SESSION['list_active'])    ? $_SESSION['list_active']        : 1;
  69  $_entry['list_inactive']    = isset($_SESSION['list_inactive'])    ? $_SESSION['list_inactive']    : 1;
  70  
  71  
  72  $_entry['query'] = '1=1';
  73  
  74  if(isset($_SESSION['filter']) && is_array($_SESSION['filter']) && count($_SESSION['filter'])) {
  75      
  76      $_entry['filter_array'] = array();
  77  
  78      foreach($_SESSION['filter'] as $_entry['filter']) {
  79          //usr_name, usr_login, usr_email
  80          $_entry['filter_array'][] = "CONCAT(domain,query) LIKE '%".aporeplace($_entry['filter'])."%'";
  81      }
  82      if(count($_entry['filter_array'])) {
  83          
  84          $_SESSION['filter'] = ' AND ('.implode(' OR ', $_entry['filter_array']).')';
  85          $_entry['query'] .= $_SESSION['filter'];
  86      
  87      }
  88  
  89  } elseif(isset($_SESSION['filter']) && is_string($_SESSION['filter'])) {
  90  
  91      $_entry['query'] .= $_SESSION['filter'];
  92  
  93  }
  94  
  95  
  96  // paginating values
  97  $_entry['count_total'] = _dbQuery('SELECT * FROM '.DB_PREPEND.'phpwcms_log_seo WHERE '.$_entry['query'], 'COUNT');
  98  $_entry['pages_total'] = ceil($_entry['count_total'] / $_SESSION['list_user_count']);
  99  if($_SESSION['seolog_page'] > $_entry['pages_total']) {
 100      $_SESSION['seolog_page'] = empty($_entry['pages_total']) ? 1 : $_entry['pages_total'];
 101  }
 102  
 103  
 104  
 105  ?>
 106  <h1 class="title" style="margin-bottom:10px"><?php echo $BLM['listing_title'] ?></h1>
 107  <form action="<?php echo MODULE_HREF ?>" method="post" name="paginate" id="paginate"><input type="hidden" name="do_pagination" value="1" />
 108  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="paginate" summary="">
 109      <tr>
 110          <td><table border="0" cellpadding="0" cellspacing="0" summary="">
 111              <tr>
 112  <?php 
 113  if($_entry['pages_total'] > 1) {
 114  
 115      echo '<td>';
 116      if($_SESSION['seolog_page'] > 1) {
 117          echo '<a href="'.MODULE_HREF.'&amp;page='.($_SESSION['seolog_page']-1).'">';
 118          echo '<img src="img/famfamfam/action_back.gif" alt="" border="0" /></a>';
 119      } else {
 120          echo '<img src="img/famfamfam/action_back.gif" alt="" border="0" class="inactive" />';
 121      }
 122      echo '</td>';
 123      echo '<td><input type="text" name="page" id="page" maxlength="4" size="4" value="'.$_SESSION['seolog_page'];
 124      echo '"  class="textinput" style="margin:0 3px 0 5px;width:30px;font-weight:bold;" /></td>';
 125      echo '<td class="chatlist">/'.$_entry['pages_total'].'&nbsp;</td>';
 126      echo '<td>';
 127      if($_SESSION['seolog_page'] < $_entry['pages_total']) {
 128          echo '<a href="'.MODULE_HREF.'&amp;page='.($_SESSION['seolog_page']+1).'">';
 129          echo '<img src="img/famfamfam/action_forward.gif" alt="" border="0" /></a>';
 130      } else {
 131          echo '<img src="img/famfamfam/action_forward.gif" alt="" border="0" class="inactive" />';
 132      }
 133      echo '</td><td class="chatlist">&nbsp;|&nbsp;</td>';
 134  
 135  } else {
 136  
 137      echo '<td class="chatlist"><input type="hidden" name="page" id="page" value="1" /></td>';
 138  
 139  }
 140  ?>
 141                  <td><input type="text" name="filter" id="filter" size="10" value="<?php 
 142                  
 143                  if(isset($_POST['filter']) && is_array($_POST['filter']) ) {
 144                      echo html_specialchars(implode(' ', $_POST['filter']));
 145                  }
 146                  
 147                  ?>" class="textinput" style="margin:0 2px 0 0;width:110px;text-align:left;" title="filter results" /></td>
 148                  <td><input type="image" name="gofilter" src="img/famfamfam/action_go.gif" style="margin-right:3px;" /></td>
 149              
 150              </tr>
 151          </table></td>
 152  
 153      <td class="chatlist" align="right">
 154          <a href="<?php echo MODULE_HREF ?>&amp;c=10">10</a>
 155          <a href="<?php echo MODULE_HREF ?>&amp;c=25">25</a>
 156          <a href="<?php echo MODULE_HREF ?>&amp;c=50">50</a>
 157          <a href="<?php echo MODULE_HREF ?>&amp;c=100">100</a>
 158          <a href="<?php echo MODULE_HREF ?>&amp;c=250">250</a>
 159          <a href="<?php echo MODULE_HREF ?>&amp;c=all"><?php echo $BL['be_ftptakeover_all'] ?></a>
 160      </td>
 161  
 162      </tr>
 163  </table>
 164  </form>
 165  
 166  <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="">
 167          
 168      <tr><td colspan="4"><img src="img/leer.gif" alt="" width="1" height="3"></td></tr>
 169      <tr><td colspan="4" bgcolor="#92A1AF"><img src="img/leer.gif" alt="" width="1" height="1"></td></tr>
 170      
 171  <?php
 172  // loop listing available newsletters
 173  $row_count = 0;                
 174  
 175  $sql  = 'SELECT * FROM '.DB_PREPEND.'phpwcms_log_seo WHERE '.$_entry['query'].' ';
 176  $sql .= 'LIMIT '.(($_SESSION['seolog_page']-1) * $_SESSION['list_user_count']).','.$_SESSION['list_user_count'];
 177  $data = _dbQuery($sql);
 178  
 179  #print_r($sql);
 180  
 181  foreach($data as $row) {
 182  
 183      echo '<tr'.( ($row_count % 2) ? ' bgcolor="#F3F5F8"' : '' ).'>';
 184  
 185      echo '<td class="tdbottom3 tdtop3" nowrap="nowrap">';
 186      echo $row['create_date'];
 187      echo '&nbsp;</td>';
 188          
 189      echo '<td class="tdbottom3 tdtop3"><a href="';
 190      echo html_specialchars($row['referrer']).'" target="_blank">'.html_specialchars($row['domain']);
 191      echo '</a></td>';
 192      
 193      echo '<td class="tdbottom3 tdtop3" align="center">&nbsp;';
 194      echo $row['pos'];
 195      echo '&nbsp;</td>';
 196  
 197      
 198      echo '<td class="tdbottom3 tdtop3">';
 199      echo html_specialchars(PHPWCMS_CHARSET != 'utf-8' && phpwcms_seems_utf8($row['query']) ? makeCharsetConversion($row['query'], 'utf-8', PHPWCMS_CHARSET, false) : $row['query']);
 200      echo '</td>';
 201  
 202      echo "</tr>\n";
 203  
 204      $row_count++;
 205  }
 206  
 207  if($row_count) {
 208      echo '<tr><td colspan="4" bgcolor="#92A1AF"><img src="img/leer.gif" alt="" width="1" height="1"></td></tr>';
 209  }
 210  
 211  ?>    
 212  
 213      <tr><td colspan="4"><img src="img/leer.gif" alt="" width="1" height="15"></td></tr>
 214  </table>


Generated: Sun Jan 29 16:31:14 2012 Cross-referenced by PHPXref 0.7.1