Get Started - Meet Someone Special Today At Fourth Ring Personals. Always Free and Easy!!
Want to get in on the hottest easiest FREE personals dating network? Get started today at Fourth Ring!
- It's easy!
- It's quick!
- AND NOW IT'S COMPLETELY FREE - POST A 10 DAY PERSONALS AD FOR FREE AT FOURTHRING.COM!
Rates:
//mysql variables
$user = "88date";
$pass = "date168";
$host = "mysql.88date.com";
$db_name = "88date";
$dsn = "mysql://$user:$pass@$host/$db_name"; //windows
// domain information
$url_Prefix="fourthring.com";
$full_url="http://www.fourthring.com";
$theDomainName="Fourthring Personals";
$infoEmail="info@fourthring.com";
$adminDomain="https://admin.fourthring.com";
/*
CHANGE THE FOLLOWING HARDCODED URLS:
1) /login/index.php I had to hardcode the forwarding url - didn't work with using $full_url for some reason. I think it's a server setting.
2) /billing/index.php Change the hardcoded url for the paypal return url
*/
//ALSO DON'T FORGET TO MANUALLY SET UP THE CHRON JOBS
// need to set /ad_logos and /chron folders as writeable (chmod777)
// go to fourthring.com and do crontab -l to get the cron job scripts for both chron.php and unverified.php
$link = mysql_connect($host, $user, $pass);
if (!$link) {
echo " Sorry we are having network issues. Please revisit in a short while.";
exit;
}
// set the current db
$db_selected = mysql_select_db($db_name, $link);
if (!$db_selected) {
echo" Sorry we are having network issues. Please revisit in a short while.";
exit;
}
?> function FillTemplate ($inName, $inValues=array(), $inUnhandled="delete")
{
$theTemplateFile="$inName";
if($theFile=fopen($theTemplateFile,'r')) {
$theTemplate=fread($theFile, filesize($theTemplateFile));
fclose($theFile);
}
$theKeys=array_keys($inValues);
foreach($theKeys as $theKey) {
//lok for and replace the key everywhere it occurs in the template
$theTemplate=str_replace("\{$theKey}",$inValues[$theKey],$theTemplate);
}
if('delete'==$inUnhandled){
//remove remaining keys
$theTemplate=eregi_replace('{[^ }]*}','',$theTemplate);
}
elseif ('comment' ==$inUnhandled) {
//comment remaining keys
$theTemplate=eregi_replace('{([^}]*)}','',
$theTemplate);
}
return $theTemplate;
}
function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
function chkEmailExists($email)
{
include("mySQLpref.php");
//-----------MySQL Code-------------------------------------------------------------
// Search database to see if valid user, get userID, etc
//first check if email even exists in db.
unset($emailExist);
$chkEmail="SELECT count(*) from VendorContactTbl where Email='".$email."'";
$result = mysql_query($chkEmail);
$value = mysql_result($result, 0);
if ($value!=0)
{
return true;
}
else
{
return false;
}
}
function authUser($email,$password)
{
include("mySQLpref.php");
// That user doesn't exists in DB
if (!chkEmailExists($email))
{
$errorCode="Sorry, we do not have a user by that name.";
return ($errorCode);
}
//email exists, now check password...
else
{
$userID="";
$userID=chkGoodUserPass($email,$password);
//print "the user is $userID";
//exit;
//Check if expired user.
if ($userID=="e"){
$errorCode="This account has been disabled - please contact support";
return($errorCode);
}
// User hasn't been verified yet.
if ($userID==-1) {
$errorCode="Sorry, your account has not been verified yet. Please check your email to activate your account. Click here to have your password emailed to you";
return($errorCode);
}
// Wrong Password
if (($userID=="p")||($userID==""))
{
$errorCode="Sorry, we were unable to locate a user with email:$email and the submitted password. Click here to have your password emailed to you";
return($errorCode);
}
//Check first char to see if user is either super or regular user
if ($userID{0}=="S"){
//strip off the "S"
$uid=substr($userID, 1);
logInStatus($uid,$uid);
return;
}
// Regular User
elseif (($userID{0}!="S")&&($userID>0))
{
//user is good, log them in set loggedIn status and auth to "yes";
logInStatus($userID,"reg");
return;
}
}// end else email exists
}// end function authUser();
function logInStatus($userID,$super)
{
//print "in functions user is $userID";
//Log the current session id into the db
$sessionID=session_id();
$sessionSQL="UPDATE VendorContactTbl SET sessionID='".$sessionID."' Where UserId='".$userID."'";
$result = mysql_query($sessionSQL);
if (!$result) {
print "";
die('Sorry there is unusually high traffic at this moment, please try again in a short while. ');
}
// function logs in user and sets status of loggedIn to yes;
session_register('screenName');
session_register('userID');
session_register('auth');
session_register('loggedIn');
session_register('super');
$_SESSION['screenName']=getScreenName($userID);
$_SESSION['loggedIn']="yes";
$_SESSION['auth']="yes";
$_SESSION['userID']=$userID;
$_SESSION['super']=$super;
//insert update information (time date stamp, ip address, etc).
}
function getScreenName($userID)
{
include("mySQLpref.php");
// get the screen name;
$screenName="";
$getSN="SELECT ccName from VendorContactTbl where UserId='".$userID."'";
$result = mysql_query($getSN);
$screenName = mysql_result($result, 0);
return $screenName;
}
function chkLoggedIn()
{
if ( (!array_key_exists('loggedIn',$_SESSION))||(!array_key_exists('auth',$_SESSION)) )
{
return false;
}
if( ($_SESSION['loggedIn']=="yes")&&($_SESSION['auth']=="yes") )
{
return true;
}
else
{
return false;
}
}
function chkGoodUserPass($userName,$password)
{
// This will check database if the user and password match.
include("mySQLpref.php");
$userID=0;
//-----------MySQL Code-------------------------------------------------------------
$getUserInfo="SELECT UserId, Verified, DECODE(`Password`,'vegasKey'), Super, Valid from VendorContactTbl where Email='".$userName."'";
$result = mysql_query($getUserInfo);
$row = mysql_fetch_row($result);
$UserID=$row[0];
$verified=$row[1];
$dbPassword=$row[2];
$super=$row[3];
$valid=$row[4];
//print "
sql: $getUserInfo
userid $UserID
verify $verified super $super valid $valid password: $password $dbPassword
";
// check if verified user
if ($verified!=1)
{
return -1;
}
// check if valid / expired user
if ($valid==0)
{
return "e";
}
// check password
if ($password!=$dbPassword)
{
//print "passwords don't match - $password=$dbPassword";
//exit;
return "p";
}
// check if super user
if ($super==1)
{
$UserID="S$UserID";
return $UserID;
}
// regular user
else
{
return $UserID;
}
}
function getIconImage ($userId)
{
include ('mySQLpref.php');
//Get ScreenName
$screenName=getScreenName($userId);
//Get an adId from one of their postings
$CadSQL="SELECT count(*) FROM AdShort WHERE userID=\"$userId\" AND Active=1";
$Cresult = mysql_query($CadSQL);
$Cnum = mysql_result($Cresult, 0);
if ($Cnum !=0)
{
$adSQL="SELECT adID FROM AdShort WHERE userID=\"$userId\" ";
$result = mysql_query($adSQL);
$RadID = mysql_result($result, 0);
//get image information from AdTable
$imageSql="SELECT Logo, LogoDim FROM AdTable WHERE adID=\"$RadID\" ";
$imageresult = mysql_query($imageSql);
$imagerow = mysql_fetch_row($imageresult);
$iconName=$imagerow[0];
$iconDim=$imagerow[1];
if ($iconName=="default.jpg")
{
//no photo
return ("$screenName");
}
else
{
$ifullImagePath="$adminDomain/ad_logos/".$iconName;
$dimArray=explode(",",$iconDim);
$hgt=$dimArray[0];
$wid=$dimArray[1];
//loop to get it resized until less than 110 width and height
while ( ($hgt>60)||($wid>60))
{
$hgt=($hgt*.95);
$wid=($wid*.95);
}
$iconHTML="
".$screenName."
Click To Message Me
";
return($iconHTML);
}//end else - not default .jpg
}//end if Cnum!=0 //ad exists
//no ad set up yet for the user so just return the screen name
else
{
//no Ads!
return ("$screenName");
}
}
function getUserId($adID)
{
$userSQL="SELECT userID FROM AdShort where adID=\"$adID\" ";
$result = mysql_query($userSQL);
$userData= mysql_fetch_array($result);
return $userData[0];
}
function getImageThumbSize ($imageFileName)
{
//get image information
$fullImagePath="../ad_logos/".$imageFileName;
$imageInfo=getimagesize("$fullImagePath");
$hgt=$imageInfo[1];
$wid=$imageInfo[0];
//loop to get it resized until less than 110 width and height
while ( ($hgt>150)||($wid>150))
{
$hgt=($hgt*.95);
$wid=($wid*.95);
}
//round up
$hgt=round($hgt,2);
$wid=round($wid,2);
$imageThumbSize= array ("h" => $hgt, "w" => $wid);
//print "inside function h is ".$imageThumbSize['h']." and w is ".$imageThumbSize['w'];
return($imageThumbSize);
}
function photoHTML ($PhotoFileName,$logoDim) {
include ('mySQLpref.php');
//print "
inside function photoHTML - img $PhotoFileName and dim $logoDim
";
//HARDCODED THE SPOT FOR THE IMAGES
$ifullImagePath="https://admin.fourthring.com/ad_logos/".$PhotoFileName;
$dimArray=explode(",",$logoDim);
$hgt=$dimArray[0];
$wid=$dimArray[1];
return "";
}
function superSmallImageResizer ($prefix,$imageFileName)
{
//get image information
$ifullImagePath="$url_Prefix/ad_logos/".$imageFileName;
$fullImagePath=$prefix.$imageFileName;
//print "$fullImagePath
$ifullImagePath";
$imageInfo=getimagesize("$fullImagePath");
$hgt=$imageInfo[1];
$wid=$imageInfo[0];
//loop to get it resized until less than 200 width and height
while ( ($hgt>110)||($wid>110))
{
$hgt=($hgt*.95);
$wid=($wid*.95);
}
return "";
}
function getFileContents($filename)
{
$contents="";
$FILE = fopen($filename, "r");
while (!(feof($FILE) ) ) {
$contents.= fgets($FILE, 3000);
}
return ($contents);
}
function sendVerification($email,$pw)
{
include("mySQLpref.php");
// get info for verifcation email link.
$getUserInfoSql="SELECT ccName, DECODE(`Password`,'vegasKey'), UserId, sessionID from VendorContactTbl where email='".$email."'";
$result = mysql_query($getUserInfoSql);
$verifyData= mysql_fetch_array($result);
$ccName=$verifyData[0];
$CompanyName=$verifyData[1];
$Password=$verifyData[2];
$UserId=$verifyData[3];
$sessionID=$verifyData[4];
// SendMail Code
$to=$email;
$subject = "$theDomainName Registration";
$headers ="From: $infoEmail\r\n";
$body="Dear $ccName,\n\n
Thank you for registering on $theDomainName!\n\n
You have registered with the following information:\n
Email:\t$email\n
Password:\t$Password\n
";
// If this is a send password request, no need to print out the verification link in the email
if ($pw!=1) {
$body=$body."Please click on the following link to properly activate your user account:\n
http://$url_Prefix/register/verify.php?Email=$email&UserId=$UserId&activate=$sessionID";
}
if (mail($to, $subject, $body,$headers))
{
$message="Thank you for registering with $theDomainName. Please check your $email email to activate your account.";
}
else
{
$message="Sorry, we are experience unsually high traffic. Please try back in 15 mins.";
}
return($message);
}
function emailInvoice($userID,$adID)
{
include("mySQLpref.php");
// get info for verifcation email link.
$getUserInfoSql="SELECT a1.ccName, a1.Email, a1.CompanyName, a2.Premium, a2.ExpirationDate, a2.Billcycle, a2.CreationDate from VendorContactTbl a1, AdShort a2 where a2.AdId='".$adID."' AND a1.UserId='".$userID."'";
//print "$getUserInfoSql";
$result = mysql_query($getUserInfoSql);
$userData= mysql_fetch_array($result);
$userName=$userData[0];
$userEmail=$userData[1];
$companyName=$userData[2];
$premium=$userData[3];
$expDate=$userData[4];
$billCycle=$userData[5];
$startDate=$userData[6];
//based on the billCycle rate amount find out how much time before expiration date.
$expRateSql="SELECT Time, Measurement FROM RateTable WHERE Rate='".$billCycle."'";
$result=mysql_query($expRateSql);
$row = mysql_fetch_row($result);
$expTime=$row[0];
$expMeasure=$row[1];
//get the premium rate
$PreexpRateSql="SELECT Rate FROM RateTable WHERE Time='Premium'";
$result=mysql_query($PreexpRateSql);
$pre_row = mysql_fetch_row($result);
$premiumRate=$pre_row[0];
//$adCode=getAdCode($adID,1,'',0);
$grandTotal=$billCycle;
// SendMail Code
$to=$userEmail;
$subject = "$theDomainName - Invoice";
$headers ="From: $infoEmail\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$body="Dear $userName,
Thank you for registering with $theDomainName!
This is an invoice for your recently purchased ad on $theDomainName
| $expTime $expMeasure Ad | $$billCycle |
| Featured Advertiser Upgrade | $$premiumRate |
| Total | $$grandTotal |
| This ad will run from $startDate till $expDate | |
Please click on the following link to login and edit your ad.
$full_url
Thanks!
-$theDomainName "; //print "msg $to,$subject, $body"; if (mail($to, $subject, $body,$headers)) { $message="message sent"; } else { $message="message error"; } return($message); } function getCategoryName($categoryID) { include("mySQLpref.php"); // get info for verifcation email link. $getCatNameSql="SELECT name FROM categories WHERE categoryID='".$categoryID."'"; //print""; $result = mysql_query($getCatNameSql); $catName = mysql_result($result, 0); return $catName; } //gets the breed name from the adID function getBreedName($adID) { include("mySQLpref.php"); $getCatNumzSql="SELECT Category FROM AdShort WHERE AdId='".$adID."'"; //print""; $catNumResult = mysql_query($getCatNumzSql); $catNumber = mysql_result($catNumResult, 0); $breedName=getCategoryName($catNumber); return $breedName; } //gets the gender and intent function getGender($adID) { include("mySQLpref.php"); $getCatNumzSql="SELECT Category FROM AdShort WHERE AdId='".$adID."'"; //print""; $catNumResult = mysql_query($getCatNumzSql); $catNumber = mysql_result($catNumResult, 0); switch ($catNumber) { case "1" : $breedName="DUDE|2"; break; case "2" : $breedName="CHICK|1"; break; case "3" : $breedName="GAY|4"; break; case "4" : $breedName="DYKE|3"; break; } return $breedName; } function checkCategory($submittedCategory,$userID) { include("mySQLpref.php"); // get info for verifcation email link. $getCatInfoSql="SELECT count(*) FROM AdShort WHERE UserId='".$userID."' AND Category='".$submittedCategory."'"; //print ""; $result = mysql_query($getCatInfoSql); $catData= mysql_fetch_array($result); return $catData[0]; } function sendExpirationNotice($userID,$adID,$expDate) { include("mySQLpref.php"); // get info for verifcation email link. $getUserInfoSql="SELECT ccName, Email, CompanyName from VendorContactTbl where UserId='".$userID."'"; $result = mysql_query($getUserInfoSql); $userData= mysql_fetch_array($result); $userName=$userData[0]; $userEmail=$userData[1]; $companyName=$userData[2]; //$adCode=getAdCode($adID,1,'',0); // SendMail Code $to=$userEmail; $subject = "$theDomainName - Notice Of Your Expiring Ad"; $headers ="From: $infoEmail\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $body="Dear $userName,\n\n Thank you for advertising with $theDomainName!\n\n We want to remind you that you have an ad that will expire on $expDate\n After $expDate, this ad will be deactivated and will no longer be available on our system\n\n Please click on the following link to login and extend your ad. \n $url_Prefix \n\n Thanks!\n -$theDomainName "; //print "msg $to,$subject, $body"; if (mail($to, $subject, $body,$headers)) { $message="message sent"; } else { $message="message error"; } return($message); } function dateDiff($dformat, $endDate, $beginDate) { $date_parts1=explode($dformat, $beginDate); $date_parts2=explode($dformat, $endDate); $start_date=gregoriantojd($date_parts1[0], $date_parts1[1], $date_parts1[2]); $end_date=gregoriantojd($date_parts2[0], $date_parts2[1], $date_parts2[2]); return $end_date - $start_date; } function uploadPhotoScript ($uploadFileName) { $HTTP_POST_FILES['adLogo']=$uploadFileName; // Image file upload by Bloody // http://www.bloodys.com/ // email: info@bloodys.com // If you use this script, please put a link back to http://www.bloodys.com/ print "inside the upload script
"; $path = "files/"; $max_size = 400000; $randomTime=getmicrotime(); if (is_uploaded_file($HTTP_POST_FILES['adLogo']['tmp_name'])) { if ($HTTP_POST_FILES['adLogo']['size']>$max_size) { return("error The file is too big
\n"); } if (($HTTP_POST_FILES['adLogo']['type']=="image/gif") || ($HTTP_POST_FILES['adLogo']['type']=="image/pjpeg") || ($HTTP_POST_FILES['adLogo']['type']=="image/jpeg")) { $imageFileName=$userID.$randomTime.$HTTP_POST_FILES['adLogo']['name']; //replace spaces with underlines. $goodImageFileName=str_replace(' ','_',$imageFileName); $pathFileName=$path.$goodImageFileName; print "$pathFileName
"; $res = copy($HTTP_POST_FILES['adLogo']['tmp_name'], $pathFileName); if (!$res) { return("error Upload failed!
\n"); } else { echo "upload sucessful
\n"; } // Set the post variable to display... echo "File Name: ".$goodImageFileName."
\n"; echo "File Size: ".$HTTP_POST_FILES['adLogo']['size']." bytes
\n"; echo "File Type: ".$HTTP_POST_FILES['adLogo']['type']; return($goodImageFileName); } else { return("error Wrong file type
\n"); } } } function paypal_encrypt($hash) { //Sample PayPal Button Encryption: Copyright 2006 StellarWebSolutions.com //Not for resale - license agreement at //http://www.stellarwebsolutions.com/en/eula.php global $MY_KEY_FILE; global $MY_CERT_FILE; global $PAYPAL_CERT_FILE; global $OPENSSL; $openssl_cmd = "$OPENSSL smime -sign -signer $MY_CERT_FILE -inkey $MY_KEY_FILE " . "-outform der -nodetach -binary | $OPENSSL smime -encrypt " . "-des3 -binary -outform pem $PAYPAL_CERT_FILE"; $descriptors = array( 0 => array("pipe", "r"), 1 => array("pipe", "w"), ); $process = proc_open($openssl_cmd, $descriptors, $pipes); if (is_resource($process)) { foreach ($hash as $key => $value) { if ($value != "") { //echo "Adding to blob: $key=$value\n"; fwrite($pipes[0], "$key=$value\n"); } } fflush($pipes[0]); fclose($pipes[0]); $output = ""; while (!feof($pipes[1])) { $output .= fgets($pipes[1]); } //echo $output; fclose($pipes[1]); $return_value = proc_close($process); return $output; } return "ERROR"; }; function getAdCode ($adID,$color,$breed,$featured) { //$typeUpdate="imp"; //updateStats($adID,$typeUpdate); // Record an impression for this ad $getAdSql="SELECT a1.Title, a1.Description, a1.Logo, a1.LogoDim, a1.Logo2, a1.Logo2Dim, a1.Logo3, a1.Logo3Dim, a1.Logo4, a1.Logo4Dim, a2.City, a2.State, a2.Zip, a2.Country, a3.relType, a3.hairColor, a3.eyeColor, a3.birthdate, a3.bodyType, a2.userID, a4.ccName FROM AdTable a1, AdShort a2, extraInfo a3, VendorContactTbl a4 WHERE a1.adID='".$adID."' AND a2.adID='".$adID."'AND a3.adID='".$adID."'AND a2.userID=a4.userID"; //print "$getAdSql"; $result = mysql_query($getAdSql); $row = mysql_fetch_row($result); $sql_title=$row[0]; $sql_description=$row[1]; $sql_logo=$row[2]; $sql_logoDim=$row[3]; $sql_logo2=$row[4]; $sql_logoDim2=$row[5]; $sql_logo3=$row[6]; $sql_logoDim3=$row[7]; $sql_logo4=$row[8]; $sql_logoDim4=$row[9]; $sql_city=$row[10]; $sql_state=$row[11]; $sql_zip=$row[12]; $sql_country=$row[13]; $sql_relType=$row[14]; $sql_hairColor=$row[15]; $sql_eyeColor=$row[16]; $sql_birthdate=$row[17]; $sql_bodyType=$row[18]; $sql_screenName=$row[20]; //proper the ad title and description $sql_title=ucwords($sql_title); $sql_description=ucwords($sql_description); $sql_country=ucwords($sql_country); $sql_city=ucwords($sql_city); $sql_state=strtoupper($sql_state); //calc age $byear=substr($sql_birthdate,0,4); $bmonth=substr($sql_birthdate,5,2); $bday=substr($sql_birthdate,8,2); $sql_age=calculate_age($byear,$bmonth,$bday); //adjust photo code .. if one was submitted if ($sql_logo!="") { $sql_logo=photoHTML($sql_logo,$sql_logoDim); } if ($sql_logo2!="") { $sql_logo2=photoHTML($sql_logo2,$sql_logoDim2); } if ($sql_logo3!="") { $sql_logo3=photoHTML($sql_logo3,$sql_logoDim3); } if ($sql_logo4!="") { $sql_logo4=photoHTML($sql_logo4,$sql_logoDim4); } //get the breed name hack if ($breed!="") { $breedLink=strtolower(str_replace(" ","-",$breed)); } //build the ad if (($color%2)==0) { $adTopCode="
".$sql_title; } elseif($featured==-1) { $pieces = explode("|", $breed); $fixNumber=$pieces[1]; $linkCode=""; } else { //$linkCode=""; $linkCode=""; } $adHTMLcode="
| ";
//if gender fix, then print out different text
if ($featured==-1)
{
$adHTMLcode=$adHTMLcode.
"
$sql_logo
$breed
$sql_logo
$sql_title$sql_descriptionScreen Name: $sql_screenName $breed From:$sql_city, $sql_state $sql_country Age:$sql_age yrs old $sql_hairColor hair $sql_eyeColor eyes Body:$sql_bodyType Looking for a $sql_relType relationship. Click HERE to get to know me!
|
"; if ($row[$x]=="1") { $interestString.=$interestArray[$x].", "; } } // hack for grammar if ($interestString!="") { // swap trailing comma with a period $interestString=substr_replace($interestString,".",-2); // swap last comma with 'and' $position = strrpos($interestString,","); $interestString=substr_replace($interestString," and ",$position,1); } //adjust photo code .. if one was submitted if ($sql_logo!="") { $sql_logo=photoHTML($sql_logo,$sql_logoDim); $enlargeMsg='yes'; } if ($sql_logo2!="") { $sql_logo2=photoHTML($sql_logo2,$sql_logoDim2); } if ($sql_logo3!="") { $sql_logo3=photoHTML($sql_logo3,$sql_logoDim3); } if ($sql_logo4!="") { $sql_logo4=photoHTML($sql_logo4,$sql_logoDim4); } $adHTMLcode="
Click on image to enlarge"; } $adHTMLcode.="
$sql_title
$sql_description
Screen Name: $sql_screenName
From:$sql_city, $sql_state $sql_country
$sql_age yrs old / Year of $sql_astroChinese / $sql_astroSign
Category: $breedCat
--Physical Features--
$sql_hairColor hair $sql_eyeColor eyes Body:$sql_bodyType
Ethnicity:$sql_ethnicity
--Personal--
Marital Status:$sql_maritalStatus
Education:$sql_education
Occupation:$sql_occupation | Income:$income
Smoke:$sql_smoker | Drinker:$sql_drinker
Religion: $sql_religion | Political Views:$sql_political
--Interests--
$interestString
Looking for a $sql_relType relationship.
"; //public posting $sqlReply="SELECT fromUserID, pubPosting,date FROM replyAds WHERE toAdId=\"$adID\" ORDER BY `date` DESC "; //print "sql $sqlReply"; $replyResult = mysql_query($sqlReply); while ($replyRow = mysql_fetch_array($replyResult, MYSQL_NUM)) { $userID=$replyRow[0]; $iconHTML=getIconImage($userID); $pubPosting=$replyRow[1]; $datePosted=$replyRow[2]; //skip if it's a private posting. if ($pubPosting!="") { $sql_pubPosting.="
$datePosted
$iconHTML: $pubPosting
"; } } if ($sql_pubPosting!="") { $adHTMLcode.="
Public Responses:
$sql_pubPosting
"; } $adHTMLcode.="
"; return($adHTMLcode); } function createAdLink ($adRoll,$sqlMsg, $theAdNumber) { if (!empty($adRoll)) { $adRollString=implode(",", $adRoll); //print "inside function $theAdNumber."; $adLinkCode="$theAdNumber"; return $adLinkCode; } else { return "0"; } } function calculate_age($birth_num_year,$birth_num_month,$birth_num_day) { $birth_num_month_days = date(t, mktime(0, 0, 0, $birth_num_month, $birth_num_day, $birth_num_year)); $current_num_year = date(Y); $current_num_month = date(n); $current_num_day = date(j); $current_num_month_days = date(t); if($current_num_month>$birth_num_month) { $yy = $current_num_year - $birth_num_year; $mm = $current_num_month - $birth_num_month - 1; $dd = $birth_num_month_days - $birth_num_day + $current_num_day; if($dd>$current_num_month_days) { $mm += 1; $dd -= $current_num_month_days; } } if($current_num_month < $birth_num_month) { $yy = $current_num_year - $birth_num_year - 1; $mm = $birth_num_month + $current_num_month - 1; $dd = $birth_num_month_days - $birth_num_day + $current_num_day; if($dd>$current_num_month_days) { $mm += 1; $dd -= $current_num_day; } } if($current_num_month==$birth_num_month) { if($current_num_day == $birth_num_day) { $yy = $current_num_year - $birth_num_year; $mm = 0; $dd = 0; } if($current_num_day < $birth_num_day) { $yy = $current_num_year - $birth_num_year - 1; $mm = $birth_num_month + $current_num_month - 1; $dd = $birth_num_month_days - $birth_num_day + $current_num_day; if($dd>$current_num_month_days) { $mm += 1; $dd -= $current_num_day; } } if($current_num_day>$birth_num_day) { $yy = $current_num_year - $birth_num_year; $mm = $current_num_month - 1; $dd = $birth_num_month_days - $birth_num_day + $current_num_day; if($dd>$current_num_month_days) { $mm += 1; $mm -= $current_num_month; $dd -= $current_num_month_days; } } } //$age = $yy. " years, " . $mm . " months, " . $dd . " days old"; $age = $yy; return $age; } function calcChineseZodiac($year){ // Calculate Chinese Zodiac (divide year by 12 and get modulus). 0=rat,1=Ox,2=Tiger, 3=Rabbit, 4=Dragon, 5=Snake, 6=Horse, 7=Goat, 8=Monkey, 9=Chicken, 10=Dog, 11=Pig. $chineseZodiacArray = array (0=>'Rat','Ox', 'Tiger', 'Rabbit', 'Dragon', 'Snake', 'Horse', 'Goat', 'Monkey', 'Chicken', 'Dog', 'Pig'); $modz=$year%12; $astroChinese=$chineseZodiacArray[$modz]; return $astroChinese; //print "$year : $astroChinese
"; } function calcZodiac($month,$day){ // Calculate astro sign if ($month == 1 && $day <=19) {$astroSign = "Capricorn";} if ($month == 1 && $day >=20) {$astroSign = "Aquarius";} if ($month == 2 && $day <=18) {$astroSign = "Aquarius";} if ($month == 2 && $day >=19) {$astroSign = "Pisces";} if ($month == 3 && $day <=20) {$astroSign = "Pisces";} if ($month == 3 && $day >=21) {$astroSign = "Aries";} if ($month == 4 && $day <=20) {$astroSign = "Aries";} if ($month == 4 && $day >=21) {$astroSign = "Taurus";} if ($month == 5 && $day <=20) {$astroSign = "Taurus";} if ($month == 5 && $day >=21) {$astroSign = "Gemini";} if ($month == 6 && $day <=20) {$astroSign = "Gemini";} if ($month == 6 && $day >=21) {$astroSign = "Cancer";} if ($month == 7 && $day <=21) {$astroSign = "Cancer";} if ($month == 7 && $day >=22) {$astroSign = "Leo";} if ($month == 8 && $day <=21) {$astroSign = "Leo";} if ($month == 8 && $day >=22) {$astroSign = "Virgo";} if ($month == 9 && $day <=21) {$astroSign = "Virgo";} if ($month == 9 && $day >=22) {$astroSign = "Libra";} if ($month == 10 && $day <=21) {$astroSign = "Libra";} if ($month == 10 && $day >=22) {$astroSign = "Scorpio";} if ($month == 11 && $day <=21) {$astroSign = "Scorpio";} if ($month == 11 && $day >=22) {$astroSign = "Sagittarius";} if ($month == 12 && $day <=20) {$astroSign = "Sagittarius";} if ($month == 12 && $day >=21) {$astroSign = "Capricorn";} //print "
astro:$astroSign"; return $astroSign; } function updateStats($adID,$typeUpdate){ $statsSql="SELECT Impressions,Clicks from AdStats WHERE AdID='".$adID."'"; $result = mysql_query($statsSql); $row = mysql_fetch_row($result); $impStats=$row[0]; $clicksStats=$row[1]; if($typeUpdate=="imp") { $impStats=$impStats+1; $updateStatsSql="UPDATE AdStats SET Impressions=$impStats WHERE AdId='".$adID."'"; } elseif($typeUpdate=="clicks") { $clicksStats=$clicksStats+1; $updateStatsSql="UPDATE AdStats SET Clicks=$clicksStats WHERE AdId='".$adID."'"; } //do the update $result = mysql_query($updateStatsSql); if (!$result) { print ""; die('Sorry there is unusually high traffic at this moment, please try again in a short while. '); } } ?>
Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /home/sdang/fourthring.com/get_started/index.php on line 41
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/sdang/fourthring.com/get_started/index.php on line 41
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/sdang/fourthring.com/get_started/index.php on line 42
Featured Advertising Rates
For an additional $, upgrade to become a FEATURED advertiser.
* You get 4 photos!
* Top of the page position!
We accept secure PayPal transactions for your convenience
Post Your Personals Ad in 3 Easy Steps!
Step 1. Register as an advertiser
Step 2. Login and post your ad
Step 3. Choose to be a standard or featured advertiser:
Standard Advertiser
* Includes one free photo upload
* Ad appears on lower portion of search resutls
Featured Advertiser
For an additional $, upgrade to become a FEATURED advertiser.
* You get 4 photos!
* Top of the page for search results!
Click here to get started today!

Click here to get started today!
Click here to get started today!
