/////////////////////notificare

function getpmcount1($uid,$view="all")
{
  if($view=="all"){
    $nopm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM tecweb_notificare WHERE touid='".$uid."'"));
    }else if($view =="snt")
    {
        $nopm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM tecweb_notificare WHERE byuid='".$uid."'"));
    }else if($view =="str")
    {
        $nopm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM tecweb_notificare WHERE touid='".$uid."' AND starred='1'"));
    }else if($view =="urd")
    {
        $nopm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM tecweb_notificare WHERE touid='".$uid."' AND unread='1'"));
    }
    return $nopm[0];
}

/////////////////////notificari necitite

function notificarenecitita($uid)
{
    $nopm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM tecweb_notificare WHERE touid='".$uid."' AND unread='1'"));
    return $nopm[0];
}
///////////////////
/////////////////////// auto pm
function autopm($msg, $who)
{
    mysql_query("INSERT INTO tecweb_notificare SET text='".$msg."', byuid='1', touid='".$who."', unread='1', timesent='".time()."'");
    
}
/////////////////////// auto pm
function pmautomat($msg, $who)
{
    mysql_query("INSERT INTO tecweb_notificare SET text='".$msg."', byuid='1', touid='".$who."', unread='1', timesent='".time()."'");
    
}




ATENTIE: :D

Functiile autopm si pmautomat le inlocuiesti cu astea 2 :D
