\n"; } dprint($debug,"pNum = $pNum",$myrow); $cat = $myrow["cat"]; $sortBy = $myrow["sort_by_attr"]; $sortCol = $myrow["sort_col"]; $sortDesc = $myrow["sort_desc"]; ?> <? echo $myrow["description"]." ".$sortCol;?>


Return to Album Home
Add Object
"; } ?>
0) { // not an All menu $query = "SELECT objects.obj_name, objects.obj_key, attribs.attr_num, attribs.attr_val, updated"; $query = $query." FROM objects"; $query = $query." INNER JOIN attribs ON objects.obj_key = attribs.obj_num"; $query = $query." WHERE (((attribs.attr_num)=$sortBy)"; $query = $query." AND (cat=$cat)"; $query = $query.") ORDER BY attribs.attr_val,obj_name"; if ($sortDesc == 1) $query = $query." DESC"; $result = mysql_query($query,$db); if ($result != null) { while ($myrow = mysql_fetch_array($result)) { $query = "select count(pic_key) from pics,objx WHERE obj_num=".$myrow["obj_key"]." AND pic_num=pic_key AND (publish & $TOWEB)=$TOWEB"; $result2 = mysql_query($query,$db); if ($result2 != null) { $myrow2 = mysql_fetch_array($result2); } else { $debug = true; } ?> \n"; } } else { $query = "SELECT * FROM pics,srcs where src_key=src AND (publish & $TOWEB)=$TOWEB"; $query = $query." ORDER BY "; if ($sortDesc == 1) { if (strpos($sortCol, ",") === false) { $query = $query."$sortCol DESC"; } else { $tok = strtok($sortCol,","); $addCom = false; while ($tok) { if ($addCom) { $query = $query.","; } else { $addCom = true; } $query = $query." ".$tok." DESC"; $tok = strtok(","); } } } else { $query = $query."$sortCol"; } $result = mysql_query($query,$db); if ($result != null) { $lkey = ""; $idx = 0; while ($myrow = mysql_fetch_array($result)) { if (strpos($sortCol, ",") === false) { $key = $myrow[$sortCol]; } else { if ($sortCol == "decade,year,month,day") { if ($myrow["day"] > 0) { $key = $myrow["decade"].$myrow["year"]."-".$myrow["month"]."-".$myrow["day"]."
"; } else if ($myrow["month"] > 0) { $key = $myrow["decade"]."".$myrow["year"]."-".$myrow["month"]."
"; } else if ($myrow["year"] > -1) { $key = $myrow["decade"]."".$myrow["year"]."
"; } else if ($myrow["decade"] > 0) { $key = "Sometime during ".$myrow["decade"]."0 to ".$myrow["decade"]."9
"; } } else { $key = ""; $tok = strtok($sortCol,","); while ($tok) { $key = $key." ".$myrow[$tok]; $tok = strtok(","); } } } if ($key == $lkey) { $key = ""; } else { $lkey = $key; $key = " \n"; } $_SESSION["picStack"] = $stack; ?>
> () pics > Edit it (". $updated.")"; } if ($debug) { echo "=$updated - $up - $now=".($now - $up); } ?>
$key"; } ?>
> > Edit it (". $updated.")"; } if ($debug) { echo "=$updated - $up - $now=".($now - $up); } $stack[$idx] = $myrow["pic_key"]; $idx = $idx + 1; ?>






Time for queries to run secs