Location: PHPKode > scripts > WH Social > wh_social/admin/discussions.php
<?php

    if(file_exists('handler/stay.php') == TRUE) {

        require('handler/stay.php');

        }else{

        echo '<p class="red_span" align="center">Error - Fehler</p>';
        exit;
        }

?>

<?php define('INCLUDE_CHECK',1); define('MYSQL_CHECK',1); ?>

<?php require('../framework/config.php'); ?>
<?php require('../framework/mysql.php'); ?>
<?php require('../framework/constants.php'); ?>
<?php require('../framework/class/cache_class.php'); no_cache(); ?>
<?php require('../framework/security.php'); ?>
<?php require('handler/language.php'); ?>

<?php require('structure/header.inc.php'); ?>

    <div class="menu">
        <div class="menu_left">
            <ul id="admin_navi">
                <li><a href="index.php"><?php echo $lang['blank_admin_area']; ?></a></li>
                <li><a href="members.php"><?php echo $lang['admin_members']; ?></a></li>
                <li class="active"><a href="discussions.php"><?php echo $lang['discussions']; ?></a></li>
                <li><a href="topics.php"><?php echo $lang['blank_topics']; ?></a></li>
                <li><a href="news.php"><?php echo $lang['news']; ?></a></li>
                <li><a href="events.php"><?php echo $lang['events']; ?></a></li>
                <li><a href="newsletter.php"><?php echo $lang['newsletter']; ?></a></li>
                <li><a href="statistic.php"><?php echo $lang['statistic']; ?></a></li>
            </ul>
        </div>
        <div class="menu_right">
            <?php

            if(isset($_SESSION['admin']) && $_SESSION['admin'] == TRUE) {

            echo '<div class="admin_settings">
            <a class="admin_account"><span>' . $lang['blank_navigation'] . '</span></a>
            <div class="admin_submenu" style="display: none;">
                <ul class="root">
                    <li><a href="' . $url . '" target="_blank">' . $lang['goto_network'] . '</a></li>
                    <li><a href="signout.php">' . $lang['signout'] . '</a></li>
                </ul>
            </div>
            </div>';
            }

            ?>
        </div>
    </div>
</div>

<div class="clear"></div>

<div id="content_wrapper">
    <div class="content">

    <?php

        echo '<h1 class="p_space">' . $lang['discussions'] . '</h1>';

        $count = mysql_query("SELECT id FROM discussions");
        include('../framework/pagination.php');

        $query = "SELECT
                      topics.id AS topID,
                      topics.subject,
                      topics.views,
                      discussions.id AS discID,
                      discussions.content,
                      discussions.topic,
                      discussions.date AS discDATE,
                      discussions.author,
                      members.id AS memID,
				      members.name
                  FROM
                      topics
                  LEFT JOIN
				      discussions
			      ON
				      discussions.topic = topics.id
			      LEFT JOIN
				      members
			      ON
				      discussions.author = members.id
                  ORDER BY
                      discDATE DESC
                  LIMIT
                      $start,$entries";

        $result = mysql_query($query) OR die(mysql_error());

        if($result) {

        echo '<table width="100%" class="tables">
        <tr>
        <td width="5%"><strong>ID</strong></td>
        <td width="30%"><strong>' . $lang['one_post'] . '</strong></td>
        <td width="15%"><strong>' . $lang['date'] . '</strong></td>
        <td width="26%"><strong>' . $lang['admin_topic_id'] . '</strong></td>
        <td width="14%"><strong>' . $lang['member_id'] . '</strong></td>
        <td width="10%" align="center"><strong>' . $lang['admin_delete'] . '</strong></td>
        </tr>';

        define('C_DELIMITER', '#wordCut#');
        include('handler/trimwords.php');

        include_once('../framework/filter.php');
        include_once('../framework/functions/badwords.php');
        include_once('handler/grafics.php');

        while($row = mysql_fetch_assoc($result)) {

            $text = mysql_filter(filter_html(badwords(smileys(stripslashes(nl2br($row['content']))))));

            echo '<tr>
            <td width="5%">' . (int)$row['discID'] . '</td>
            <td width="30%">' . wordCut($text, 350) . '...<br><br><a href="../read_discussion.php?id=' . (int)$row['topID'] . '" target="_blank">[' . $lang['read_more_text'] . ']</a></td>
            <td width="15%">' . date('d.m.Y - H:i', strtotime($row['discDATE'])) . '</td>
            <td width="26%">' . htmlentities($row['subject'], ENT_QUOTES) . '</td>
            <td width="14%">' . htmlentities($row['name'], ENT_QUOTES) . '</td>
            <td width="10%" align="center"><a href="unwrite.php?id=' . (int)$row['discID'] . '"><img src="../style/icons/delete.png" alt="' . $lang['admin_delete'] . '" title="' . $lang['admin_delete'] . '" border="0"></a></td>
            </tr>';
            }

        echo '</table>
        <div class="clear_long"></div>';

        }else{

        echo '<p class="false">Keine Beitr&auml;ge vorhanden</p>';
        }

        echo '<div id="pagi">
        <span class="pages">' . $lang['admin_page'] . ' ' . $page . ' ' . $lang['admin_by'] . ' ' . $allsites . '</span>';
        echo $link_string;
        echo '</div>';

        echo '<div class="clear"></div>';

    ?>

<?php require('structure/footer.inc.php'); ?>
Return current item: WH Social