0 AND img_height > 0 AND url LIKE ? ORDER BY date DESC LIMIT 1"); $query->bind_param("s", $like_expr); if (!$query->execute()) { error_log("Failed to execute query."); if (mysqli_errno($con) > 0) { error_log(mysqli_error($con)); } } $result = $query->get_result(); if (!$result) { error_log("Failed to fetch results."); if (mysqli_errno($con) > 0) { error_log(mysqli_error($con)); } } function og_tag($dom, $property, $content) { $tag = $dom->createElement("meta"); $tag->setAttribute("property", $property); $tag->setAttribute("content", $content); return $tag; } function tw_tag($dom, $name, $content) { $tag = $dom->createElement("meta"); $tag->setAttribute("name", $name); $tag->setAttribute("content", $content); return $tag; } $image = DEFAULT_IMAGE; $img_width = DEFAULT_WIDTH; $img_height = DEFAULT_HEIGHT; $img_title = DEFAULT_TITLE; if (mysqli_num_rows($result) > 0) { while ($row = mysqli_fetch_assoc($result)) { $image = "https://www.mtu.edu" . $row["image"]; $img_width = $row["img_width"]; $img_height = $row["img_height"]; $img_title = $row["img_title"]; break; } } $dom = new DOMDocument(); $dom->appendChild(og_tag($dom, "og:image", $image)); $dom->appendChild(og_tag($dom, "og:image:alt", $img_title)); $dom->appendChild(og_tag($dom, "og:image:height", $img_height)); $dom->appendChild(og_tag($dom, "og:image:width", $img_width)); $dom->appendChild(tw_tag($dom, "twitter:card", "summary_large_image")); $dom->appendChild(tw_tag($dom, "twitter:image", $image)); $dom->appendChild(tw_tag($dom, "twitter:image:alt", $img_title)); foreach ($dom->childNodes as $tag) { echo $dom->saveXML($tag); }
0) { echo ""; include($cachefile); exit; } ob_start(); if ($type == 'top') { $param = "/" . $path . "%"; $query = mysqli_prepare($con, "SELECT * FROM news_unscripted_ou WHERE url LIKE ? ORDER BY date DESC LIMIT 3"); $query->bind_param("s", $param); $query->execute(); if ($result = $query->get_result()) { $count = 1; echo '
'; //echo '

Latest Stories

'; echo '
'; while ($row = $result->fetch_assoc()) { if ($count == 1) { echo '
"; } } if ($type == 'stories') { $param = "/" . $path . "%"; $query = mysqli_prepare($con, "SELECT * FROM news_unscripted_ou WHERE url LIKE ? ORDER BY date DESC LIMIT 3"); $query->bind_param("s", $param); $query->execute(); if ($result = $query->get_result()) { $count = 1; echo '
'; //echo '

Latest Stories

'; echo '
'; while ($row = $result->fetch_assoc()) { if ($count == 1) { echo '
"; } } if ($type == 'bottom') { $param = "/" . $path . "%"; $query = mysqli_prepare($con, "SELECT * FROM news_unscripted_ou WHERE url LIKE ? ORDER BY date DESC LIMIT 3, ?"); $query->bind_param("si", $param, $limit); $query->execute(); if ($result = $query->get_result()) { echo '
'; //echo "

".$htitle."

"; echo '
    '; $count = 1; while ($row = $result->fetch_assoc()) { array_push($usedstories, $row['id']); $id = $row['id']; $image = $row['image']; $image_desc = trim($row['img_title']); $title = $row['title']; $link = $row['url']; $date = strtotime($row['date']); $body = $row['body']; $category = $row['category']; if (stripos($category, "interdisciplinary") !== false) { $has_interdisc = " » Interdisciplinary"; } else { $has_interdisc = ''; } if (stripos($body, "ytimg.com") || $row['video_url'] != '') { $has_video = ''; } else { $has_video = false; } ?>
  • <?php echo $image_desc; ?>
    Michigan Technological University Logo

  • "; //echo ''; echo "
"; } ?> 5) { $fp = fopen($cachefile, 'w'); fwrite($fp, ob_get_contents()); fclose($fp); } // finally send browser output ob_end_flush(); //print_r($usedstories); ?> 0) { echo ""; include($cachefile); exit; } ob_start(); if ($type == 'top') { $param = "/" . $path . "%"; $query = mysqli_prepare($con, "SELECT * FROM news_unscripted_ou WHERE url LIKE ? ORDER BY date DESC LIMIT 3"); $query->bind_param("s", $param); $query->execute(); if ($result = $query->get_result()) { $count = 1; echo '
'; //echo '

Latest Stories

'; echo '
'; while ($row = $result->fetch_assoc()) { if ($count == 1) { echo '
"; } } if ($type == 'stories') { $param = "/" . $path . "%"; $query = mysqli_prepare($con, "SELECT * FROM news_unscripted_ou WHERE url LIKE ? ORDER BY date DESC LIMIT 3"); $query->bind_param("s", $param); $query->execute(); if ($result = $query->get_result()) { $count = 1; echo '
'; //echo '

Latest Stories

'; echo '
'; while ($row = $result->fetch_assoc()) { if ($count == 1) { echo '
"; } } if ($type == 'bottom') { $param = "/" . $path . "%"; $query = mysqli_prepare($con, "SELECT * FROM news_unscripted_ou WHERE url LIKE ? ORDER BY date DESC LIMIT 3, ?"); $query->bind_param("si", $param, $limit); $query->execute(); if ($result = $query->get_result()) { echo '
'; //echo "

".$htitle."

"; echo '
    '; $count = 1; while ($row = $result->fetch_assoc()) { array_push($usedstories, $row['id']); $id = $row['id']; $image = $row['image']; $image_desc = trim($row['img_title']); $title = $row['title']; $link = $row['url']; $date = strtotime($row['date']); $body = $row['body']; $category = $row['category']; if (stripos($category, "interdisciplinary") !== false) { $has_interdisc = " » Interdisciplinary"; } else { $has_interdisc = ''; } if (stripos($body, "ytimg.com") || $row['video_url'] != '') { $has_video = ''; } else { $has_video = false; } ?>
  • <?php echo $image_desc; ?>
    Michigan Technological University Logo

  • "; //echo ''; echo "
"; } ?> 5) { $fp = fopen($cachefile, 'w'); fwrite($fp, ob_get_contents()); fclose($fp); } // finally send browser output ob_end_flush(); //print_r($usedstories); ?> bind_param("s", $param); $query->execute(); if ($result = $query->get_result()) { $mag = Array(); $row = mysqli_fetch_assoc($result); } else { error_log(mysqli_error($con)); die("There was an error retrieving the requested content. Please try again in a few minutes or contact webmaster@mtu.edu if you continue to see this message."); } ?> = '2023/01/01' OR path LIKE ?) ) ORDER BY pub_date DESC LIMIT ?"); $query->bind_param("ssi", $param, $param, $limit); $query->execute(); }else{ $query = mysqli_prepare($con, "SELECT * FROM mag_listing_ou WHERE SUBSTRING(path, 20, 300) LIKE ? AND PATH NOT LIKE '%/issue-template%' AND PATH NOT LIKE '%/ou-%' ORDER BY pub_date DESC LIMIT ?"); $query->bind_param("si", $param, $limit); $query->execute(); } if ($result = $query->get_result()) { $issues = array(); while ($row = mysqli_fetch_assoc($result)) { $issues[] = $row; } usort($issues, 'date_compare'); $path = $issues[0]['path']; } ?>
"> " . htmlspecialchars($title) . ""; } ?>
      " . $value['homepage_text'] . ""; $link_id = strtolower(str_replace(" ", "-", $value['title'])); ?>
    • <?php echo $value['title']; ?> Cover Image

    Past Issues

    Past Issues