0) { $rs=mysql_fetch_assoc($result); $cookie['nickname']=$rs['nickname']; $cookie['id']=$rs['id']; $cookie['type']=$rs['type']; } else { setcookie("remuser", "", time()-3600, "/"); $cookie['nickname']=false; } ?> "\n\n|-ul|\n\n", "/\|-ol\|/" => "\n\n|-ol|\n\n", "/\|ul-\|/" => "\n\n|ul-|\n\n", "/\|ol-\|/" => "\n\n|ol-|\n\n", "/^(\n){1,}/" => "", "/(\n){1,}$/" => "", "/\n/" => "\n
", "/(\n
){2,}/" => "

\n

", "/\|h2\-\|(.*?)\|\-h2\|/" => "

\\1

", "/\|h3\-\|(.*?)\|\-h3\|/" => "

\\1

", "/\|h4\-\|(.*?)\|\-h4\|/" => "

\\1

", "/\|strong\-\|(.*?)\|\-strong\|/" => "\\1", "/\|ins\-\|(.*?)\|\-ins\|/" => "\\1", "/\|em\-\|(.*?)\|\-em\|/" => "\\1", "/\|link\-(.*?)\|(.*?)\|\-link\|/" => "\\2", "/\|linknf\-(.*?)\|(.*?)\|\-linknf\|/" => "\\2", "/\|img\-(.*?)\|(~(.*?)~)(.*?)\|\-img\|/" => "\"\\1\"\\2", "/\|img\-(.*?)\|(.*?)\|\-img\|/" => "\"\\1\"", "/\|color\-(.*?)\|(.*?)\|\-color\|/" => "\\2", "/~(.*?)~/" => "id=\"\\1\"", "/\^(.*?)\^/" => "class=\"\\1\"", "/1.\t/" => "•\t", "/2.\t/" => "•\t", "/3.\t/" => "•\t", "/4.\t/" => "•\t", "/5.\t/" => "•\t", "/6.\t/" => "•\t", "/7.\t/" => "•\t", "/8.\t/" => "•\t", "/9.\t/" => "•\t", "/10.\t/" => "•\t", "/11.\t/" => "•\t", "/12.\t/" => "•\t", "/13.\t/" => "•\t", "/14.\t/" => "•\t", "/15.\t/" => "•\t", "/16.\t/" => "•\t", "/17.\t/" => "•\t", "/18.\t/" => "•\t", "/19.\t/" => "•\t", "/20.\t/" => "•\t", "/●\t/" => "•\t", "/•\t/" => "[*]" ); $_str=preg_replace(array_keys($array), array_values($array), $_str); $_str="

".$_str."

\n"; $_str=str_replace("

\n", "

", $_str); $_str=preg_replace_callback("/\|ul\-\|(.*?)\|\-ul\|/is", "make_UL_list", $_str); $_str=preg_replace_callback("/\|ol\-\|(.*?)\|\-ol\|/is", "make_OL_list", $_str); $_str=str_replace("

    \n

    /", "

      ", $_str); $_str=str_replace("

    ", "\n
", $_str); $_str=str_replace("\n

", "\n", $_str); $_str=preg_replace("/
  • (.*?)<\/p>\n

    /", "

  • \\1
    ", $_str); $_str=preg_replace("/

    <([o|u])l><\/li>/", "<\\1l>", $_str); $_str=preg_replace("/

    <([o|u])l><\/p>\n

    class=\"(.*?)\"<\/li>/", "<\\1l class=\"\\2\">", $_str); $_str=str_replace("\t

  • ", "", $_str); $_str=str_replace("
  • ", "
  • ", $_str); $_str=str_replace("
  • ", "", $_str); $_str=preg_replace("/

    (.*?)<\/h([2-4])><\/p>/", "\\2", $_str); $_str=preg_replace("/

    (.*?)<\/h([2-4])>
    \n/", "\\2\n

    ", $_str); $_str=preg_replace("/ \/>id=\"(.*?)\"/", " id=\"\\1\" />", $_str); $_str=preg_replace("/>id=\"(.*?)\"/", " id=\"\\1\">", $_str); $_str=preg_replace("/ \/>class=\"(.*?)\"/", " class=\"\\1\" />", $_str); $_str=preg_replace("/>class=\"(.*?)\"/", " class=\"\\1\">", $_str); $_str=preg_replace("/

    <([o|u])l><\/p>\n<\/li>/", "<\\1l\\2>", $_str); $_str=str_replace("|flash_map|", "

    \n\t\t\t\t\n\t\n\t\n\t\n\t\n\t0) { echo "\n"; } } function make_sitemap($father_id, $pre) { $result=mysql_query("select `id`, `link_text`, `url` from `pages` where `father_id`=$father_id and `status`=true order by `type`, `order`, `id` asc"); if (mysql_num_rows($result)>0) { echo "
      "; while ($rs=mysql_fetch_assoc($result)) { $rsid=$rs['id']; if ($rs['url']=="index") echo "\n\t\t\t\t\t
    1. Commercial Plumbing"; else echo "\n\t\t\t\t\t
    2. ".htmlspecialchars($rs['link_text']).""; $result2=mysql_query("select `id` from pages where `father_id`='$rsid' limit 1"); if (mysql_num_rows($result2)>0) { $pre.=$rs['url']."/"; make_sitemap($rsid, $pre); $pre=substr($pre, 0, strrpos(substr($pre, 0, -1), "/"))."/"; if ($pre=="/") $pre=""; } echo "
    3. "; } echo "\n\t\t\t\t
    \n"; } } function make_options_tree($father_id) { $result=mysql_query("select `id`, `link_text`, `url`, `status`, `inmenus` from `pages` where `population`=0 and `father_id`=$father_id and `url`<>'full-list' order by `type`, `order`, `url` asc"); if (mysql_num_rows($result)>0) { echo "
      "; while ($rs=mysql_fetch_assoc($result)) { $p_status=($rs['status'])?"":" *"; $p_inner=($rs['inmenus']==true)?"":" *"; $rsid=$rs['id']; echo "\n\t\t\t\t\t
    1. ".$rs['url']."".$p_inner.$p_status." (".htmlspecialchars($rs['link_text']).")"; $result2=mysql_query("select `id` from `pages` where `father_id`='$rsid' limit 1"); if (mysql_num_rows($result2)>0) make_options_tree($rsid); echo "
    2. "; } echo "\n\t\t\t\t
    \n"; } } function make_fid_options($father_id, $depth, $edit, $father_id1) { $_edit=($edit===true)?"":" and `id`<>".$edit; $result=mysql_query("select `id`, `url`, `link_text` from `pages` where `population`=0 and `father_id`=$father_id and `type`=1 and `status`=true and `url`<>'index'$_edit order by `order`, `url` asc") or die ("Problems in query. ".mysql_error()); if (mysql_num_rows($result)>0) { while ($rs=mysql_fetch_assoc($result)) { $isselected=($father_id1==$rs['id'])?" selected=\"selected\"":""; echo "\n\t\t\t\t\t"; $rsid=$rs['id']; $result2=mysql_query("select `id` from `pages` where `father_id`=$rsid limit 1"); if (mysql_num_rows($result2)>0) { $depth++; make_fid_options($rsid, $depth, $edit, $father_id1); $depth--; } } } } function make_advertisements_list() { $result=mysql_query("select `id`, `ad_url`, `ad_name`, `ad_link_text`, `ad_type` from `advertisers` order by `id` asc") or die ("Problems in query. ".mysql_error()); if (mysql_num_rows($result)>0) { echo "
      "; while ($rs=mysql_fetch_assoc($result)) { $result2=mysql_query("select count(`city_id`) as `cities_checked` from `ads_pages` where `ad_id`=".$rs['id']) or die ("Problems in query. ".mysql_error()); if (mysql_num_rows($result2)>0) { $rs2=mysql_fetch_assoc($result2); $ad_total_cities=($rs2['cities_checked']==0)?"0":$rs2['cities_checked']; } else $ad_total_cities="0"; $has_profile=($rs['ad_url']!="")?" *":""; $type=($rs['ad_type']==1)?"free listing":"top banners"; echo "\n\t\t\t\t\t
    1. ".$rs['ad_name']." (".$rs['ad_link_text'].") [type: ".$type."]".$has_profile." (appears in ".$ad_total_cities." cities total)
    2. "; } echo "\n\t\t\t\t
    \n"; } else {echo "

    huh??

    ";} } function make_cities_checkboxes($ad_id) { $states_abbr=array("al", "ak", "az", "ar", "ca", "co", "ct", "de", "fl", "ga", "hi", "id", "il", "in", "ia", "ks", "ky", "la", "me", "md", "ma", "mi", "mn", "ms", "mo", "mt", "ne", "nv", "nh", "nj", "nm", "ny", "nc", "nd", "oh", "ok", "or", "pa", "ri", "sc", "sd", "ut", "tn", "tx", "vt", "va", "wa", "dc", "wv", "wi", "wy"); for ($i=0; $i0) { $rs=mysql_fetch_assoc($result); $total_checked=""; $all_cities_checked=""; if ($ad_id>0) { $result2=mysql_query("select count(`id`) as `cities_checked` from `pages`, `ads_pages` where `father_id`=".$rs['id']." and `id`=`city_id` and `ad_id`=".$ad_id); $rs2=mysql_fetch_assoc($result2); if ($rs2['cities_checked']>0) $total_checked="(".$rs2['cities_checked'].")"; $result3=mysql_query("select count(`id`) as `cities_total` from `pages` where `father_id`=".$rs['id']." and `status`=true and `population`>0"); $rs3=mysql_fetch_assoc($result3); if ($rs3['cities_total']==$rs2['cities_checked']) $all_cities_checked=" checked=\"checked\""; } echo "\n\t\t\t\t\t
  • \n\t\t\t\t\t\t

    ".$rs['link_text']."".$total_checked."

    \n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    \n\t\t\t\t\t
  • "; } } $result=mysql_query("select `city_id` from `ads_pages` where `ad_id`='$ad_id'") or die ("Problems in query. ".mysql_error()); if (mysql_num_rows($result)>0) { $s=""; while ($rs=mysql_fetch_assoc($result)) { $s.=",".$rs['city_id']; } echo ""; } } function ten_digits_to_phone($digits) { return "(".substr($digits, 0, 3).") ".substr($digits, 3, 3)." - ".substr($digits, 6); } function phone_to_ten_digits($phone) { return str_replace(")", "", str_replace("(", "", str_replace(" ", "", str_replace("-", "", $phone)))); } function show_contactus_form($action, $values, $legend, $p) { $states=array("al" => "Alabama", "ak" => "Alaska", "az" => "Arizona", "ar" => "Arkansas", "ca" => "California", "co" => "Colorado", "ct" => "Connecticut", "de" => "Delaware", "fl" => "Florida", "ga" => "Georgia", "hi" => "Hawaii", "id" => "Idaho", "il" => "Illinois", "in" => "Indiana", "ia" => "Iowa", "ks" => "Kansas", "ky" => "Kentucky", "la" => "Louisiana", "me" => "Maine", "md" => "Maryland", "ma" => "Massachusetts", "mi" => "Michigan", "mn" => "Minnesota", "ms" => "Mississippi", "mo" => "Missouri", "mt" => "Montana", "ne" => "Nebraska", "nv" => "Nevada", "nh" => "New Hampshire", "nj" => "New Jersey", "nm" => "New Mexico", "ny" => "New York", "nc" => "North Carolina", "nd" => "North Dekota", "oh" => "Ohio", "ok" => "Oklahoma", "or" => "Oregon", "pa" => "Pennsylvania", "ri" => "Rhode Island", "sc" => "South Carolina", "sd" => "South Dekota", "ut" => "Utah", "tn" => "Tennessee", "tx" => "Texas", "vt" => "Vermont", "va" => "Virginia", "wa" => "Washington", "dc" => "Washington DC", "wv" => "West Virginia", "wi" => "Wisconsin", "wy" => "Wyoming"); $states_options=""; foreach ($states as $k=>$v) { $selected=($values['state']==$k)?" selected=\"selected\"":""; $states_options.="\n\t\t\t\t\t\t"; } echo "
    ".$legend."
    ".$p."
    "; } ?>Problems in query. Access denied for user ''@'localhost' (using password: NO)