* * Source Code: https://github.com/cornernote/minetest-gamewiki * License: GPLv3 */ require('globals.php'); ?> View Item :: <?php echo $GLOBALS['name']; ?>
query('SELECT id, mod, type, name, description, data FROM "item" WHERE name = "' . $name . '"'); $row = $q->fetchArray(); $data = json_decode($row['data']); ?>

options->inventory_image) ? is_array($data->options->inventory_image) ? $data->options->inventory_image : array($data->options->inventory_image) : array(), isset($data->options->tiles) ? (array)$data->options->tiles : array(), isset($data->options->tile_images) ? (array)$data->options->tile_images : array() ); if (!empty($images)) { echo '

Images

'; echo gamewiki::images($images, array('fullsize' => true, 'class' => 'image')); } // created by crafts $output = false; ob_start(); echo '

Created By Crafts

'; $q = $db->query('SELECT id, mod, type, output, quantity, data FROM "craft" WHERE output = "' . $name . '"'); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; while ($row_c = $q->fetchArray()) { $data = json_decode($row_c['data']); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; $output = true; } echo '
ModTypeRecipe 
' . $row_c['mod'] . '' . $row_c['type'] . '' . (isset($data->options->recipe) ? gamewiki::craft_recipe($data->options->recipe, $row_c['type'], true) : $row_c['type']) . 'view craft
'; $contents = ob_get_clean(); if ($output) echo $contents; // used for crafts $output = false; ob_start(); echo '

Used For Crafts

'; $q = $db->query('SELECT id, mod, type, output, quantity, data FROM "craft_to_itemname" LEFT JOIN "craft" ON "craft"."id"="craft_to_itemname"."craft_id" WHERE name = "' . $name . '" ORDER BY output'); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; while ($row_c = $q->fetchArray()) { $data = json_decode($row_c['data']); echo ''; echo ''; echo ''; echo ''; if ($row_c['type'] == 'fuel') { echo ''; } else { echo ''; } echo ''; echo ''; $output = true; } echo '
ModTypeRecipeOutput 
' . $row_c['mod'] . '' . $row_c['type'] . '' . (isset($data->options->recipe) ? gamewiki::craft_recipe($data->options->recipe, $row_c['type'], true) : $row_c['type']) . '' . gamewiki::item('default:furnace_active', null, true) . '' . ($row_c['output'] ? gamewiki::item($row_c['output'], $row_c['quantity'], true) : 'no output') . 'view craft
'; $contents = ob_get_clean(); if ($output) echo $contents; // used by abms $rows = array(); $q = $db->query('SELECT id FROM "abm_to_itemname" LEFT JOIN "abm" ON "abm"."id"="abm_to_itemname"."abm_id" WHERE name = "' . $name . '"'); while ($row_a = $q->fetchArray()) { $rows[] = 'view abm'; } if ($rows) { echo '

Used By ABMs

'; echo implode(' ', $rows); } // used by aliases $output = false; ob_start(); echo '

Used By Aliases

'; $q = $db->query('SELECT id, name, mod FROM "alias" WHERE itemname = "' . $name . '"'); echo ''; echo ''; echo ''; echo ''; echo ''; while ($row_a = $q->fetchArray()) { $output = true; echo ''; echo ''; echo ''; echo ''; } echo '
ModAlias
' . $row_a['mod'] . '' . $row_a['name'] . '
'; $contents = ob_get_clean(); if ($output) echo $contents; // other data echo '

Data

'; echo '

mod:' . $row['mod'] . '

'; print '
';
    print_r($data);
    print '
'; ?>