Jump to content

Two issues - Bold text? Quick replying sends to myself?


TeddyKiller

Recommended Posts

I have noticed that sometimes mails come up.. and in the sent messages, or in the inbox if done correctly.. all the text below comes up in bold. Though when you view the mails.. it looks fine.

http://i278.photobucket.com/albums/kk87/JeanieTallis/hbbbb.png - Image of Issue

Number 1 displays that its like in sent messages/inbox. etc

Number 2 displays what the message is like when viewed.

I'm not sure what the issue is, it may be in the code or not. You'll have to tell me.

 

The second issue, when you view a message you sent.. at the bottom is a quick reply. This for some reason.. sends a mail to myself. I think the problem is.. viewing a message sent to you, and viewing a message you sent to someone else uses the same view message case. So if you sent a message.. the from: field will actually be your username.. there for you end up sending it to yourself.

 

I'm not going to provide any code yet, don't know which parts are nessecary.

How can i fix the two issues?

 

Cheers

Here is the sent messages, the inbox is the same.. just with a slightly different query.

     case "sent":
     
          echo '<a href="mail.php">Inbox Messages</a> - <a href="mail.php?act=sent">Sent Messages</a> - <a href="mail.php?act=send">Send Message</a><br />';
        echo '<fieldset><legend>Sent Messages</legend><form name="myForm" action="" method="post">';
        
        $q = mysql_query("SELECT * FROM `sent_messages` WHERE from_status='0' AND from_id='$user->id' order by `date` desc");
           if(mysql_num_rows($q) > 0){
           while($r = mysql_fetch_array($q)){
              $wr = mysql_query("SELECT * FROM `users` WHERE id='".$r['to_id']."'");
              $rw = mysql_fetch_array($wr);
              echo '
              <div style="text-align:left; border-bottom:1px solid #e1e3d3; padding-bottom:5px;">
              <div id="topmail">Date: '.date('d.m.y \a\t H:i', $r['date']).'<br />To: <a href="#">'.ucwords($rw['username']).'</a> - Subject: <a href="mail.php?act=viewmessage&hash='.$_SESSION['hash'].'&msgid='.$r['id'].'">'.ucwords($r['subject']).'</a></div>
              <div id="mail">
              <div style="margin-right:50px;">'.substr($r['message'],0,100).'</div>
              </div>
              </div><br />';
           }
        } else { echo 'You currently have no sent messages. Get sending!'; }
        
        echo '</fieldset></form>';
     
     break; 

The only thing that jumps out at me is that you have 5 <div> open tags, and only 3 </div> closing tags. Might be a style carrying over to the next <div>, unless they're closed elsewhere.

No. They are all closed. I tidied it up a bit.

echo '
<div style="text-align:left; border-bottom:1px solid #e1e3d3; padding-bottom:5px;">
    <div id="topmail">
        Date: '.date('d.m.y \a\t H:i', $r['date']).'<br />To: <a href="#">'.ucwords($rw['username']).'</a> - Subject: 
        <a href="mail.php?act=viewmessage&hash='.$_SESSION['hash'].'&msgid='.$r['id'].'">'.ucwords($r['subject']).'</a>
    </div>
    <div id="mail">
        <div style="margin-right:50px;">' . substr($r['message'],0,100) . '</div>
    </div>
</div><br />';

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.