-if (defined('mxchange_installed') && (mxchange_installed))
-{
- if (!empty($_GET['code']))
- {
- // Generate image
- GENERATE_IMAGE(bigintval($_GET['code']));
- }
-}
- else
-{
- // You have to configure first!
- LOAD_URL("install.php");
+// Load header
+loadIncludeOnce('inc/header.php');
+
+// Code set?
+if (isGetRequestElementSet('code')) {
+ // Generate image
+ generateImageOrCode(bigintval(getRequestElement('code')));
+} elseif (isGetRequestElementSet('img')) {
+ // 'img' set so create the IFN (Include-FileName)
+ $inc = sprintf('inc/img/img_%s.php', getRequestElement('img'));
+
+ // Include is readable?
+ if (isIncludeReadable($inc)) {
+ // Include it
+ loadInclude($inc);
+ } // END - if