Example #1
0
 public function allusers($title, $body)
 {
     // To send HTML mail, the Content-type header must be set
     $header = 'MIME-Version: 1.0' . "\r\n";
     $header .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
     // Additional headers
     $header .= 'From: register@domain.com' . "\r\n";
     $header .= 'Reply-To: register@domain.com' . "\r\n";
     $header .= 'X-Mailer: PHP/' . phpversion();
     $message = "<html>";
     $message .= "<body>";
     $message .= $body;
     $message .= "</body>";
     $message .= "</html>";
     //echo $message;
     $db = new Database();
     $db->connect();
     $query = "select `email` from `user` where `accountstatusid`>1";
     $db->query($query);
     $tmp = $db->getresult();
     foreach ($tmp as $value) {
         //echo "mail(".$value['email'].")<br>";
         mail($value['email'], $title, $message, $header);
     }
     //mail('*****@*****.**',$title,$message,$header);
 }
Example #2
0
 public function set_settings()
 {
     $db = new Database();
     $db->connect();
     $query = "\n\t\t\t\tselect site_on, email_alerts, launch_date, registration_on, login_on\n\t\t\t\tfrom settings\n\t\t\t\t";
     $db->query($query);
     $this->site = $db->getresult();
     return TRUE;
 }
Example #3
0
 public function options($name)
 {
     $db = new Database();
     $db->connect();
     $query = "\n\t\t\t\tselect id, name\n\t\t\t\tfrom `" . $name . "` tabl\n\t\t\t\t";
     // interestedin
     // lookingfor
     // relationshiptype
     // sex
     // schoolstatus
     // political
     $db->query($query);
     $tmp = $db->getresult();
     return $tmp;
 }
Example #4
0
 public function get_lastupdate($uid)
 {
     $db = new Database();
     $db->connect();
     $lastupdatequery = "\n\t\t\t\t\tselect p.timestamp as last\n\t\t\t\t\tfrom profileupdates p\n\t\t\t\t\twhere p.userid='" . $uid . "'\n\t\t\t\t\torder by p.timestamp desc\n\t\t\t\t\tlimit 1\n\t\t\t\t\t";
     //echo $lastupdatequery;
     $db->query($lastupdatequery);
     //$db->select('profileupdates','`dtime` as lastupdate, count(`id`) as updates',"userid='".$uid."'",'dtime DESC');
     $tmp = $db->getresult();
     //print_r($tmp);
     return $tmp['last'];
 }
Example #5
0
 public function totaluniquevisitors()
 {
     $db = new Database();
     $db->connect();
     $query = "select sum(`hits`) as `thits` from `Uniques_Per_Day` ";
     //echo $query;
     $db->query($query);
     //$db->select('`log`','`ip`',$where,$order,$group);
     $result = $db->getresult();
     $views = $result['thits'];
     return $views;
 }
 public function pending_requests()
 {
     $db = new Database();
     $db->connect();
     $uid = $this->userid;
     $relationshipquery = "\n\t\t\t\t\tselect distinct \n\t\t\t\t\tr.senderid as friend\n\t\t\t\t\tfrom relationship r\n\t\t\t\t\tjoin user u on u.id=r.senderid\n\t\t\t\t\tWHERE r.receiverid IN (" . $uid . ")\n\t\t\t\t\tand r.confirmed=0\n\t\t\t\t\tand u.accountstatusid>1\n\t\t\t\t\t";
     $db->query($relationshipquery);
     $tmp = $db->getresult();
     if ($tmp[0]['friend'] < 1) {
         $tmp2[0]['friend'] = $tmp['friend'];
     } else {
         $tmp2 = $tmp;
     }
     $friendarray = array();
     foreach ($tmp2 as $friend) {
         $position = count($friendarray);
         $friendarray[$position] = $friend['friend'];
     }
     return $friendarray;
 }
Example #7
0
 public function viewthread($uid, $type = '', $startresults = 0, $totalresults = 5)
 {
     //last 5 to or from that person
     $db = new Database();
     $db->connect();
     $id = $this->userid;
     if ($type == 'unread') {
         $type = 1;
     }
     $inboxquery = "\n\t\t\t\t\tselect\n\t\t\t\t\tr.id as messages\n\t\t\t\t\tfrom message r\n\t\t\t\t\tjoin user u on u.id=r.senderid\n\t\t\t\t\tjoin user ur on ur.id=r.receiverid\n\t\t\t\t\tWHERE ((r.receiverid = '" . $id . "' and r.senderid = '" . $uid . "')\n\t\t\t\t\tor\n\t\t\t\t\t(";
     if ($type != 1) {
         $inboxquery .= "r.receiverid = '" . $uid . "' and r.senderid = '" . $id . "'";
     } else {
         $inboxquery .= "1=2";
     }
     $inboxquery .= "))\n\t\t\t\t\tand u.accountstatusid>1\n\t\t\t\t\tand ur.accountstatusid>1\n\t\t\t\t\t";
     if ($type) {
         $inboxquery .= "and r.messagestatusid='" . $type . "'";
     }
     $inboxquery .= " order by r.id desc";
     //echo $inboxquery;
     $db->query($inboxquery);
     $tmp = $db->getresult();
     //print_r($tmp);
     if ($tmp[0]['messages'] < 1) {
         $tmp2[0]['messages'] = $tmp['messages'];
     } else {
         $tmp2 = $tmp;
     }
     $farray = array();
     foreach ($tmp2 as $spaceid => $frienddata) {
         $farray[$spaceid] = $frienddata['messages'];
     }
     return $farray;
 }
 public function confirmation($id, $code)
 {
     $db = new Database();
     $db->connect();
     $where = "`confirmnumber`='" . $id . "' and `codenumber`='" . $code . "'";
     $db->select('`confirmationemail`', '`userid`', $where);
     $result = $db->getresult();
     $userid = $result['userid'];
     if ($userid < 1) {
         return -1;
     }
     $confirmuserquery = "update user set `accountstatusid`='2' where `id`='" . $userid . "' limit 1";
     $removeconfirmquery = "delete from confirmationemail where `userid`='" . $userid . "'";
     $db->query($confirmuserquery);
     $db->query($removeconfirmquery);
     return 1;
 }