insert_id; //echo "

Added $thisName as $thisID.

"; // now register the attributes // we have url, headline, source, and author, all optional. so we check if it exists, and if it does, then write it as an artifact content $thisTarget_content = $thisTarget . "_content"; $thisTarget_attribute = $thisTarget . "_attribute"; // $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); if ($thisID != null) { $insert = mysqli_query($mysqli," INSERT INTO $thisTarget_attribute VALUES ( $thisID, '$appID', '$thisStatus', 'Creator email', '', '', '$thisCreateAuthor', null, null, null, now(), '$thisCreateAuthor', now(), '$thisCreateAuthor' ) "); if (isset($_FILES['nodeAsset'])) { //echo "mithFILES!"; $filename = basename($_FILES['nodeAsset']['name']); $filename = str_replace(' ', '_', $filename); $cleanFilename = str_replace(' ', '', $filename); $filenameExtension = pathinfo($cleanFilename, PATHINFO_EXTENSION); $newFilename = "1958-". $thisID . "." . $filenameExtension; $nodeAsset = $newFilename; $uploaddir = 'assets/'; $uploadfile = $uploaddir . $newFilename; // if the filetype is HEIC, try converting to JPG VIA THIS information https://itnext.io/tackling-iphone-or-ipad-images-support-in-browser-8e3e64e9aaa1 if (move_uploaded_file($_FILES['nodeAsset']['tmp_name'], $uploadfile)) { //echo "File $newFilename is valid, and was successfully uploaded.\n"; $insert = mysqli_query($mysqli," INSERT INTO $thisTarget_attribute VALUES ( $thisID, '$appID', '$thisStatus', 'WebAR asset file', null, null, '', '$newFilename', null, null, now(), '$thisCreateAuthor', now(), '$thisCreateAuthor' ) "); } else { //echo "Meh ...\n"; } } } } else { // produce an error message // produce dummy page // https://fantendo.fandom.com/wiki/Fantendo:Main_Menu?file=Nyan+cat+animated.gif // https://static.wikia.nocookie.net/fantendo/images/9/9f/Nyan_cat_animated.gif/revision/latest?cb=20121125193107&format=original $aframeAsset = ""; $aframeEntity = " "; $nodalLink = ""; } } else { // not creating, just viewing if (isset($_GET['id'])) { $thisID=$_GET['id']; $table="activity_attribute"; $type="WebAR asset file"; $detail = "value"; $nodeAsset = generateActivityDetail($thisID,$table,$type,$detail); } else { // produce dummy page // https://fantendo.fandom.com/wiki/Fantendo:Main_Menu?file=Nyan+cat+animated.gif // https://static.wikia.nocookie.net/fantendo/images/9/9f/Nyan_cat_animated.gif/revision/latest?cb=20121125193107&format=original $aframeAsset = ""; $aframeEntity = " "; $nodalLink = ""; } } // check filename extsion of nodeasset $thisFilenameExtension = pathinfo($nodeAsset, PATHINFO_EXTENSION); if ($thisFilenameExtension == "png" || $thisFilenameExtension == "PNG" || $thisFilenameExtension == "gif" || $thisFilenameExtension == "GIF" || $thisFilenameExtension == "JPG" || $thisFilenameExtension == "jpg" || $thisFilenameExtension == "JPEG" || $thisFilenameExtension == "jpeg") { $thisEntityWidth = calculateAspect($nodeAsset,"width"); $thisEntityHeight = calculateAspect($nodeAsset,"height"); $aframeAsset = ""; $aframeEntity = " "; $nodalLink = "
https://www.instantnodals.com/node.php?id=$thisID
"; //$trackThis = trackView($thisID); } elseif ($thisFilenameExtension == "glb" || $thisFilenameExtension == "GLB" || $thisFilenameExtension == "gltf" || $thisFilenameExtension == "GLTF") { $aframeAsset = ""; $aframeEntity =" "; $nodalLink = "
https://www.instantnodals.com/node.php?id=$thisID
"; //$trackThis = trackView($thisID); } elseif ($thisFilenameExtension == "stl" || $thisFilenameExtension == "STL" ) { $aframeAsset = ""; $color = generateHexColor(); $aframeEntity =" "; $nodalLink = "
https://www.instantnodals.com/node.php?id=$thisID
"; } else { if ($nodalLink == null) { $aframeAsset = ""; $aframeEntity = " "; $nodalLink = ""; } else { $aframeAsset = ""; $aframeEntity = " "; $nodalLink = ""; } } ?> #InstantNodal