= 2 ) && ( ! ( $tpn[id] == 1 ) ) ) // if >= 2 and NOT Admin . . . . { $countem = true; // User already has Two or more ads ! $message = "You are permitted TWO Ads only.
You currently have $count[0] Ads.
"; // set message } else // User has 0 or 1 Ads $countem = false; } if ( ( isset( $actionflag ) && $actionflag=="update_ad" ) && ($countem != true) && ( $message == "" ) ) // If all okay - actionflag set correctly AND user has < 2 Ads AND $message (error message) NOT set { if ( $form[URL] == "http://" ) // Empty it if not filled in $form[URL]=""; $form[TOWN] = ucwords( strtolower( stripslashes( html( $form[TOWN] ) ) ) ); // Set format $form[STATE] = ucwords( strtolower( stripslashes( html( $form[STATE] ) ) ) ); // Set format $form[AD_TITLE] = ucwords( strtolower( stripslashes( html( $form[AD_TITLE] ) ) ) ); // Set format $form[NICKNAME] = ucwords( strtolower( stripslashes( html( $form[NICKNAME] ) ) ) ); // Set format $form[AVAILABLE] = "Email Only"; // Force Value ! if ( ( $form[INCAT1] == "" ) OR $form[INCAT1] == "0" ) $form[INCAT1] = "21"; // set default INCAT1 // $catresult = checkAdCat( $user_id, $ad_id, $form[INCAT1] ); // check INCAT1 and category // if ( $catresult == false ) // $message .= "Sorry - Only one Ad in each category permitted.
"; if ( $form[SEX_ORI] == "" ) // Just in case not set $form[SEX_ORI] = 0; /* Now check the category for obvious errors ie - male setting into 'Female Seeking ...' category */ if ( ( $form[SEX_ORI] == 0 ) AND ( $form[INCAT1]==4 OR $form[INCAT1]==31 OR $form[INCAT1]==32 OR $form[INCAT1]==34 OR $form[INCAT1]==54 OR $form[INCAT1]==33 ) ) // for males $message = "Ad Category ERROR - you cannot have that Category! You said you are a Male ?"; elseif ( ( $form[SEX_ORI] == 1 ) AND ( $form[INCAT1]==3 OR $form[INCAT1]==18 OR $form[INCAT1]==19 OR $form[INCAT1]==21 OR $form[INCAT1]==53 OR $form[INCAT1]==20 ) ) // for females $message = "Ad Category ERROR - you cannot have that Category! You said you are a Female ?"; if ( $form[WHAT_SEEK] == "") // and again just in case $form[WHAT_SEEK] == 3; if ( $form[SITECODE] == "") $form[SITECODE] = $user_row[COUNTRY]; if ( trim( $form[AD_TITLE] ) == "") $form[AD_TITLE] = "No Title Given"; else $form[AD_TITLE] = eregi_replace("\'","", $form[AD_TITLE] ); //strip ' char $form[LAST_UPDATE] = date("U", time()+64800); // Set datestamp to current time in UNIX time $nowtime = date("jS M Y G:i:s", time()+64800); // Set now time in 'day/mth/yr time' format if ( $message=="" ) { /* Store it in DB */ $form[NICKNAME] = eregi_replace("\'","", $form[NICKNAME] ); // strip any ' chars $result = insertAd( $form[AD_TITLE], $form[SEX_ORI], $form[WHAT_SEEK], $form[AVAILABLE], $form[OCCUPATION], $form[PERSONALITY], $form[LOOKS], $form[PHOTO], $form[LOVE], $form[LOATHE], $form[URL], $form[APPEARCOUNTRY], $form[APPEARCITY], $form[APPEARSTATE], $form[STATUS], $form[LAST_UPDATE], $REMOTE_ADDR, $form[NICKNAME], $form[INCAT1], $form[SW_CHAT], $form[MY_SAY], $form[SITECODE], $tpn[id], $ad_id ); /* $sexori $gender and $seeking */ $gender_array = array('Male','Female','Couple'); foreach ( $gender_array as $key=>$val ) { if ( $form[SEX_ORI] == $key ) $sexori = $val; } foreach ( $gender_array as $key=>$val ) { if ( $form[GENDER] == $key ) $gender = $val; } $seeking_array = array('Nothing','Male','Female','Either','Casual','Couple','Penpal','Group'); foreach ( $seeking_array as $key=>$val ) { if ( $form[WHAT_SEEK] == $key ) $seeking = $val; } if ($ad_id == false) // Has $ad_id been set ? { $ident = $result; // no ? ... Set $ident to returned result $action = "a NEW Ad at"; } else // else must be set so ... { $ident = $ad_id; // ... set $ident to $ad_id $action = "UPDATED an Ad at"; } // email webmaster with details of ad. $to = "ads@personals.net.au"; $subject = "$ident ADULT Personal Ad Submitted"; $option = "From: updatead@personals.net.au\r\nReally_From: updatead.html\r\nX_Keyword: ADULT_updatead\r\n"; mail( $to, $subject, "User - $tpn[id] : \"$tpn[login]\" has $action https://personals.powweb.com/adminviewad.html?ad_id=$ident (ID=$ident) at $nowtime ($form[LAST_UPDATE]). Details: ======== Site: $user_row[DEFSITE] Age: $user_row[AGE] Name: $user_row[FIRSTNAME] $user_row[LASTNAME] = = = = = = = = = = = = = = = = = Title: $form[AD_TITLE] Gender: $sexori Seeking : $sexori ---> $seeking Available: $form[AVAILABLE] Occupation: $form[OCCUPATION] Nickname: $form[NICKNAME] Personality:$form[PERSONALITY] Looks: $form[LOOKS] My_Say: $form[MY_SAY] Love: $form[LOVE] Loathe: $form[LOATHE] URL: $form[URL] AppearCity: $form[APPEARCITY] AppearState: $form[APPEARSTATE] AppearCountry: $form[DEFSITE] Status: $form[STATUS] Last_Update: $form[LAST_UPDATE] RemoteAddr: $REMOTE_ADDR INCAT1: $form[INCAT1] ChatSwitch: $form[SW_CHAT] SiteCode: $form[SITECODE] User_ID: $tpn[id] Ad_ID: $ident" , $option ); // finish the mail call header( "Location: reviewads.html?".SID ); // after sending email to Webmaster with details for history } } elseif ( ! empty( $ad_id ) ) // $ad_id IS set ... { $form = $ad_row; // set $form to $ad_row values if ( $form[UID] != $tpn[id] ) // then check - Security #4 { include("../tpnheader.inc"); require("../tpnpublicnav.inc"); // Set up public Navigation buttons mail("webmaster@personals.net.au", "Unauthorised attempt at Viewing/Editing Ads", "Adult user $tpn[id] has attempted to View/Edit Ad_ID = $ad_id", "From: UpdateAd.html@personals.net.au"); print "

You are not permitted to view or edit Ads that are not your own !!
"; print "The webmaster has been notified of your attempt to view or edit someone elses Ad via unauthorised means and you will be logged out automatically.

"; $result = session_unregister("tpn"); session_destroy(); if ($result) { print "

You have been Logged Out."; } exit; } } /* Now, we set up the page for the browser */ ?>

$message
"; } if ( $countem == false ) // Does NOT have more than two ads OR is Admin. { ?>

You are permitted a maximum of TWO ads only.
Please enter all information about you, and in the correct fields.

Photos vastly increase the chances of a reply !
Please send any photos to webmaster@personals.net.au in '.jpg' format ONLY. You may have up to 2 (two) photos per Ad.
Quote your AD_ID number = as well as your Membership Number = so we know where to put it !!
A new Ad will have the Ad number available AFTER it has been submitted.
Send the image from your registered Email address please. Any photos are not to be explicit or excessively suggestive.

Answer all questions truthfully and accurately for the greatest chance of a good response.
DON'T put in "Ask Me" or similar - I've already asked you - ok ?
Also, do NOT put Contact details - Email addresses, Phone numbers etc - anywhere in the Ad.

$message
"; } ?>

Visible"; $adstatus1="1\" checked"; $adstatus2="2\""; } elseif ( $form[STATUS]==2 ) // 2 = Invisible { $status="Invisible"; $adstatus1="1\""; $adstatus2="2\" checked"; } elseif ( (! $form[STATUS] ) || $form[STATUS]==0 ) // Brand new Ad { $form[STATUS]=2; $status="New Ad"; $adstatus1="1\" checked"; $adstatus2="2\""; } else // otherwise it is Webmaster Locked ! $status="LOCKED
Queries regarding this Ad to be directed to the Webmaster
"; ?>

 Ad Current Status :  
Make Ad Visible  Make Ad Invisible  (This Ad will not be visible to others until your membership is approved)
"; ?>

Ad Title:
Ad Nickname:
You Are a:  Male,  Female, or Couple?
Ad Category:
Ad to appear in Town/City:
Nearest large population center
My State/County/Province: Your State:
Your State:
State, County, Borough or Province:

Abbreviation for Australian and US states
Ad to appear in Country:
I Seek a:
I am Available By: 
My Occupation: 
   

  My Appearance: (My height, weight, complexion, eye colour, hair colour, etc)
 
  My Personality: (Quiet, funny, noisy, optimistic, pessimistic etc)
 
  I Love: (Things you like a lot - music, movies, things you do, or want to)
 
  I Loathe: (Things you detest - Things you don't like)
 
  My Say:Tell us about you, what you seek, what you are advertising for, smoker/drinker, hobbies etc)
 
 
    Please Press Enter Details ONCE only. This may take a few seconds.
Last updated on Australian EST.