(Release) Sledmores ASE News Comment Editor.

Kristopher

Photographer
Dec 25, 2010
802
66
Sledmores housekeeping editor.
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:


The housekeeping if you don't have:


Credits:
Sledmore
Stoner (Me)
Kryptos
Hejula
Holmes
 

GohanSSJ

Ya.
Feb 18, 2013
281
30
Yesh!

Many thanks to you for this this is literally awesome!

I've also been using Craig's ASE And that one is pretty good as well better than the other ASE(s) around the themes so many thanks for this - Likes.
 

Kristopher

Photographer
Dec 25, 2010
802
66
After work I plan to improve the news comments and make it a final release then move to fixing tags to work including the tag suggestions and users likes. More fixes to come soon. Also planing a release on a habbo theme
 

MrGreen

Member
Oct 3, 2013
66
4
I hope you can make a fix for the multiple comments scenario or if somebody has a fix for this, it would help. Tried the code on the official thread but it just makes it so I can't comment at all.
 

Kristopher

Photographer
Dec 25, 2010
802
66
Kryptos for Rev. Sledmore for housekeeping. Holmes for helping. Hejula for the Habbo Theme. Me for the small edits.
 

Lotus

Legacy, it's all anyone leaves behind.
Jun 8, 2012
1,637
501

working on a little thing here. Staff over rank 5 have perms to remove and delete comments. Without having to access the housekeeping. Implemented Sledmores Delete as my php aint like gods.
 

LeChris

github.com/habbo-hotel
Sep 30, 2013
2,737
1,319

working on a little thing here. Staff over rank 5 have perms to remove and delete comments. Without having to access the housekeeping. Implemented Sledmores Delete as my php aint like gods.
plz dont copy my ideas

y u doing sky again wot abt cars
 

Users who are viewing this thread

Top