Location: PHPKode > scripts > WH Board > wh_board/category.php
<?php require('style/layout/header.php'); ?>

    <div class="content_left"><?php $crumb = mysql_query("SELECT cat_id, cat_name FROM categories WHERE cat_id = " . mysql_real_escape_string(intval($_GET['id']))); ?>
        <ul id="breadcrumbs">
        <li><a href="index.php"><?php echo $lang['main_page']; ?></a></li>
        <li><a href="category.php?id=<?php echo intval($_GET['id']); ?>" class="actual"><?php while($info = mysql_fetch_assoc($crumb)) { echo htmlentities($info['cat_name'], ENT_QUOTES); } ?></a></li>
        </ul>
    </div>
    <div class="content_right"><form method="post" id="search" action="search.php?search">
        <input type="text" name="search" placeholder="<?php echo $lang['enter_search_term']; ?>..." class="searchfield">
        <input type="hidden" name="submit" value="<?php echo $lang['search']; ?>" alt="<?php echo $lang['search']; ?>">
        </form>
    </div>

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

    <div id="headline">&nbsp;</div>

    <?php

		if((isset($_GET['id'])) && (is_numeric($_GET['id']))) {

		$id = mysql_real_escape_string($_GET['id']);
		$id = intval($_GET['id']);

			}else{

			echo '<p>' . $lang['invalid_id'] . '!</p>';
			exit();
			}

		$sql = "SELECT
					cat_id,
					cat_name,
					cat_description
				FROM
					categories
				WHERE
					cat_id = " . $id;

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

		if(!$result) {

		echo '<p class="false">' . $lang['no_categories'] . '</p>' . mysql_error();

			}else{

			if(intval(mysql_num_rows($result)) == 0) {

			echo '<p class="false">' . $lang['no_categories'] . '</p>';

		}else{

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

            echo '<div class="left">&nbsp;</div>
            <div class="right"><a href="create.php?id=' . (int)$row['cat_id'] . '" class="quickbutton">' . $lang['create_new_topic'] . '</a></div>
            <div class="cleaning"></div>';
    		}

        $count = mysql_query("SELECT topic_cat FROM topics WHERE topic_cat = '" . $id . "'");
		include('framework/navi_extended.php');

		$query = "SELECT	
					  topic_id,
					  topic_subject,
					  topic_date,
					  topic_cat,
					  topic_views
				  FROM
					  topics
				  WHERE
					  topic_cat = '" . $id . "'
				  ORDER BY
					  topic_id DESC
				  LIMIT
					  $start,$entries";

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

		if(!$result) {

		echo '<p class="false">' . $lang['no_topics_in_cat'] . '</p>' . mysql_error();

			}else{

			if(intval(mysql_num_rows($result)) == 0) {

			echo '<p class="false">' . $lang['no_topics_in_cat'] . '</p>';

		}else{

		echo '<table width="100%" class="tables">
        <tr>
        <td align="left"><span class="dark">' . $lang['topic'] . '</span></td>
        <td align="left"><span class="dark">' . $lang['date'] . ' | Views</span></td>
        <td align="center"><span class="dark">' . $lang['posts'] . '</span></td>
        </tr>';

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

            echo '<tr>';
            if(strtotime($row['topic_date']) >= time()-7200) {
            echo '<td width="62%"><img src="style/images/notification/topic_new.png" hspace="5" alt="Neues Thema"> <a href="topic.php?id=' . (int)$row['topic_id'] . '" class="topic_cat">' . htmlentities($row['topic_subject'], ENT_QUOTES) . '</a><br></td>';

                }else{

                echo '<td width="62%"><img src="style/images/notification/topic.png" hspace="5" alt="Thema"> <a href="topic.php?id=' . (int)$row['topic_id'] . '" class="topic_cat">' . htmlentities($row['topic_subject'], ENT_QUOTES) . '</a></td>';
                }

            echo '<td width="30%"><img src="style/images/notification/clock.png" hspace="5" alt="Datum">';

            echo date('d.m.Y', strtotime($row['topic_date']));

            echo '&nbsp;&nbsp;&nbsp;<img src="style/images/notification/views.png" alt="Views">&nbsp;&nbsp;<span class="text_tags">' . (int)$row['topic_views'] . '</span></td>
            <td width="8%" align="center">';

            $count_posts = mysql_query("SELECT post_id FROM posts WHERE post_topic = " . (int)$row['topic_id'] . "");
            $result_posts = intval(mysql_num_rows($count_posts));

            echo '<div class="bubble"><span class="bubpoint"></span><span class="bubcon">' . $result_posts . '</span></div></td></tr>';
            }

            echo '</table>';

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

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

		}}}}

	?>

<?php require('style/layout/footer.php'); ?>
Return current item: WH Board