require("config.php"); include("funcs1.php"); if ($md=="logout") { logout();} connect_to_db(); if ($md=="print_menu") { if($admpassw1 != $adm_passw){ $inc_passw="incorrect password !"; printpasswordform($inc_passw); exit; } setcookie("admcookpassw", $admpassw1); print_menu(); exit; } if($admcookpassw != $adm_passw){ if ($admcookpassw != ""){ $inc_passw= "Incorrect password or cookies does not work"; } printpasswordform($inc_passw); exit; } if ($md=="") print_menu(); if ($md=="create_db") create_db(); if ($md=="create_tb") create_tb(); if ($md=="sql_tb") print_sql_tb(); if ($md=="moderate") {include("funcs2.php"); moderate(); } if ($md=="adm_delete") {include("funcs2.php"); adm_delete();} if ($md=="make_ads_visible") make_ads_visible(); if ($md=="make_ads_unvisible") make_ads_unvisible(); if ($md=="admrate_ads") admrate_ads(); if ($md=="getemails") getemails($ct); function getemails($ct) { global $table_ads, $categories, $html_footer, $html_header, $dstnem; $cattitle11=$categories[$ct][0]; if ($ct==""){$cattitle11="all";} echo "
"; echo "
Home: ";
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']." No ads in this category";}
echo "
E-mail List. Category: $cattitle11
";
}
}
}
else
{
while ($row = mysql_fetch_array ($sql_res))
{
$email1112="1";
if ($row['email']!=""){
echo $row['email']."
";
}
}
}
if ($email1112=="0")
{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= "
| Close Window and Return to Admin Area: |
|
|
| 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."
|
";
$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: 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="
|
|
$inc_passw
|
|
"; echo "
| Browse Moderated Folders | |
|
"; echo "
| Make listings Visible/Invisible | |||||
|
| Delete Ads | |
|
|
| Rate Ads: | |
|
|
| Edit Ad | |
|
| Print E-Mail Lists | |||
|
|
Top:
$message |