Kristopher
Photographer
- Dec 25, 2010
- 803
- 68
Sledmores housekeeping editor.
Changed a few querys so it works with my release:
The housekeeping if you don't have:
Credits:
Sledmore
Stoner (Me)
Kryptos
Hejula
Holmes
Code:
<?php $pagerank = 7; include "templates/header.php"; ?>
<div id="site_content">
<?php include "templates/sidebar.php"; ?>
<div id="content_container">
<div id="content">
<h1>{hotelName} Hotel ASE :: News Comments</h1><hr/>
<?php
if (isset($_GET['edit']) && $_GET['edit'] != null)
{
$two = mysql_fetch_assoc(mysql_query("SELECT * FROM cms_comments WHERE article = '" . filter($_GET['edit']) . "'"));
?>
<?php
if($_GET['delete'])
{
if(mysql_num_rows(mysql_query("SELECT * FROM cms_comments WHERE id = '".filter($_GET['delete'])."'")))
{
mysql_query("DELETE FROM cms_comments WHERE id = '".filter($_GET['delete'])."'");
echo '<div class="alert alert-success" align="center">That comment has now been deleted!</div>';
}
else
{
echo '<div class="alert alert-error" align="center">Couldn\'t find that comment, sorry!</div>';
}
}
?>
<table class="table table-striped table-bordered table-condensed">
<tr>
<td><b>User</b></td>
<td><b>Comment</b></td>
<td><b>Action</b></td>
</tr>
<?php
$getArticles = mysql_query("SELECT * FROM `cms_comments` WHERE `article` = '".filter($_GET['edit'])."'");
while(($articles = mysql_fetch_array($getArticles)))
{
$getUserInfo = mysql_query("SELECT * FROM users WHERE id = '".$articles['userid']."'");
$userInfo = mysql_fetch_array($getUserInfo);
echo "
<tr>
<td><a href='?url=player_edit&username=".$userInfo['username']."'>" . $userInfo['username'] ."</a></td>
<td>" . $articles['comment'] ."</td>
<td><a href='?url=logs_news_comments&edit=".$articles['article']."&delete=" . $articles['id'] . "'><b>Delete</b></a></td>
</tr>";
}
?>
</table>
<?php
}
else
{
?>
<table class="table table-striped table-bordered table-condensed">
<tr>
<td><b>Article</b></td>
<td><b>View Comments</b></td>
</tr>
<?php
$getArticles = mysql_query("SELECT * FROM `cms_news`");
while(($articles = mysql_fetch_array($getArticles)))
{
echo "
<tr>
<td>" . $articles['title'] ."</td>
<td><a href='?url=logs_news_comments&edit=".$articles['id']."'><b>View comments</b></a></td>
</tr>";
}
}
?>
</table>
</div>
</div>
</div>
</div>
<?php include "templates/footer.php"; ?>
Changed a few querys so it works with my release:
You must be registered for see links
The housekeeping if you don't have:
You must be registered for see links
Credits:
Sledmore
Stoner (Me)
Kryptos
Hejula
Holmes