'wss://relay.damus.io',1 => 'wss://ch1.budu.com', 2 => 'wss://nos.lol'); date_default_timezone_set('America/New_York'); $docroot="/var/www/vhosts/budu.com/httpdocs/"; $droot = $_SERVER["DOCUMENT_ROOT"]; $rstatusarray = array(0 => 'not disclosed', 1 => 'Single (Looking)',2 => 'Single (not looking)', 3 => 'Married (looking)',4 => 'Married (not looking)',5 => 'Open Relationship',6 => 'Dating Someone (looking)',7 => '>Dating Someone (not looking)',8 => 'In a relationship (looking)',9 => 'In a relationship (not looking)'); $categories = array( 35 => "KIN for Coffee", 36 => "KIN for Pizza", 27 => "Personal", 28 => "Transportation", 29 => "Hunger", 1 => "Influencer/Creator", 2 => "Animals", 3 => "Environment", 4 => "Education", 5 => "Health", 6 => "Community", 7 => "Arts", 8 => "Sports", 9 => "Disaster Relief", 10 => "Human Rights", 11 => "Social Services", 12 => "Startup", 13 => "Technology", 14 => "Science", 15 => "Food and Agriculture", 16 => "Travel and Adventure", 17 => "Music and Film", 18 => "Fashion and Beauty", 19 => "Gaming", 20 => "LGBTQ+", 21 => "Women's Empowerment", 22 => "Disability Support", 23 => "Veterans and Military", 24 => "Religious and Spiritual", 26 => "NSFW Onlyfans Findom", 30 => "Offgrid", 31 => "Development Africa", 32 => "Development Central South America", 33 => "Development Asia", 34 => "Adult", 25 => "Other", ); $language_codes = array( 'en' => 'English' , 'aa' => 'Afar' , 'ab' => 'Abkhazian' , 'af' => 'Afrikaans' , 'am' => 'Amharic' , 'ar' => 'Arabic' , 'as' => 'Assamese' , 'ay' => 'Aymara' , 'az' => 'Azerbaijani' , 'ba' => 'Bashkir' , 'be' => 'Byelorussian' , 'bg' => 'Bulgarian' , 'bh' => 'Bihari' , 'bi' => 'Bislama' , 'bn' => 'Bengali/Bangla' , 'bo' => 'Tibetan' , 'br' => 'Breton' , 'ca' => 'Catalan' , 'co' => 'Corsican' , 'cs' => 'čeština' , 'cy' => 'Welsh' , 'da' => 'Danish' , 'de' => 'German' , 'dz' => 'Bhutani' , 'el' => 'Greek' , 'eo' => 'Esperanto' , 'es' => 'Español' , 'et' => 'Estonian' , 'eu' => 'Basque' , 'fa' => 'Persian' , 'fi' => 'Finnish' , 'fj' => 'Fiji' , 'fo' => 'Faeroese' , 'fr' => 'French' , 'fy' => 'Frisian' , 'ga' => 'Irish' , 'gd' => 'Scots/Gaelic' , 'gl' => 'Galician' , 'gn' => 'Guarani' , 'gu' => 'Gujarati' , 'ha' => 'Hausa' , 'hi' => 'Hindi' , 'hr' => 'Croatian' , 'hu' => 'Hungarian' , 'hy' => 'Armenian' , 'ia' => 'Interlingua' , 'ie' => 'Interlingue' , 'ik' => 'Inupiak' , 'id' => 'Indonesian' , 'is' => 'Icelandic' , 'it' => 'Italian' , 'iw' => 'Hebrew' , 'ja' => 'Japanese' , 'ji' => 'Yiddish' , 'jw' => 'Javanese' , 'ka' => 'Georgian' , 'kk' => 'Kazakh' , 'kl' => 'Greenlandic' , 'km' => 'Cambodian' , 'kn' => 'Kannada' , 'ko' => 'Korean' , 'ks' => 'Kashmiri' , 'ku' => 'Kurdish' , 'ky' => 'Kirghiz' , 'la' => 'Latin' , 'ln' => 'Lingala' , 'lo' => 'Laothian' , 'lt' => 'Lithuanian' , 'lv' => 'Latvian/Lettish' , 'mg' => 'Malagasy' , 'mi' => 'Maori' , 'mk' => 'Macedonian' , 'ml' => 'Malayalam' , 'mn' => 'Mongolian' , 'mo' => 'Moldavian' , 'mr' => 'Marathi' , 'ms' => 'Malay' , 'mt' => 'Maltese' , 'my' => 'Burmese' , 'na' => 'Nauru' , 'ne' => 'Nepali' , 'nl' => 'Dutch' , 'no' => 'Norwegian' , 'oc' => 'Occitan' , 'om' => '(Afan)/Oromoor/Oriya' , 'pa' => 'Punjabi' , 'pl' => 'Polish' , 'ps' => 'Pashto/Pushto' , 'pt' => 'Portuguese' , 'qu' => 'Quechua' , 'rm' => 'Rhaeto-Romance' , 'rn' => 'Kirundi' , 'ro' => 'Romanian' , 'ru' => 'Russian' , 'rw' => 'Kinyarwanda' , 'sa' => 'Sanskrit' , 'sd' => 'Sindhi' , 'sg' => 'Sangro' , 'sh' => 'Serbo-Croatian' , 'si' => 'Singhalese' , 'sk' => 'Slovak' , 'sl' => 'Slovenian' , 'sm' => 'Samoan' , 'sn' => 'Shona' , 'so' => 'Somali' , 'sq' => 'Albanian' , 'sr' => 'Serbian' , 'ss' => 'Siswati' , 'st' => 'Sesotho' , 'su' => 'Sundanese' , 'sv' => 'Swedish' , 'sw' => 'Swahili' , 'ta' => 'Tamil' , 'te' => 'Tegulu' , 'tg' => 'Tajik' , 'th' => 'Thai' , 'ti' => 'Tigrinya' , 'tk' => 'Turkmen' , 'tl' => 'Tagalog' , 'tn' => 'Setswana' , 'to' => 'Tonga' , 'tr' => 'Turkish' , 'ts' => 'Tsonga' , 'tt' => 'Tatar' , 'tw' => 'Twi' , 'uk' => 'Ukrainian' , 'ur' => 'Urdu' , 'uz' => 'Uzbek' , 'vi' => 'Vietnamese' , 'vo' => 'Volapuk' , 'wo' => 'Wolof' , 'xh' => 'Xhosa' , 'yo' => 'Yoruba' , 'zh' => 'Chinese' , 'zu' => 'Zulu' , ); asort($language_codes); $language_numbers = array( 'en' => 0, 'aa' => 1, 'ab' => 2, 'af' => 3, 'am' => 4, 'ar' => 5, 'as' => 6, 'ay' => 7, 'az' => 8, 'ba' => 9, 'be' => 10, 'bg' => 11, 'bh' => 12, 'bi' => 13, 'bn' => 14, 'bo' => 15, 'br' => 16, 'ca' => 17, 'co' => 18, 'cs' => 19, 'cy' => 20, 'da' => 21, 'de' => 22, 'dz' => 23, 'el' => 24, 'eo' => 25, 'es' => 26, 'et' => 27, 'eu' => 28, 'fa' => 29, 'fi' => 30, 'fj' => 31, 'fo' => 32, 'fr' => 33, 'fy' => 34, 'ga' => 35, 'gd' => 36, 'gl' => 37, 'gn' => 38, 'gu' => 39, 'ha' => 40, 'hi' => 41, 'hr' => 42, 'hu' => 43, 'hy' => 44, 'ia' => 45, 'ie' => 46, 'ik' => 47, 'in' => 48, 'is' => 49, 'it' => 50, 'iw' => 51, 'ja' => 52, 'ji' => 53, 'jw' => 54, 'ka' => 55, 'kk' => 56, 'kl' => 57, 'km' => 58, 'kn' => 59, 'ko' => 60, 'ks' => 61, 'ku' => 62, 'ky' => 63, 'la' => 64, 'ln' => 65, 'lo' => 66, 'lt' => 67, 'lv' => 68, 'mg' => 69, 'mi' => 70, 'mk' => 71, 'ml' => 72, 'mn' => 73, 'mo' => 74, 'mr' => 75, 'ms' => 76, 'mt' => 77, 'my' => 78, 'na' => 79, 'ne' => 80, 'nl' => 81, 'no' => 82, 'oc' => 83, 'om' => 84, 'pa' => 85, 'pl' => 86, 'ps' => 87, 'pt' => 88, 'qu' => 89, 'rm' => 90, 'rn' => 91, 'ro' => 92, 'ru' => 93, 'rw' => 94, 'sa' => 95, 'sd' => 96, 'sg' => 97, 'sh' => 98, 'si' => 99, 'sk' => 100, 'sl' => 101, 'sm' => 102, 'sn' => 103, 'so' => 104, 'sq' => 105, 'sr' => 106, 'ss' => 107, 'st' => 108, 'su' => 109, 'sv' => 110, 'sw' => 111, 'ta' => 112, 'te' => 113, 'tg' => 114, 'th' => 115, 'ti' => 116, 'tk' => 117, 'tl' => 118, 'tn' => 119, 'to' => 120, 'tr' => 121, 'ts' => 122, 'tt' => 123, 'tw' => 124, 'uk' => 125, 'ur' => 126, 'uz' => 127, 'vi' => 128, 'vo' => 129, 'wo' => 130, 'xh' => 131, 'yo' => 132, 'zh' => 133, 'zu' => 134 ); $langan = array(0=>"english",1=>"Espanol"); $httphost = $_SERVER['HTTP_HOST']; $subd=array_shift(explode(".",$httphost)); $browser_language = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); $la = $browser_language; if($la == ""){ $la= "en"; } #nigeria scammer $ipaddress = get_ip(); function get_ip() { $ipaddress = ''; if ($_SERVER['HTTP_CLIENT_IP']) $ipaddress = $_SERVER['HTTP_CLIENT_IP']; else if($_SERVER['HTTP_X_FORWARDED_FOR']) $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR']; else if($_SERVER['HTTP_X_FORWARDED']) $ipaddress = $_SERVER['HTTP_X_FORWARDED']; else if($_SERVER['HTTP_FORWARDED_FOR']) $ipaddress = $_SERVER['HTTP_FORWARDED_FOR']; else if($_SERVER['HTTP_FORWARDED']) $ipaddress = $_SERVER['HTTP_FORWARDED']; else if($_SERVER['REMOTE_ADDR']) $ipaddress = $_SERVER['REMOTE_ADDR']; else $ipaddress = 'UNKNOWN'; return $ipaddress; } include('langinc.php'); db_connect(); function db_connect() { global $pdodb; try { # MySQL with PDO_MYSQL $pdodb = new PDO("mysql:host=localhost;dbname=jevemefn_budu1", 'jevemefn_budu1', 'Budu123$#'); $pdodb->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch(PDOException $e) { echo $e->getMessage(); } } // referal system if($_REQUEST["uid"] > 0){ #echo 'refid:'.$_REQUEST["uid"]; if($_REQUEST["uid"] <> $_SESSION["uid"]){ $_SESSION["referid"] = $_REQUEST["uid"]; $updateactivity = $pdodb->prepare("UPDATE LOW_PRIORITY girls SET rvisitors=rvisitors+1 WHERE ID=:sessid"); $updateactivity->bindParam(':sessid',$_REQUEST["uid"]); $updateactivity->execute(); } } function distance($lat1, $lon1, $lat2, $lon2, $unit="K") { $theta = $lon1 - $lon2; $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta)); $dist = acos($dist); $dist = rad2deg($dist); $miles = $dist * 60 * 1.1515; $unit = strtoupper($unit); if ($unit == "K") { return ($miles * 1.609344); } else if ($unit == "N") { return ($miles * 0.8684); } else { return $miles; } } if(empty($_SESSION["uid"])){ if(!empty($_COOKIE["logincookie"])){ $stmt = $pdodb->prepare("SELECT mid FROM mlogins WHERE crazycookie=:logincookie LIMIT 1"); $stmt->bindParam(':logincookie',$_COOKIE["logincookie"]); $stmt->execute(); while($i2=$stmt->fetch()){ $_SESSION["uid"] = $i2["mid"]; } } } if($_SESSION["uid"] > 0){ $getuserinfo = $pdodb->prepare("SELECT ID,username,nvisitors,points,gender,views,country,nmessages,subscriptions,mainpic,fname,npmessages, pageupdates,nnotify,emailis,mailoften,lastforumpost,paying,credits,karma,nfriends,tfriends, tfollowers,payuntil,lastforum,laststatus,statusviews,city,banned,verified,dblat,dblon,kinaddress,referredby,budus FROM girls WHERE ID=:sessid"); $getuserinfo->bindParam(':sessid',$_SESSION["uid"]); $getuserinfo->execute(); while($i3=$getuserinfo->fetch()) { $d_id = $i3["ID"]; $d_username = $i3["username"]; $d_visitors = $i3["nvisitors"]; $d_points = $i3["points"]; $d_views = $i3["views"]; $d_karma = $i3["karma"]; $d_country = $i3["country"]; $d_nmessages = $i3["nmessages"]; $d_subscriptions = $i3["subscriptions"]; $d_mainpic = $i3["mainpic"]; $d_fname = $i3["fname"]; $d_npmessages = $i3["npmessages"]; $d_pageupdates = $i3["pageupdates"]; $d_notify = $i3["nnotify"]; $d_city = $i3["city"]; $d_lat = $i3["dblat"]; $d_lon = $i3["dblon"]; $d_nfriends = $i3["nfriends"]; $d_emailis = $i3["emailis"]; $d_mailoften = $i3["mailoften"]; $d_gender = $i3["gender"]; $d_lastforumpost = $i3["lastforumpost"]; $d_paying = $i3["paying"]; $d_credits = $i3["credits"]; $d_tfriends = $i3["tfriends"]; $d_tfollowers = $i3["tfollowers"]; $d_payuntil = $i3["payuntil"]; $d_lastforum = $i3["lastforum"]; $d_laststatus = $i3["laststatus"]; $d_statusviews = $i3["statusviews"]; $d_earnings = $i3["earnings"]; $d_banned = $i3["banned"]; $d_verified = $i3["verified"]; $d_skyfeed = $i3["skyfeed"]; $d_kinaddress = $i3["kinaddress"]; $d_referredby = $i3["referredby"]; $d_budus = $i3["budus"]; } if($d_payuntil <> "0000-00-00 00:00:00"){ $d1 = new DateTime($d_payuntil); $d2 = new DateTime(date("Y-m-d H:i:s")); if($d2 < $d1){ $paid = true; }else{ $paid = false; } }else{ $paid = false; } if($getuserinfo->rowCount() == 1){ #user exists everything ok }else{ #echo 'try to reload the page. you have a session but you are not in the database. contact: daniel@budu.com or skype:danieltravolto if you have problems'; #die(); } $nowis = intval(date("YmdHi")); $updateactivity = $pdodb->prepare("UPDATE LOW_PRIORITY girls SET lastactionint=:nowis,lastact=now() WHERE ID=:sessid"); $updateactivity->bindParam(':nowis',$nowis); $updateactivity->bindParam(':sessid',$_SESSION["uid"]); $updateactivity->execute(); } function encrypt($string, $key) { $result = ''; for($i=0; $iIsSMTP(); $mail->SMTPKeepAlive =false; $mail->CharSet = 'UTF-8'; $mail->Priority = 1; $mail->SMTPDebug = 0; $mail->Timeout = 10; $mail->Port = 587; // set mailer to use SMTP $mail->Host = "smtp.elasticemail.com"; // specify main and backup server $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Username = "info@budu.com"; // SMTP username $mail->Password = "3E3447465A825369DDE10D4CDDFAD8E6CAAB"; // SMTP password $mail->From = "info@budu.com"; $mail->FromName = "budu.com"; $mail->AddAddress($to2, "budu.com"); // $mail->AddAddress("ellen@example.com"); // name is optional $mail->AddReplyTo("info@budu.com", "budu.com"); //$mail->WordWrap = 50; // set word wrap to 50 characters //$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments //$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name $mail->IsHTML(true); // set email format to HTML $mail->Subject = $subject2; $message2 = $message2 . '
====================================================
Telegram: https://www.t.me/budubiz
https://budu.com

disable, unsubscribe or set notification emails:
https://budu.com/settings.php?emailis='.$to2.'

Forgot Password:
https://budu.com/forgot_pass.php

budu.com uses https://getcode.com mobile payment app
'; $mail->Body = $message2; //$mail->AltBody = $message2; if(!$mail->Send()) { echo "Message could not be sent.

"; echo "Mailer Error: " . $mail->ErrorInfo; }else{ # echo ":::Message Sent::: ".$to2; } } function forgotpass($from2, $to2, $subject2, $message2) { #echo 'mailcheck'; $mail = new PHPMailer(true); $mail->IsSMTP(); $mail->SMTPKeepAlive =false; $mail->CharSet = 'UTF-8'; $mail->Priority = 1; $mail->SMTPDebug = 0; $mail->Timeout = 10; $mail->Port = 587; // set mailer to use SMTP $mail->Host = "smtp.elasticemail.com"; // specify main and backup server $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Username = "info@budu.com"; // SMTP username $mail->Password = "3E3447465A825369DDE10D4CDDFAD8E6CAAB"; // SMTP password $mail->From = "info@budu.com"; $mail->FromName = "budu.com"; $mail->AddAddress($to2, "budu.com"); // $mail->AddAddress("ellen@example.com"); // name is optional $mail->AddReplyTo("info@budu.com", "budu.com"); //$mail->WordWrap = 50; // set word wrap to 50 characters //$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments //$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name $mail->IsHTML(true); // set email format to HTML $mail->Subject = $subject2; $message2 = $message2 . '
====================================================
Telegram: https://www.t.me/budubiz
https://budu.com

disable, unsubscribe or set notification emails:
https://budu.com/settings.php?emailis='.$to2.'

Forgot Password:
https://budu.com/forgot_pass.php

budu.com uses https://getcode.com mobile payment app
'; $mail->Body = $message2; //$mail->AltBody = $message2; if(!$mail->Send()) { echo "Message could not be sent.

"; echo "Mailer Error: " . $mail->ErrorInfo; }else{ # echo ":::Message Sent::: ".$to2; } } function sendmail($from2, $to2, $subject2, $message2) { #echo 'mailcheck'; $mail = new PHPMailer(true); $mail->IsSMTP(); $mail->SMTPKeepAlive =false; $mail->CharSet = 'UTF-8'; $mail->Priority = 1; $mail->SMTPDebug = 0; $mail->Timeout = 10; $mail->Port = 587; // set mailer to use SMTP $mail->Host = "smtp.elasticemail.com"; // specify main and backup server $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Username = "info@budu.com"; // SMTP username $mail->Password = "3E3447465A825369DDE10D4CDDFAD8E6CAAB"; // SMTP password $mail->From = "info@budu.com"; $mail->FromName = "budu.com"; $mail->AddAddress($to2, "budu.com"); // $mail->AddAddress("ellen@example.com"); // name is optional $mail->AddReplyTo("info@budu.com", "budu.com"); //$mail->WordWrap = 50; // set word wrap to 50 characters //$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments //$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name $mail->IsHTML(true); // set email format to HTML $mail->Subject = $subject2; $message2 = $message2 . '
====================================================
Telegram: https://www.t.me/budubiz
https://budu.com

disable, unsubscribe or set notification emails:
https://budu.com/settings.php?emailis='.$to2.'

Forgot Password:
https://budu.com/forgot_pass.php

budu.com uses https://getcode.com mobile payment app
'; $mail->Body = $message2; //$mail->AltBody = $message2; if(!$mail->Send()) { echo "Message could not be sent.

"; echo "Mailer Error: " . $mail->ErrorInfo; }else{ # echo ":::Message Sent::: ".$to2; } } $cats=array("people"=>"People","nature"=>"Nature","architecture"=>"Architecture","objects"=>"Objects","funny"=>"Funny","others"=>"Others"); $a_rstatus=array("0"=>"Not Disclosed","1"=>"Single (Looking)","2"=>"Married","3"=>"Open Relationship","4"=>"Single (Not Looking)","5"=>"In Loving Relationship","6"=>"Dating Someone"); $a_liketypes=array("0"=>"Love","1"=>"Adore","2"=>"Sexy","3"=>"Gorgeous","4"=>"Beautiful","5"=>"Sweet","6"=>"Stylish","7"=>"Cute","8"=>"Funny","9"=>"Cool","10"=>"Hot"); $c_codes=array("AF"=>"Afghanistan","NL"=>"Netherlands","AN"=>"Netherlands Antilles","AL"=>"Albania","DZ"=>"Algeria","AS"=>"American Samoa","AD"=>"Andorra","AO"=>"Angola","AI"=>"Anguilla","AG"=>"Antigua and Barbuda","AE"=>"United Arab Emirates","AR"=>"Argentina","AM"=>"Armenia","AW"=>"Aruba","AU"=>"Australia","AZ"=>"Azerbaijan","BS"=>"Bahamas","BH"=>"Bahrain","BD"=>"Bangladesh","BB"=>"Barbados","BE"=>"Belgium","BZ"=>"Belize","BJ"=>"Benin","BM"=>"Bermuda","BT"=>"Bhutan","BO"=>"Bolivia","BA"=>"Bosnia and Herzegovina","BW"=>"Botswana","BR"=>"Brazil","VG"=>"Virgin Islands, British","BN"=>"Brunei","BG"=>"Bulgaria","BF"=>"Burkina Faso","BI"=>"Burundi","KY"=>"Cayman Islands","CL"=>"Chile","CK"=>"Cook Islands","CR"=>"Costa Rica","DJ"=>"Djibouti","DM"=>"Dominica","DO"=>"Dominican Republic","EC"=>"Ecuador","EG"=>"Egypt","SV"=>"El Salvador","ER"=>"Eritrea","ES"=>"Spain","ZA"=>"South Africa","ET"=>"Ethiopia","FK"=>"Falkland Islands","FJ"=>"Fiji Islands","PH"=>"Philippines","FO"=>"Faroe Islands","GA"=>"Gabon","GM"=>"Gambia","GE"=>"Georgia","GH"=>"Ghana","GI"=>"Gibraltar","GD"=>"Grenada","GL"=>"Greenland","GP"=>"Guadeloupe","GU"=>"Guam","GT"=>"Guatemala","GN"=>"Guinea","GW"=>"Guinea-Bissau","GY"=>"Guyana","HT"=>"Haiti","HN"=>"Honduras","HK"=>"Hong Kong","SJ"=>"Svalbard and Jan Mayen","ID"=>"Indonesia","IN"=>"India","IQ"=>"Iraq","IR"=>"Iran","IE"=>"Ireland","IS"=>"Iceland","IL"=>"Israel","IT"=>"Italy","TP"=>"East Timor","AT"=>"Austria","JM"=>"Jamaica","JP"=>"Japan","YE"=>"Yemen","JO"=>"Jordan","CX"=>"Christmas Island","YU"=>"Yugoslavia","KH"=>"Cambodia","CM"=>"Cameroon","CA"=>"Canada","CV"=>"Cape Verde","KZ"=>"Kazakhstan","KE"=>"Kenya","CF"=>"Central African Republic","CN"=>"China","KG"=>"Kyrgyzstan","KI"=>"Kiribati","CO"=>"Colombia","KM"=>"Comoros","CG"=>"Congo","CD"=>"Congo, The Democratic Republic of the","CC"=>"Cocos (Keeling) Islands","KP"=>"North Korea","KR"=>"South Korea","GR"=>"Greece","HR"=>"Croatia","CU"=>"Cuba","KW"=>"Kuwait","CY"=>"Cyprus","LA"=>"Laos","LV"=>"Latvia","LS"=>"Lesotho","LB"=>"Lebanon","LR"=>"Liberia","LY"=>"Libya","LI"=>"Liechtenstein","LT"=>"Lithuania","LU"=>"Luxembourg","EH"=>"Western Sahara","MO"=>"Macao","MG"=>"Madagascar","MK"=>"Macedonia","MW"=>"Malawi","MV"=>"Maldives","MY"=>"Malaysia","ML"=>"Mali","MT"=>"Malta","MA"=>"Morocco","MH"=>"Marshall Islands","MQ"=>"Martinique","MR"=>"Mauritania","MU"=>"Mauritius","YT"=>"Mayotte","MX"=>"Mexico","FM"=>"Micronesia, Federated States of","MD"=>"Moldova","MC"=>"Monaco","MN"=>"Mongolia","MS"=>"Montserrat","MZ"=>"Mozambique","MM"=>"Myanmar","NA"=>"Namibia","NR"=>"Nauru","NP"=>"Nepal","NI"=>"Nicaragua","NE"=>"Niger","NG"=>"Nigeria","NU"=>"Niue","NF"=>"Norfolk Island","NO"=>"Norway","CI"=>"Côte dIvoire","OM"=>"Oman","PK"=>"Pakistan","PW"=>"Palau","PA"=>"Panama","PG"=>"Papua New Guinea","PY"=>"Paraguay","PE"=>"Peru","PN"=>"Pitcairn","MP"=>"Northern Mariana Islands","PT"=>"Portugal","PR"=>"Puerto Rico","PL"=>"Poland","GQ"=>"Equatorial Guinea","QA"=>"Qatar","FR"=>"France","GF"=>"French Guiana","PF"=>"French Polynesia","RE"=>"Réunion","RO"=>"Romania","RW"=>"Rwanda","SE"=>"Sweden","SH"=>"Saint Helena","KN"=>"Saint Kitts and Nevis","LC"=>"St. Lucia","VC"=>"St. Vincent and the Grenadines","PM"=>"Saint Pierre and Miquelon","DE"=>"Germany","RS"=>"Serbia","ME"=>"Montenegro","SB"=>"Solomon Islands","ZM"=>"Zambia","WS"=>"Samoa","SM"=>"San Marino","ST"=>"Sao Tome and Principe","SA"=>"Saudi Arabia","SN"=>"Senegal","SC"=>"Seychelles","SL"=>"Sierra Leone","SG"=>"Singapore","SK"=>"Slovakia","SI"=>"Slovenia","SO"=>"Somalia","LK"=>"Sri Lanka","SD"=>"Sudan","FI"=>"Finland","SR"=>"Suriname","SZ"=>"Swaziland","CH"=>"Switzerland","SY"=>"Syria","TJ"=>"Tajikistan","TW"=>"Taiwan","TZ"=>"Tanzania","DK"=>"Denmark","TH"=>"Thailand","TG"=>"Togo","TK"=>"Tokelau","TO"=>"Tonga","TT"=>"Trinidad and Tobago","TD"=>"Chad","CZ"=>"Czech Republic","TN"=>"Tunisia","TR"=>"Turkey","TM"=>"Turkmenistan","TC"=>"Turks and Caicos Islands","TV"=>"Tuvalu","UG"=>"Uganda","UA"=>"Ukraine","HU"=>"Hungary","UY"=>"Uruguay","NC"=>"New Caledonia","NZ"=>"New Zealand","UZ"=>"Uzbekistan","BY"=>"Belarus","WF"=>"Wallis and Futuna","VU"=>"Vanuatu","VA"=>"Vatican City State","VE"=>"Venezuela","RU"=>"Russia","VN"=>"Vietnam","EE"=>"Estonia","US"=>"United States","VI"=>"Virgin Islands, U.S.","ZW"=>"Zimbabwe","PS"=>"Palestine","AQ"=>"Antarctica","BV"=>"Bouvet Island","IO"=>"British Indian Ocean Territory","GS"=>"South Georgia and the South Sandwich Islands","HM"=>"Heard Island and McDonald Islands","TF"=>"French Southern territories","UK"=>"UK","UM"=>"US (Minor Outlying Islands)"); function getage($bMonth,$bDay,$bYear) { list($cYear, $cMonth, $cDay) = explode("-", date("Y-m-d")); return ( ($cMonth >= $bMonth && $cDay >= $bDay) || ($cMonth > $bMonth) ) ? $cYear - $bYear : $cYear - $bYear - 1; } function zodiac ($day,$month, $year) { if ( ( $month == 3 && $day > 20 ) || ( $month == 4 && $day < 20 ) ) { $zodiac = "Aries"; } elseif ( ( $month == 4 && $day > 19 ) || ( $month == 5 && $day < 21 ) ) { $zodiac = "Taurus"; } elseif ( ( $month == 5 && $day > 20 ) || ( $month == 6 && $day < 21 ) ) { $zodiac = "Gemini"; } elseif ( ( $month == 6 && $day > 20 ) || ( $month == 7 && $day < 23 ) ) { $zodiac = "Cancer"; } elseif ( ( $month == 7 && $day > 22 ) || ( $month == 8 && $day < 23 ) ) { $zodiac = "Leo"; } elseif ( ( $month == 8 && $day > 22 ) || ( $month == 9 && $day < 23 ) ) { $zodiac = "Virgo"; } elseif ( ( $month == 9 && $day > 22 ) || ( $month == 10 && $day < 23 ) ) { $zodiac = "Libra"; } elseif ( ( $month == 10 && $day > 22 ) || ( $month == 11 && $day < 22 ) ) { $zodiac = "Scorpio"; } elseif ( ( $month == 11 && $day > 21 ) || ( $month == 12 && $day < 22 ) ) { $zodiac = "Sagittarius"; } elseif ( ( $month == 12 && $day > 21 ) || ( $month == 1 && $day < 20 ) ) { $zodiac = "Capricorn"; } elseif ( ( $month == 1 && $day > 19 ) || ( $month == 2 && $day < 19 ) ) { $zodiac = "Aquarius"; } elseif ( ( $month == 2 && $day > 18 ) || ( $month == 3 && $day < 21 ) ) { $zodiac = "Pisces"; } return $zodiac; } function makeClickableLinks($text) { $text = preg_replace('/\*\*(.*?)\*\*/', '$1', $text); $text = preg_replace_callback('/\B#(\w*[a-z0-9_-]+\w*)/i', 'hashtag_to_link', $text); return preg_replace_callback('/((((f|ht)tp(s)?:\/\/)|www)[-a-zA-Z?-??-?()0-9@:%_+.~#$?&;\/\/=]+)/i', function($matches) { if (substr($matches[0], 0 , 4) == 'www.') { // The match starts with www., add a protocol (http:// being the most common). $matches[0] = 'http://' . $matches[0]; } return '' . $matches[0] . ''; }, $text); foreach($matches as $var){ #if(strstr($var,"jpg") || strstr($var,"jpeg") || strstr($var,"gif") || strstr($var,"png")){ # $text .= ''; #} if(strstr($var[0],"youtube")){ $queryString = parse_url($var[0], PHP_URL_QUERY); parse_str($queryString, $params); if (isset($params['v'])) { $text .= ' '; } } } return $text; } function hashtag_to_link($matches) { return '' . $matches[0] . ''; } function formatlinks($text){ preg_match_all('#\bhttps?://[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/))#', $text, $matches); foreach($matches as $var){ if(strstr($var[0],"youtube")){ $queryString = parse_url($var[0], PHP_URL_QUERY); parse_str($queryString, $params); if (isset($params['v'])) { $text .= ' '; } } } return $text; } function embedyoutube($link,$options=""){ $yid = get_youtube_video_ID($link); $video = '

'; return $video; } function get_youtube_video_ID($youtube_video_url) { /** * Pattern matches * http://youtu.be/ID * http://www.youtube.com/embed/ID * http://www.youtube.com/watch?v=ID * http://www.youtube.com/?v=ID * http://www.youtube.com/v/ID * http://www.youtube.com/e/ID * http://www.youtube.com/user/username#p/u/11/ID * http://www.youtube.com/leogopal#p/c/playlistID/0/ID * http://www.youtube.com/watch?feature=player_embedded&v=ID * http://www.youtube.com/?feature=player_embedded&v=ID */ $pattern = '%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i'; // Checks if it matches a pattern and returns the value if (preg_match("/^(?:http(?:s)?:\/\/)?(?:www\.)?(?:m\.)?(?:youtu\.be\/|youtube\.com\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user)\/))([^\?&\"'>]+)/", $youtube_video_url, $matches)) { return $matches; } // if no match return false. return false; } function get_time_ago($time_stamp) { $time_difference = strtotime('now') - $time_stamp; $units = [ 'year' => 60 * 60 * 24 * 365.242199, 'month' => 60 * 60 * 24 * 30.4368499, 'week' => 60 * 60 * 24 * 7, 'day' => 60 * 60 * 24, 'hour' => 60 * 60, 'minute' => 60 ]; foreach ($units as $unit_name => $unit) { if ($time_difference >= $unit) { $num = floor($time_difference / $unit); return $num . ' ' . ($num > 1 ? $unit_name . 's' : $unit_name) . ' ago'; } } return 'just now'; } function get_time_ago_string($time_stamp, $divisor, $time_unit) { $time_difference = strtotime("now") - $time_stamp; $time_units = floor($time_difference / $divisor); settype($time_units, 'string'); if ($time_units === '0') { return '1 minute '; } elseif ($time_units === '1') { return '1 ' . $time_unit . 's '; } else { /* * More than "1" $time_unit. This is the "plural" message. */ // TODO: This pluralizes the time unit, which is done by adding "s" at the end; this will not work for i18n! return $time_units . ' ' . $time_unit . ''; } } function insert_notify($toid,$notifymsg,$notifyurl){ global $pdodb; if($_SESSION["uid"] > 0){ $fromid = $_SESSION["uid"]; }else{ $fromid = 1; } $stmt2 = $pdodb->prepare("INSERT INTO notifications(notifymsg,notifyurl,fromid,toid,whenpost) VALUES(:notifymsg ,:notifyurl,:fromid,:toid,now()) "); $stmt2->bindParam(':fromid',$fromid,PDO::PARAM_INT); $stmt2->bindParam(':toid',$toid); $stmt2->bindParam(':notifyurl',$notifyurl); $stmt2->bindParam(':notifymsg',$notifymsg); $stmt2->execute(); $stmt = $pdodb->prepare("UPDATE LOW_PRIORITY girls SET nnotify=nnotify+1 WHERE ID=:toid LIMIT 1"); $stmt->bindParam(':toid',$toid); $stmt->execute(); } function alert($text){ } function analyzetext($text){ return $text; } function is_ani($filename) { if(!($fh = @fopen($filename, 'rb'))) return false; $count = 0; //an animated gif contains multiple "frames", with each frame having a //header made up of: // * a static 4-byte sequence (\x00\x21\xF9\x04) // * 4 variable bytes // * a static 2-byte sequence (\x00\x2C) // We read through the file til we reach the end of the file, or we've found // at least 2 frame headers while(!feof($fh) && $count < 2) { $chunk = fread($fh, 1024 * 100); //read 100kb at a time $count += preg_match_all('#\x00\x21\xF9\x04.{4}\x00\x2C#s', $chunk, $matches); } fclose($fh); return $count > 1; } function getuserdata($userid){ global $pdodb; $getuserinfo = $pdodb->prepare("SELECT emailis,username FROM girls WHERE ID=:userid LIMIT 1"); $getuserinfo->bindParam(':userid',$userid); $getuserinfo->execute(); while($i3=$getuserinfo->fetch()) { $data["email"] = $i3["emailis"]; $data["username"] = $i3["username"]; } return $data; } function getUrlName($utf8Name) { $urlName = $utf8Name; $zeichen = Array("/ä/","/ö/","/ü/","/Ä/","/Ö/","/Ü/","/ß/","/ /","/\./"); $replace = Array("ae","oe","ue","Ae","Oe","Ue","ss","-","-"); $urlName = preg_replace($zeichen, $replace, $urlName); $urlName = preg_replace("/[^a-zA-Z0-9_-]/" , "" , $urlName); $zeichen = Array("/---/","/--/"); $replace = Array("-","-"); $urlName = preg_replace($zeichen, $replace, $urlName); $urlName = substr(strtolower($urlName), 0, 100); $urlName = trim($urlName, "-"); return $urlName; } function updatefollowercount($whoid){ global $pdodb; $stmt = $pdodb->prepare("SELECT ID FROM followers WHERE toid=:toid"); $stmt->bindParam(':toid',$whoid,PDO::PARAM_INT); $stmt->execute(); $nfollowers = $stmt->rowCount(); $stmt = $pdodb->prepare("SELECT ID FROM followers WHERE fromid=:fromid"); $stmt->bindParam(':fromid',$whoid,PDO::PARAM_INT); $stmt->execute(); $nfollowing = $stmt->rowCount(); $stmt = $pdodb->prepare("UPDATE LOW_PRIORITY girls SET tfollowers=:nfollowers, tfollowing=:nfollowing WHERE ID=:updateid"); $stmt->bindParam(':updateid',$whoid,PDO::PARAM_INT); $stmt->bindParam(':nfollowers',$nfollowers,PDO::PARAM_INT); $stmt->bindParam(':nfollowing',$nfollowing,PDO::PARAM_INT); $stmt->execute(); } function save_rseo_nofollow($content) { $content2 = preg_replace_callback('~<(a\s[^>]+)>~isU', "cb2", $content); return $content2; } function cb2($match) { list($original, $tag) = $match; // regex match groups if (stripos($tag, "nofollow")) { return $original; }else { return "<$tag rel='nofollow'>"; } } function neat_trim($str, $n, $delim='…') { $len = strlen($str); if ($len > $n) { preg_match('/(.{' . $n . '}.*?)\b/', $str, $matches); return rtrim($matches[1]) . $delim; } else { return $str; } } function getGeoCode($address) { global $googleapikey; global $geocode; // Eingabe: Adresse, z.B. 1600 Amphitheatre Parkway Mountain View, CA // Ausgabe: Lat und Lon global $language; $language = "en"; $address = urlencode($address); # $url = "https://maps.googleapis.com/maps/api/geocode/json?address=$address&language=$language&sensor=true&key=$googleapikey"; $url = "https://us1.locationiq.com/v1/search.php?key=".$geocode."&q=".$address."&format=json"; #echo $url; $results = file_get_contents_curl($url); #print_r($results); $results = json_decode($results,1); /* $n_address_items = sizeOf($results["results"][0]["address_components"]); for($i=0;$i<$n_address_items;$i++) { $tmp = $results["results"][0]["address_components"][$i]["types"][0]; if($tmp=="locality"){ $city = $results["results"][0]["address_components"][$i]["long_name"]; } } */ #$geoCode["city"] = $city; # $geoCode["lat"] = $results["results"][0]["geometry"]["location"]["lat"]; # $geoCode["lon"] = $results["results"][0]["geometry"]["location"]["lng"]; #$geoCode["city"] = $city; $geoCode["lat"] = $results[0]["lat"]; $geoCode["lon"] = $results[0]["lon"]; return $geoCode; } function file_get_contents_curl($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser. curl_setopt($ch, CURLOPT_URL, $url); $data = curl_exec($ch); curl_close($ch); return $data; } function cleanstring($string) { $c = mb_detect_encoding($string, mb_detect_order(), true); $string = iconv($c, 'ASCII//TRANSLIT',$string); $string = str_replace(' ', '-', $string); // Replaces all spaces with hyphens. $string = str_replace('/', '-', $string); // Replaces all spaces with hyphens. $string = preg_replace('/[^A-Za-z0-9\-üÜöÖäÄ]/', '', $string); // Removes special chars. return preg_replace('/-+/', '-', $string); // Replaces multiple hyphens with single one. } function unaccent($string) { if (strpos($string = htmlentities($string, ENT_QUOTES, 'UTF-8'), '&') !== false) { $string = html_entity_decode(preg_replace('~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|tilde|uml);~i', '$1', $string), ENT_QUOTES, 'UTF-8'); } return $string; } function unsubscribe($cid){ global $pdodb; $stmt = $pdodb->prepare("DELETE FROM subscribeto WHERE cid=:cid AND mid=:mid LIMIT 1"); $stmt->bindParam(':cid',$cid); $stmt->bindParam(':mid',$_SESSION["uid"],PDO::PARAM_INT); $stmt->execute(); $stmt3 = $pdodb->prepare("SELECT ID FROM subscribeto WHERE cid=:cid"); $stmt3->bindParam(':cid',$cid); $stmt3->execute(); $nmembers = $stmt3->rowCount(); $stmt2 = $pdodb->prepare("UPDATE LOW_PRIORITY forums SET nmembers=:nmembers WHERE ID=:cid"); $stmt2->bindParam(':cid',$cid); $stmt2->bindParam(':nmembers',$nmembers); $stmt2->execute(); echo 'unsubscribed'; } function subscribeto($cid){ global $pdodb; $stmt = $pdodb->prepare("SELECT ID FROM subscribeto WHERE cid=:cid AND mid=:mid LIMIT 1"); $stmt->bindParam(':cid',$cid); $stmt->bindParam(':mid',$_SESSION["uid"],PDO::PARAM_INT); $stmt->execute(); if($stmt->rowCount() == 0){ $stmt2 = $pdodb->prepare("INSERT INTO subscribeto(cid,mid) VALUES(:cid ,:mid) "); $stmt2->bindParam(':cid',$cid); $stmt2->bindParam(':mid',$_SESSION["uid"],PDO::PARAM_INT); $stmt2->execute(); echo 'now subscribed'; $stmt2 = $pdodb->prepare("UPDATE LOW_PRIORITY girls SET subscriptions=subscriptions+1 WHERE ID=:cid"); $stmt2->bindParam(':cid',$_SESSION["uid"]); $stmt2->execute(); $stmt3 = $pdodb->prepare("SELECT ID FROM subscribeto WHERE cid=:cid"); $stmt3->bindParam(':cid',$cid); $stmt3->execute(); $nmembers = $stmt3->rowCount(); $stmt2 = $pdodb->prepare("UPDATE LOW_PRIORITY forums SET nmembers=:nmembers WHERE ID=:cid"); $stmt2->bindParam(':cid',$cid); $stmt2->bindParam(':nmembers',$nmembers); $stmt2->execute(); }else{ echo 'already joined'; } $stmt3 = $pdodb->prepare("SELECT ID FROM subscribeto WHERE cid=:cid"); $stmt3->bindParam(':cid',$cid); $stmt3->execute(); $nmembers = $stmt3->rowCount(); $stmt2 = $pdodb->prepare("UPDATE LOW_PRIORITY forums SET nmembers=:nmembers WHERE ID=:cid"); $stmt2->bindParam(':cid',$cid); $stmt2->bindParam(':nmembers',$nmembers); $stmt2->execute(); } function linkfound($str){ if(strstr($str,".com") || strstr($str,".de") || strstr($str,"http://") || strstr($str,"https://")){ return true; }else{ return false; } } function mailq($emailis,$title,$desc,$pid){ global $pdodb; $stmt = $pdodb->prepare("INSERT IGNORE INTO mailq (emailis, titleis,mid,msgis,pid) VALUES(:emailis, :titleis,:mid,:descis,:pid)"); $stmt->bindParam(':titleis',$title); $stmt->bindParam(':emailis',$emailis); $stmt->bindParam(':descis',$desc); $stmt->bindParam(':mid',$_SESSION["uid"],PDO::PARAM_INT); $stmt->bindParam(':pid',$pid,PDO::PARAM_INT); $stmt->execute(); } function unique_multidim_array($array, $key) { $temp_array = array(); $i = 0; $key_array = array(); foreach($array as $val) { if (!in_array($val[$key], $key_array)) { $key_array[$i] = $val[$key]; $temp_array[$i] = $val; } $i++; } return $temp_array; } function socketlabs($to2, $subject2, $message2) { #echo 'using socketlabs'; $mail = new PHPMailer(); $mail->IsSMTP(); $mail->SMTPKeepAlive = true; $mail->Priority = 1; $mail->SMTPDebug = 0; $mail->Timeout = 45; // set mailer to use SMTP $mail->Host = "smtp.sendgrid.net"; // specify main and backup server $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Port = 587; $mail->Username = "apikey"; // SMTP username $mail->Password = "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"; // SMTP password $mail->From = "info@budu.com"; $mail->FromName = "budu.com"; $mail->AddAddress($to2, "budu.com"); // $mail->AddAddress("ellen@example.com"); // name is optional $mail->AddReplyTo("info@budu.com", "budu.com"); $mail->SetFrom("info@budu.com","budu.com", 0); //$mail->WordWrap = 50; // set word wrap to 50 characters //$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments //$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name //$mail->IsHTML(true); // set email format to HTML $message2 .= " =============================================== Telegram Channel: https://www.t.me/buducom "; $mail->Subject = $subject2; $mail->Body = $message2; //$mail->AltBody = $message2; //echo $to2; if(!$mail->Send()) { echo "Message could not be sent.

"; echo "Mailer Error: " . $mail->ErrorInfo; }else{ #echo 'message sent '.$to2; } } function unsubscribetopage($cid){ global $pdodb; $stmt = $pdodb->prepare("DELETE FROM pagesubscriptions WHERE cid=:cid AND mid=:mid LIMIT 1"); $stmt->bindParam(':cid',$cid); $stmt->bindParam(':mid',$_SESSION["uid"],PDO::PARAM_INT); $stmt->execute(); $stmt3 = $pdodb->prepare("SELECT ID FROM pagesubscriptions WHERE cid=:cid"); $stmt3->bindParam(':cid',$cid); $stmt3->execute(); $nmembers = $stmt3->rowCount(); $stmt2 = $pdodb->prepare("UPDATE LOW_PRIORITY forums SET nmembers=:nmembers WHERE ID=:cid"); $stmt2->bindParam(':cid',$cid); $stmt2->bindParam(':nmembers',$nmembers); $stmt2->execute(); echo 'unsubscribed'; } function subscribetopage($cid){ global $pdodb; $stmt = $pdodb->prepare("SELECT ID FROM pagesubscriptions WHERE pageid=:cid AND mid=:mid LIMIT 1"); $stmt->bindParam(':cid',$cid); $stmt->bindParam(':mid',$_SESSION["uid"],PDO::PARAM_INT); $stmt->execute(); if($stmt->rowCount() == 0){ $stmt2 = $pdodb->prepare("INSERT INTO pagesubscriptions(pageid,mid) VALUES(:cid ,:mid) "); $stmt2->bindParam(':cid',$cid); $stmt2->bindParam(':mid',$_SESSION["uid"],PDO::PARAM_INT); $stmt2->execute(); echo 'now subscribed'; $stmt3 = $pdodb->prepare("SELECT ID FROM pagesubscriptions WHERE pageid=:cid"); $stmt3->bindParam(':cid',$cid); $stmt3->execute(); $nmembers = $stmt3->rowCount(); $stmt2 = $pdodb->prepare("UPDATE LOW_PRIORITY pages SET subscribers=:nmembers WHERE ID=:cid"); $stmt2->bindParam(':cid',$cid); $stmt2->bindParam(':nmembers',$nmembers); $stmt2->execute(); }else{ echo 'already joined'; } $stmt3 = $pdodb->prepare("SELECT ID FROM pagesubscriptions WHERE pageid=:cid"); $stmt3->bindParam(':cid',$cid); $stmt3->execute(); $nmembers = $stmt3->rowCount(); $stmt2 = $pdodb->prepare("UPDATE LOW_PRIORITY pages SET subscribers=:nmembers WHERE ID=:cid"); $stmt2->bindParam(':cid',$cid); $stmt2->bindParam(':nmembers',$nmembers); $stmt2->execute(); } function addtip($toid,$amount){ global $pdodb; #echo 'addtip'; $stmt2 = $pdodb->prepare("INSERT INTO tipsreceived(fromid,toid,howmuch,whentip) VALUES(:fromid,:toid,:howmuch,now())"); $stmt2->bindParam(':fromid',$_SESSION["uid"]); $stmt2->bindParam(':toid',$toid); $stmt2->bindParam(':howmuch',$amount); $stmt2->execute(); } function unjoingroup($cid){ global $pdodb; $stmt = $pdodb->prepare("DELETE FROM groupsubs WHERE groupid=:cid AND mid=:mid LIMIT 1"); $stmt->bindParam(':cid',$cid); $stmt->bindParam(':mid',$_SESSION["uid"],PDO::PARAM_INT); $stmt->execute(); $stmt3 = $pdodb->prepare("SELECT ID FROM groupsubs WHERE groupid=:cid"); $stmt3->bindParam(':cid',$cid); $stmt3->execute(); $nmembers = $stmt3->rowCount(); $stmt2 = $pdodb->prepare("UPDATE LOW_PRIORITY groups SET nsubs=:nmembers WHERE ID=:cid"); $stmt2->bindParam(':cid',$cid); $stmt2->bindParam(':nmembers',$nmembers); $stmt2->execute(); echo 'subscribed'; } function joingroup($cid){ global $pdodb; $stmt = $pdodb->prepare("SELECT ID FROM groupsubs WHERE groupid=:cid AND mid=:mid LIMIT 1"); $stmt->bindParam(':cid',$cid); $stmt->bindParam(':mid',$_SESSION["uid"],PDO::PARAM_INT); $stmt->execute(); if($stmt->rowCount() == 0){ $stmt2 = $pdodb->prepare("INSERT INTO groupsubs(groupid,mid) VALUES(:cid ,:mid) "); $stmt2->bindParam(':cid',$cid); $stmt2->bindParam(':mid',$_SESSION["uid"],PDO::PARAM_INT); $stmt2->execute(); echo 'now subscribed'; #$stmt2 = $pdodb->prepare("UPDATE LOW_PRIORITY girls SET subscriptions=subscriptions+1 WHERE ID=:cid"); #$stmt2->bindParam(':cid',$_SESSION["uid"]); #$stmt2->execute(); $stmt3 = $pdodb->prepare("SELECT ID FROM groupsubs WHERE groupid=:cid"); $stmt3->bindParam(':cid',$cid); $stmt3->execute(); $nmembers = $stmt3->rowCount(); $stmt2 = $pdodb->prepare("UPDATE LOW_PRIORITY groups SET nsubs=:nmembers WHERE ID=:cid"); $stmt2->bindParam(':cid',$cid); $stmt2->bindParam(':nmembers',$nmembers); $stmt2->execute(); }else{ echo 'already joined'; } $stmt3 = $pdodb->prepare("SELECT ID FROM subscribeto WHERE cid=:cid"); $stmt3->bindParam(':cid',$cid); $stmt3->execute(); $nmembers = $stmt3->rowCount(); $stmt2 = $pdodb->prepare("UPDATE LOW_PRIORITY forums SET nmembers=:nmembers WHERE ID=:cid"); $stmt2->bindParam(':cid',$cid); $stmt2->bindParam(':nmembers',$nmembers); $stmt2->execute(); } function influencepoint($mid,$points=1){ global $pdodb; $stmt2 = $pdodb->prepare("INSERT IGNORE INTO influencers(mid, daypoints,weekpoints) VALUES(:mid,:daypoints,:weekpoints) ON DUPLICATE KEY UPDATE daypoints=daypoints+:daypoints,weekpoints=weekpoints+:daypoints"); $stmt2->bindParam(':mid',$mid); $stmt2->bindParam(':daypoints',$points); $stmt2->bindParam(':weekpoints',$points); $stmt2->execute(); } function todo(){ global $d_verified; $i[] = 'Share your profile in the Miss ranky contest'; $i[] = 'Write in your own Blog'; $i[] = 'Write in your own group'; $i[] = 'Post a Status'; $i[] = 'Post a Classified'; if($d_verified <> 1){ $i[] = 'Get Verified'; } $randkey = array_rand($i,1); return $i[$randkey]; } function cmtofeet($cm) { $inches = ceil($cm/2.54); $feet = floor(($inches/12)); $measurement = $feet."' ".($inches%12).'"'; return $measurement; } function mask_email($email, $char_shown_front = 1, $char_shown_back = 1) { $mail_parts = explode('@', $email); $username = $mail_parts[0]; $len = strlen($username); if ($len < $char_shown_front or $len < $char_shown_back) { return implode('@', $mail_parts); } //Logic: show asterisk in middle, but also show the last character before @ $mail_parts[0] = substr($username, 0, $char_shown_front) . str_repeat('*', $len - $char_shown_front - $char_shown_back) . substr($username, $len - $char_shown_back, $char_shown_back); return implode('@', $mail_parts); } function firstwords($str,$words=2,$del="-"){ $str = preg_replace('/[^A-Za-z0-9\- ]/', '', $str); $str = htmlspecialchars($str); $split = explode(" ",trim($str)); for($i=0;$i<$words;$i++){ $sentence .= $split[$i].$del; } $sentence = rtrim($sentence, $del); return $sentence; } function lastword($str){ $str2 = explode(' ', $str); $str2 = array_pop($str2); return $str2; } function hashclick($text){ #$text = eregi_replace('@([_0-9a-z-]+)',' @\\1', $text); return $text; } function langtime($time){ global $la; $newstr = $time; if($la == "de"){ $newstr = str_replace("hodiny","Stunde her",$newstr); $newstr = str_replace("hodiny","Stunden her",$newstr); $newstr = str_replace("Měsíce","Monat her",$newstr); $newstr = str_replace("Měsíce","Monate her",$newstr); $newstr = str_replace("minuty","Minute her",$newstr); $newstr = str_replace("minuty","Minuten her",$newstr); return $newstr; }elseif($la == "es"){ $newstr = str_replace("hodiny","hora",$newstr); $newstr = str_replace("hodiny","horas",$newstr); $newstr = str_replace("Měsíce","mes",$newstr); $newstr = str_replace("Měsíce","meses",$newstr); $newstr = str_replace("minuty","minuto",$newstr); $newstr = str_replace("minuty","minutos",$newstr); return $newstr; }else{ return $time; } } function getHashtags($string) { $hashtags= FALSE; preg_match_all("/(#\w+)/u", $string, $matches); if ($matches) { $hashtagsArray = array_count_values($matches[0]); $hashtags = array_keys($hashtagsArray); } return $hashtags; } function randomuser() { $alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; $pass = array(); //remember to declare $pass as an array $alphaLength = strlen($alphabet) - 1; //put the length -1 in cache for ($i = 0; $i < 8; $i++) { $n = rand(0, $alphaLength); $pass[] = $alphabet[$n]; } return implode($pass); //turn the array into a string } function randomPassword() { $alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; $pass = array(); //remember to declare $pass as an array $alphaLength = strlen($alphabet) - 1; //put the length -1 in cache for ($i = 0; $i < 8; $i++) { $n = rand(0, $alphaLength); $pass[] = $alphabet[$n]; } return implode($pass); //turn the array into a string } function milestokm($miles){ $ratio = 1.609344; $kms = $miles * $ratio; return round($kms); } function replaceAnchorTags($text) { // This pattern matches tags with any attributes and captures the text between and $anchorPattern = '/]*>(.*?)<\/a>/i'; $replacement = 'you have to login to see the url'; return preg_replace($anchorPattern, $replacement, $text); } function estimateReadingTime($text, $wpm = 200) { // Count the number of words in the text $wordCount = str_word_count($text); // Calculate the reading time $readingTime = ceil($wordCount / $wpm); return $readingTime; } function generateYouTubeEmbedCode($url) { // Extract video ID from various YouTube URL formats preg_match('/(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/i', $url, $matches); $videoId = $matches[1]; return '

' . '
'; } function getytid($url) { // Extract video ID from various YouTube URL formats preg_match('/(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/i', $url, $matches); $videoId = $matches[1]; return $videoId ; } function createUrlString($string) { // Convert the string to lowercase. Use mb_strtolower to support multibyte characters $string = mb_strtolower($string, 'UTF-8'); // Replace non-alphanumeric characters with spaces, allowing Unicode letters and numbers // \p{L} matches any kind of letter from any language // \p{N} matches any kind of numeric character in any script $string = preg_replace('/[^\p{L}\p{N}\s]/u', ' ', $string); // Trim leading and trailing spaces $string = trim($string); // Replace multiple spaces with a single space $string = preg_replace('/\s+/u', ' ', $string); // Split the string into words $words = explode(' ', $string); // Keep only the first 10 words $words = array_slice($words, 0, 10); // Join the words with dashes $urlString = implode('-', $words); return $urlString; } function logErrors($error) { global $pdodb; try { $sql = "INSERT INTO donatedebug (debugtext) VALUES (:errorlog)"; $stmt = $pdodb->prepare($sql); $stmt->bindParam(":errorlog", $error); $stmt->execute(); } catch (PDOException $e) { // Consider logging this to a file since the database logging failed error_log("Failed to log error to database: " . $e->getMessage()); } } // Get the document root path $documentRoot = $_SERVER['DOCUMENT_ROOT']; function getJsVersion($relFilePath) { global $documentRoot; $filePath = $documentRoot . '' . $relFilePath; $lastModified = filemtime($filePath); return $lastModified; } function getaititle($message) { $url = "https://api.openai.com/v1/chat/completions"; $headers = array( "Content-Type: application/json", "Authorization: Bearer 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" ); $data = array( "model" => "gpt-3.5-turbo", "messages" => array( array( "role" => "user", "content" => $message ) ), "temperature" => 0.7 ); $ch = curl_init($url); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); #var_dump($response); $result = json_decode($response, true); return $result["choices"][0]["message"]["content"]; } function getadvchat($message) { $url = "https://api.openai.com/v1/chat/completions"; $headers = array( "Content-Type: application/json", "Authorization: Bearer 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" ); $data = array( "model" => "gpt-4-0125-preview", "messages" => array( array( "role" => "user", "content" => $message ) ), "temperature" => 0.7 ); $ch = curl_init($url); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); #var_dump($response); $result = json_decode($response, true); return $result["choices"][0]["message"]["content"]; } ?>