Changeset 8548


Ignore:
Timestamp:
Jan 9, 2011, 11:16:13 AM (10 years ago)
Author:
rub
Message:

Add info on wiew_list

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/FacebookPlug/Server/trunk/admin/view_list.php

    r8517 r8548  
    1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    2 <html>
    3 <head>
    4   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    5   <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
    6 </head>
    7 <body>
    8   <center>
    9    <table>
    10     <tr>
    11       <th>ID</th>
    12       <th>Date/Time</th>
    13       <th>Image</th>
    14       <th>Gallery</th>
    15     </tr>
    161<?php
    172// +-----------------------------------------------------------------------+
     
    3722
    3823$view_version = (isset($_GET['v']) ? $_GET['v'] : FBP_VERSION);
     24$max_rows = (isset($_GET['r']) ? $_GET['mr'] : 1000);
     25$max_group_rows = (isset($_GET['r']) ? $_GET['mgr'] : 10);
    3926
     27?>
     28<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
     29<html>
     30<head>
     31  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     32  <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
     33</head>
     34<body>
     35  <h1>Stats</h1>
     36  <table>
     37    <tr>
     38      <th>Caption</th>
     39      <th>Count</th>
     40    </tr>
     41<?php
    4042
    41 $result = fbp_db_query("select * from FBP_HISTORY where VERSION = '".mysql_real_escape_string($view_version)."' and SCRIPT_NAME = 'do_upload_photo' order by ID desc;");
     43$queries =  array(
     44  "select 'Uploaded photos' Caption, count(*) C from FBP_HISTORY where VERSION = '".mysql_real_escape_string($view_version)."' and SCRIPT_NAME = 'do_upload_photo';",
     45  "select 'Upload photo requests' Caption, count(*) C from FBP_HISTORY where VERSION = '".mysql_real_escape_string($view_version)."' and SCRIPT_NAME = 'upload_photo';",
     46  "select concat('Uploaded photos ', date_format(TIMESTAMP, '%Y%m%d')) Caption, count(*) C from FBP_HISTORY where VERSION = '".mysql_real_escape_string($view_version)."' and SCRIPT_NAME = 'do_upload_photo' group by date_format(TIMESTAMP, '%Y%m%d') order by date_format(TIMESTAMP, '%Y%m%d') desc limit 0 , ".mysql_real_escape_string($max_group_rows).";",
     47  "select concat('Upload photo requests ', date_format(TIMESTAMP, '%Y%m%d')) Caption, count(*) C from FBP_HISTORY where VERSION = '".mysql_real_escape_string($view_version)."' and SCRIPT_NAME = 'upload_photo' group by date_format(TIMESTAMP, '%Y%m%d') desc limit 0 , ".mysql_real_escape_string($max_group_rows).";",
     48);
     49
     50foreach ($queries as $query)
     51{
     52  $result = fbp_db_query($query);
     53
     54  while ($row = mysql_fetch_assoc($result))
     55  {
     56    echo '
     57        <tr>
     58          <td>'.$row['Caption'].'</td>
     59          <td>'.$row['C'].'</td>
     60        </tr>
     61  ';
     62  }
     63}
     64?>
     65  </table>
     66  <h1>History</h1>
     67  <table>
     68    <tr>
     69      <th>ID</th>
     70      <th>Date/Time</th>
     71      <th>Image</th>
     72      <th>Gallery</th>
     73    </tr>
     74<?php
     75$result = fbp_db_query("select * from FBP_HISTORY where VERSION = '".mysql_real_escape_string($view_version)."' and SCRIPT_NAME = 'do_upload_photo' order by ID desc limit 0 , ".mysql_real_escape_string($max_rows).";");
    4276
    4377// Mettre le count et le titre de l'image
    44 echo  mysql_num_rows($result).' uploaded photos';
     78//~ echo  mysql_num_rows($result).' uploaded photos';
    4579
    4680while ($row = mysql_fetch_assoc($result))
    4781{
    4882  echo '
    49 <tr>
    50   <td>'.$row['ID'].'</td>
    51   <td>'.$row['TIMESTAMP'].'</td>
    52   <td><a href="'.$row['PICTURE_URL'].'"><img src="'.$row['IMAGE_URL'].'" title="'.$row['PICTURE_TITLE'].'" style="height:75px"></a></td>
    53   <td>'.$row['GALLERY_TITLE'].'</td>
     83    <tr>
     84      <td>'.$row['ID'].'</td>
     85      <td>'.$row['TIMESTAMP'].'</td>
     86      <td><a href="'.$row['PICTURE_URL'].'" onclick="window.open(this.href); return false;"><img src="'.$row['IMAGE_URL'].'" title="'.$row['PICTURE_TITLE'].'" style="height:75px"></a></td>
     87      <td>'.$row['GALLERY_TITLE'].'</td>
     88    </tr>
    5489';
    5590}
    5691?>
    57    </table>
     92    </table>
    5893  </center>
    5994</body>
Note: See TracChangeset for help on using the changeset viewer.