Ignore:
Timestamp:
Feb 19, 2010, 8:41:01 PM (14 years ago)
Author:
grum
Message:

Unable to analyze the gallery : bug fixed !
and other little bugs fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/AMetaData/amd_aip.class.inc.php

    r4905 r4915  
    149149        case 'makeStatsDoAnalyze':
    150150          $result=$this->ajax_amd_makeStatsDoAnalyze($_REQUEST['imagesList']);
    151           break;
    152         case 'makeStatsConsolidate':
    153           $result=$this->ajax_amd_makeStatsConsolidate($_REQUEST['step']);
    154151          break;
    155152        case 'makeStatsGetStatus':
     
    477474  /**
    478475   * display and manage the database page
    479    */
    480   private function displayDatabase()
    481   {
    482     global $template, $page;
    483 
    484     $template->set_filename('body_page', dirname(__FILE__).'/admin/amd_database.tpl');
    485 
    486     $datas=array(
    487       'urlRequest' => $this->page_link,
    488       'NumberOfItemsPerRequest' => $this->my_config['amd_NumberOfItemsPerRequest'],
    489     );
    490 
    491     $template->assign("datas", $datas);
    492 
    493     $template->assign_var_from_handle('AMD_BODY_PAGE', 'body_page');
    494   } // display_config
    495 
    496 
    497   /**
    498    * display and manage the status page on the stat page
    499476   *
    500477   * the function automatically update the AMD tables :
     
    505482   * @return String : the content of the page
    506483   */
    507   protected function displayStatStatus()
    508   {
    509     $local_tpl = new Template(AMD_PATH."admin/", "");
    510     $local_tpl->set_filename('body_page',
    511                   dirname($this->filelocation).'/admin/amd_stat_status.tpl');
     484  private function displayDatabase()
     485  {
     486    global $template, $page;
    512487
    513488    /*
     
    538513    pwg_query($sql);
    539514
     515
     516    $template->set_filename('body_page', dirname(__FILE__).'/admin/amd_database.tpl');
     517
    540518    $datas=array(
    541519      'urlRequest' => $this->page_link,
     520      'NumberOfItemsPerRequest' => $this->my_config['amd_NumberOfItemsPerRequest'],
    542521    );
    543522
    544     $local_tpl->assign('datas', $datas);
    545 
    546     return($local_tpl->parse('body_page', true));
    547   }
     523    $template->assign("datas", $datas);
     524
     525    $template->assign_var_from_handle('AMD_BODY_PAGE', 'body_page');
     526  } // displayDatabase
     527
    548528
    549529
     
    750730            'value' => addslashes($value)
    751731          );
    752 
    753           $sql="UPDATE ".$this->tables['used_tags']."
    754                   SET numOfImg = numOfImg+1
    755                   WHERE numId=$numId;";
    756           pwg_query($sql);
    757732        }
    758733      }
     
    859834      }
    860835    }
     836
     837    $sql="UPDATE ".$this->tables['used_tags']." ut,
     838            (SELECT COUNT(imageId) AS nb, numId
     839              FROM ".$this->tables['images_tags']."
     840              GROUP BY numId) nb
     841          SET ut.numOfImg = nb.nb
     842          WHERE ut.numId = nb.numId;";
     843    pwg_query($sql);
    861844
    862845    return(trim($returned).";");
     
    970953
    971954  /**
    972    * make some stat consolidation
    973    *  "0" : consolidate "exif.%" tags
    974    *  "1" : consolidate "iptc.%" tags
    975    *  "2" : consolidate "xmp.%" tags
    976    *
    977    * @param String $step
    978    */
    979   private function ajax_amd_makeStatsConsolidate($step)
    980   {/*
    981     $sql="INSERT INTO ".$this->tables['used_tags']."
    982             SELECT tagId, count(distinct imageId)
    983               FROM ".$this->tables['images_tags']."
    984               WHERE tagId LIKE '%s'
    985               GROUP BY tagId";
    986 
    987     switch($step)
    988     {
    989       case "0":
    990         pwg_query("DELETE FROM ".$this->tables['used_tags']);
    991         $sql=sprintf($sql, "exif.%");
    992         pwg_query($sql);
    993         break;
    994       case "1":
    995         $sql=sprintf($sql, "iptc.%");
    996         pwg_query($sql);
    997         break;
    998       case "2":
    999         $sql=sprintf($sql, "xmp.%");
    1000         pwg_query($sql);
    1001         break;
    1002     }*/
    1003   }
    1004 
    1005 
    1006   /**
    1007955   * return a formatted <table> (using the template "amd_stat_show_iListTags")
    1008956   * of used tag with, for each tag, the number and the percentage of pictures
Note: See TracChangeset for help on using the changeset viewer.