Changeset 6919 for extensions/AMetaData/amd_install.class.inc.php
- Timestamp:
- Sep 14, 2010, 7:14:43 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AMetaData/amd_install.class.inc.php
r6891 r6919 50 50 $this->loadConfig(); 51 51 $this->config['installed']=AMD_VERSION2; 52 $this->config['newInstall']='y'; 52 53 $this->saveConfig(); 53 54 … … 121 122 unset($tables_def); 122 123 123 $tables_insert=array( 124 125 $tablesInsert=array( 124 126 "INSERT INTO `".$this->tables['groups']."` VALUES(1, 0)", 125 127 "INSERT INTO `".$this->tables['groups_names']."` VALUES(1, '".$user['language']."', '".$lang['g003_default_group_name']."')", … … 135 137 ('magic.ShotInfo.Flash.Fired', 8, 1)" 136 138 ); 137 foreach($tables _insert as $sql)139 foreach($tablesInsert as $sql) 138 140 { 139 141 pwg_query($sql); 140 142 } 143 141 144 142 145 return($result); … … 279 282 pwg_query($sql); 280 283 } 281 282 $listToAnalyze=Array(Array(), Array());283 /*284 * select 25 pictures into the caddie285 */286 $sql="SELECT ti.id, ti.path287 FROM ".CADDIE_TABLE." tc288 LEFT JOIN ".IMAGES_TABLE." ti ON ti.id = tc.element_id289 WHERE tc.user_id = ".$user['id']."290 AND ti.id IS NOT NULL291 ORDER BY RAND() LIMIT 25;";292 $result=pwg_query($sql);293 if($result)294 {295 while($row=pwg_db_fetch_assoc($result))296 {297 $listToAnalyze[0][]=$row;298 $listToAnalyze[1][]=$row['id'];299 }300 }301 /*302 * if caddie is empty, of is have less than 25 pictures, select other303 * pictures from the gallery304 */305 if(count($listToAnalyze[0])<25)306 {307 if(count($listToAnalyze[0])>0)308 {309 $excludeList="WHERE ti.id NOT IN(".implode(",", $listToAnalyze[1]).") ";310 }311 else312 {313 $excludeList="";314 }315 $sql="SELECT ti.id, ti.path, ti.has_high316 FROM ".IMAGES_TABLE." ti ".$excludeList."317 ORDER BY RAND() LIMIT ".(25-count($listToAnalyze[0])).";";318 $result=pwg_query($sql);319 if($result)320 {321 while($row=pwg_db_fetch_assoc($result))322 {323 $listToAnalyze[0][]=$row;324 }325 }326 }327 328 /*329 * analyze the 25 selected pictures330 */331 if(count($listToAnalyze[0])>0)332 {333 // $path = path of piwigo's on the server filesystem334 $path=dirname(dirname(dirname(__FILE__)));335 336 foreach($listToAnalyze[0] as $val)337 {338 if($val['has_high']===true and $this->config['amd_UseMetaFromHD']=='y')339 {340 $this->analyzeImageFile($path."/".dirname($val['path'])."/pwg_high/".basename($val['path']), $val['id']);341 }342 else343 {344 $this->analyzeImageFile($path."/".$val['path'], $val['id']);345 }346 347 }348 349 $this->makeStatsConsolidation();350 }351 284 } 352 285
Note: See TracChangeset
for help on using the changeset viewer.