// Change URLs calling for prestashop.com
This commit is contained in:
@@ -437,13 +437,13 @@ class AdminHomeControllerCore extends AdminController
|
||||
|
||||
|
||||
if (@fsockopen('www.prestashop.com', 80, $errno, $errst, AdminHomeController::TIPS_TIMEOUT))
|
||||
$result['discover_prestashop'] .= '<iframe frameborder="no" style="margin: 0px; padding: 0px; width: 315px; height: 290px;" src="'.$protocol.'://www.prestashop.com/rss/news2.php?v='._PS_VERSION_.'&lang='.$isoUser.'"></iframe>';
|
||||
$result['discover_prestashop'] .= '<iframe frameborder="no" style="margin: 0px; padding: 0px; width: 315px; height: 290px;" src="'.$protocol.'://api.prestashop.com/rss/news2.php?v='._PS_VERSION_.'&lang='.$isoUser.'"></iframe>';
|
||||
else
|
||||
$result['discover_prestashop'] .= '';
|
||||
|
||||
// SHOW PAYPAL TIPS
|
||||
$content = '';
|
||||
$content = @file_get_contents($protocol.'://www.prestashop.com/partner/paypal/paypal-tips.php?protocol='.$protocol.'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)Context::getContext()->language->id, false, $stream_context);
|
||||
$content = @file_get_contents($protocol.'://api.prestashop.com/partner/paypal/paypal-tips.php?protocol='.$protocol.'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)Context::getContext()->language->id, false, $stream_context);
|
||||
$content = explode('|', $content);
|
||||
if ($content[0] == 'OK' && Validate::isCleanHtml($content[1]))
|
||||
$result['discover_prestashop'] .= $content[1];
|
||||
@@ -468,7 +468,7 @@ class AdminHomeControllerCore extends AdminController
|
||||
public function getBlockPartners()
|
||||
{
|
||||
$stream_context = @stream_context_create(array('http' => array('method'=> 'GET', 'timeout' => AdminHomeController::TIPS_TIMEOUT)));
|
||||
$content = @file_get_contents($protocol.'://www.prestashop.com/partner/preactivation/preactivation-block.php?version=1.0&shop='.urlencode(Configuration::get('PS_SHOP_NAME')).'&protocol='.$protocol.'&url='.urlencode($_SERVER['HTTP_HOST']).'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)Context::getContext()->language->id.'&email='.urlencode(Configuration::get('PS_SHOP_EMAIL')).'&date_creation='._PS_CREATION_DATE_.'&v='._PS_VERSION_.'&security='.md5(Configuration::get('PS_SHOP_EMAIL')._COOKIE_IV_), false, $stream_context);
|
||||
$content = @file_get_contents($protocol.'://api.prestashop.com/partner/preactivation/preactivation-block.php?version=1.0&shop='.urlencode(Configuration::get('PS_SHOP_NAME')).'&protocol='.$protocol.'&url='.urlencode($_SERVER['HTTP_HOST']).'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)Context::getContext()->language->id.'&email='.urlencode(Configuration::get('PS_SHOP_EMAIL')).'&date_creation='._PS_CREATION_DATE_.'&v='._PS_VERSION_.'&security='.md5(Configuration::get('PS_SHOP_EMAIL')._COOKIE_IV_), false, $stream_context);
|
||||
if (!$content)
|
||||
$return = ''; // NOK
|
||||
else
|
||||
@@ -504,7 +504,7 @@ class AdminHomeControllerCore extends AdminController
|
||||
$isoUser = Context::getContext()->language->iso_code;
|
||||
$isoCountry = Context::getContext()->country->iso_code;
|
||||
|
||||
$content = @file_get_contents($protocol.'://www.prestashop.com/partner/prestashop/prestashop-link.php?iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)Context::getContext()->language->id, false, $stream_context);
|
||||
$content = @file_get_contents($protocol.'://api.prestashop.com/partner/prestashop/prestashop-link.php?iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)Context::getContext()->language->id, false, $stream_context);
|
||||
if (!$content)
|
||||
return ''; // NOK
|
||||
else
|
||||
|
||||
@@ -99,7 +99,7 @@ class AdminLocalizationControllerCore extends AdminController
|
||||
{
|
||||
if (Tools::isSubmit('submitLocalizationPack'))
|
||||
{
|
||||
if (!$pack = @Tools::file_get_contents('http://www.prestashop.com/download/localization/'.Tools::getValue('iso_localization_pack').'.xml') &&
|
||||
if (!$pack = @Tools::file_get_contents('http://api.prestashop.com/download/localization/'.Tools::getValue('iso_localization_pack').'.xml') &&
|
||||
!$pack = @Tools::file_get_contents(dirname(__FILE__).'/../../localization/'.Tools::getValue('iso_localization_pack').'.xml'))
|
||||
$this->_errors[] = Tools::displayError('Cannot load localization pack (from prestashop.com and from your local folder "localization")');
|
||||
else if (!$selection = Tools::getValue('selection'))
|
||||
@@ -128,7 +128,7 @@ class AdminLocalizationControllerCore extends AdminController
|
||||
$localizations_pack = false;
|
||||
$this->tpl_option_vars['options_content'] = $this->initOptions();
|
||||
|
||||
$xml_localization = Tools::simplexml_load_file('http://www.prestashop.com/rss/localization.xml');
|
||||
$xml_localization = Tools::simplexml_load_file('http://api.prestashop.com/rss/localization.xml');
|
||||
if (!$xml_localization)
|
||||
{
|
||||
$localization_file = dirname(__FILE__).'/../../localization/localization.xml';
|
||||
|
||||
@@ -31,7 +31,7 @@ define ('TEXTAREA_SIZED', 70);
|
||||
|
||||
class AdminTranslationsControllerCore extends AdminController
|
||||
{
|
||||
protected $link_lang_pack = 'http://www.prestashop.com/download/lang_packs/get_each_language_pack.php';
|
||||
protected $link_lang_pack = 'http://api.prestashop.com/download/lang_packs/get_each_language_pack.php';
|
||||
protected $total_expression = 0;
|
||||
protected $all_iso_lang = array();
|
||||
protected $modules_translations = array();
|
||||
@@ -312,7 +312,7 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
if (Validate::isLangIsoCode($arr_import_lang[0]))
|
||||
{
|
||||
if ($content = Tools::file_get_contents(
|
||||
'http://www.prestashop.com/download/lang_packs/gzip/'.$arr_import_lang[1].'/'.$arr_import_lang[0].'.gzip', false,
|
||||
'http://api.prestashop.com/download/lang_packs/gzip/'.$arr_import_lang[1].'/'.$arr_import_lang[0].'.gzip', false,
|
||||
@stream_context_create(array('http' => array('method' => 'GET', 'timeout' => 5)))))
|
||||
{
|
||||
$file = _PS_TRANSLATIONS_DIR_.$arr_import_lang[0].'.gzip';
|
||||
|
||||
Reference in New Issue
Block a user