Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 06-09-06
Wardy's Avatar
This is the one
 
Join Date: Aug 2003
Posts: 2,747
Thanks: 14
Thanked 0 Times in 0 Posts
Wardy is an unknown quantity at this point
  PHP/Mysql displaying certain results in bold

I have a members section on a site I'm doing that allows users to send PMs to one another, I have all this bit set up and working fine.
What I want to do is have any unread PMs in bold and any tread PMs not in bold (basically the same way as most PM systems/email work).

I have created it so that when a user has read the PM that the variable "viewed" is updated to be the value of 1 (unread PMs are 0).

PHP Code:
$query  "SELECT * FROM userspm WHERE user='$user' ORDER BY messageid DESC LIMIT $limitvalue, $limit";          
    
$result mysql_query($query) or die("Error: " mysql_error()); 

    if(
mysql_num_rows($result) == 0){ 
        echo(
"No Private Messages"); 
    } 

    
$bgcolor "#FFFFFF"//
    
$bgcolor2 "#BFDFFF"//
    
$bgcolor3 "#FFCC33"//
    
$bgcolor4 "#FFDF80"//
    
$bgcolor5 "#FFEEB9"//
    
$font =    "Verdana, Arial, Helvetica, sans-serif"//
    
$fontsize "2"//
    
$tdwidth "150"//
    
$tdwidth2 "300"//

    
echo("<table>");
    echo(
"<tr bgcolor=".$bgcolor.">\n<td>");
    echo(
"<td width=".$tdwidth." bgcolor=".$bgcolor.">");
    echo(
"<font face=".$font."><B>");
    echo(
"<font size=".$fontsize.">");
    echo(
'Sender');
    echo(
"<td width=".$tdwidth2." bgcolor=".$bgcolor.">");
    echo(
"<font face=".$font.">");
    echo(
"<font size=".$fontsize."><B>");
    echo(
'Subject');
    echo(
"<td width=".$tdwidth." bgcolor=".$bgcolor.">");
    echo(
"<font face=".$font.">");
    echo(
"<font size=".$fontsize."><B>");
    echo(
'Date');
      
    while(
$row mysql_fetch_array($result)){ 
        if (
$bgcolor == "#FFFFFF"){ 
            
$bgcolor "#FFFFFF"
        }else{ 
            
$bgcolor "#FFFFFF"
     } 

    echo(
"<tr bgcolor=".$bgcolor.">\n<td>");
    echo(
"<td width=".$tdwidth." bgcolor=".$bgcolor.">");
    echo(
"<font face=".$font.">");
    echo(
"<font size=".$fontsize.">");
    echo(
'' $row["username"] . '');
    echo(
"<td width=".$tdwidth2." bgcolor=".$bgcolor.">");
    echo(
"<font face=".$font.">");
    echo(
"<font size=".$fontsize.">");
    echo(
'<a href="http://www.mysite.com/read-message.php?mid=' $row["messageid"] . '">' $row["pmtitle"] . '</a></div>');
    echo(
"<td width=".$tdwidth." bgcolor=".$bgcolor.">");
    echo(
"<font face=".$font.">");
    echo(
"<font size=".$fontsize.">");
    echo(
'' $row["date"] . '');
    } 

    echo(
"</table>");
?></font> 
Is anyone able to help please?!

Cheers
Wardy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-09-06
Ste's Avatar
Ste Ste is offline
It's a hard life .....
 
Join Date: Apr 2004
Location: Lancashire
Posts: 607
Thanks: 0
Thanked 0 Times in 0 Posts
Ste is an unknown quantity at this point
Wow that’s a bit of a funny way of doing it. A much easier way would be to use a stylesheet with alink and vlink

alink { font-weight: bold;}
vlink { font-weight: normal;}
__________________
A World of Poker - Its the Nutz! www.aworldofpoker.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-09-06
uklejon's Avatar
Registered User
 
Join Date: Aug 2003
Location: Shropshire
Posts: 815
Thanks: 0
Thanked 0 Times in 0 Posts
uklejon is an unknown quantity at this point
Don;t know any PHP but I've done similar in ASP.

Logic wise you'de need two lines something like.

If viewed = 1 then print out HTML in bold
If viewed = 0 then print out HTML normal


In ASP it would be

If viewed=0 Then Response.Write("<b>" & PM & "</b>")
If viewed=1 Then Response.Write PM

Or you could do it by setting the <b> tag at the top of the code dependant on what the variable is.

EG.

If viewed = 1 then return a <b> tag

PM code stuff

If viwed = 1 then return a </b> tag

Either should work.

Jon
__________________
Jon

UK Link Exchange - Find Link Exchange Partners
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Google Sued for Low Rankings Another Media The Affiliate Marketing Lounge 66 26-04-07 11:57 PM
google to expand into CPA betterHalf The Affiliate Marketing Lounge 23 30-06-06 12:53 PM
DGM results phildarv DGM Affiliates 3 13-03-06 08:41 PM
Minimum requirements for displaying PPC results hoppy The Affiliate Marketing Lounge 2 30-12-04 09:48 PM
ASOS Audit Results jesss1 The Affiliate Marketing Lounge 13 27-02-04 11:14 AM


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7