setTimezone($timezone); $dt = $date->format( 'd M Y H:i' ); $time_now = strtotime("$dt"); $title_url = $_GET['tu']; $ad_id = $_GET['aid']; $najx_id = $ad_id; $city_url = $_GET['city']; $own_url = "/$city_url/$title_url-v$ad_id.html"; $ad_details = $sanformation->ad_details($ad_id); $check_url = "/$ad_details[city_url]/$ad_details[title_url]-v$ad_id.html"; //============================= check for 404 start ====== if($ad_details[title_url] != ''){ if($check_url != $own_url) { //header('HTTP/1.1 404 Not Found'); //header("Location: 404.html"); //include '404_include.html'; header("HTTP/1.1 301 Moved Permanently"); header("Location: /$city_url"); }else{ //header("Location: $check_url"); } $activated_on = $ad_details['activated_on']; $activated_on = date("F j, Y, g:i a", $activated_on); $adids = $ad_id; $views = $ad_details['views']; $title = $ad_details['title']; $title = removetags($title); $description = $ad_details['description']; $description = removetags($description); //$description_meta = substr($description, 0, 100); $description_meta = $description; $description_meta = str_replace("\n", " ", $description_meta); $description_meta = str_replace("\r", " ", $description_meta); $description_meta = str_replace("
", " ", $description_meta); $description_meta = str_replace("
", " ", $description_meta); $description_meta = str_replace(">", " ", $description_meta); $description_meta = str_replace("<", " ", $description_meta); $description_meta = remove_any_tags($description_meta); $description_meta = substr($description_meta, 0, 100); $ad_owner_email = $ad_details['ad_owner_email']; $owner_contact_no = $ad_details['owner_contact_no']; $city_name = $ad_details['city_name']; $locations = $ad_details['locations']; $category_name = $ad_details['category_name']; $category_url = $ad_details['category_url']; $category_id = $ad_details['category_id']; $category_parents = $ad_details['category_parents']; $ind_row = $sanformation->category_details($category_parents); $ind_name = $ind_row['category_name']; $ind_url = $ind_row['category_url']; $photo = $ad_details['photo']; $image_array = explode(",",$photo); $video = $ad_details['video']; $brand = $ad_details['brand']; $price = $ad_details['price']; if($price != '0'){ $price_val = '
  • Price : Rs. '.number_format($price).'
  • '; } $owner_contact_no = $ad_details['owner_contact_no']; $ad_owner_email = $ad_details['ad_owner_email']; $show_mail = $ad_details['show_mail']; $show_no = $ad_details['show_no']; if($show_mail == '1'){ $show_mail_val = '
  • Poster Email : '.$ad_owner_email.'
  • '; } if($show_no == '1'){ $show_no_val = '
  • Poster Contact No : '.$owner_contact_no.'
  • '; } $status = $ad_details['status']; $owner_email_encode = base64_encode($ad_owner_email); //================================================================================================================================================= $host = 'localhost'; $database_name = 'dialindi_india'; $user_name = 'dialindi_shanti'; $user_password = 'shantiranjan123'; $dbh=mysql_connect ($host, $user_name, $user_password) or die('Cannot connect to the database because: ' . mysql_error()); mysql_select_db ($database_name); $sql = "SELECT * FROM `users` WHERE `mail_address_1` = '$ad_owner_email' LIMIT 0,1"; $temp = mysql_query($sql); $row = mysql_fetch_array($temp); $uid = $row[uid]; //====================================================================================================================================================================== include 'opendb.php'; $home_url = "/$city_url/"; $category_url = "/$city_url/$category_url-c$category_id"."a0p1.html"; $ind_url = "/$city_url/$ind_url-s$category_parents"."a0p1.html"; //============================================ duration calculator ================================ $dt = $date->format( 'd M Y H:i' ); $time_now = strtotime("$dt"); function Duration($s, $e){ $timestamp = $e - $s; $years=floor($timestamp/(60*60*24*365));$timestamp%=60*60*24*365; $weeks=floor($timestamp/(60*60*24*7));$timestamp%=60*60*24*7; $days=floor($timestamp/(60*60*24));$timestamp%=60*60*24; $hrs=floor($timestamp/(60*60));$timestamp%=60*60; $mins=floor($timestamp/60);$secs=$timestamp%60; /* if ($years >= 1) { $str.= $years.' years '; } if ($weeks >= 1) { $str.= $weeks.' weeks '; } if ($days >= 1) { $str.=$days.' days '; } if ($hrs >= 1) { $str.=$hrs.' hours '; } if ($mins >= 1) { $str.=$mins.' minutes '; } */ //--------------------------------------------------- if($days < 1){ if ($hrs >= 1) { $str.=$hrs.' hours '; } if ($mins >= 1) { $str.=$mins.' minutes '; } }else{ $str = '2'; } return $str; } //================================================================================================================ if($user_mail != ''){ $sq = "SELECT `b_id` FROM `bookmarked` WHERE `ad_id` = '$ad_id' AND `user_mail` = '$user_mail'"; $resb = mysql_query($sq); $bc = mysql_num_rows($resb); }else{ $bc = '2'; } ?> <?=$title;?> - <?=$category_name;?> in <?=$city_name;?> (<?=$ad_id;?>)
    > > > > Listing Details
    Add ID : | Views :

    -
      st_cut($vals); if($val != ''){ ?>
    • :
    • Brand :
    st_cut($val); if($val != ''){ if($leb != 'Price'){ ?>
    : 

    Photograph

    Videos

    Recent ads in this category
    '; while($rows = mysql_fetch_array($result)) { $plan = $rows[plan]; $ad_id = $rows[ad_id]; $title = $rows[title]; $title = removetags($title); $title_url = $rows[title_url]; $description = $rows[description]; $wordChunks = explode("
    ", $description); $description = ''; for($i = 0; $i < count($wordChunks); $i++){ $description .= "$wordChunks[$i] "; } $wordChunks = explode("
    ", $description); $description = ''; for($i = 0; $i < count($wordChunks); $i++){ $description .= "$wordChunks[$i] "; } $description = removetags($description); $description = substr($description, 0, 200); $listing_approve_date = $rows['activated_on']; $listing_approve_date_disp = date("F j, Y, g:i a", $listing_approve_date); $images = $rows[photo]; $image_array = explode(",",$images); $count_array = count($image_array); if($count_array == '1' AND $images == ''){ $cnt = '0'; }else{ $cnt = $count_array; } if($rows[photo] == 'none'){ $img = "/images/noimage.gif"; $img_cd = ''; }elseif($rows[photo] != ''){ if($count_array == '0'){ $img = "http://medias.dialindia.com/".$rows[photo]; }else{ $img = "http://medias.dialindia.com/".$image_array[0]; } $img_cd = ''; }else{ $img = "/images/noimage.gif"; $img_cd = ''; } $duration = Duration($listing_approve_date, $time_now); if($duration != '2'){ $duro = $duration.' ago'; }else{ $duro = $listing_approve_date_disp; } $locations = $rows[locations]; $locations_array = explode(",",$locations); if($locations != ''){ $loc = ''.$locations_array[0].''; }else{ $loc = ''; } $you_are = $rows[you_are]; $yr = substr($you_are, 1, 50); $yr = substr($yr, 0, -2); if($yr != ''){ $you = ''.$yr.''; }else{ $you = ''; } $price = $rows[price]; if($price != '0'){ $pric = 'Rs. '.number_format($price).''; }else{ $pric = ''; } $add_url = "http://www.dialindia.com/$city_url/$title_url-v$ad_id.html"; if($plan == '1'){ $class = "whiteboxdetails"; }elseif($plan == '2'){ $class = 'yellowboxdetails'; } $display .= '
    '.$description.'...
    '.$cnt.' photos | Posted: '.$duro.'
    '.$pric.$you.$loc.'
    '; } } echo $display; ?>
    Post your reply for this AD
    Your name
    Email
    Contact No.
    (optional - so that the poster can contact you)
    Message
    Send me copy of this mail.
    ssion = $ssion
    ".$_SESSION['pvs'.$ad_id]."
    $sql_update"; ?>