Jump to content

Recommended Posts

Hi Guys,

 

currently in my script if the user has a private message the inbox word turns red, but what i wanted to do was turn it blue if messages were unread

 

i tried this:

 

<tr>
<td colspan="3" align="center" width="100%" height="25">
<div id="links">
<a href="my_account.php">My Account</a> | 
<?php
     // Get the users details from mysql...//////////////////////////////////////////////
     $query_1 = "SELECT * FROM `membership` WHERE `username`='$member'";
     $result_1 = mysql_query($query_1) or die (mysql_error());
     $row = mysql_fetch_array($result_1);
     
     $id = $row['id'];
     $username = $row['username'];
     $email = $row['email'];
     $country = $row['country'];
     $avatar = $row['avatar'];
     
     // check if the user has messages in there inbox.../////////////////////////////////
     $query_msg = "SELECT * FROM `pms` WHERE `reciever_id`='$id'";
     $result_msg = mysql_query($query_msg) or die (mysql_error());
     
     $how_many = mysql_num_rows($result_msg);
     $read = $rows['read_flag'];
     
     if (mysql_num_rows($result_msg) > 0) {
     
        echo '<a href="inbox.php"><font color="red">Inbox</font></a>  | ';
        
     } elseif ($read == 'N') {
     
        echo '<a href="inbox.php"><font color="blue">Inbox</font></a>  | ';
     
     } else {
     
        echo '<a href="inbox.php">Inbox</a>  | ';     
     
     }
?>
<a href="search.php">Search</a> | <a href="scene_reviews.php">1337 Reviews</a> | <a href="browse_nzb.php">Browse NZB's</a> | <a href="userlist.php">Users</a> | <a href="forums.php">Forums</a> | <a href="upload_nzb.php">Upload NZB</a> | <a href="trailers.php">Trailers</a> | <a href="requests.php">Requests</a> | <a href="contact_staff.php">Contact</a> | <a href="top_ten.php">Top 10</a> | <a href="faq.php">FAQ</a>
</div>
</td>
</tr>
<tr>
<td colspan="2" bgcolor="#F8F7F1" height="100%" align="center" valign="top" id="content">

 

but i know i really need to do a while loop somewhere to see if there is unread messages but am stuck as to where lol

 

any help would be great

 

cheers

 

Graham

Link to comment
https://forums.phpfreaks.com/topic/63609-private-messaging-code/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.