PK œqhYî¶J‚ßF ßF ) nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/
Dir : /home/trave494/polo-family.com/wp-content/plugins/wooaffiliates/_utils/ |
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 IP: 209.182.202.254 |
Dir : //home/trave494/polo-family.com/wp-content/plugins/wooaffiliates/_utils/amazon.api.categs.php |
<?php if ( !defined('ABSPATH') ) { $absolute_path = __FILE__; $path_to_file = explode( 'wp-content', $absolute_path ); $path_to_wp = $path_to_file[0]; /** Set up WordPress environment */ require_once( $path_to_wp.'/wp-load.php' ); } else { die('wrong path!'); } $__allowedCountries = array('CA','CN','DE','ES','FR','IN','IT','JP','UK','US','BR','MX'); function generateAssetsFiles__( $write=true, $type='all', $country='all' ) { if ( $type == 'all' ) { assets_search_sort__( $write, 'sortvalues', $country ); assets_search_sort__( $write, 'searchindexParam', $country ); assets_browsenodes__( $write ); } else if ( in_array($type, array('sortvalues', 'searchindexParam')) ) { assets_search_sort__( $write, $type, $country ); } else if ( $type == 'browsenodes' ) { assets_browsenodes__( $write ); } } function assets_search_sort__( $write=true, $type='all', $ccountry='all' ) { global $aiowaff, $__allowedCountries; require('amazon.api.categs.lib.php'); if ( empty($assets) ) return false; $ret = array(); if ( !empty($ccountry) && $ccountry!='all' ) { $assets = array("$ccountry" => $assets["$ccountry"]); } if ( empty($assets) ) return; foreach ($assets as $country => $categs) { if ( empty($categs) ) continue 1; foreach ($categs as $title => $params) { if ( $type == 'sortvalues' ) $params = $params[2]; else if ( $type == 'searchindexParam' ) $params = $params[1]; if ( empty($params) ) continue 1; $params = implode(':', explode(',', $params)); $ret["$country"][] = implode(',', array($title, $params)); } } ksort($ret); //var_dump('<pre>', $ret, '</pre>'); if (!$write) return $ret; if ( !empty($ccountry) && $ccountry!='all' ) { $file_name = $aiowaff->cfg['paths']['plugin_dir_path'] . 'assets/amazon/' . $type . '-' . strtoupper($ccountry) . '.csv'; assets_writefile__($file_name, $ret["$ccountry"]); } else { foreach ( $__allowedCountries as $country ) { $file_name = $aiowaff->cfg['paths']['plugin_dir_path'] . 'assets/amazon/' . $type . '-' . strtoupper($country) . '.csv'; assets_writefile__($file_name, $ret["$country"]); } } return $ret; } function assets_browsenodes__( $write=true ) { global $aiowaff, $__allowedCountries; require('amazon.api.categs.lib.php'); if ( empty($assets) ) return false; $ret = array(); if ( empty($assets) ) return; foreach ($assets as $country => $categs) { if ( empty($categs) ) continue 1; foreach ($categs as $title => $params) { $params = $params[0]; if ( empty($params) ) continue 1; $ret["$title"]["$country"] = $params; } } ksort($ret); //var_dump('<pre>', $ret, '</pre>'); if ( empty($ret) ) return false; $retd = array(); $retd[] = implode(',', array('', implode(',', $__allowedCountries))); foreach ($ret as $categ => $nodeid) { foreach ($__allowedCountries as $country) { if ( !isset($ret["$categ"]["$country"]) ) $ret["$categ"]["$country"] = ''; } $tmp = array(); foreach ($__allowedCountries as $country) { $tmp[] = $ret["$categ"]["$country"]; } $retd[] = implode(',', array($categ, implode(',', $tmp))); } //var_dump('<pre>', $retd, '</pre>'); if (!$write) return $retd; $file_name = $aiowaff->cfg['paths']['plugin_dir_path'] . 'assets/amazon/browsenodes.csv'; assets_writefile__($file_name, $retd); return $retd; } function assets_writefile__($file_name, $content) { global $aiowaff; $content = implode("\r", $content); //var_dump('<pre>',$file_name, $content,'</pre>'); $has_wrote = $aiowaff->wp_filesystem->put_contents( $file_name, $content, FS_CHMOD_FILE ); $has_wrote2 = false; if( !$has_wrote ){ $has_wrote2 = file_put_contents( $file_name, $content ); } $wrote_status = $has_wrote || $has_wrote2; echo '<div style="display: block;">' . $file_name . '<span style="display: inline-block; margin-left: 20px; color: #' . ($wrote_status ? '00ff00' : 'ff0000') . '">' . ($wrote_status ? 'success' : 'error') . '</span></div>'; } generateAssetsFiles__(); die('debug...');