Fix Custom Links in the Top nav from breaking ITFlow if the database isnt updated to 1.4.6

This commit is contained in:
johnnyq 2024-10-30 19:49:39 -04:00
parent 1df98166bd
commit 910787c81c
1 changed files with 27 additions and 23 deletions

View File

@ -28,33 +28,37 @@
<!-- Right navbar links -->
<ul class="navbar-nav ml-auto">
<!--Custom Nav Link -->
<?php
$sql_custom_links = mysqli_query($mysqli, "SELECT * FROM custom_links WHERE custom_link_location = 2 AND custom_link_archived_at IS NULL
ORDER BY custom_link_order ASC, custom_link_name ASC"
);
<?php if(CURRENT_DATABASE_VERSION > '1.4.5' ) { // Check DB Version REMOVE on Decemeber 1st 2024 -Johnny ?>
while ($row = mysqli_fetch_array($sql_custom_links)) {
$custom_link_name = nullable_htmlentities($row['custom_link_name']);
$custom_link_uri = nullable_htmlentities($row['custom_link_uri']);
$custom_link_icon = nullable_htmlentities($row['custom_link_icon']);
$custom_link_new_tab = intval($row['custom_link_new_tab']);
if ($custom_link_new_tab == 1) {
$target = "target='_blank' rel='noopener noreferrer'";
} else {
$target = "";
}
<!--Custom Nav Link -->
<?php
$sql_custom_links = mysqli_query($mysqli, "SELECT * FROM custom_links WHERE custom_link_location = 2 AND custom_link_archived_at IS NULL
ORDER BY custom_link_order ASC, custom_link_name ASC"
);
?>
while ($row = mysqli_fetch_array($sql_custom_links)) {
$custom_link_name = nullable_htmlentities($row['custom_link_name']);
$custom_link_uri = nullable_htmlentities($row['custom_link_uri']);
$custom_link_icon = nullable_htmlentities($row['custom_link_icon']);
$custom_link_new_tab = intval($row['custom_link_new_tab']);
if ($custom_link_new_tab == 1) {
$target = "target='_blank' rel='noopener noreferrer'";
} else {
$target = "";
}
<li class="nav-item" title="<?php echo $custom_link_name; ?>">
<a href="<?php echo $custom_link_uri; ?>" <?php echo $target; ?> class="nav-link">
<i class="fas fa-<?php echo $custom_link_icon; ?> nav-icon"></i>
</a>
</li>
?>
<?php } ?>
<!-- End Custom Nav Links -->
<li class="nav-item" title="<?php echo $custom_link_name; ?>">
<a href="<?php echo $custom_link_uri; ?>" <?php echo $target; ?> class="nav-link">
<i class="fas fa-<?php echo $custom_link_icon; ?> nav-icon"></i>
</a>
</li>
<?php } ?>
<!-- End Custom Nav Links -->
<?php } // End DB Check ?>
<!-- New Notifications Dropdown -->
<?php