Check For Mail

How can i check wether or not a user has mail? Preferably in PHP!!

Quote · 2 Sep 2009

// member ID
$iMemberID = 1;


// new messages
$new_mess_arr = db_arr( "SELECT ID, Text, Subject FROM `Messages` WHERE Recipient = {$iMemberID} AND New = '1' ORDER BY Date DESC LIMIT 1" );

$messID = $new_mess_arr[ID];
$messText = $new_mess_arr[Text];
$messSubject = $new_mess_arr[Subject];


something you can start with...

Quote · 2 Sep 2009

Thanks I looked at it and modified it to the following to also get the senders details as well:

<?

// Limit notification summary to how many characters?
$jQNlimit = 100;

$jQNMemberID = (int)$_COOKIE['memberID'];
$jQN_recipient_result = mysql_query("SELECT * FROM Messages WHERE New='1' AND Recipient='$jQNMemberID'");

while($jQN_recipient_row = mysql_fetch_array($jQN_recipient_result)){

$jQN_sender_result = mysql_query("SELECT * FROM Profiles WHERE ID='$jQN_recipient_row[Sender]'");
while($jQN_sender_row = mysql_fetch_array($jQN_sender_result)){

//////////////////////////////////
/////// Notification Parts ///////
//////////////////////////////////
$jQNsubject = $jQN_recipient_row['Subject'];
$jQNsummary = $jQN_recipient_row['Text'];
$jQNsender = $jQN_sender_row['NickName'];
$jQNsenderPic = $jQN_sender_row['Picture'];
}

if (strlen($jQNsummary) > $jQNlimit)
$jQNsummary = substr($jQNsummary, 0, strrpos(substr($jQNsummary, 0, $jQNlimit), ' ')) . '...';

?>

Now I was wondering...that pulls up a number for the senders display picture, how can I turn that round and get the actual URL of their display picture?

Quote · 4 Sep 2009

// Check For Mail
function getBlockCode_CheckMail() {
global $site;
global $getBlockCode_CheckMail_db_num;
global $max_thumb_width;
global $max_thumb_height;
global $oTemplConfig;

$iMemberID = (int)$_COOKIE['memberID'];
$feature_num     = 25;

if ( $feature_num )
{
$featured_res = db_res( "SELECT ID, Sender, Text, Subject FROM `Messages` WHERE New='1' AND Recipient='$iMemberID' LIMIT $feature_num" );

$ret .= '<div class="clear_both"></div>';

if( mysql_num_rows( $featured_res ) > 0 )
{
$j=1;
while( $featured_arr = mysql_fetch_assoc( $featured_res ) )
{

$ret .= '<table width="100%" bgcolor="#FFFFFF" border="0" cellpadding="5" cellspacing="0">';
$ret .= '<tr valign="top">';

$ret .= '<td width="30%">';
$ret .= '<table width="100%" bgcolor="#FFFFFF" border="0" cellpadding="0" cellspacing="0">';
$ret .= '<div class="featured_block_1">';
$ret .= get_member_thumbnail( $featured_arr['Sender'], 'none' );
$ret .= '</div>';
$ret .= '</table>';
$ret .= '</td>';

$ret .= '<td width="70%">';
$ret .= '<table width="100%" bgcolor="#FFFFFF" border="0" cellpadding="0" cellspacing="0">';
$ret .= '<div>';
$ret .= '<font size="3" color="#0080C0" face="Arial"><b>';
$ret .= $featured_arr['Subject'];
$ret .= '</b></font>';
$ret .= '</div>';
$ret .= '<div>';
$ret .= '<font size="2" color="#000000" face="Arial">';
$ret .= $featured_arr['Text'];
$ret .= '</font>';
$ret .= '</div>';
$ret .= '</table>';
$ret .= '</td>';

$ret .= '</tr>';
$ret .= '</table>';

$j++;
}
}
else
{
$ret .= '<div class="no_result">';
$ret .= '<div>';
$ret .= _t("_No results found");
$ret .= '</div>';
$ret .= '</div>';
}
$ret .= '<div class="clear_both"></div>';
}

return $ret;
}

Quote · 13 Sep 2009
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.