0 ) { $ad_table = ($xview == "showad") ? $t_ads : $t_events; $sql = "SELECT adtitle, addesc FROM $ad_table a WHERE a.adid = $xadid"; $ad = mysql_fetch_assoc(mysql_query($sql)); $no_tag_desc = strip_tags($ad["addesc"]); $desc_output = preg_replace("/\r?\n/m", " ", $no_tag_desc); $meta_description = substr($desc_output, 0, 255) . '...'; $mk = str_replace($key_strip, " ", $ad["adtitle"]); $mk = explode(" ", $mk); $meta_keywords = implode(", ", $mk); } if (($xview == "ads" ) && $xsubcatid > 0) { $misql = "SELECT thdessubcats, thebaysubcats FROM $t_subcats WHERE subcatid = $xsubcatid"; $resultado=mysql_query($misql) or die (mysql_error()); $ret = mysql_fetch_array($resultado); $segm = $ret[thdessubcats]; $sebay = $ret[thebaysubcats]; }; if (($xview == "ads" ) && $xsubcatid < 1) { $misql2 = "SELECT thdescats, thebaycats FROM $t_cats WHERE catid = $xcatid"; $resultado2=mysql_query($misql2) or die (mysql_error()); $ret2 = mysql_fetch_array($resultado2); $segm = $ret2[thdescats]; $sebay = $ret2[thebaycats]; }; if ($segm == "") {$segm = $meta_description;} ?>