///////////////////////// // // COMMENCE INVOCATION // ombhurbhuvahswahatatsaviturvarenyambhargodevasyadhihimahidhiyoyonahpratchodayat ///////////////////////// // // CONNECT TO UNITY // old require_once ('../mysql_connect_wigglefish.php'); require_once ('../meta/mysql/mysqli_connect_wigglefish.php'); ///////////////////////// // // REGISTER SESSION session_name ('karmabomb.com'); session_start(); ///////////////////////// // // DECLARE GLOBAL VALUES define("WEBSITE_ID", "101"); define("WEBSITE_URL", "https://www.karmabomb.com"); define("WEBSITE_NAME", "karmabomb.com"); define("THIS_PAGE", "index.php"); define("WEBSITE_PATH", "karmabomb.com"); ///////////////////////// // // REGISTER FUNCTION CLASSES // old include "../unity.wigglefish.com/meta/unity2012/_master_class_loader.php"; include "../meta/unityarchives/unity.wigglefish.com/meta/unity2012t/_master_class_loader.php"; function trackPair($this_content) { $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); // $this_date = now(); // get the ip address $thisIP = $_SERVER['REMOTE_ADDR']; $this_website_id = 101; $this_target = "activity"; $this_status = 1; $this_user = 0; // save a record $do = add_primary_record($this_target,null,$this_website_id,$this_status,"Activity","Diptych",$this_user,$this_date); $query = "select id from activity order by id DESC"; // this gets the last record theoretically this will work for now but it's not best practice. $this_record = mysqli_query($mysqli,$query); if ($getID = mysqli_fetch_assoc($this_record)) { $lastID = $getID['id']; $this_id = $lastID; } //echo $this_id; // save the $result as content // next, create the secondary targets $this_target_content = "activity_content"; $this_target_attribute = "activity_attribute"; if ($this_content != null) { $this_content_type = "Result Content"; $this_content_name = ""; // there is non because we have user input $this_content_description = ""; // there is non because we have user input $this_content_content = "$this_content"; $this_content_value = ""; // there is none because we have user input $this_relate_key = ""; // there is none because we have user input $this_relate_value = ""; // there is none because we have user input add_secondary_record($this_target_content,$this_id,$this_website_id,$this_status,$this_content_type,$this_content_name,$this_content_description,$this_content_content,$this_content_value,$this_relate_key,$this_relate_value,$this_user,$this_date); } //echo $thisIP; if ($thisIP != null) { $this_content_type = "User Information"; $this_content_name = "IP Address"; // there is non because we have user input $this_content_description = ""; // there is non because we have user input $this_content_content = "$thisIP"; $this_content_value = ""; // there is none because we have user input $this_relate_key = ""; // there is none because we have user input $this_relate_value = ""; // there is none because we have user input add_secondary_record($this_target_attribute,$this_id,$this_website_id,$this_status,$this_content_type,$this_content_name,$this_content_description,$this_content_content,$this_content_value,$this_relate_key,$this_relate_value,$this_user,$this_date); } } ///////////////////////// // // RENDER HTML if ($_GET['view']=="post") { $html_content_body = "
"; } else { // get two random $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $this_website_id = WEBSITE_ID; $query = " SELECT mc.id,mc.value FROM media_content mc WHERE mc.website_id = $this_website_id AND mc.type = 'File' AND (mc.value LIKE '%.JPG' or mc.value LIKE '%.PNG') ORDER BY rand() LIMIT 2 "; $rows=mysqli_query($mysqli,$query); $result=mysqli_num_rows($rows); if ($result) { $results = ""; // record results // as an activity // trim the last comma $imagePair=rtrim($imagePair,", "); $record = trackPair($imagePair); $html_content_body = "