amazOOP amazOOP
[ class tree: amazOOP ] [ index: amazOOP ] [ all elements ]

Source for file configurator.php

Documentation is available at configurator.php

  1. <?php
  2. /**
  3. * This file is a GUI for amazOOP's configuration files.
  4. *
  5. * The first time you access the {@tutorial amazoop.configure.pkg Configurator}, you will be
  6. * asked for an administrator name and password, which will protect your settings.
  7. *
  8. * To learn more about how to set up amazOOP, read the {@tutorial amazoop.install.pkg Installation}
  9. * Tutorial}.
  10. *
  11. * The URL of the configurator would be something similar to:
  12. * http://www.yoursite.com/amazoop/config/configurator.php
  13. *
  14. * @package amazOOP
  15. * @subpackage Configuration
  16. */
  17.  
  18. /**
  19. * @ignore
  20. */
  21. define('_AMAZOOP', true);
  22. session_start();
  23.  
  24. $core_path = dirname(__FILE__) . '/';
  25.  
  26. if(!is_dir($core_path))
  27. $core_path = './';
  28. elseif($core_path && !preg_match('/\/$/', $core_path))
  29. $core_path .= '/';
  30.  
  31. define('CORE_PATH', $core_path);
  32.  
  33. /**
  34. * Password file
  35. * @access private
  36. */
  37. $passFile = CORE_PATH . ".htamazoop";
  38.  
  39. /**
  40. * General Configuration
  41. *
  42. *
  43. *
  44. */
  45. if(isset($_POST['action']) && $_POST['action'] == "save" && $_GET['modify'] == "general"){
  46. $configfile = "userdata.inc.php";
  47. @chmod ($configfile, 0766);
  48. $permission = is_writable($configfile);
  49. if (!$permission) {
  50. $error_msg = array(0, "Config file not writeable !");
  51. }
  52. else{
  53. $config = "<?php\n";
  54. $config .= "defined( '_AMAZOOP' ) or die( 'Direct Access to this location is not allowed.' );\n";
  55. $config .= "/**\n";
  56. $config .= " * This file contains all, at least in theory, of properties that can be configured\n";
  57. $config .= " * in amazOOP.\n";
  58. $config .= " *\n";
  59. $config .= " * It is divided in two parts:\n";
  60. $config .= " * - one you <i>must</i> modify to get amazOOP to work on your server, and\n";
  61. $config .= " * - one you should only touch <b>if you know</b> what you are doing!\n";
  62. $config .= " *\n";
  63. $config .= " * @author Mauricio Diaz <madd0@users.sourceforge.net>\n";
  64. $config .= " * @copyright 2004 (c) Mauricio Diaz Orlich\n";
  65. $config .= " * @license http://www.gnu.org/licenses/gpl.html GNU Public License\n";
  66. $config .= " * @version 0.3\n";
  67. $config .= " *\n";
  68. $config .= " * @package amazOOP\n";
  69. $config .= " * @subpackage Configuration\n";
  70. $config .= " */\n";
  71. $config .= "\n";
  72. $config .= "\$_AMAZOOP_CONFIG = array( 'address' => array('test' => '".$_POST['address_test']."',\n";
  73. $config .= " 'def' => '".$_POST['address_def']."'),\n";
  74. $config .= " 'path_to_script' => array('test' => '".$_POST['path_to_script_test']."',\n";
  75. $config .= " 'def' => '".$_POST['path_to_script_def']."'),\n";
  76. $config .= " 'close_tag_character' => array('test' => '".$_POST['close_tag_character_test']."',\n";
  77. $config .= " 'def' => '".$_POST['close_tag_character_def']."'),\n";
  78. $config .= " 'file_separator' => array('test' => '".$_POST['file_separator_test']."',\n";
  79. $config .= " 'def' => '".$_POST['file_separator_def']."'),\n";
  80. $config .= " 'UTF-8_encode' => array('test' => '".$_POST['UTF-8_encode_test']."',\n";
  81. $config .= " 'def' => '".$_POST['UTF-8_encode_def']."'),\n";
  82. $config .= " 'open_links_in' => array('test' => '".$_POST['open_links_in_test']."',\n";
  83. $config .= " 'def' => '".$_POST['open_links_in_def']."'),\n";
  84. $config .= " 'log_errors' => array('test' => '".$_POST['log_errors_test']."',\n";
  85. $config .= " 'def' => '".$_POST['log_errors_def']."'),\n";
  86. $config .= " 'log_requests' => array('test' => '".$_POST['log_requests_test']."',\n";
  87. $config .= " 'def' => '".$_POST['log_requests_def']."'),\n";
  88. $config .= " 'temporary_directory' => array('test' => '".$_POST['temporary_directory_test']."',\n";
  89. $config .= " 'def' => '".$_POST['temporary_directory_def']."'),\n";
  90. $config .= " 'cache_directory' => array('test' => '".$_POST['cache_directory_test']."',\n";
  91. $config .= " 'def' => '".$_POST['cache_directory_def']."'),\n";
  92. $config .= " 'max_request_log_size' => array('test' => '".$_POST['max_request_log_size_test']."',\n";
  93. $config .= " 'def' => '".$_POST['max_request_log_size_def']."'),\n";
  94. $config .= " 'max_error_log_size' => array('test' => '".$_POST['max_error_log_size_test']."',\n";
  95. $config .= " 'def' => '".$_POST['max_error_log_size_def']."'),\n";
  96. $config .= " 'request_log_file' => array('test' => '".$_POST['request_log_file_test']."',\n";
  97. $config .= " 'def' => '".$_POST['request_log_file_def']."'),\n";
  98. $config .= " 'error_log_file' => array('test' => '".$_POST['error_log_file_test']."',\n";
  99. $config .= " 'def' => '".$_POST['error_log_file_def']."'),\n";
  100. $config .= " 'timestamp_file' => array('test' => '".$_POST['timestamp_file_test']."',\n";
  101. $config .= " 'def' => '".$_POST['timestamp_file_def']."'),\n";
  102. $config .= " 'XML_template' => array('test' => '".$_POST['XML_template_test']."',\n";
  103. $config .= " 'def' => '".$_POST['XML_template_def']."'),\n";
  104. $config .= " 'check_alternative_images' => array('test' => '".$_POST['check_alternative_images_test']."',\n";
  105. $config .= " 'def' => '".$_POST['check_alternative_images_def']."'),\n";
  106. $config .= " );\n";
  107. $config .= "\n";
  108. $config .= "\$_AMAZOOP_ASSOC_IDS = array( 'us' => '".$_POST['associd_us']."',\n";
  109. $config .= " 'uk' => '".$_POST['associd_uk']."',\n";
  110. $config .= " 'fr' => '".$_POST['associd_fr']."',\n";
  111. $config .= " 'de' => '".$_POST['associd_de']."',\n";
  112. $config .= " 'jp' => '".$_POST['associd_jp']."',\n";
  113. $config .= " 'ca' => '".$_POST['associd_ca']."'\n";
  114. $config .= " );\n";
  115. $config .= "\n";
  116. $config .= "\$_AMAZOOP_DEFAULT_IMAGES = array( 'small' => array( 'url' => '".$_POST['defaultImage_small_url']."',\n";
  117. $config .= " 'width' => '".$_POST['defaultImage_small_width']."',\n";
  118. $config .= " 'height' => '".$_POST['defaultImage_small_height']."'),\n";
  119. $config .= " 'medium' => array( 'url' => '".$_POST['defaultImage_medium_url']."',\n";
  120. $config .= " 'width' => '".$_POST['defaultImage_medium_width']."',\n";
  121. $config .= " 'height' => '".$_POST['defaultImage_medium_height']."'),\n";
  122. $config .= " 'large' => array( 'url' => '".$_POST['defaultImage_large_url']."',\n";
  123. $config .= " 'width' => '".$_POST['defaultImage_large_width']."',\n";
  124. $config .= " 'height' => '".$_POST['defaultImage_large_height']."')\n";
  125. $config .= " );\n";
  126. $config .= "\n";
  127. $config .= "\$_AMAZOOP_MEDIA_IMAGES = array( 'DVD' => array( 'url' => '".$_POST['mediaImage_DVD_url']."',\n";
  128. $config .= " 'width' => '".$_POST['mediaImage_DVD_width']."',\n";
  129. $config .= " 'height' => '".$_POST['mediaImage_DVD_height']."'),\n";
  130. $config .= " 'VHS' => array( 'url' => '".$_POST['mediaImage_VHS_url']."',\n";
  131. $config .= " 'width' => '".$_POST['mediaImage_VHS_width']."',\n";
  132. $config .= " 'height' => '".$_POST['mediaImage_VHS_height']."'),\n";
  133. $config .= " 'dreamcast' => array( 'url' => '".$_POST['mediaImage_dreamcast_url']."',\n";
  134. $config .= " 'width' => '".$_POST['mediaImage_dreamcast_width']."',\n";
  135. $config .= " 'height' => '".$_POST['mediaImage_dreamcast_height']."'),\n";
  136. $config .= " 'gamecube' => array( 'url' => '".$_POST['mediaImage_gamecube_url']."',\n";
  137. $config .= " 'width' => '".$_POST['mediaImage_gamecube_width']."',\n";
  138. $config .= " 'height' => '".$_POST['mediaImage_gamecube_height']."'),\n";
  139. $config .= " 'linux' => array( 'url' => '".$_POST['mediaImage_linux_url']."',\n";
  140. $config .= " 'width' => '".$_POST['mediaImage_linux_width']."',\n";
  141. $config .= " 'height' => '".$_POST['mediaImage_linux_height']."'),\n";
  142. $config .= " 'PS2' => array( 'url' => '".$_POST['mediaImage_PS2_url']."',\n";
  143. $config .= " 'width' => '".$_POST['mediaImage_PS2_width']."',\n";
  144. $config .= " 'height' => '".$_POST['mediaImage_PS2_height']."'),\n";
  145. $config .= " 'windows' => array( 'url' => '".$_POST['mediaImage_windows_url']."',\n";
  146. $config .= " 'width' => '".$_POST['mediaImage_windows_width']."',\n";
  147. $config .= " 'height' => '".$_POST['mediaImage_windows_height']."'),\n";
  148. $config .= " 'xbox' => array( 'url' => '".$_POST['mediaImage_xbox_url']."',\n";
  149. $config .= " 'width' => '".$_POST['mediaImage_xbox_width']."',\n";
  150. $config .= " 'height' => '".$_POST['mediaImage_xbox_height']."'),\n";
  151. $config .= " 'mac_OS' => array( 'url' => '".$_POST['mediaImage_mac_OS_url']."',\n";
  152. $config .= " 'width' => '".$_POST['mediaImage_mac_OS_width']."',\n";
  153. $config .= " 'height' => '".$_POST['mediaImage_mac_OS_height']."')\n";
  154. $config .= " );\n";
  155. $config .= "\n";
  156. $config .= "\$_AMAZOOP_BUYNOW_BUTTONS = array( 'us' => array( 'url' => '".$_POST['buyNow_us_url']."',\n";
  157. $config .= " 'width' => '".$_POST['buyNow_us_width']."',\n";
  158. $config .= " 'height' => '".$_POST['buyNow_us_height']."'),\n";
  159. $config .= " 'uk' => array( 'url' => '".$_POST['buyNow_uk_url']."',\n";
  160. $config .= " 'width' => '".$_POST['buyNow_uk_width']."',\n";
  161. $config .= " 'height' => '".$_POST['buyNow_uk_height']."'),\n";
  162. $config .= " 'de' => array( 'url' => '".$_POST['buyNow_de_url']."',\n";
  163. $config .= " 'width' => '".$_POST['buyNow_de_width']."',\n";
  164. $config .= " 'height' => '".$_POST['buyNow_de_height']."'),\n";
  165. $config .= " 'jp' => array( 'url' => '".$_POST['buyNow_jp_url']."',\n";
  166. $config .= " 'width' => '".$_POST['buyNow_jp_width']."',\n";
  167. $config .= " 'height' => '".$_POST['buyNow_jp_height']."')\n";
  168. $config .= " );";
  169. $config .= "?>";
  170.  
  171. if ($fp = fopen("$configfile", "w+")) {
  172. fwrite($fp, $config, strlen($config));
  173. fclose ($fp);
  174. $error_msg = array(1, "General Settings saved!");
  175. }
  176. }
  177. }
  178.  
  179. /**
  180. * Categories
  181. *
  182. *
  183. *
  184. *
  185. */
  186. elseif(isset($_POST['action']) && $_POST['action'] == "save" && $_GET['modify'] == "categories"){
  187. $configfile = "categories.inc.php";
  188. @chmod ($configfile, 0766);
  189. $permission = is_writable($configfile);
  190. if (!$permission) {
  191. $error_msg = array(0, "Config file not writeable !");
  192. }
  193. else{
  194. $langSpace = 30;
  195. $catSpace = 44;
  196. $valSpace = 56;
  197. $categories = array();
  198.  
  199. foreach($_POST as $postVar => $postVal){
  200. $postVarArray = explode("_", $postVar);
  201. if(sizeof($postVarArray) == 3){
  202. if($postVarArray[1] == "us" || $postVarArray[1] == "uk" ||
  203. $postVarArray[1] == "de" || $postVarArray[1] == "jp"){
  204. if(!isset($_POST[$postVar."_delete"])){
  205. if($_POST[$postVar."_browsenode"] != "" || $_POST[$postVar."_mode"] == "all"){
  206. if($postVarArray[1] == "jp")
  207. $name = $_POST[$postVar."_name"];
  208. else
  209. $name = htmlentities(utf8_decode($_POST[$postVar."_name"]));
  210. $categories[$postVarArray[1]][] = array($postVal,
  211. $_POST[$postVar."_mode"],
  212. $_POST[$postVar."_browsenode"],
  213. $name);
  214. }
  215. }
  216. }
  217. }
  218. }
  219.  
  220.  
  221. $config = "<?php\n";
  222. $config .= "/**\n";
  223. $config .= " * This file contains a table with amazOOP's categories. New categories can be added, and old\n";
  224. $config .= " * categories can be edited with the {@tutorial amazoop.configure.pkg Configurator}.\n";
  225. $config .= " *\n";
  226. $config .= " * @author Mauricio Diaz <madd0@users.sourceforge.net>\n";
  227. $config .= " * @copyright 2004 (c) Mauricio Diaz Orlich\n";
  228. $config .= " * @license http://www.gnu.org/licenses/gpl.html GNU General Public License\n";
  229. $config .= " * @version 0.3RC2\n";
  230. $config .= " *\n";
  231. $config .= " * @package amazOOP\n";
  232. $config .= " * @subpackage Configuration\n";
  233. $config .= " */\n";
  234. $config .= "\n";
  235. $config .= "/**\n";
  236. $config .= " * For security, only {@link aq.php} should be included in your pages\n";
  237. $config .= " */\n";
  238. $config .= "defined( '_AMAZOOP' ) or die( 'Direct Access to this location is not allowed.' );\n";
  239. $config .= "/**\n";
  240. $config .= " * A table with amazOOP categories. It can be edited with the {@tutorial amazoop.configure.pkg Configurator}\n";
  241. $config .= " * @global array \$_AMAZOOP_CATEGORIES\n";
  242. $config .= " * @access private\n";
  243. $config .= " */\n";
  244.  
  245. /**
  246. * US
  247. */
  248. $maxSize = array_reduce($categories['us'], "maximum", 0);
  249. $j = 1;
  250. $config .= "\$_AMAZOOP_CATEGORIES = array( 'us' => array( // amazOOP categories mapped to official AWS modes\n";
  251. foreach($categories['us'] as $cat){
  252. $config .= str_repeat(" ", $catSpace) . "'".$cat[0]."'" . str_repeat(" ", $maxSize+1-strlen($cat[0])) . "=> array(";
  253. $config .= "'mode' => '".$cat[1]."',\n";
  254. $config .= str_repeat(" ", $valSpace + $maxSize) . "'browsenode' => '".$cat[2]."',\n";
  255. $config .= str_repeat(" ", $valSpace + $maxSize) . "'name' => '".$cat[3]."')";
  256. if($j != sizeof($categories['us']))
  257. $config .= ",\n";
  258. else
  259. $config .= "),\n\n";
  260. $j++;
  261. }
  262.  
  263. /**
  264. * UK
  265. */
  266. $maxSize = array_reduce($categories['uk'], "maximum", 0);
  267. $j = 1;
  268. $config .= str_repeat(" ", $langSpace) . "'uk' => array( // amazOOP categories mapped to official AWS modes\n";
  269. foreach($categories['uk'] as $cat){
  270. $config .= str_repeat(" ", $catSpace) . "'".$cat[0]."'" . str_repeat(" ", $maxSize+1-strlen($cat[0])) . "=> array(";
  271. $config .= "'mode' => '".$cat[1]."',\n";
  272. $config .= str_repeat(" ", $valSpace + $maxSize) . "'browsenode' => '".$cat[2]."',\n";
  273. $config .= str_repeat(" ", $valSpace + $maxSize) . "'name' => '".$cat[3]."')";
  274. if($j != sizeof($categories['uk']))
  275. $config .= ",\n";
  276. else
  277. $config .= "),\n\n";
  278. $j++;
  279. }
  280.  
  281. /**
  282. * DE
  283. */
  284. $maxSize = array_reduce($categories['de'], "maximum", 0);
  285. $j = 1;
  286. $config .= str_repeat(" ", $langSpace) . "'de' => array( // amazOOP categories mapped to official AWS modes\n";
  287. foreach($categories['de'] as $cat){
  288. $config .= str_repeat(" ", $catSpace) . "'".$cat[0]."'" . str_repeat(" ", $maxSize+1-strlen($cat[0])) . "=> array(";
  289. $config .= "'mode' => '".$cat[1]."',\n";
  290. $config .= str_repeat(" ", $valSpace + $maxSize) . "'browsenode' => '".$cat[2]."',\n";
  291. $config .= str_repeat(" ", $valSpace + $maxSize) . "'name' => '".$cat[3]."')";
  292. if($j != sizeof($categories['de']))
  293. $config .= ",\n";
  294. else
  295. $config .= "),\n\n";
  296. $j++;
  297. }
  298.  
  299. /**
  300. * JP
  301. */
  302. $maxSize = array_reduce($categories['jp'], "maximum", 0);
  303. $j = 1;
  304. $config .= str_repeat(" ", $langSpace) . "'jp' => array( // amazOOP categories mapped to official AWS modes\n";
  305. foreach($categories['jp'] as $cat){
  306. $config .= str_repeat(" ", $catSpace) . "'".$cat[0]."'" . str_repeat(" ", $maxSize+1-strlen($cat[0])) . "=> array(";
  307. $config .= "'mode' => '".$cat[1]."',\n";
  308. $config .= str_repeat(" ", $valSpace + $maxSize) . "'browsenode' => '".$cat[2]."',\n";
  309. $config .= str_repeat(" ", $valSpace + $maxSize) . "'name' => '".$cat[3]."')";
  310. if($j != sizeof($categories['jp']))
  311. $config .= ",\n";
  312. else
  313. $config .= "),\n\n";
  314. $j++;
  315. }
  316.  
  317. $config .= ");\n";
  318. $config .= "?>\n";
  319.  
  320. if ($fp = fopen("$configfile", "w+")) {
  321. fwrite($fp, $config, strlen($config));
  322. fclose ($fp);
  323. $error_msg = array(1, "amazOOP Categories saved!");
  324. }
  325. }
  326. }
  327.  
  328. /*****************************************************************************************
  329. *
  330. *
  331. * Create Store Codes File
  332. *
  333. *
  334. *******************************************************************************************/
  335.  
  336. elseif(isset($_POST['action']) && $_POST['action'] == "save" && $_GET['modify'] == "stores"){
  337. $configfile = "stores.inc.php";
  338. @chmod ($configfile, 0766);
  339. $permission = is_writable($configfile);
  340. if (!$permission) {
  341. $error_msg = array(0, "Config file not writeable !");
  342. }
  343. else{
  344. $storeSpace = 30;
  345. $categories = array();
  346.  
  347. foreach($_POST as $postVar => $postVal){
  348. $postVarArray = explode("_", $postVar);
  349. if(sizeof($postVarArray) == 3 && $postVarArray[2] == "name"){
  350. if(!isset($_POST["store_" . $postVarArray[1] ."_delete"]))
  351. if($postVal != "" && $_POST["store_" . $postVarArray[1] ."_code"] != "")
  352. $categories[] = array($postVal, $_POST["store_" . $postVarArray[1] . "_code"]);
  353. }
  354. }
  355.  
  356. $config = "<?php\n";
  357. $config .= "/**\n";
  358. $config .= " * This file contains an array with codes for popular third party\n";
  359. $config .= " * stores that sell products at Amazon.\n";
  360. $config .= " * These codes are used to obtain images that are incorrectly returned\n";
  361. $config .= " * by AWS.\n";
  362. $config .= " *\n";
  363. $config .= " * @see LiteDetails::getImage()\n";
  364. $config .= " *\n";
  365. $config .= " * @author Mauricio Diaz <madd0@users.sourceforge.net>\n";
  366. $config .= " * @copyright 2004 (c) Mauricio Diaz Orlich\n";
  367. $config .= " * @license http://www.gnu.org/licenses/gpl.html GNU General Public License\n";
  368. $config .= " * @version 0.3RC1\n";
  369. $config .= " *\n";
  370. $config .= " * @package amazOOP\n";
  371. $config .= " * @subpackage Configuration\n";
  372. $config .= " */\n";
  373. $config .= "\n";
  374. $config .= "/**\n";
  375. $config .= " * Store codes.\n";
  376. $config .= " * Each store has its own code.\n";
  377. $config .= " * If an image from AWS doesn't work it's probably because it's from a different store.\n";
  378. $config .= " * This array is used to try to solve that.\n";
  379. $config .= " * This is a terrible way of solving the problem (that AWS will hopefully solve soon)\n";
  380. $config .= " * In the meantime, use it like this or, to disable it, simply set Check Alternative images\n";
  381. $config .= " * to 0, 1 or 2.\n";
  382. $config .= " *\n";
  383. $config .= " * @see LiteDetails::getImage()\n";
  384. $config .= " * @global array \$_AMAZOOP_STORE_CODES\n";
  385. $config .= " */\n";
  386. $config .= "\$_AMAZOOP_STORE_CODES = array(";
  387.  
  388. $maxSize = array_reduce($categories, "maximum", 0);
  389. $first = true;
  390. foreach($categories as $category){
  391. $name = stripslashes($category[0]);
  392. $code = $category[1];
  393.  
  394. if(!$first)
  395. $config .= str_repeat(" ", $storeSpace);
  396. $config .= "\"".$name."\"" .str_repeat(" ", $maxSize - strlen($name)+1) . "=> '" . $code . "',\n";
  397. $first = false;
  398. }
  399. $config .= ");\n";
  400. $config .= "?>\n";
  401.  
  402. if ($fp = fopen("$configfile", "w+")) {
  403. fwrite($fp, $config, strlen($config));
  404. fclose ($fp);
  405. $error_msg = array(1, "Store Codes saved!");
  406. }
  407. }
  408. }
  409.  
  410. /*****************************************************************************************
  411. *
  412. *
  413. * Create RSS File
  414. *
  415. *
  416. *******************************************************************************************/
  417.  
  418. elseif(isset($_POST['action']) && $_POST['action'] == "save" && $_GET['modify'] == "rss"){
  419. $configfile = "rss.inc.php";
  420. @chmod ($configfile, 0766);
  421. $permission = is_writable($configfile);
  422. if (!$permission) {
  423. $error_msg = array(0, "Config file not writeable !");
  424. }
  425. else{
  426. $config = "<?php\n";
  427. $config .= "/**\n";
  428. $config .= " * This file contains settings for RSS feeds.\n";
  429. $config .= " *\n";
  430. $config .= " * @author Mauricio Diaz <madd0@users.sourceforge.net>\n";
  431. $config .= " * @copyright 2004 (c) Mauricio Diaz Orlich\n";
  432. $config .= " * @license http://www.gnu.org/licenses/gpl.html GNU General Public License\n";
  433. $config .= " * @version 0.3RC2\n";
  434. $config .= " *\n";
  435. $config .= " * @package amazOOP\n";
  436. $config .= " * @subpackage Configuration\n";
  437. $config .= " */\n";
  438. $config .= "\n";
  439. $config .= "/**\n";
  440. $config .= " * For security, only this file should be included in your scripts.\n";
  441. $config .= " * @access private\n";
  442. $config .= " */\n";
  443. $config .= "defined('_AMAZOOP') or die( 'Direct Access to this location is not allowed.' );\n";
  444. $config .= "\n";
  445. $config .= "/**\n";
  446. $config .= " * This array holds basic information to be used in the RSS feed generated by {@link AmazonQuery}.\n";
  447. $config .= " * More information on these values will be available soon.\n";
  448. $config .= " * @global array \$_AMAZOOP_RSS\n";
  449. $config .= " * @access private\n";
  450. $config .= " */\n";
  451. $config .= "\$_AMAZOOP_RSS = array( 'xmlSchema' => 'http://www.madd0.com/rss2m.xsd',\n";
  452. $config .= " 'generator' => 'amazOOP v0.3 (http://amazoop.sourceforge.net)',\n";
  453. $config .= " 'docs' => 'http://backend.userland.com/rss',\n";
  454.  
  455. foreach($_POST as $postVar => $postVal){
  456. $postVarArray = explode("_", $postVar);
  457. if(sizeof($postVarArray) == 2 && $postVarArray[0] == "rss")
  458. $config.= " '" . $postVarArray[1] . "'" . str_repeat(" ", 15 - strlen($postVarArray[1])) . "=> '" . $postVal . "',\n";
  459. }
  460. $config .= ");\n";
  461. $config .= "?>\n";
  462.  
  463. if ($fp = fopen("$configfile", "w+")) {
  464. fwrite($fp, $config, strlen($config));
  465. fclose ($fp);
  466. $error_msg = array(1, "RSS settings saved!");
  467. }
  468. }
  469. }
  470.  
  471. /**
  472. *{@internal *****************************************************************************
  473. *
  474. * Include Configuration files
  475. *
  476. ************************************************************************************ }}*/*/
  477.  
  478. /**#@+
  479. * @access private
  480. */
  481. require_once("userdata.inc.php");
  482. require_once("categories.inc.php");
  483. require_once("stores.inc.php");
  484. require_once("rss.inc.php");
  485. require_once("modes.inc.php");
  486. /**#@-*/ * Suffixes for different Amazon sites
  487. * @access private
  488. */
  489. $sites = array( "us" => ".com", "uk" => ".co.uk", "fr" => ".fr", "de" => ".de", "jp" => ".co.jp", "ca" => ".ca");
  490.  
  491. /**
  492. * Find the longest string in an array.
  493. *
  494. * @param integer $v initial value or largest value until now
  495. * @param array $w the array containing the strings
  496. *
  497. * @return integer the largest value
  498. *
  499. * @access private
  500. */
  501. function maximum($v, $w){
  502. return max($v, strlen($w[0]));
  503. }
  504. ?>
  505. <?php echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?".">\n"; ?>
  506. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  507.  
  508. <html xmlns="http://www.w3.org/1999/xhtml">
  509. <head>
  510. <title>amazOOP Configurator</title>
  511. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  512. <style type="text/css">
  513. <!--
  514. body{
  515. color: #000000;
  516. background-color: #ffffff;
  517. font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif;
  518. font-size: 11px;
  519. }
  520.  
  521. h1 {
  522. font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif;
  523. font-size: 18px;
  524. font-weight: bold;
  525. }
  526.  
  527. h2 {
  528. font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif;
  529. font-size: 16px;
  530. font-weight: bold;
  531. }
  532.  
  533. h3 {
  534. font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif;
  535. font-size: 14px;
  536. font-weight: bold;
  537. }
  538.  
  539. h4 {
  540. font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif;
  541. font-size: 12px;
  542. font-weight: bold;
  543. }
  544.  
  545. a {
  546. color: #000000;
  547. }
  548.  
  549. a:hover {
  550. color: #666666;
  551. }
  552.  
  553. td {
  554. font-size: 11px;
  555. }
  556.  
  557. th {
  558. font-size: 11px;
  559. font-weight: bold;
  560. text-align: center;
  561. background-color: #FF9900
  562. }
  563.  
  564. hr {
  565. height: 1px;
  566. border-style: solid;
  567. border-color: #ff9900;
  568. margin-top: 10px;
  569. margin-bottom: 10px;
  570. }
  571.  
  572. input {
  573. font-family: Verdana, Arial, Helvetica, sans-serif;
  574. font-size: 11px;
  575. color: #000000;
  576. background-color: #FFFFFF;
  577. border: 1px solid #000000;
  578. }
  579.  
  580. select {
  581. font-family: Verdana, Arial, Helvetica, sans-serif;
  582. font-size: 11px;
  583. color: #000000;
  584. background-color: #FFFFFF;
  585. border: 1px solid #000000;
  586. }
  587.  
  588. textarea {
  589. font-family: Verdana, Arial, Helvetica, sans-serif;
  590. font-size: 11px;
  591. color: #000000;
  592. background-color: #FFFFFF;
  593. border: 1px solid #000000;
  594. }
  595.  
  596. .odd {
  597. background: #FFFFBB;
  598. }
  599.  
  600. -->
  601. </style>
  602. </head>
  603. <body>
  604. <h1 align="center"><img src="amazoop_80x50.gif" width="80" height="50" alt="amazOOP" border="0" /><br />
  605. amazOOP Configurator</h1>
  606. <?php
  607. if(isset($error_msg) && is_array($error_msg)){
  608. echo "<p align=\"center\">";
  609.  
  610. switch($error_msg[0]){
  611. case 0:
  612. echo "<font color=\"red\">";
  613. break;
  614. case 1:
  615. echo "<font color=\"green\">";
  616. break;
  617. case 2:
  618. echo "<font color=\"orange\">";
  619. break;
  620. }
  621. echo "<b>$error_msg[1]</b></font></p>";
  622. }
  623.  
  624. if(!file_exists($passFile)){
  625. $showForm = true;
  626.  
  627. if(isset($_POST['newAcc'])){
  628. if(strlen($_POST['pass1']) >= 7){
  629. if($_POST['pass1'] == $_POST['pass2']){
  630. if($fp = fopen($passFile,'w+')){
  631. $salt = "";
  632. mt_srand((double)microtime()*1000000);
  633. $chars = array_merge(range('a','z'),range('A','Z'),range(0,9));
  634. for($i=0;$i<2;$i++)
  635. $salt .= $chars[mt_rand(0,count($chars)-1)];
  636. fputs($fp, $_POST['user'] . ":" . crypt($_POST['pass1'], $salt) . "\n");
  637. fclose($fp);
  638. $showForm = false;
  639. }
  640. else
  641. $erro_msg = "Password file could not be created!";
  642. }
  643. else
  644. $error_msg = "Passwords don't match!";
  645. }
  646. else
  647. $error_msg = "Password must be at least 7 characters in length!";
  648. }
  649.  
  650.  
  651. if($showForm){
  652. ?>
  653. <h2 align="center">Welcome to amazOOP</h2>
  654. <p align="center">For your security, you are now going to create an administrator account for amazOOP</p>
  655. <p align="center">Make sure you will not forget the administrator's user name or password, since they
  656. cannot be retrieved!</p>
  657. <?php
  658. if(isset($error_msg))
  659. echo "<p align=\"center\"><font color=\"red\"><b>$error_msg</b></font></p>";
  660. ?>
  661. <form name="newAccount" action="" method="POST">
  662. <table align="center" style="border: solid #000000 1px">
  663. <tr>
  664. <th colspan="2">New Account</th>
  665. </tr>
  666. <tr>
  667. <td>User:</td>
  668. <td><input type="text" name="user" size="20" /></td>
  669. </tr>
  670. <tr>
  671. <td>Password:</td>
  672. <td><input type="password" name="pass1" size="20" /></td>
  673. </tr>
  674. <tr>
  675. <td>Confirm Password:</td>
  676. <td><input type="password" name="pass2" size="20" /></td>
  677. </tr>
  678. <tr>
  679. <td colspan="2" align="center"><input type="submit" value="Create!" name="newAcc" /></th>
  680. </tr>
  681. </table>
  682. </form>
  683. <?php
  684. }
  685. }
  686. else{
  687. if(isset($_POST['login'])){
  688. $lines = file($passFile);
  689. $array = explode(':',$lines[0]);
  690. $user = $array[0];
  691. $password = chop($array[1]);
  692.  
  693. if($_POST['user'] == $user && $password == crypt($_POST['pass1'], substr($password,0,2)))
  694. $_SESSION['logged'] = true;
  695. else
  696. $error_msg = "Invalid user name or password!";
  697. }
  698.  
  699.  
  700. if(!isset($_SESSION['logged']) || !$_SESSION['logged']){
  701. if(isset($error_msg))
  702. echo "<p align=\"center\"><font color=\"red\"><b>$error_msg</b></font></p>";
  703. ?>
  704. <form name="newAccount" action="" method="POST">
  705. <table align="center" style="border: solid #000000 1px">
  706. <tr>
  707. <th colspan="2">Log in</th>
  708. </tr>
  709. <tr>
  710. <td>User:</td>
  711. <td><input type="text" name="user" size="20" /></td>
  712. </tr>
  713. <tr>
  714. <td>Password:</td>
  715. <td><input type="password" name="pass1" size="20" /></td>
  716. </tr>
  717. <tr>
  718. <td colspan="2" align="center"><input type="submit" value="Enter" name="login" /></th>
  719. </tr>
  720. </table>
  721. </form>
  722. <?php
  723. }
  724. }
  725.  
  726.  
  727. if(isset($_SESSION['logged']) && $_SESSION['logged']){
  728. ?>
  729. <p align="center"><a href="configurator.php?modify=general">General</a> |
  730. <a href="configurator.php?modify=categories">Categories</a> |
  731. <a href="configurator.php?modify=stores">Store Codes</a> |
  732. <a href="configurator.php?modify=rss">RSS Feeds</a>
  733. </p>
  734. <?php
  735. /**
  736. * General
  737. *
  738. *
  739. */
  740. if(!isset($_GET['modify']) || $_GET['modify'] == "general"){
  741. ?>
  742. <form name="configuration" action="" method="POST">
  743. <table align="center" style="border: solid #000000 1px">
  744. <tr>
  745. <th colspan="3">General Configuration</td>
  746. </tr>
  747. <tr>
  748. <td>&nbsp;</td>
  749. <th>Test Server</th>
  750. <th>Definitive Server</th>
  751. </tr>
  752.  
  753. <?php
  754. $i = 1;
  755. foreach($_AMAZOOP_CONFIG as $configEntry => $configValue){
  756. ?>
  757. <tr<?php if($i%2 == 0) echo " class=\"odd\""?>>
  758. <td valign="top"><?php echo ucwords(str_replace("_", " ", $configEntry)) ?>:</td>
  759. <?php
  760. if($configValue['test'] == "true" || $configValue['test'] == "false"){
  761. ?>
  762. <td>
  763. <input style="border:none;"<?php if($i%2 == 0) echo " class=\"odd\""?>" type="radio" name="<?php echo $configEntry ?>.test" value="true" <?php if($configValue['test'] == "true") echo "checked" ?> />Yes
  764. <input style="border:none;"<?php if($i%2 == 0) echo " class=\"odd\""?>" type="radio" name="<?php echo $configEntry ?>.test" value="false" <?php if($configValue['test'] == "false") echo "checked" ?> />No
  765. </td>
  766. <td>
  767. <input style="border:none;"<?php if($i%2 == 0) echo " class=\"odd\""?>" type="radio" name="<?php echo $configEntry ?>.def" value="true" <?php if($configValue['def'] == "true") echo "checked" ?> />Yes
  768. <input style="border:none;"<?php if($i%2 == 0) echo " class=\"odd\""?>" type="radio" name="<?php echo $configEntry ?>.def" value="false" <?php if($configValue['def'] == "false") echo "checked" ?> />No
  769. </td>
  770. <?php
  771. }
  772. elseif($configValue['test'] == "xhtml" || $configValue['test'] == "html"){
  773. ?>
  774. <td>
  775. <input style="border:none;"<?php if($i%2 == 0) echo " class=\"odd\""?>" type="radio" name="<?php echo $configEntry ?>.test" value="xhtml" <?php if($configValue['test'] == "xhtml") echo "checked" ?> />XHTML ( /&gt;)
  776. <input style="border:none;"<?php if($i%2 == 0) echo " class=\"odd\""?>" type="radio" name="<?php echo $configEntry ?>.test" value="html" <?php if($configValue['test'] == "html") echo "checked" ?> />HTML (&gt;)
  777. </td>
  778. <td>
  779. <input style="border:none;"<?php if($i%2 == 0) echo " class=\"odd\""?>" type="radio" name="<?php echo $configEntry ?>.def" value="xhtml" <?php if($configValue['def'] == "xhtml") echo "checked" ?> />XHTML ( /&gt;)
  780. <input style="border:none;"<?php if($i%2 == 0) echo " class=\"odd\""?>" type="radio" name="<?php echo $configEntry ?>.def" value="html" <?php if($configValue['def'] == "html") echo "checked" ?> />HTML (&gt;)
  781. </td>
  782. <?php
  783. }
  784. elseif($configValue['test'] == "windows" || $configValue['test'] == "unix"){
  785. ?>
  786. <td>
  787. <input style="border:none;"<?php if($i%2 == 0) echo " class=\"odd\""?>" type="radio" name="<?php echo $configEntry ?>.test" value="windows" <?php if($configValue['test'] == "windows") echo "checked" ?> />Windows (\)
  788. <input style="border:none;"<?php if($i%2 == 0) echo " class=\"odd\""?>" type="radio" name="<?php echo $configEntry ?>.test" value="unix" <?php if($configValue['test'] == "unix") echo "checked" ?> />Unix (/)
  789. </td>
  790. <td>
  791. <input style="border:none;"<?php if($i%2 == 0) echo " class=\"odd\""?>" type="radio" name="<?php echo $configEntry ?>.def" value="windows" <?php if($configValue['def'] == "windows") echo "checked" ?> />Windows (\)
  792. <input style="border:none;"<?php if($i%2 == 0) echo " class=\"odd\""?>" type="radio" name="<?php echo $configEntry ?>.def" value="unix" <?php if($configValue['def'] == "unix") echo "checked" ?> />Unix (/)
  793. </td>
  794. <?php
  795. }
  796. elseif($configValue['test'] == "new" || $configValue['test'] == "same"){
  797. ?>
  798. <td>
  799. <input style="border:none;"<?php if($i%2 == 0) echo " class=\"odd\""?>" type="radio" name="<?php echo $configEntry ?>.test" value="new" <?php if($configValue['test'] == "new") echo "checked" ?> />New Window<br />
  800. <input style="border:none;"<?php if($i%2 == 0) echo " class=\"odd\""?>" type="radio" name="<?php echo $configEntry ?>.test" value="same" <?php if($configValue['test'] == "same") echo "checked" ?> />Same Window
  801. </td>
  802. <td>
  803. <input style="border:none;"<?php if($i%2 == 0) echo " class=\"odd\""?>" type="radio" name="<?php echo $configEntry ?>.def" value="new" <?php if($configValue['def'] == "new") echo "checked" ?> />New Window<br />
  804. <input style="border:none;"<?php if($i%2 == 0) echo " class=\"odd\""?>" type="radio" name="<?php echo $configEntry ?>.def" value="same" <?php if($configValue['def'] == "same") echo "checked" ?> />Same Window
  805. </td>
  806. <?php
  807. }
  808. else{
  809. if(strlen($configValue['test']) <= 25 && strlen($configValue['def']) <= 25){
  810. ?>
  811. <td><input<?php if($i%2 == 0) echo " class=\"odd\""?> type="text" size="25" name="<?php echo $configEntry ?>.test" value="<?php echo $configValue['test'] ?>" /></td>
  812. <td><input<?php if($i%2 == 0) echo " class=\"odd\""?> type="text" size="25" name="<?php echo $configEntry ?>.def" value="<?php echo $configValue['def'] ?>" /></td>
  813. <?php
  814. }
  815. else{
  816. ?>
  817. <td><textarea<?php if($i%2 == 0) echo " class=\"odd\""?> cols="25" rows="3" name="<?php echo $configEntry ?>.test"><?php echo $configValue['test'] ?></textarea></td>
  818. <td><textarea<?php if($i%2 == 0) echo " class=\"odd\""?> cols="25" rows="3" name="<?php echo $configEntry ?>.def"><?php echo $configValue['def'] ?></textarea></td>
  819. <?php
  820. }
  821. }
  822. ?>
  823. </tr>
  824. <?php
  825. $i++;
  826. }
  827. ?>
  828. <tr>
  829. <th colspan="3">Associate IDs</th>
  830. </tr>
  831. <?php
  832. foreach($_AMAZOOP_ASSOC_IDS as $locale => $id){
  833. ?>
  834. <tr<?php if($i%2 == 0) echo " class=\"odd\""?>>
  835. <td valign="top">Amazon<?php echo $sites[$locale] ?></td>
  836. <td colspan="2"><input<?php if($i%2 == 0) echo " class=\"odd\""?> type="text" size="25" name="associd.<?php echo $locale ?>" value="<?php echo $id ?>" /></td>
  837. </tr>
  838. <?php
  839. $i++;
  840. }
  841. ?>
  842. <tr>
  843. <th colspan="3">Default Images</th>
  844. </tr>
  845. <?php
  846. foreach($_AMAZOOP_DEFAULT_IMAGES as $size => $info){
  847. ?>
  848. <tr<?php if($i%2 == 0) echo " class=\"odd\""?>>
  849. <td valign="top"><?php echo ucwords($size) ?>:</td>
  850. <td colspan="2">
  851. <table>
  852. <tr>
  853. <td>Path: <input<?php if($i%2 == 0) echo " class=\"odd\""?> type="text" size="35" name="defaultImage.<?php echo $size ?>.url" value="<?php echo $info['url'] ?>" /></td>
  854. <td align="center" rowspan="2">
  855. <?php
  856. if($info['url'] != ""){
  857. $url = "http://" . $_SERVER['SERVER_NAME'] . $info['url'];
  858. $preview = getimagesize($url);
  859. echo "<a href=\"$url\" target=\"_blank\"><img src=\"$url\" width=\"". ($preview[0]*50/$preview[1]) ."\" height=\"50\" border=\"1\" alt=\"Preview\" /></a>";
  860. }
  861. ?>
  862. </td>
  863. </tr>
  864. <tr>
  865. <td>
  866. Width: <input<?php if($i%2 == 0) echo " class=\"odd\""?> type="text" size="3" name="defaultImage.<?php echo $size ?>.width" value="<?php echo $info['width'] ?>" />
  867. Height: <input<?php if($i%2 == 0) echo " class=\"odd\""?> type="text" size="3" name="defaultImage.<?php echo $size ?>.height" value="<?php echo $info['height'] ?>" />
  868. </td>
  869. </tr>
  870. </table>
  871. </tr>
  872. <?php
  873. $i++;
  874. }
  875. ?>
  876. <tr>
  877. <th colspan="3">Media Images</th>
  878. </tr>
  879. <?php
  880. foreach($_AMAZOOP_MEDIA_IMAGES as $size => $info){
  881. ?>
  882. <tr<?php if($i%2 == 0) echo " class=\"odd\""?>>
  883. <td valign="top"><?php echo ucwords(str_replace("_", " ", $size)) ?>:</td>
  884. <td colspan="2">
  885. <table>
  886. <tr>
  887. <td>Path: <input<?php if($i%2 == 0) echo " class=\"odd\""?> type="text" size="35" name="mediaImage.<?php echo $size ?>.url" value="<?php echo $info['url'] ?>" /></td>
  888. <td align="center" rowspan="2">
  889. <?php
  890. if($info != ""){
  891. $url = "http://" . $_SERVER['SERVER_NAME'] . $info['url'];
  892. $preview = getimagesize($url);
  893. echo "<a href=\"$url\" target=\"_blank\"><img src=\"$url\" $preview[3] border=\"1\" alt=\"Preview\" /></a>";
  894. }
  895. ?>
  896. </td>
  897. </tr>
  898. <tr>
  899. <td>
  900. Width: <input<?php if($i%2 == 0) echo " class=\"odd\""?> type="text" size="3" name="mediaImage.<?php echo $size ?>.width" value="<?php echo $info['width'] ?>" />
  901. Height: <input<?php if($i%2 == 0) echo " class=\"odd\""?> type="text" size="3" name="mediaImage.<?php echo $size ?>.height" value="<?php echo $info['height'] ?>" />
  902. </td>
  903. </tr>
  904. </table>
  905. </tr>
  906. <?php
  907. $i++;
  908. }
  909. ?>
  910. <tr>
  911. <th colspan="3">Buy Now Buttons</th>
  912. </tr>
  913. <?php
  914. foreach($_AMAZOOP_BUYNOW_BUTTONS as $locale => $info){
  915. ?>
  916. <tr<?php if($i%2 == 0) echo " class=\"odd\""?>>
  917. <td valign="top"><?php echo strtoupper($locale) ?>:</td>
  918. <td colspan="2">
  919. <table>
  920. <tr>
  921. <td>Path: <input<?php if($i%2 == 0) echo " class=\"odd\""?> type="text" size="35" name="buyNow.<?php echo $locale ?>.url" value="<?php echo $info['url'] ?>" /></td>
  922. </tr>
  923. <tr>
  924. <td>
  925. Width: <input<?php if($i%2 == 0) echo " class=\"odd\""?> type="text" size="3" name="buyNow.<?php echo $locale ?>.width" value="<?php echo $info['width'] ?>" />
  926. Height: <input<?php if($i%2 == 0) echo " class=\"odd\""?> type="text" size="3" name="buyNow.<?php echo $locale ?>.height" value="<?php echo $info['height'] ?>" />
  927. </td>
  928. </tr>
  929. <tr>
  930. <td align="center"><?php
  931. if($info['url'] != ""){
  932. ?>
  933. <img src="http://<?php echo $_SERVER['SERVER_NAME'] . $info['url'] ?>"border="1" alt="Preview" />
  934. <?php
  935. }
  936. else
  937. echo "&nbsp;"
  938. ?>
  939. </td>
  940. </tr>
  941. </table>
  942. </tr>
  943. <?php
  944. $i++;
  945. }
  946. ?>
  947. </table>
  948. <center><input type="hidden" name="action" value="save" /><br />
  949. <input type="submit" name="submit" value="Save" /></center>
  950. </form>
  951. <?php
  952. }
  953.  
  954. /**
  955. * Categories
  956. *
  957. *
  958. */
  959. elseif(isset($_GET['modify']) && $_GET['modify'] == "categories"){
  960. ?>
  961. <form name="configuration" action="configurator.php?modify=categories" method="POST">
  962. <table align="center" style="border: solid #000000 1px">
  963. <tr>
  964. <th colspan="5">amazOOP Categories</td>
  965. </tr>
  966. <?php
  967. foreach($_AMAZOOP_CATEGORIES as $locale => $category){
  968. ?>
  969. <tr>
  970. <th colspan="5" style="text-align:left"><?php echo strtoupper($locale) ?></th>
  971. </tr>
  972. <tr>
  973. <td align="center">Category</td>
  974. <td align="center">Mode</td>
  975. <td align="center">Browse Node</td>
  976. <td align="center">Name</td>
  977. <td align="center">Delete</td>
  978. </tr>
  979. <?php
  980. $i = 0;
  981. foreach($category as $catName => $value){
  982. ?>
  983. <tr<?php if($i%2 == 0) echo " class=\"odd\""?>>
  984. <td><input<?php if($i%2 == 0) echo " class=\"odd\""?> type="text" size="10" name="category.<?php echo $locale ?>.<?php echo str_replace("_", "-", $catName) ?>" value="<?php echo $catName ?>" /></td>
  985. <td>
  986. <select<?php if($i%2 == 0) echo " class=\"odd\""?> name="category.<?php echo $locale ?>.<?php echo str_replace("_", "-", $catName) ?>.mode">
  987. <?php
  988. foreach($_AMAZON_MODES[$locale] as $mode){
  989. ?>
  990. <option value="<?php echo $mode ?>"<?php if($mode == $value['mode']) echo " selected" ?>><?php echo $mode ?></option>
  991. <?php
  992. }
  993. ?>
  994. </select>
  995. </td>
  996. <td><input<?php if($i%2 == 0) echo " class=\"odd\""?> type="text" size="10" name="category.<?php echo $locale ?>.<?php echo str_replace("_", "-", $catName) ?>.browsenode" value="<?php echo $value['browsenode'] ?>" /></td>
  997. <td><input<?php if($i%2 == 0) echo " class=\"odd\""?> type="text" size="25" name="category.<?php echo $locale ?>.<?php echo str_replace("_", "-", $catName) ?>.name" value="<?php echo $value['name'] ?>" /></td>
  998. <td align="center"><input<?php if($i%2 == 0) echo " class=\"odd\""?> type="checkbox" name="category.<?php echo $locale ?>.<?php echo str_replace("_", "-", $catName) ?>.delete" value="true" /></td>
  999. </tr>
  1000. <?php
  1001. $i++;
  1002. }
  1003. ?>
  1004. <tr<?php if($i%2 == 0) echo " class=\"odd\""?>>
  1005. <td><input<?php if($i%2 == 0) echo " class=\"odd\""?> type="text" size="10" name="category.<?php echo $locale ?>.new" value="" /></td>
  1006. <td>
  1007. <select<?php if($i%2 == 0) echo " class=\"odd\""?> name="category.<?php echo $locale ?>.new.mode">
  1008. <?php
  1009. foreach($_AMAZON_MODES[$locale] as $mode){
  1010. ?>
  1011. <option value="<?php echo $mode ?>"><?php echo $mode ?></option>
  1012. <?php
  1013. }
  1014. ?>
  1015. </select>
  1016. </td>
  1017. <td><input<?php if($i%2 == 0) echo " class=\"odd\""?> type="text" size="10" name="category.<?php echo $locale ?>.new.browsenode" value="" /></td>
  1018. <td><input<?php if($i%2 == 0) echo " class=\"odd\""?> type="text" size="25" name="category.<?php echo $locale ?>.new.name" value="" /></td>
  1019. <td align="center">new</td>
  1020. </tr>
  1021. <?php
  1022. }
  1023. ?>
  1024. </table>
  1025. <center><input type="hidden" name="action" value="save" /><br />
  1026. <input type="submit" name="submit" value="Save" /></center>
  1027. </form>
  1028. <?php
  1029. }
  1030.  
  1031. /**
  1032. * Stores
  1033. *
  1034. *
  1035. */
  1036. elseif(isset($_GET['modify']) && $_GET['modify'] == "stores"){
  1037. ?>
  1038. <form name="configuration" action="configurator.php?modify=stores" method="POST">
  1039. <table align="center" style="border: solid #000000 1px">
  1040. <tr>
  1041. <th colspan="5">Store Codes</td>
  1042. </tr>
  1043. <tr>
  1044. <td align="center">&nbsp;</td>
  1045. <td align="center">Name</td>
  1046. <td align="center">Code</td>
  1047. <td align="center">Delete</td>
  1048. </tr>
  1049. <?php
  1050. $i = 0;
  1051. foreach($_AMAZOOP_STORE_CODES as $store => $code){
  1052. ?>
  1053. <tr<?php if($i%2 == 0) echo " class=\"odd\""?>>
  1054. <td><?php echo $i+1 ?>.</td>
  1055. <td><input<?php if($i%2 == 0) echo " class=\"odd\""?> type="text" size="40" name="store.<?php echo $i ?>.name" value="<?php echo $store ?>" /></td>
  1056. <td><input<?php if($i%2 == 0) echo " class=\"odd\""?> type="text" size="25" name="store.<?php echo $i ?>.code" value="<?php echo $code ?>" /></td>
  1057. <td align="center"><input<?php if($i%2 == 0) echo " class=\"odd\""?> type="checkbox" name="store.<?php echo $i ?>.delete" value="true" /></td>
  1058. </tr>
  1059. <?php
  1060. $i++;
  1061. }
  1062. ?>
  1063. <tr<?php if($i%2 == 0) echo " class=\"odd\""?>>
  1064. <td><?php echo $i+1 ?>.</td>
  1065. <td><input<?php if($i%2 == 0) echo " class=\"odd\""?> type="text" size="40" name="store.new.name" value="" /></td>
  1066. <td><input<?php if($i%2 == 0) echo " class=\"odd\""?> type="text" size="25" name="store.new.code" value="" /></td>
  1067. <td align="center">new</td>
  1068. </tr>
  1069. </table>
  1070. <center><input type="hidden" name="action" value="save" /><br />
  1071. <input type="submit" name="submit" value="Save" /></center>
  1072. </form>
  1073. <?php
  1074. }
  1075.  
  1076. /**
  1077. * RSS Feeds
  1078. *
  1079. *
  1080. */
  1081. elseif(isset($_GET['modify']) && $_GET['modify'] == "rss"){
  1082. ?>
  1083. <form name="configuration" action="configurator.php?modify=rss" method="POST">
  1084. <table align="center" style="border: solid #000000 1px">
  1085. <tr>
  1086. <th colspan="5">Store Codes</td>
  1087. </tr>
  1088. <tr>
  1089. <td align="center">Variable</td>
  1090. <td align="center">Value</td>
  1091. </tr>
  1092.  
  1093. <tr class="odd">
  1094. <td>Link</td>
  1095. <td><input class="odd" type="text" size="25" name="rss.link" value="<?php echo $_AMAZOOP_RSS['link'] ?>" /></td>
  1096. </tr>
  1097.  
  1098. <tr>
  1099. <td>Copyright</td>
  1100. <td><textarea cols="25" rows="3" name="rss.copyright"><?php echo $_AMAZOOP_RSS['copyright'] ?></textarea></td>
  1101. </tr>
  1102.  
  1103. <tr class="odd">
  1104. <td>Managing Editor</td>
  1105. <td><input class="odd" type="text" size="25" name="rss.managingEditor" value="<?php echo $_AMAZOOP_RSS['managingEditor'] ?>" /></td>
  1106. </tr>
  1107.  
  1108. <tr>
  1109. <td>Web Master</td>
  1110. <td><input type="text" size="25" name="rss.webMaster" value="<?php echo $_AMAZOOP_RSS['webMaster'] ?>" /></td>
  1111. </tr>
  1112.  
  1113. <tr class="odd">
  1114. <td>Author</td>
  1115. <td><input class="odd" type="text" size="25" name="rss.author" value="<?php echo $_AMAZOOP_RSS['author'] ?>" /></td>
  1116. </tr>
  1117.  
  1118. <tr>
  1119. <td>Image URL</td>
  1120. <td><input type="text" size="60" name="rss.imageURL" value="<?php echo $_AMAZOOP_RSS['imageURL'] ?>" /></td>
  1121. </tr>
  1122.  
  1123. <tr class="odd">
  1124. <td>Image Width</td>
  1125. <td><input class="odd" type="text" size="5" name="rss.imageWidth" value="<?php echo $_AMAZOOP_RSS['imageWidth'] ?>" /></td>
  1126. </tr>
  1127.  
  1128. <tr>
  1129. <td>Image Height</td>
  1130. <td><input type="text" size="5" name="rss.imageHeight" value="<?php echo $_AMAZOOP_RSS['imageHeight'] ?>" /></td>
  1131. </tr>
  1132.  
  1133. <tr class="odd">
  1134. <td>Image Link</td>
  1135. <td><input class="odd" type="text" size="60" name="rss.imageLink" value="<?php echo $_AMAZOOP_RSS['imageLink'] ?>" /></td>
  1136. </tr>
  1137.  
  1138. <tr>
  1139. <td>Image Title</td>
  1140. <td><input type="text" size="25" name="rss.imageTitle" value="<?php echo $_AMAZOOP_RSS['imageTitle'] ?>" /></td>
  1141. </tr>
  1142.  
  1143. <tr class="odd">
  1144. <td>Feed Title</td>
  1145. <td><input class="odd" type="text" size="25" name="rss.title" value="<?php echo $_AMAZOOP_RSS['title'] ?>" /></td>
  1146. </tr>
  1147.  
  1148. <tr>
  1149. <td>Feed Description</td>
  1150. <td><textarea cols="25" rows="3" name="rss.description"><?php echo $_AMAZOOP_RSS['description'] ?></textarea></td>
  1151. </tr>
  1152.  
  1153. </table>
  1154. <center><input type="hidden" name="action" value="save" /><br />
  1155. <input type="submit" name="submit" value="Save" /></center>
  1156. </form>
  1157. <?php
  1158. }
  1159. }
  1160. ?>
  1161. </body>
  1162. </html>
 
Documentation generated on Sat, 21 Aug 2004 17:40:28 +0200 by phpDocumentor 1.3.0RC3
hosted by
SourceForge.net Logo