Al_90
02-21-2006, 12:36 AM
with my forum i want the user to be able to see different icons if the post is new, any ideas on how to do it? right now i am using
<?
if (isset($_SESSION['username']))
{
$sql_query = mysql_query("SELECT time from users WHERE username = '" . $_SESSION['username'] . "'");
$my_time = mysql_fetch_array($sql_query);
$user_time = $my_time['time'];
if ($topic_locked == 'yes' && $topic_time > $user_time) { ?>
<img src="images/new_locked_icon.gif" width="25" height="25">
<? } elseif ($topic_locked == 'yes' && $topic_time < $user_time) { ?>
<img src="images/locked_icon.gif" width="25" height="25">
<? } elseif ($topic_locked == 'no' && $topic_time > $user_time) { ?>
<img src="images/new_regular_icon.gif" width="25" height="25">
<? } elseif ($topic_locked == 'no' && $topic_time < $user_time) { ?>
<img src="images/regular_icon.gif" width="25" height="25">
<?
}
}
?>
and topic_time is assigned above in the code, i just didnt include it. many thanks
<?
if (isset($_SESSION['username']))
{
$sql_query = mysql_query("SELECT time from users WHERE username = '" . $_SESSION['username'] . "'");
$my_time = mysql_fetch_array($sql_query);
$user_time = $my_time['time'];
if ($topic_locked == 'yes' && $topic_time > $user_time) { ?>
<img src="images/new_locked_icon.gif" width="25" height="25">
<? } elseif ($topic_locked == 'yes' && $topic_time < $user_time) { ?>
<img src="images/locked_icon.gif" width="25" height="25">
<? } elseif ($topic_locked == 'no' && $topic_time > $user_time) { ?>
<img src="images/new_regular_icon.gif" width="25" height="25">
<? } elseif ($topic_locked == 'no' && $topic_time < $user_time) { ?>
<img src="images/regular_icon.gif" width="25" height="25">
<?
}
}
?>
and topic_time is assigned above in the code, i just didnt include it. many thanks