"; echo "

Home:
E-mail List. Category: $cattitle11

"; if ($dstnem==""){ echo" (Click on the link to see listing with this email)

"; } if ($dstnem==""){ echo " print list without duplicating e-mails

"; } $sellct1="idnum, email"; if ($dstnem=="1"){ $sellct1="distinct email";} $whrecat11="catname='$ct' and"; if ($ct==""){$whrecat11="";} $sql_query="select $sellct1 from $table_ads where $whrecat11 visible=1 order by email"; $sql_res=mysql_query("$sql_query"); $email1112="0"; if ($dstnem==""){ while ($row = mysql_fetch_array ($sql_res)) { $email1112="1"; if ($row['email']!=""){ echo " ".$row['email']."
"; } } } else { while ($row = mysql_fetch_array ($sql_res)) { $email1112="1"; if ($row['email']!=""){ echo $row['email']."
"; } } } if ($email1112=="0") {echo "

No ads in this category";} echo "

"; echo " "; exit; } function make_ads_visible() { global $list_id, $table_ads; $array_id=get_array_id($list_id); foreach ($array_id as $value) { $sql_query="update $table_ads set visible=1 where idnum=$value"; mysql_query("$sql_query"); } $message=" Submissions have been replaced to the index "; admin_message($message); exit; } function admrate_ads() { global $list_id, $table_ads, $ads_rt; $array_id=get_array_id($list_id); foreach ($array_id as $value) { $sql_query="update $table_ads set adrate=$ads_rt where idnum=$value"; mysql_query("$sql_query"); } $message=" Submissions have been rated ! "; admin_message($message); exit; } function make_ads_unvisible() { global $list_id, $table_ads; $array_id=get_array_id($list_id); foreach ($array_id as $value) { $sql_query="update $table_ads set visible=2 where idnum=$value"; mysql_query("$sql_query"); } $message=" Submissions have been replaced to the unvisible folder "; admin_message($message); exit; } function adm_delete() { global $list_id, $table_ads; $array_id=get_array_id($list_id); foreach ($array_id as $value) { $sql_query="delete from $table_ads where idnum=$value"; mysql_query("$sql_query"); delete_photos($value); } $message= "

Listing has been deleted succesfully
"; admin_message($message); exit; } function logout() { setcookie("admcookpassw", "0"); printpasswordform("Log out Ok !"); exit; } function get_moder_num($vis) { global $cat_fields, $table_ads, $page, $adsonpage ; $sql_query="select count(idnum) from $table_ads where visible=$vis"; $sql_res=mysql_query("$sql_query"); $row=mysql_fetch_row($sql_res); $count=$row[0]; return $count; } function moderate() { global $cat_fields, $table_ads, $page, $adsonpage, $vis, $html_header, $html_footer; if ($vis=="0") $mode_text="new posted ads"; if ($vis=="2") $mode_text="univisible ads"; if ($vis=="3") $mode_text="ads edited by users"; $count=get_moder_num($vis); echo $html_header; echo"
Close Window and Return to Admin Area:
Browsing $mode_text
"; echo"
Pages:".moder_pages_list($count)."

"; echo get_moder_ads(); echo $html_footer; exit; } function get_moder_ads() { global $cat_fields, $gener_fields, $specific_fields, $table_ads, $ct, $page,$adsonpage, $vis, $ads_fields; $html_ads=""; $start_num=($page-1)*$adsonpage; if($page=="")$start_num=0; $sql_query="select * from $table_ads where visible=$vis order by idnum desc limit $start_num, $adsonpage"; $sql_res=mysql_query("$sql_query"); $html_ads=$html_ads."

"; while ($row = mysql_fetch_array ($sql_res)) { $html_ads=$html_ads.print_moder_ad($row); } $html_ads=$html_ads."
"; return $html_ads; } function print_moder_ad ($row) { global $cat_fields, $photos_count, $all_fields, $photo_path,$photo_url, $previewphoto_path,$prphotolimits,$pr_lim_width,$pr_lim_height, $previewphoto_url, $select_text, $real_format, $ads_fields, $categories; $html_ad="
"; $idnum=$row['idnum']; $time1=$row['time']; $date_posted=get_date($time1); $catname=$row['catname']; if ($row['login']!="") { $html_ad=$html_ad."member: ".$row['login']."
"; } $html_ad=$html_ad."Category: ".$categories[$catname][0]."
"; $html_ad=$html_ad."id: $idnum; Date posted: $date_posted
"; foreach ($ads_fields as $key => $value) { if (($row[$key]!="") and ($row[$key]!=$select_text) and ($row[$key]!='http://') and ($row[$key]!='NULL') and ($row[$key]!='null')) { if ($all_fields[$key][6]=='real') {$row[$key]=sprintf($real_format, $row[$key]);} $html_ad=$html_ad." ".$ads_fields[$key][0]." : $row[$key]
"; } } get_jpg_path($idnum); for($i=1; $i<=$photos_count; $i++) { if (file_exists($photo_path[$i])){ $html_ad=$html_ad."
Photo $i"; } } if (file_exists($previewphoto_path)){ $phlimitinfo=""; if ($prphotolimits=='yes'){ $phlimitinfo="width='$pr_lim_width' height='$pr_lim_height'"; if ($pr_lim_height==""){ $phlimitinfo="width='$pr_lim_width'"; } } $html_ad=$html_ad."
Preview Photo: "; } $html_ad=$html_ad.print_multimed1($idnum); $html_ad=$html_ad."
Edit this listing"; $html_ad=$html_ad."

"; return $html_ad; } function print_multimed1($idnum) { global $incl_mtmdfile,$multimedia_path, $multimedia_url, $multim_link; $mm_link=""; if ($incl_mtmdfile=='yes') { get_jpg_path($idnum); if (file_exists($multimedia_path)) { $mm_link="

  • Multimedia file: $multim_link
  • "; } } return $mm_link; } function moder_pages_list($ads_count) { global $adsonpage, $ct, $page, $vis; $num_pages=($ads_count-$ads_count%$adsonpage)/$adsonpage; if ($ads_count%$adsonpage > 0) {$num_pages++;} $list_pages=""; for ($i = 1; $i <= $num_pages; $i++) { if ($i != $page){ $list_pages=$list_pages."[$i]"; } else { $list_pages=$list_pages."[$i]"; } } return $list_pages; } function printpasswordform($inc_passw) { global $html_header, $html_footer; echo $html_header; echo "
    Admin Interface

    $inc_passw

    Input admin password :

    (Cookies must be set up)


    "; echo $html_footer; exit; } function print_menu() { global $html_header, $html_footer, $db_name, $table_ads, $moderating, $categories; echo $html_header; echo "
    Admin Interface

    "; echo "
    Browse Moderated Folders
    New Posted Ads (".get_moder_num("0").")
    Edited Ads by Users (".get_moder_num("3").")
    Unvisible Ads (".get_moder_num("2").")

    "; echo "
    Make listings Visible/Invisible
    Ads ID#:
    Ads ID#:
    separate by comma, e.g. if you input 12,22,34-37,40 then will be submitted ads with the following id: 12,22,34,35,36,37,40

    Delete Ads
    Ads ID#:

    Separate by comma, e.g. if you input 12,22,34-37,40 then will be deleted listings with the following id: 12,22,34,35,36,37,40

    Rate Ads:
    Ads rate: Ads ID#:

    Separate by comma, e.g. if you input 12,22,34-37,40 then will be deleted ads with the following id: 12,22,34,35,36,37,40
    All ads with rate > 0 will be placed aditionally into folder 'Best ads' ordered by rate value.

    Edit Ad
    Ad ID#:

    Print E-Mail Lists
    "; $s357=0; foreach ($categories as $key => $value) { $aa1=explode("_",$key); if($aa1[0] != 'title') { if($s357 != '1') { $s357='1'; echo "\n"; } else { $s357='0'; echo "\n"; } } } echo "
    "; print_cat_name2($key); echo "\n"; print_cat_name2($key); echo "
    Print e-mail list for all categories

    Log Out from admin. interface

    "; echo $html_footer; exit; } function print_cat_name2($key) { global $categories; echo " ".$categories[$key][0]." "; } function get_array_id($string_id) { $i=0; $string1=split(",",$string_id); foreach ($string1 as $value1) { $string2=split("-", $value1); if ($string2[1]!="") { for ($j=$string2[0];$j<=$string2[1];$j++) {$array_id[$i]=$j; $i++;} } else{$array_id[$i]=$value1; $i++;} } return $array_id; } function admin_message($message) { global $cat_fields, $photos_count, $html_header, $html_footer, $id, $ct, $categories, $ad_second_width, $left_width_sp, $exp_period; echo $html_header; echo "
    Top:  

    $message


    "; echo $html_footer; exit; } ?>