Changeset 4915 for extensions/AMetaData/amd_aip.class.inc.php
- Timestamp:
- Feb 19, 2010, 8:41:01 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AMetaData/amd_aip.class.inc.php
r4905 r4915 149 149 case 'makeStatsDoAnalyze': 150 150 $result=$this->ajax_amd_makeStatsDoAnalyze($_REQUEST['imagesList']); 151 break;152 case 'makeStatsConsolidate':153 $result=$this->ajax_amd_makeStatsConsolidate($_REQUEST['step']);154 151 break; 155 152 case 'makeStatsGetStatus': … … 477 474 /** 478 475 * 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_config495 496 497 /**498 * display and manage the status page on the stat page499 476 * 500 477 * the function automatically update the AMD tables : … … 505 482 * @return String : the content of the page 506 483 */ 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; 512 487 513 488 /* … … 538 513 pwg_query($sql); 539 514 515 516 $template->set_filename('body_page', dirname(__FILE__).'/admin/amd_database.tpl'); 517 540 518 $datas=array( 541 519 'urlRequest' => $this->page_link, 520 'NumberOfItemsPerRequest' => $this->my_config['amd_NumberOfItemsPerRequest'], 542 521 ); 543 522 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 548 528 549 529 … … 750 730 'value' => addslashes($value) 751 731 ); 752 753 $sql="UPDATE ".$this->tables['used_tags']."754 SET numOfImg = numOfImg+1755 WHERE numId=$numId;";756 pwg_query($sql);757 732 } 758 733 } … … 859 834 } 860 835 } 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); 861 844 862 845 return(trim($returned).";"); … … 970 953 971 954 /** 972 * make some stat consolidation973 * "0" : consolidate "exif.%" tags974 * "1" : consolidate "iptc.%" tags975 * "2" : consolidate "xmp.%" tags976 *977 * @param String $step978 */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 /**1007 955 * return a formatted <table> (using the template "amd_stat_show_iListTags") 1008 956 * of used tag with, for each tag, the number and the percentage of pictures
Note: See TracChangeset
for help on using the changeset viewer.