iSwifter
08-12-2014, 04:41 AM
Hey guys im wondering how to get your news panel to show only one category for radipanel
heres the code im using to display the news it displays everything.
<?php
require_once( "../_inc/glob.php" );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>radiPanel News Archive</title>
<style type="text/css" media="screen">
}
body, a, input, select, textarea {
font-family: Verdana, Tahoma, Arial;
font-size: 11px;
color: #333;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
form {
padding: 0;
margin: 0;
}
.wrapper {
width: auto;
margin: auto;
}
.title {
padding: 5px;
margin-bottom: 5px;
font-size: 14px;
font-weight: bold;
background-color: #eee;
color: #444;
}
.content {
padding: auto;
}
.good, .bad {
padding: 5px;
margin-bottom: 5px;
}
.good strong, .bad strong {
font-size: 12px;
font-weight: bold;
}
.good {
background-color: #d9ffcf;
border-color: #ade5a3;
color: #1b801b;
}
.bad {
border-radius: 3px;
color: #FFF;
text-shadow: #AC4131 1px 1px;
padding: 5px;
margin-top: 20px;
background: #e66c6c;
height: auto;
border: solid 1px #c05b5b;
border-bottom: solid 2px #c05b5b;
width: 95%;
}
input, select, textarea {
border: 1px #e0e0e0 solid;
border-bottom-width: 2px;
padding: 3px;
}
input {
width: auto;
}
input.button {
width: auto;
cursor: pointer;
background: #eee;
}
select {
width: 176px;
}
textarea {
width: 288px;
}
label {
display: block;
padding: 3px;
}
.news_box {
height: auto;
width: 20%;
float: left;
background: url('../web/img/banner.png');
background-repeat: no-repeat;
background-position: center center;
border-radius: 3px;
padding: 4px;
cursor: pointer;
opacity: 1;
transition: opacity 0.4s ease-in;
text-align: center;
color: #ffffff;
border: 1px solid #3988A7;
text-shadow: 1px 1px 0px #125b85;
margin-bottom: 5px;
}
.news_box:hover {
opacity: 0.8;
}
.news_content {
float: right;
width: 74%;
height: 34px;
margin-bottom: 5px; padding: 3px 0 0 0;
}
</style>
</head>
<body>
<div class="top"></div>
<div class="mid">
<div class="red"><img src="../voltertxtgen/text.php?t=CENTRAL%20INTELLIGENCE%20AGENCY%20NEWS&s=7&w=1" /></div>
<div class="wrapper">
<div class="content">
<?php
if( $_GET['cat'] ) {
$cat = " WHERE category = '" . $core->clean( $_GET['cat'] ) . "1";
}
$query = $db->query( "SELECT * FROM news{$cat} ORDER BY stamp DESC" );
$num = $db->num( $query );
while( $array = $db->assoc( $query ) ) {
$time = date( "jS F Y", $array['stamp'] );
?>
<div class="news_box" style="width: 20%; margin-bottom: 5px; padding: 10px;"><strong><?php echo $time; ?></strong></div>
<div style="float: right; width: 75%; height: 34px; margin-bottom: 5px; padding: 3px 0 0 0;"> <a href="#?news" onclick="javascript:ajaxpage('../staff/_frontend/news/<?php echo $array['id']; ?>', 'content');"><?php echo $array['title']; ?></a><br /><?php echo $array['desc']; ?>
</div>
<?php
}
if( $num == 0 ) {
?></div>
<center>
</br>
<div class="bad" style="margin-bottom: 0px;">
<strong>Sorry</strong>
<br />
There aren't any news items in this category!
</div>
</center>
<?php
}
?>
</div>
</div>
</div>
<div class="bot"></div>
</body>
</html>
heres the code im using to display the news it displays everything.
<?php
require_once( "../_inc/glob.php" );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>radiPanel News Archive</title>
<style type="text/css" media="screen">
}
body, a, input, select, textarea {
font-family: Verdana, Tahoma, Arial;
font-size: 11px;
color: #333;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
form {
padding: 0;
margin: 0;
}
.wrapper {
width: auto;
margin: auto;
}
.title {
padding: 5px;
margin-bottom: 5px;
font-size: 14px;
font-weight: bold;
background-color: #eee;
color: #444;
}
.content {
padding: auto;
}
.good, .bad {
padding: 5px;
margin-bottom: 5px;
}
.good strong, .bad strong {
font-size: 12px;
font-weight: bold;
}
.good {
background-color: #d9ffcf;
border-color: #ade5a3;
color: #1b801b;
}
.bad {
border-radius: 3px;
color: #FFF;
text-shadow: #AC4131 1px 1px;
padding: 5px;
margin-top: 20px;
background: #e66c6c;
height: auto;
border: solid 1px #c05b5b;
border-bottom: solid 2px #c05b5b;
width: 95%;
}
input, select, textarea {
border: 1px #e0e0e0 solid;
border-bottom-width: 2px;
padding: 3px;
}
input {
width: auto;
}
input.button {
width: auto;
cursor: pointer;
background: #eee;
}
select {
width: 176px;
}
textarea {
width: 288px;
}
label {
display: block;
padding: 3px;
}
.news_box {
height: auto;
width: 20%;
float: left;
background: url('../web/img/banner.png');
background-repeat: no-repeat;
background-position: center center;
border-radius: 3px;
padding: 4px;
cursor: pointer;
opacity: 1;
transition: opacity 0.4s ease-in;
text-align: center;
color: #ffffff;
border: 1px solid #3988A7;
text-shadow: 1px 1px 0px #125b85;
margin-bottom: 5px;
}
.news_box:hover {
opacity: 0.8;
}
.news_content {
float: right;
width: 74%;
height: 34px;
margin-bottom: 5px; padding: 3px 0 0 0;
}
</style>
</head>
<body>
<div class="top"></div>
<div class="mid">
<div class="red"><img src="../voltertxtgen/text.php?t=CENTRAL%20INTELLIGENCE%20AGENCY%20NEWS&s=7&w=1" /></div>
<div class="wrapper">
<div class="content">
<?php
if( $_GET['cat'] ) {
$cat = " WHERE category = '" . $core->clean( $_GET['cat'] ) . "1";
}
$query = $db->query( "SELECT * FROM news{$cat} ORDER BY stamp DESC" );
$num = $db->num( $query );
while( $array = $db->assoc( $query ) ) {
$time = date( "jS F Y", $array['stamp'] );
?>
<div class="news_box" style="width: 20%; margin-bottom: 5px; padding: 10px;"><strong><?php echo $time; ?></strong></div>
<div style="float: right; width: 75%; height: 34px; margin-bottom: 5px; padding: 3px 0 0 0;"> <a href="#?news" onclick="javascript:ajaxpage('../staff/_frontend/news/<?php echo $array['id']; ?>', 'content');"><?php echo $array['title']; ?></a><br /><?php echo $array['desc']; ?>
</div>
<?php
}
if( $num == 0 ) {
?></div>
<center>
</br>
<div class="bad" style="margin-bottom: 0px;">
<strong>Sorry</strong>
<br />
There aren't any news items in this category!
</div>
</center>
<?php
}
?>
</div>
</div>
</div>
<div class="bot"></div>
</body>
</html>