- Timestamp:
- May 17, 2010, 7:46:39 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/GrumPluginClasses/classes/GPCRequestBuilder.class.inc.php
r6174 r6208 366 366 if($clearAll) 367 367 { 368 $sql="DELETE FROM ". $this->tables['result_cache'];368 $sql="DELETE FROM ".self::$tables['result_cache']; 369 369 } 370 370 else 371 371 { 372 $sql="DELETE FROM ".$this->tables['result_cache']." pgrc, ".$this->tables['request']." pgr 373 WHERE pgrc.id = pgr.id 374 AND pgr.date < '".date('Y-m-d H:i:s', strtotime("-2 hour"))."'"; 372 $sql="DELETE pgrc FROM ".self::$tables['result_cache']." pgrc 373 LEFT JOIN ".self::$tables['request']." pgr 374 ON pgrc.id = pgr.id 375 WHERE pgr.date < '".date('Y-m-d H:i:s', strtotime("-2 hour"))."'"; 375 376 } 376 377 pwg_query($sql); … … 386 387 { 387 388 global $user; 389 390 self::clearCache(); 388 391 389 392 $registeredPlugin=self::getRegistered(); … … 428 431 { 429 432 $pluginNeeded[$val['owner']][$key]=$_REQUEST['extraData'][$key]['param']; 430 $pluginList[ ]=$val['owner'];433 $pluginList[$val['owner']]=$val['owner']; 431 434 } 432 435 … … 512 515 self::updateRequest($requestNumber, $numberItems, 0, implode(',', $pluginList)); 513 516 517 514 518 return("$requestNumber;".$numberItems); 515 519 } 516 520 517 self::clearCache(); 518 519 return($sql); 521 return("0;0"); 520 522 } 521 523 … … 538 540 } 539 541 540 $limitFrom=$numPerPage*($pageNumber-1)+1; 541 $limitTo=$numPerPage*$pageNumber; 542 $limitFrom=$numPerPage*($pageNumber-1); 542 543 543 544 $pluginNeeded=explode(',', $request['connected_plugin']); … … 554 555 'RB_PIT' => "pit.id AS imageId, pit.name AS imageName, pit.path AS imagePath", // from the piwigo's image table 555 556 'RB_PIC' => "GROUP_CONCAT(pic.category_id SEPARATOR ',') AS imageCategoriesId", // from the piwigo's image_category table 556 'RB_PCT' => "GROUP_CONCAT(pct.name SEPARATOR '#sep#') AS imageCategoriesNames", //from the piwigo's categories table 557 'RB_PCT' => "GROUP_CONCAT(CASE WHEN pct.name IS NULL THEN '' ELSE pct.name END SEPARATOR '#sep#') AS imageCategoriesNames, 558 GROUP_CONCAT(CASE WHEN pct.permalink IS NULL THEN '' ELSE pct.permalink END SEPARATOR '#sep#') AS imageCategoriesPLink, 559 GROUP_CONCAT(CASE WHEN pct.dir IS NULL THEN 'V' ELSE 'P' END) AS imageCategoriesDir", //from the piwigo's categories table 557 560 ), 558 561 'FROM' => Array( … … 635 638 .' GROUP BY '.$build['GROUPBY'] 636 639 .' ORDER BY pit.id ' 637 .' LIMIT '.$limitFrom.', '.$ limitTo;640 .' LIMIT '.$limitFrom.', '.$numPerPage; 638 641 639 642 $result=pwg_query($sql); … … 647 650 $datas['imagePath']=$row['imagePath']; 648 651 $datas['imageName']=$row['imageName']; 652 649 653 $datas['imageCategoriesId']=explode(',', $row['imageCategoriesId']); 650 654 $datas['imageCategoriesNames']=explode('#sep#', $row['imageCategoriesNames']); 655 $datas['imageCategoriesPLink']=explode('#sep#', $row['imageCategoriesPLink']); 656 $datas['imageCategoriesDir']=explode(',', $row['imageCategoriesDir']); 657 658 659 $datas['imageCategories']=Array(); 660 for($i=0;$i<count($datas['imageCategoriesId']);$i++) 661 { 662 $datas['imageCategories'][]=array( 663 'id' => $datas['imageCategoriesId'][$i], 664 'name' => $datas['imageCategoriesNames'][$i], 665 'dirType' => $datas['imageCategoriesDir'][$i], 666 'pLinks' => $datas['imageCategoriesPLink'][$i], 667 'link'=> make_index_url( 668 array( 669 'category' => array( 670 'id' => $datas['imageCategoriesId'][$i], 671 'name' => $datas['imageCategoriesNames'][$i], 672 'permalink' => $datas['imageCategoriesPLink'][$i]) 673 ) 674 ) 675 ); 676 } 651 677 652 678 /* affect datas for each plugin
Note: See TracChangeset
for help on using the changeset viewer.