Skip to content

Commit

Permalink
Last topic fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusTBjercke committed Oct 11, 2018
1 parent ef98997 commit eb92881
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion admin/edit_socialicons.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<div class="edit_settings">

<h1>Edit website settings</h1>
<h1>Edit social icons in the footer</h1>
<button onclick="window.location='admin.php';">Go back</button>

<ul>
Expand Down
2 changes: 1 addition & 1 deletion admin/home.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<li><a href="admin.php?page=edit_posts"><button><span class="glyphicon glyphicon-pencil"></span> Edit posts</button></a></li>
<li><a href="admin.php?page=edit_gallery"><button><span class="glyphicon glyphicon-picture"></span> Edit gallery</button></a></li>
<li><a href="admin.php?page=edit_settings"><button><span class="glyphicon glyphicon-cog"></span> Edit website settings</button></a></li>
<li><a href="admin.php?page=edit_settings"><button><i class="fa fa-facebook-square" aria-hidden="true"></i> Edit footer social icons</button></a></li>
<li><a href="admin.php?page=edit_socialicons"><button><i class="fa fa-facebook-square" aria-hidden="true"></i> Edit footer social icons</button></a></li>
<!-- <li><a href="admin.php?page=edit_theme"><button><span class="glyphicon glyphicon-eye-open"></span> Edit website theme</button></a></li>-->
</ul>
</div>
11 changes: 8 additions & 3 deletions includes/classes/forum_lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,15 @@ public function getLastTopic($viewAsLink = false) {
$query = "SELECT * FROM forum_posts ORDER BY id DESC LIMIT 1";
$result = $mysqli_cms->query($query);
$fetch = $result->fetch_assoc();
if ($viewAsLink == false) {
return $fetch['name'];
$num = $result->num_rows;
if ($num > 0) {
if ($viewAsLink == false) {
return $fetch['name'];
} else {
return '<a href="forum.php?page=topic&cat=' . $fetch['category_id'] . '&id=' . $fetch['id'] . '">' . $fetch['name'] . '</a>';
}
} else {
return '<a href="forum.php?page=topic&cat=' . $fetch['category_id'] . '&id=' . $fetch['id'] . '">' . $fetch['name'] . '</a>';
return 'No topics yet.';
}
}

Expand Down

0 comments on commit eb92881

Please sign in to comment.