function new_warning_post($post_or_userid, $subject, $message, $points, $KIND)
{
    global $userdata, $settings, $locale;
    if ($KIND == "Forum") {
        $new_warning_sql = dbquery("SELECT post_id, thread_id, forum_id, post_author FROM " . DB_POSTS . " WHERE post_id='" . $post_or_userid . "'");
    }
    if ($KIND == "Other" || dbrows($new_warning_sql) != 0) {
        if ($KIND == "Forum") {
            $post_warn_data = dbarray($new_warning_sql);
            $warnuser_id = $post_warn_data['post_author'];
            $post = $post_or_userid;
            $threadid = $post_warn_data['thread_id'];
            $forumid = $post_warn_data['forum_id'];
        } else {
            $warnuser_id = $post_or_userid;
            $post = "0";
            $threadid = "0";
            $forumid = "0";
        }
        $insertdate = date("U");
        $sql = dbquery("INSERT INTO " . DB_WARNING . "\r\n\t\t(warn_kind, user_id, post_id, thread_id, forum_id, warn_subject, warn_message, warn_point, warn_admin, warn_datestamp)\r\n\t\tVALUES\r\n\t\t(" . _db($KIND) . ", " . _db($warnuser_id) . ", " . _db($post) . ", " . _db($threadid) . ", " . _db($forumid) . ", " . _db($subject) . ", " . _db($message) . ",\r\n\t\t" . _db($points) . ", " . _db($userdata['user_id']) . ", " . _db($insertdate) . ");");
        // We need to send a PM to the warned user
        if ($settings['warning_set_send_pm'] == 1) {
            $pn_subject = stripinput(trim($locale['WARN210']));
            if ($KIND == "Forum") {
                $in = $locale['WARN211'] . " [url=" . $settings['siteurl'] . "forum/viewthread.php?thread_id=" . $post_warn_data['thread_id'] . "&pid=" . $post_warn_data['post_id'] . "#post_" . $post_warn_data['post_id'] . "]" . GetPostTitle($post_warn_data['thread_id']) . "[/url]\n";
            } else {
                $in = '';
            }
            $warning_subject = dbarray(dbquery("SELECT warn_subject FROM " . DB_WARNING_CATALOG . " WHERE warn_id='" . $subject . "'"));
            $data_w = dbarray(dbquery("SELECT warn_length FROM " . DB_WARNING_CATALOG . " WHERE warn_id='" . (int) $subject . "'"));
            $warning_length = $insertdate + $data_w['warn_length'] * 86400;
            $pn_messages = stripinput(trim($in . $locale['WARN212'] . " " . $warning_subject['warn_subject'] . "\r\n\t\t\t\t\t\t\t\t\t" . $locale['WARN213'] . " " . $message . "\r\n\t\t\t\t\t\t\t\t\t" . $locale['WARN214'] . date($locale['WARN215'], $warning_length) . $locale['WARN216']));
            if ($settings['warning_set_pm_from'] == 0) {
                $pn_from = $userdata['user_id'];
            } else {
                $pn_from = $settings['warning_set_pm_from'];
            }
            $result = dbquery("INSERT INTO " . DB_MESSAGES . " (message_to, message_from, message_subject, message_message, message_smileys, message_read, message_datestamp, message_folder) VALUES ('" . $warnuser_id . "','" . $pn_from . "','" . $pn_subject . "','" . $pn_messages . "','y','0','" . $insertdate . "','0')");
        }
        // We need to send a PM to an Admin if User has more than 100 points
        if (show_warning_points($warnuser_id) >= 100) {
            $pn_subject = stripinput(trim($locale['WARN217']));
            $pn_messages = stripinput(trim("The member reached the limit:\n [url=" . $settings['siteurl'] . "warning.php?lookup=" . $warnuser_id . "]" . $locale['WARN218'] . "[/url]\n You should take some actions and suspend/bann this member!"));
            $result = dbquery("INSERT INTO " . DB_MESSAGES . " (message_to, message_from, message_subject, message_message, message_smileys, message_read, message_datestamp, message_folder) VALUES ('" . $settings['warning_set_pm_to'] . "','" . "0" . "','" . $pn_subject . "','" . $pn_messages . "','y','0','" . $insertdate . "','0')");
        }
        return true;
    } else {
        return false;
    }
}
function ShowFilterComponent($filter_name, $filter_components, $separator)
{
    $filter_components = explode($separator, $filter_components);
    foreach ($filter_components as $filter_component) {
        if ($filter_component != '') {
            ?>
        
		<div id="<?php 
            echo $filter_name;
            ?>
Components<?php 
            echo $filter_component;
            ?>
Div" style="float: left; padding-right: 5px;">
			<?php 
            if ($separator == ";") {
                echo GetPostTitle($filter_component);
            } else {
                echo GetTermTitle($filter_component);
            }
            ?>

		</div>
        <div class="NoScroll clear-btn" style="float: left; width: 16px; height:22px;">
        	<a href="#" onclick="UnselectOption('<?php 
            echo $filter_name;
            ?>
Components<?php 
            echo $filter_component;
            ?>
');">		
        		<img class="clear-all-btn" src="/wp-content/themes/bridgehouse/images/clear-item-button.png" alt="">
            </a>
        </div><br style="clear:both;">
	<?php 
        }
    }
}