Changeset 8083
- Timestamp:
- Dec 11, 2010, 10:08:43 PM (14 years ago)
- Location:
- trunk/admin
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/languages.class.php
r6550 r8083 197 197 global $user; 198 198 199 $pem_category_id = 8; 199 $get_data = array( 200 'category_id' => 8, 201 'format' => 'php', 202 ); 200 203 201 204 // Retrieve PEM versions 202 205 $version = PHPWG_VERSION; 203 206 $versions_to_check = array(); 204 $url = PEM_URL . '/api/get_version_list.php ?category_id='.$pem_category_id.'&format=php';205 if (fetchRemote($url, $result ) and $pem_versions = @unserialize($result))207 $url = PEM_URL . '/api/get_version_list.php'; 208 if (fetchRemote($url, $result, $get_data) and $pem_versions = @unserialize($result)) 206 209 { 207 210 if (!preg_match('/^\d+\.\d+\.\d+/', $version)) … … 224 227 225 228 // Retrieve PEM languages infos 226 $url = PEM_URL . '/api/get_revision_list.php?category_id='.$pem_category_id.'&format=php&last_revision_only=true'; 227 $url .= '&version=' . implode(',', $versions_to_check); 228 $url .= '&lang='.$user['language']; 229 230 if (fetchRemote($url, $result)) 229 $url = PEM_URL . '/api/get_revision_list.php'; 230 $get_data = array_merge($get_data, array( 231 'last_revision_only' => 'true', 232 'version' => implode(',', $versions_to_check), 233 'lang' => $user['language'], 234 ) 235 ); 236 237 if (fetchRemote($url, $result, $get_data)) 231 238 { 232 239 $pem_languages = @unserialize($result); … … 259 266 if ($archive = tempnam( PHPWG_ROOT_PATH.'language', 'zip')) 260 267 { 261 $url = PEM_URL . '/download.php?rid=' . $revision; 262 $url .= '&origin=piwigo_' . $action; 263 264 if ($handle = @fopen($archive, 'wb') and fetchRemote($url, $handle)) 268 $url = PEM_URL . '/download.php'; 269 $get_data = array( 270 'rid' => $revision, 271 'origin' => 'piwigo_'.$action, 272 ); 273 274 if ($handle = @fopen($archive, 'wb') and fetchRemote($url, $handle, $get_data)) 265 275 { 266 276 fclose($handle); -
trunk/admin/include/plugins.class.php
r6725 r8083 291 291 global $user; 292 292 293 $get_data = array( 294 'category_id' => 12, 295 'format' => 'php', 296 ); 297 293 298 // Retrieve PEM versions 294 299 $version = PHPWG_VERSION; 295 300 $versions_to_check = array(); 296 $url = PEM_URL . '/api/get_version_list.php ?category_id=12&format=php';297 if (fetchRemote($url, $result ) and $pem_versions = @unserialize($result))301 $url = PEM_URL . '/api/get_version_list.php'; 302 if (fetchRemote($url, $result, $get_data) and $pem_versions = @unserialize($result)) 298 303 { 299 304 if (!preg_match('/^\d+\.\d+\.\d+/', $version)) … … 326 331 327 332 // Retrieve PEM plugins infos 328 $url = PEM_URL . '/api/get_revision_list.php?category_id=12&format=php&last_revision_only=true'; 329 $url .= '&version=' . implode(',', $versions_to_check); 330 $url .= '&lang=' . substr($user['language'], 0, 2); 331 $url .= '&get_nb_downloads=true'; 333 $url = PEM_URL . '/api/get_revision_list.php'; 334 $get_data = array_merge($get_data, array( 335 'last_revision_only' => 'true', 336 'version' => implode(',', $versions_to_check), 337 'lang' => substr($user['language'], 0, 2), 338 'get_nb_downloads' => 'true', 339 ) 340 ); 332 341 333 342 if (!empty($plugins_to_check)) 334 343 { 335 $url .= $new ? '&extension_exclude=' : '&extension_include='; 336 $url .= implode(',', $plugins_to_check); 337 } 338 if (fetchRemote($url, $result)) 344 if ($new) 345 { 346 $get_data['extension_exclude'] = implode(',', $plugins_to_check); 347 } 348 else 349 { 350 $get_data['extension_include'] = implode(',', $plugins_to_check); 351 } 352 } 353 if (fetchRemote($url, $result, $get_data)) 339 354 { 340 355 $pem_plugins = @unserialize($result); … … 387 402 if ($archive = tempnam( PHPWG_PLUGINS_PATH, 'zip')) 388 403 { 389 $url = PEM_URL . '/download.php?rid=' . $revision; 390 $url .= '&origin=piwigo_' . $action; 391 392 if ($handle = @fopen($archive, 'wb') and fetchRemote($url, $handle)) 404 $url = PEM_URL . '/download.php'; 405 $get_data = array( 406 'rid' => $revision, 407 'origin' => 'piwigo_'.$action, 408 ); 409 410 if ($handle = @fopen($archive, 'wb') and fetchRemote($url, $handle, $get_data)) 393 411 { 394 412 fclose($handle); -
trunk/admin/include/themes.class.php
r6550 r8083 448 448 global $user; 449 449 450 $pem_category_id = 10; 450 $get_data = array( 451 'category_id' => 10, 452 'format' => 'php', 453 ); 451 454 452 455 // Retrieve PEM versions 453 456 $version = PHPWG_VERSION; 454 457 $versions_to_check = array(); 455 $url = PEM_URL . '/api/get_version_list.php ?category_id='.$pem_category_id.'&format=php';456 if (fetchRemote($url, $result ) and $pem_versions = @unserialize($result))458 $url = PEM_URL . '/api/get_version_list.php'; 459 if (fetchRemote($url, $result, $get_data) and $pem_versions = @unserialize($result)) 457 460 { 458 461 if (!preg_match('/^\d+\.\d+\.\d+/', $version)) … … 485 488 486 489 // Retrieve PEM themes infos 487 $url = PEM_URL . '/api/get_revision_list.php?category_id='.$pem_category_id.'&format=php&last_revision_only=true'; 488 $url .= '&version=' . implode(',', $versions_to_check); 489 $url .= '&lang=' . substr($user['language'], 0, 2); 490 $url .= '&get_nb_downloads=true'; 490 $url = PEM_URL . '/api/get_revision_list.php'; 491 $get_data = array_merge($get_data, array( 492 'last_revision_only' => 'true', 493 'version' => implode(',', $versions_to_check), 494 'lang' => substr($user['language'], 0, 2), 495 'get_nb_downloads' => 'true', 496 ) 497 ); 491 498 492 499 if (!empty($themes_to_check)) 493 500 { 494 $url .= $new ? '&extension_exclude=' : '&extension_include='; 495 $url .= implode(',', $themes_to_check); 496 } 497 if (fetchRemote($url, $result)) 501 if ($new) 502 { 503 $get_data['extension_exclude'] = implode(',', $themes_to_check); 504 } 505 else 506 { 507 $get_data['extension_include'] = implode(',', $themes_to_check); 508 } 509 } 510 if (fetchRemote($url, $result, $get_data)) 498 511 { 499 512 $pem_themes = @unserialize($result); … … 547 560 if ($archive = tempnam( PHPWG_THEMES_PATH, 'zip')) 548 561 { 549 $url = PEM_URL . '/download.php?rid=' . $revision; 550 $url .= '&origin=piwigo_' . $action; 551 552 if ($handle = @fopen($archive, 'wb') and fetchRemote($url, $handle)) 562 $url = PEM_URL . '/download.php'; 563 $get_data = array( 564 'rid' => $revision, 565 'origin' => 'piwigo_'.$action, 566 ); 567 568 if ($handle = @fopen($archive, 'wb') and fetchRemote($url, $handle, $get_data)) 553 569 { 554 570 fclose($handle); -
trunk/admin/site_manager.php
r6363 r8083 117 117 { 118 118 $clf_url = $url.'create_listing_file.php'; 119 $clf_url.= '?action=test'; 120 $clf_url.= '&version='.PHPWG_VERSION; 121 if (fetchRemote($clf_url, $result)) 119 $get_data = array( 120 'action' => 'test', 121 'version' => PHPWG_VERSION, 122 ); 123 if (fetchRemote($clf_url, $result, $get_data)) 122 124 { 123 125 $lines = explode("\r\n", $result);
Note: See TracChangeset
for help on using the changeset viewer.