1,2c1 < < $localsug='HTTP://localhost:8888/'; 15,39d14 < $localsug='HTTP://localhost:8888/'; < < if (PHP_OS == 'WINNT' || PHP_OS == 'WIN32' || PHP_OS == 'Windows') { < $homename='USERPROFILE'; < $localsug='HTTP://localhost/'; < $openverb='start'; < $openext='.bat'; < $tellprefix=''; < } else { < $homename='HOME'; < $openverb='open'; < $openext='.scpt'; < $tellprefix="tell application \"Terminal\"\n activate\n do script \"cd '" . getenv($homename) . DIRECTORY_SEPARATOR . 'Desktop' . "'\" in window 1\n do script \""; < } < < function wincomplexity($inurl) { < if (PHP_OS == 'WINNT' || PHP_OS == 'WIN32' || PHP_OS == 'Windows') { < $outurl=str_replace('&', '^&', $inurl); < $huhs=explode("'", $outurl); < if (sizeof($huhs) >= 3) { return ' ' . $huhs[1]; } < return explode('"', $outurl)[0]; < } < return $inurl; < } < 52c27 < if (PHP_OS == "Darwin" || PHP_OS == 'WINNT' || PHP_OS == 'WIN32' || PHP_OS == 'Windows') { --- > if (PHP_OS == "Darwin") { 54,55c29,30 < if (file_exists(getenv($homename) . DIRECTORY_SEPARATOR . 'Desktop' . DIRECTORY_SEPARATOR . 'MyAppleScript' . $ts . $openext)) { < unlink(getenv($homename) . DIRECTORY_SEPARATOR . 'Desktop' . DIRECTORY_SEPARATOR . 'MyAppleScript' . $ts . $openext); --- > if (file_exists(getenv('HOME') . '/Desktop/MyAppleScript' . $ts . '.scpt')) { > unlink(getenv('HOME') . '/Desktop/MyAppleScript' . $ts . '.scpt'); 57,62c32,33 < file_put_contents(getenv($homename) . DIRECTORY_SEPARATOR . 'Desktop' . DIRECTORY_SEPARATOR . 'MyAppleScript' . $ts . $openext, $tellprefix . $openverb . wincomplexity(" '" . $argv[1] . "'\" in window 1\nend tell")); < if (PHP_OS == 'WINNT' || PHP_OS == 'WIN32' || PHP_OS == 'Windows') { < exec(file_get_contents(getenv($homename) . DIRECTORY_SEPARATOR . 'Desktop' . DIRECTORY_SEPARATOR . 'MyAppleScript' . $ts . $openext)); < } else { < exec("cd " . getenv($homename) . DIRECTORY_SEPARATOR . 'Desktop ; ' . $openverb . ' MyAppleScript' . $ts . $openext); < } --- > file_put_contents(getenv('HOME') . '/Desktop/MyAppleScript' . $ts . '.scpt', "tell application \"Terminal\"\n activate\n do script \"cd '" . getenv('HOME') . '/Desktop' . "'\" in window 1\n do script \"open '" . $argv[1] . "'\" in window 1\nend tell"); > exec("cd " . getenv('HOME') . '/Desktop ; open MyAppleScript' . $ts . '.scpt'); 69d39 < if (function_exists(imagecreatetruecolor)) { 75,77c45,47 < if (file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . "imagetest.jpg")) { unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "imagetest.jpg"); } < $gretv=dirname(__FILE__) . DIRECTORY_SEPARATOR . "imagetest.jpg"; < imagejpeg($im, dirname(__FILE__) . DIRECTORY_SEPARATOR . "imagetest.jpg"); --- > if (file_exists(dirname(__FILE__) . "/" . "imagetest.jpg")) { unlink(dirname(__FILE__) . "/" . "imagetest.jpg"); } > $gretv=dirname(__FILE__) . "/" . "imagetest.jpg"; > imagejpeg($im, dirname(__FILE__) . "/" . "imagetest.jpg"); 101d70 < } else { echo ""; } 105,107c74,76 < if (isset($_GET['tsplus'])) { < $tsplus=str_replace(' ','',str_replace('+','',urldecode($_GET['tsplus']))); < } --- > if (isset($_GET['tsplus'])) { > $tsplus=str_replace('+',' ',urldecode($_GET['tsplus'])); > } 109c78 < if (PHP_OS == "Darwin" || PHP_OS == 'WINNT' || PHP_OS == 'WIN32' || PHP_OS == 'Windows') { --- > if (PHP_OS == "Darwin") { 113c82 < foreach (glob(getenv($homename) . DIRECTORY_SEPARATOR . 'Desktop' . DIRECTORY_SEPARATOR . 'http*' . $openext) as $infl) { --- > foreach (glob(getenv('HOME') . '/Desktop/http*.scpt') as $infl) { 115,119c84 < if (PHP_OS == 'WINNT' || PHP_OS == 'WIN32' || PHP_OS == 'Windows') { < $moreopens.=' ' . file_get_contents($infl) . '; '; < } else { < $moreopens.=' ' . $openverb . ' ' . basename($infl) . '; '; < } --- > $moreopens.=' open ' . basename($infl) . '; '; 122,130c87,91 < } < if (!file_exists(getenv($homename) . DIRECTORY_SEPARATOR . 'Desktop' . DIRECTORY_SEPARATOR . $tsplus . $openext)) { < file_put_contents(getenv($homename) . DIRECTORY_SEPARATOR . 'Desktop' . DIRECTORY_SEPARATOR . $tsplus . $openext, $tellprefix . $openverb . wincomplexity(" '" . str_replace('+','%20',$_GET['url']) . "'\" in window 1\nend tell")); < } < if (PHP_OS == 'WINNT' || PHP_OS == 'WIN32' || PHP_OS == 'Windows') { < passthru(file_get_contents(getenv($homename) . DIRECTORY_SEPARATOR . 'Desktop' . DIRECTORY_SEPARATOR . $tsplus . $openext)); < } else { < passthru('cd ' . getenv($homename) . DIRECTORY_SEPARATOR . 'Desktop ; ' . $moreopens . ' ' . $openverb . ' ' . $tsplus . $openext); < } --- > } > if (!file_exists(getenv('HOME') . '/Desktop/' . $tsplus . '.scpt')) { > file_put_contents(getenv('HOME') . '/Desktop/' . $tsplus . '.scpt', "tell application \"Terminal\"\n activate\n do script \"cd '" . getenv('HOME') . '/Desktop' . "'\" in window 1\n do script \"open '" . str_replace('+','%20',$_GET['url']) . "'\" in window 1\nend tell"); > } > passthru("cd " . getenv('HOME') . '/Desktop ; ' . $moreopens . ' open ' . $tsplus . '.scpt'); 134c95 < foreach (glob(getenv($homename) . DIRECTORY_SEPARATOR . 'Desktop' . DIRECTORY_SEPARATOR . 'http*' . $openext) as $infl) { --- > foreach (glob(getenv('HOME') . '/Desktop/http*.scpt') as $infl) { 136,140c97 < if (PHP_OS == 'WINNT' || PHP_OS == 'WIN32' || PHP_OS == 'Windows') { < $moreopens.=' ' . file_get_contents($infl) . '; '; < } else { < $moreopens.=' ' . $openverb . ' ' . basename($infl) . '; '; < } --- > $moreopens.=' open ' . basename($infl) . '; '; 142a100,102 > } > if (file_exists(getenv('HOME') . '/Desktop/' . $tsplus . '.scpt')) { > unlink(getenv('HOME') . '/Desktop/' . $tsplus . '.scpt'); 144,147c104,105 < if (file_exists(getenv($homename) . DIRECTORY_SEPARATOR . 'Desktop' . DIRECTORY_SEPARATOR . $tsplus . $openext)) { < unlink(getenv($homename) . DIRECTORY_SEPARATOR . 'Desktop' . DIRECTORY_SEPARATOR . $tsplus . $openext); < } < file_put_contents(getenv($homename) . DIRECTORY_SEPARATOR . 'Desktop' . DIRECTORY_SEPARATOR . $tsplus . $openext, $tellprefix . $openverb . wincomplexity(" '" . str_replace('+','%20',$_GET['url']) . "'\" in window 1\nend tell")); --- > file_put_contents(getenv('HOME') . '/Desktop/' . $tsplus . '.scpt', "tell application \"Terminal\"\n activate\n do script \"cd '" . getenv('HOME') . '/Desktop' . "'\" in window 1\n do script \"open '" . str_replace('+','%20',$_GET['url']) . "'\" in window 1\nend tell"); > //exec('open \"' . getenv('HOME') . '/Desktop/' . $tsplus . '.scpt\"'); 149,153c107 < if (PHP_OS == 'WINNT' || PHP_OS == 'WIN32' || PHP_OS == 'Windows') { < passthru(file_get_contents(getenv($homename) . DIRECTORY_SEPARATOR . 'Desktop' . DIRECTORY_SEPARATOR . $tsplus . $openext)); < } else { < passthru('cd ' . getenv($homename) . DIRECTORY_SEPARATOR . 'Desktop ; ' . $moreopens . ' ' . $openverb . ' ' . $tsplus . $openext); < } --- > passthru("cd " . getenv('HOME') . '/Desktop ; ' . $moreopens . ' open ' . $tsplus . '.scpt'); 157,159c111,113 < if (isset($_GET['localsug'])) { < if (trim($_GET['localsug']) != '') { < $localsug=str_replace('+',' ',urldecode($_GET['localsug'])); --- > if (isset($_GET['localsug'])) { > if (trim($_GET['localsug']) != '') { > $localsug=str_replace('+',' ',urldecode($_GET['localsug'])); 162c116 < } --- > } 165c119 < } --- > } 168c122 < } --- > } 174,175c128 < ?> < --- > ?> \ No newline at end of file