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
Choose File :

Url:
Dir : //home/trave494/polo-family.com/wp-content/plugins/wooaffiliates/_utils/amzcateg-duplicate.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!');
}

		function getAmazonCategs( $req_aff_id=null )
		{
			global $adf;
			
			$ret = array(); $retd = array();
			
			// try to read the plugin_root/assets/amazon/browsenodes.csv file
			$csv_file_content = $adf->wp_filesystem->get_contents( $adf->cfg['paths']['plugin_dir_path'] . 'assets/amazon/browsenodes.csv' );
			
			if( trim($csv_file_content) != "" ){
				$rows = explode("\r", $csv_file_content);
				if( count($rows) > 0 ){
					foreach ($rows as $key => $value) {
						$csv[] = explode(",", $value);
					}
				}
			}
			//var_dump('<pre>',$csv,'</pre>');

			//default
			if( count($csv[0]) > 0 ){
				foreach ($csv[0] as $key => $value) {
					if ( empty($value) ) continue 1;
					$ret["$value"] = array();
				}
			}
			
			// go through and build
			$c = 0;
			foreach ($csv as $k => $v) {
				if ( !$c ) {
					$c++; continue 1;
				}
				
				$cc = 0;
				foreach ($v as $kk => $vv) {
					if ( $cc == 0 || empty($vv) ) {
						$cc++; continue 1;
					}

					$country = $csv[0][$kk];

					if ( isset($ret["$country"]["$vv"]) && !empty($ret["$country"]["$vv"]) ) ;
					else {
						$ret["$country"]["$vv"] = array();
					}
					array_push($ret["$country"]["$vv"], $v[0]);
					$cc++;
				}
				$c++;
			}
			//var_dump('<pre>',$ret,'</pre>');
			
			// show duplicates
			$c = 0;
			foreach ($ret as $k => $v) {
				foreach ($v as $kk => $vv) {
					if ( count($vv) > 1 ) {
						$retd["$k"]["$kk"] = $vv;
					}
				}
				$c++;
			}
			var_dump('<pre>',$retd,'</pre>'); 
			
			return $retd;
		}

$categs = $adf->amzHelper->getAmazonCategs();
var_dump('<pre>', $categs, '</pre>');
getAmazonCategs();
die('debug...');