Cherpi
01-07-2010, 04:54 PM
I need some RadiPanel help, you see I want to only show 3 news articles in my headlines but I'm not sure how to, if anyone can help me then I'd absolutely love it!
<?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">
#grey {
text-decoration:none;
color: #666;
body {
padding: 0;
margin: 0;
}
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 {
background-color: #fcfcfc;
width: 350px;
margin: auto;
padding: 5px;
margin-top: 15px;
}
.title {
padding: 5px;
margin-bottom: 5px;
font-size: 14px;
font-weight: bold;
background-color: #eee;
color: #444;
}
.content {
padding: 5px;
}
.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 {
background-color: #ffcfcf;
border-color: #e5a3a3;
color: #801b1b;
}
input, select, textarea {
border: 1px #e0e0e0 solid;
border-bottom-width: 2px;
padding: 3px;
}
input {
width: 170px;
}
input.button {
width: auto;
cursor: pointer;
background: #eee;
}
select {
width: 176px;
}
textarea {
width: 288px;
}
label {
display: block;
padding: 3px;
}
.good1 {
padding: 5px;
margin-bottom: 5px;
}
#news {
font-weight: bold;
}
</style>
</head>
<body>
<?php
if( $_GET['cat'] ) {
$cat = " WHERE category = '" . $core->clean( $_GET['cat'] ) . "'";
}
$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 id="news"><span id="news"><?php echo $time; ?> » <a id="grey" href="javascript:ajaxLoader('http://habbolido.net/staff/_frontend/news/<?php echo $array['id']; ?>','main');"><?php echo $array['title']; ?></a></span><a href="javascript:ajaxLoader('news/<?php echo $array['id']; ?>','main');"><br /><br /></a>...<?php echo $array['desc']; ?><br /><br />
Posted at <strong><?php echo date( "H:i", $array['stamp'] ); ?></strong>.<br /><br />
<br /><br /></div>
<?php
}
if( $num == 0 ) {
?>
<div class="bad" style="margin-bottom: 0px;"> <strong>Sorry</strong> <br />
There aren't any news items in this category! </div>
<?php
}
?>
</body>
</html>
<?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">
#grey {
text-decoration:none;
color: #666;
body {
padding: 0;
margin: 0;
}
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 {
background-color: #fcfcfc;
width: 350px;
margin: auto;
padding: 5px;
margin-top: 15px;
}
.title {
padding: 5px;
margin-bottom: 5px;
font-size: 14px;
font-weight: bold;
background-color: #eee;
color: #444;
}
.content {
padding: 5px;
}
.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 {
background-color: #ffcfcf;
border-color: #e5a3a3;
color: #801b1b;
}
input, select, textarea {
border: 1px #e0e0e0 solid;
border-bottom-width: 2px;
padding: 3px;
}
input {
width: 170px;
}
input.button {
width: auto;
cursor: pointer;
background: #eee;
}
select {
width: 176px;
}
textarea {
width: 288px;
}
label {
display: block;
padding: 3px;
}
.good1 {
padding: 5px;
margin-bottom: 5px;
}
#news {
font-weight: bold;
}
</style>
</head>
<body>
<?php
if( $_GET['cat'] ) {
$cat = " WHERE category = '" . $core->clean( $_GET['cat'] ) . "'";
}
$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 id="news"><span id="news"><?php echo $time; ?> » <a id="grey" href="javascript:ajaxLoader('http://habbolido.net/staff/_frontend/news/<?php echo $array['id']; ?>','main');"><?php echo $array['title']; ?></a></span><a href="javascript:ajaxLoader('news/<?php echo $array['id']; ?>','main');"><br /><br /></a>...<?php echo $array['desc']; ?><br /><br />
Posted at <strong><?php echo date( "H:i", $array['stamp'] ); ?></strong>.<br /><br />
<br /><br /></div>
<?php
}
if( $num == 0 ) {
?>
<div class="bad" style="margin-bottom: 0px;"> <strong>Sorry</strong> <br />
There aren't any news items in this category! </div>
<?php
}
?>
</body>
</html>