"; echo "\n
Visit the
AZooNY Band

"; echo "\n
Suggest a new
media category

"; echo "\n
Add your art!"; echo "\n"; echo "

"; google200media(); } function closeout() { global $piece, $list, $search, $lucky, $med, $c1, $c2, $cat, $artist_id, $name_first, $name_last, $no_entries; middle(); //*************************************// Middle HERE!! //********************************************// if (isset($med)&&(!isset($c1))) { echo "\n

Artwork Media Directory

"; table3("Select a catagory within \"$med\""); echo "
"; switch ($med) { case "ceramic": table3("- ceramic -
Art that is generally created from earthen materials, molded, then fired in a kilm"); break; case "collage": table3("- collage -
Individual elements grouped together or considered as a whole. A montage which may include mixed media."); break; case "digital": table3("- digital -
Broadly defined as art that has been created or modified digitally"); break; case "drawing": table3("- drawing -
The art of representing objects by means of lines and shades"); break; case "fabric": table3("- fabric -
Art produced on cloth or fabric material"); break; case "jewelry": table3("- jewelry -
Adornments made of precious metals and/or set with gems, beads, or stones"); break; case "glasswork": table3("- glasswork -
From stained glass and neon lighting to original glass sculptures"); break; case "music": table3("- music -
From underground to classical composition"); break; case "other": table3("- other art -
Artworks that don't currently have an AZooNY category or are not easily categorized"); break; case "painting": table3("- painting -
Including oil, watercolors, pastels, acrylic and variants there of"); break; case "photography": table3("- photography -
Including 35mm, medium and large format, digital and other camera related efforts"); break; case "sculpture": table3("- sculpture -
Including castings, carvings, relief and composites"); break; case "words": table3("- words -
The art of written words"); break; case "woodworking": table3("- woodworking -
Woodworking and woodcaving art"); break; } //switch } elseif (isset($lucky)) { echo "\n

AZooNY Lucky
Art Spin!


"; table3("Spin for a random selection from our catalog of artwork"); echo "
"; // table3("Visit
ArtEveryDay.com

for more art"); // echo "
"; } elseif (isset($list)) { echo "\n

AZooNY Artwork Directory

"; if ($list=="subject") { table3("Art by subject search"); table3("New art Subject and Media categories are added all the time."); // google125button(); } elseif ($list=="media") { table3("Art by media type search"); table3("New art Media and Subject categories are added all the time."); // google125button(); } else { echo "Alphabetical listing of member artists
"; echo "

"; table3("Click on an artist name to visit their AZooNY.com web pages"); echo "

"; table3("Contact an artist directly for details on their artwork"); echo "

"; google200media(); echo "


"; table3("AZooNY.com thanks you for your visit!"); echo "
"; } } elseif (isset($piece)) { echo "

AZooNY Artwork Search Results

"; echo "
Visit the AZooNY.com homepage for $name_first $name_last

"; google125button(); } elseif (isset($no_entries)) { echo "\n

AZooNY Artwork Directory

"; table3("Artwork Info
We hope for artistic works in this category soon"); table3("Search Results
No members have entries yet in this category"); } else { $i=mt_rand(0,2); echo "\n

AZooNY Artwork Directory

"; switch($i) { case 0: table3("AZooNY Index
Artists catalog their own work in the AZooNY artwork index"); break; case 1: table3("Visit ArtEveryDay.com for daily artist features"); break; case 2: table3("Artwork Info
To learn more about a particular work or artist, visit the AZooNY artist's homepage!"); break; } table3("Artwork Info
To learn more about a particular work or artist visit their AZooNY artist's homepage!"); table3("Search Results
These are just snapshots of artwork from your search request"); // table3("AZooNYcards
Send an AZooNYcard or epostcard of an artist's artwork to a friend"); google125button(); echo "
"; } bannerjoin(); //*************************************// End Middle HERE!! //********************************************// bottom('2'); } //*************************************// MAIN //********************************************// open_databases(); ///////////////////////////////// show list by type menu ////////////////////// if (isset($list)) { if ($list=="subject") { page_top('2','AZooNY | Artwork by Subject'); echo "\n

"; relevant_random("2","150","piece_status=\"1\""); echo "


"; echo "\n

Art by Subject:
"; $record = mysql_query("(select cat1 as c from catkounts) union (select cat2 as c from catkounts) union (select cat3 as c from catkounts) order by c asc"); if (!$record) { emsg("Unable to list by subject right now. Please try again later."); echo "



"; closeout(); exit(); } else { $ttt=0; while (($row = mysql_fetch_array($record))&&($ttt==0)) if ($row['c']!="") $ttt++; echo "".$row['c'].""; while ($row = mysql_fetch_array($record)) { if ($row['c']!=""); echo ", ".$row['c'].""; } //while } //else echo "

Also see: Art by Media
Art by Artist

"; // listarray(2,$categories); echo "

"; } elseif ($list=="media") { page_top('2','AZooNY | Art by Media Type'); echo "\n

"; relevant_random("2","150","piece_status=\"1\""); echo "


"; echo "\n

Art by Media:
"; $record = mysql_query("select med from catkounts group by med asc"); if (!$record) { emsg("Unable to list by media type right now. Please try again later."); echo "



"; closeout(); exit(); } else while ($row = mysql_fetch_array($record)) { if ($row['med']!="") echo " ".$row['med']." "; } echo "

Also see: Art by Subject
Art by Artist

"; echo "

"; } elseif ($list=="artist") { page_top('2','AZooNY | Art listed by Artist'); echo "\n

"; relevant_random("2","150","piece_status=\"1\""); echo "\n
"; echo "

Art by Artist:
"; // select it all except the azoony hat userid... (if database gets rebuilt watch out) $eval="select artist_id, name_last, name_first, account_type from artists where ((artist_status=\"1\")&(artist_id<>\"72\")) order by name_last asc"; $record = mysql_query($eval); if (!$record) { emsg("Error on query of artist database in catalog - please try again later"); closeout(); exit(); } while ($row = mysql_fetch_array($record)) { if ($row["account_type"] == "1") if ($row["name_first"]=="") echo "$row[name_last]
"; else echo "$row[name_last], $row[name_first]
"; else echo "$row[name_first]
"; } //while echo "\n

"; // for new artists: $eval="select name_last, name_first, artist_id, account_type from artists where ((artist_status=\"1\")&(new_member_flag=\"1\")) order by name_last asc"; $record = mysql_query($eval); if (!$record) { emsg("Error on query of artist database in catalog - please try again later"); closeout(); exit(); } $num=mysql_num_rows($record); if ($num>0) { echo "\n
New AZooNY Artists:
"; while ($row = mysql_fetch_array($record)) { if ($row["account_type"] == "1") if ($row["name_first"]=="") echo "$row[name_last]
"; else echo "$row[name_last], $row[name_first]
"; else echo "$row[name_first]
"; } //while echo "
"; } //end if $num>0 echo "
"; echo "\n

"; echo "\n   Join AZooNY.com!
"; } //else if else { page_top('2','404 file not found (AZooNY Artwork Search)'); relevant_random("2","150","piece_status=\"1\""); echo "\nCommand not recognized
"; } echo "\n
"; closeout(); exit(); } /////////////////////feeling lucky//////////////////////// if (isset($lucky)) { page_top('2','AZooNY | Get Lucky with Art!'); $eval = "SELECT piece_master_id FROM piece WHERE (piece_status=\"1\") and (piece_image1!='') ORDER BY RAND($seed) LIMIT 1"; //does not check if artist is "active".. $record = mysql_query("$eval"); if (!$record) { emsg("***Unable to obtain a lucky piece"); closeout(); exit(); } $row = mysql_fetch_array($record); $piece=$row["piece_master_id"]; // now fall through echo "

"; } ////////////////////////////// display one piece in detail ///////////////// if (isset($piece)) { $piece_master_id = $piece; // Generic display box used for more detailed search result $record_piece = mysql_query("select * from piece where piece_master_id=\"$piece_master_id\""); $row = mysql_fetch_array($record_piece); $artist_id = $row["artist_id"]; $piece_title=$row["piece_title"]; $piece_media=$row["piece_media"]; $piece_description= nl2br($row["piece_description"]); $piece_image1=$row["piece_image1"]; if (!isset($lucky)) page_top('2',$piece_title); echo "

"; if (!$record_piece) { //error logic for query above (but need the html header to go out...) emsg("Unable to find piece $piece_master_id"); closeout(); exit(); } $record_artist = mysql_query("select * from artists where artist_id=\"$artist_id\""); if (!$record_artist) { emsg("Can not load artist data for piece $piece_master_id"); exit(); } $arow = mysql_fetch_array($record_artist); $name_first = $arow["name_first"]; $name_last = $arow["name_last"]; $home_directory = $arow["home_directory"]; $email = $arow["email"]; $web_address = $arow["web_address"]; $record = mysql_query("select * from piece_details where piece_master_id=\"$piece_master_id\""); if (!$record) { emsg("Unable to find piece_details $piece_master_id"); closeout(); exit(); } $row = mysql_fetch_array($record); $piece_demension_units = $row["piece_demension_units"]; $piece_height = $row["piece_height"]; $piece_width = $row["piece_width"]; $piece_depth = $row["piece_depth"]; $piece_weight_units = $row["piece_weight_units"]; $piece_weight = $row["piece_weight"]; $piece_color = $row["piece_color"]; $piece_allow_postcard=$row["piece_allow_postcard"]; $eval = "select * from homepage where artist_id=\"$artist_id\""; $record = mysql_query("$eval"); if (!$record) { emsg("Unable to fetch homepage information."); } $row = mysql_fetch_array($record); $show_email = $row["show_email"]; $show_web_address = $row["show_web_address"]; $show_country = $row["show_country"]; $paypal_userid = $row["paypal_userid"]; echo "\n"; if (($home_directory != "") and ($piece_image1 != "")) { echo "\n"; } echo "\n
"; if ($piece_allow_postcard == "1") { echo "\n
"; echo "\n"; echo "\n
"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n
"; //end button table } echo "

$piece_title"; echo "\n
by $name_first $name_last

"; if ($piece_description == "") { echo "\n
"; } else { echo "\n$piece_description
"; } echo "\n"; // size_box($piece_height, $piece_width, $piece_depth, $piece_demensional_units, $piece_weight, $piece_weight_units); if (($piece_height!="") || ($piece_width!="") || ($piece_depth!="") || ($piece_weight!="")) echo "("; if (($piece_height!="") || ($piece_width!="") || ($piece_depth!="")) echo "size: "; $count = 0; if ($piece_height != "") { echo $piece_height."H "; $count++; } if ($piece_width != "") { echo $piece_width."W "; $count++; } if ($piece_depth != "") { echo $piece_depth."D "; $count++; } if ($count > 0) echo "$piece_demension_units"; if ($piece_weight != "") { echo "   weight: $piece_weight "; echo "$piece_weight_units)"; } if (($piece_height!="") || ($piece_width!="") || ($piece_depth!="") || ($piece_weight!="")) echo ")"; echo ""; if (($web_address !="") && ($show_web_address == '1')) echo "\n
Artist web address: $web_address"; echo "\n
-Visit the Artist"; echo "

Listing of Item:  $piece


"; // if (($email !="") && ($show_email == '1')) echo "\n
"; echo "\n

\n"; closeout(); exit(); } if (!isset($o)) $o = 0; //offset into return if (!isset($r)) $r = 10; //how may to display function cattable($level) { global $krecord, $num, $med, $c1, $c2, $c4, $c4, $PHP_SELF; global $r_str, $q_str; echo "
"; switch ($level) { case 0: $r_str="med=$med"; $q_str="(piece_media='$med') and (piece_category1='') and (piece_category2='')"; $s_str="

    $med

"; $eval = "select * from catkounts where (med='$med') and (cat1!='') and (cat2='') group by med, cat1, cat2, cat3 ASC"; $v_eval = "select * from catkounts where (med='$med') and (cat1='')"; relevant_random("2","150","(piece_status=\"1\") and (piece_media='$med')"); break; case 1: $r_str="med=$med&c1=$c1"; $q_str="(piece_media='$med') and (piece_category1='$c1') and (piece_category2='')"; $s_str="

  $med > $c1

"; $eval = "select * from catkounts where (med='$med') and (cat1='$c1') and (cat2!='') and (cat3='') group by med, cat1, cat2, cat3 ASC"; $v_eval = "select * from catkounts where (med='$med') and (cat1='$c1') and (cat2='')"; relevant_random("2","150","(piece_status=\"1\") and (piece_media='$med') and (piece_category1='$c1')"); break; case 2: $r_str="med=$med&c1=$c1&c2=$c2"; $q_str="(piece_media='$med') and (piece_category1='$c1') and (piece_category2='$c2') and (piece_category3='')"; $s_str="

  $med > $c1 > $c2

"; $eval = "select * from catkounts where (med='$med') and (cat1='$c1') and (cat2='$c2') and (cat3!='') and (cat4='') group by med, cat1, cat2, cat3 ASC"; $v_eval = "select * from catkounts where (med='$med') and (cat1='$c1') and (cat2='$c2') and (cat3='')"; relevant_random("2","150","(piece_status=\"1\") and (piece_media='$med') and (piece_category1='$c1') and (piece_category2='$c2')"); break; } //switch echo "
  Art by media search:"; echo $s_str; echo "
"; //echo "
eval is: $eval"; $krecord = mysql_query($eval); if (!$krecord) { emsg("Fetch for media, category type failed please try again later.. (support notified)"); closeout(); exit(); } $num=mysql_num_rows($krecord); if ($num< 1) { // if there were no sub groups, $num might be 0, based on the query used above... so // check the query without the questionable sub-group, to see if the params were valid $krecord = mysql_query($v_eval); if (!$krecord) { echo "
"; emsg("unable to fetch counts file... please try again later... (support notified)"); closeout(); exit(); } if (mysql_num_rows($krecord)<1) { echo ""; switch ($level) { case 0: emsg("Invalid search requested for media: $med"); break; case 1: emsg("Invalid search requested for media: $med > $c1"); break; case 2: emsg("Invalid search requested for media: $med > $c1 > $c2"); break; case 3: emsg("Invalid search requested for media: $med > $c1 > $c2"); break; case 4: emsg("Invalid search requested for media: $med > $c1 > $c2 > $c3"); break; } //switch closeout(); exit(); } } } ///////////////// master $med selector //////////// if (isset($med)) { $i=0; $num=0; $krecord=0; if (!isset($c1)) { page_top('2',$med.' - AZooNY Art Directory Search Results'); cattable("0"); while ($krow = mysql_fetch_array($krecord)) if ($krow['cat1']!="") { $METAFLAG=1; if ($i== (int) round($num/2)) echo ""; $i++; echo "".$krow['cat1'].""; if ($krow['kount']<1) echo "  \"new
"; else echo " (".$krow['kount'].")
"; } //while/if } elseif (isset($c1) and !isset($c2)) { page_top('2',$med.' > '.$c1.' - AZooNY Art Directory Search Results'); cattable("1"); while ($krow = mysql_fetch_array($krecord)) if ($krow['cat2']!="") { $METAFLAG=1; if ($i==(int) round($num/2)) echo ""; $i++; echo "".$krow['cat2'].""; if ($krow['kount']<1) echo "  \"new
"; else echo " (".$krow['kount'].")
"; } //if/while } elseif (isset($c1) and isset($c2) and !isset($c3)) { page_top('2',$med.' > '.$c1.' > '.$c2.' - AZooNY Art Directory Search Results'); cattable("2"); while ($krow = mysql_fetch_array($krecord)) if ($krow['cat3']!="") { $METAFLAG=1; if ($i==(int)$num/2) echo ""; echo "".$krow['cat3'].""; if ($krow['kount']<1) echo "  \"new
"; else echo " (".$krow['kount'].")
"; } //if/while } else { page_top('2','Error 404 Not found'); emsg("unrecognized media search parameters"); closeout(); exit(); } echo ""; //close out the table, might be empty.. if (isset($METAFLAG)) echo "
"; } ////////////////////////////////// by subject/media/artist setup ///////////////////////// if (isset($cat)) { page_top('2',$cat.' - AZooNY Art Gallery Search Results'); echo "
"; relevant_random("2","150","(piece_status=\"1\") and ((piece_category1='$cat')or(piece_category2='$cat')or(piece_category3='$cat'))"); echo "
  Art by subject search:"; echo "

    $cat

"; $q_str="(piece_category1='$cat')or (piece_category2='$cat') or (piece_category3='$cat')"; $r_str="cat=$cat"; } // need to look at the original to see what the purpose of this was.. if (!isset($search)&&(!isset($med))&&(!isset($cat))) { page_top('2','AZooNY | Art and Artist Search Homepage'); if (!isset($piece)&&!isset($search)) { echo "\n
"; relevant_random("2","150","piece_status=\"1\""); echo "\n
Search AZooNY's Catalogs"; echo "\n

Art by Subject:
"; // listarray(2,$categories); $record = mysql_query("(select cat1 as c from catkounts) union (select cat2 as c from catkounts) union (select cat3 as c from catkounts) order by c asc"); if (!$record) { emsg("Unable to list by subject right now. Please try again later."); echo "

"; } else { $ttt=0; while (($row = mysql_fetch_array($record))&&($ttt==0)) if ($row['c']!="") $ttt++; echo "".$row['c'].""; while ($row = mysql_fetch_array($record)) { if ($row['c']!=""); echo ", ".$row['c'].""; } //while } //else echo "\n

Art by Media:
"; listarray(2,$medialist); echo "\n

Art by Artist

"; echo "\n
"; echo "Artwork Search:
"; echo "
"; closeout(); exit(); } } ////////// search art ////////// if (isset($search)) { page_top('2','AZooNY | Art Directory Search Results'); echo "
"; echo "

    Search results for:   ".stripslashes($search)."

"; echo "

"; } ////////////////// first time do all to get the matches count /////////// echo "\n
"; if ($o == 0) { if (isset($search)) $eval = "select *, match (piece_title, piece_description) against ('$search') as score from piece where match (piece_title, piece_description) against ('$search')"; else $eval="select * from piece where ($q_str and (piece_status<>\"0\"))"; //echo "
listing eval is: $eval"; // $eval="select * from piece where (($inx=\"".$$subject."\") and (piece_status<>\"0\"))"; $record_piece = mysql_query($eval); if (!$record_piece) { emsg("Error on query of piece database"); closeout(); exit(); } $c = mysql_num_rows($record_piece); } if ($c > ($o+$r)) { if (isset($search)) $eval = "select *, match (piece_title, piece_description) against ('$search') as score from piece where match (piece_title, piece_description) against ('$search') LIMIT $o,$r"; else $eval = "select * from piece where ($q_str and (piece_status<>\"0\")) ORDER BY RAND(CURDATE()+1) LIMIT $o,$r"; $record_piece = mysql_query($eval); } else { if (isset($search)) $eval = "select *, match (piece_title, piece_description) against ('$search') as score from piece where match (piece_title, piece_description) against ('$search') LIMIT $o,$r"; else $eval = "select * from piece where ($q_str and (piece_status<>\"0\")) ORDER BY RAND(CURDATE()+1) LIMIT $o,$r"; $record_piece = mysql_query($eval); } if (!$record_piece) { emsg("Error fetching piece record"); closeout(); exit(); } $count = 0; $num_rows=mysql_num_rows($record_piece); if ($num_rows>0) echo " (in random order)"; elseif ($num_rows==0) echo "


"; while ($row = mysql_fetch_array($record_piece)) { $count++; $artist_id = $row["artist_id"]; $piece_master_id = $row["piece_master_id"]; $piece_title=$row["piece_title"]; $piece_media=$row["piece_media"]; $piece_description = nl2br($row["piece_description"]); $piece_media = $row["piece_media"]; $piece_category1 = $row["piece_category1"]; $piece_category2 = $row["piece_category2"]; $piece_category3 = $row["piece_category3"]; $piece_image1=$row["piece_image1"]; if (isset($search)) $score=round($row["score"],2)*100; $record_artist = mysql_query("select name_first, name_last, home_directory from artists where artist_id=$artist_id"); if (!$record_artist) emsg("Can not load artist data for artist $artist_id"); $arow = mysql_fetch_array($record_artist); $name_first = $arow["name_first"]; $name_last = $arow["name_last"]; $home_directory = $arow["home_directory"]; echo "\n"; if (($home_directory != "") and ($piece_image1 != "")) { $len = strlen($piece_image1); $thumnail = substr($piece_image1, 0, ($len-4)); $thumnail .="_th".substr($piece_image1, -4); echo "\n"; } echo "\n
"; if (isset($search)) echo "
$score%
"; echo "$piece_title"; echo "\n
by $name_first $name_last"; if ($piece_description == "") { echo "\n
"; } else { $length=strlen($piece_description); if ($length > 166) { $piece_description = substr($piece_description, 0, 166); $piece_description .="...(more)"; } echo "\n
$piece_description
"; } echo "-More on $piece_title   -More on Artist"; echo "
$piece_media"; if ($piece_category1!="") echo " > $piece_category1"; if ($piece_category2!="") echo " > $piece_category2"; if ($piece_category3!="") echo " > $piece_category3"; echo "\n


"; } //endwhile if ($count == 0) { if (isset($search)) { echo "


No entries in search:   ".stripslashes($search)."


"; echo "Searchable parameters include artwork titles and descriptions

"; echo "\n
"; // the purpose here below?? if (isset($search)) echo "Artwork Search:



"; else echo "Artwork Search:



"; ///// } else if (!isset($METAFLAG)) { echo "


No entries yet in this category


"; $no_entries=1; closeout(); exit(); } else { closeout(); exit(); } } //////////// display search count left /////////////////////// echo "\n


"; echo colorlogo(1); echo "
"; $new_o=0; $count=1; if ($c <= $r) $cuts=1; else $cuts=$c; while ($new_o<=$cuts) { if ($o==$new_o) echo "\n$count "; else { if (isset($search)) echo "\n$count "; else echo "\n$count "; } $count++; $new_o=$new_o+$r; } echo "\n

"; closeout();