0)$select .= " OR"; $select .= " word like '%;".$p2[$e].";%'"; if(count($p2) == ($e+1))$select .= ")"; } for ($e = 0; $e < count($p3) && ($p3[$e] != ''); $e ++) { $select .= " AND word not like '%;".$p3[$e].";%'"; } $result = mysql_query($select); $all = mysql_num_rows($result); @mysql_free_result($result); if (isset($all)) $all = intval($all); if (isset($_GET['sta'])) $sta = intval($_GET['sta']); else $sta = 0; $show = HOW_CATEG; $alf = $_GET['alf']; if(trim($alf) == 1) { $order = "name ASC"; } else $order = "dates DESC"; unset($select); $select = "SELECT * FROM sets WHERE dates<=$time AND word like '%;".$categ.";%'"; for ($e = 0; $e < count($p) && ($p[$e] != ''); $e ++) { $select .= " AND word like '%;".$p[$e].";%'"; } for ($e = 0; $e < count($p2) && ($p2[$e] != ''); $e ++) { if($e == 0)$select .= " AND ("; if($e > 0)$select .= " OR"; $select .= " word like '%;".$p2[$e].";%'"; if(count($p2) == ($e+1))$select .= ")"; } for ($e = 0; $e < count($p3) && ($p3[$e] != ''); $e ++) { $select .= " AND word not like '%;".$p3[$e].";%'"; } $select .= " ORDER BY $order LIMIT $sta,$show"; //echo $select; #--------------------------------------------------------------------------------- } $result = mysql_query($select); $up = 0; $TEM = ''; if($file = @fopen("template_categ.html", "r")) { while(!feof($file))$TEM .= fgets($file, 1024); fclose($file); } while($row = mysql_fetch_object($result)) { if($up == COL_CATEG){echo ""; $up = 0;} if($row->sample == 'story'){story(); continue;} $TEMPLATE = str_replace("#%DATE%#", date(DATE_FORMAT, $row->dates), $TEM); if(MEMBERS_TYPE == "modelspage") $TEMPLATE = str_replace("#%URL%#", "select.php?n=".$row->rowid, $TEMPLATE); else $TEMPLATE = str_replace("#%URL%#", "index.php?n=".$row->rowid."&page=1", $TEMPLATE); $TEMPLATE = str_replace("#%NAME%#", stripslashes($row->$quer_name), $TEMPLATE); $TEMPLATE = str_replace("#%DESCRIBE%#", stripslashes($row->$quer_text), $TEMPLATE); $TEMPLATE = str_replace("#%MODEL_NAME%#", stripslashes($row->model_name), $TEMPLATE); $TEMPLATE = str_replace("#%HEIGHT%#", stripslashes($row->height), $TEMPLATE); $TEMPLATE = str_replace("#%BUST%#", stripslashes($row->bust), $TEMPLATE); $TEMPLATE = str_replace("#%WEIGHT%#", stripslashes($row->weight), $TEMPLATE); $TEMPLATE = str_replace("#%HIPS%#", stripslashes($row->hips), $TEMPLATE); $TEMPLATE = str_replace("#%HAIR%#", stripslashes($row->hair), $TEMPLATE); $TEMPLATE = str_replace("#%EYES%#", stripslashes($row->eyes), $TEMPLATE); $TEMPLATE = str_replace("#%NUM%#", content_count($row), $TEMPLATE); $TEMPLATE = str_replace("#%EXTRA1%#", stripslashes($row->extra1), $TEMPLATE); $TEMPLATE = str_replace("#%EXTRA2%#", stripslashes($row->extra2), $TEMPLATE); $TEMPLATE = str_replace("#%CATEG%#", $categ, $TEMPLATE); ################################################################################# $pic_url = "index.php?n=".$row->rowid; $video_url = "index.php?n=".$row->rowid."&tp=video"; if(is_dir($row->path.'screens')) $screens_url = "index.php?n=".$row->rowid."&added_path=screens/"; else $screens_url = "#"; $TEMPLATE = str_replace("#%PICTURES%#", $pic_url, $TEMPLATE); $TEMPLATE = str_replace("#%VIDEOS%#", $video_url, $TEMPLATE); $TEMPLATE = str_replace("#%SCREENS%#", $screens_url, $TEMPLATE); ################################################################################# if($dom != '') { $hosting = parse_url($row->icon); $TEMPLATE = str_replace("#%ICON1%#", str_replace($hosting["host"], $dom, $row->url.$added_path."icon1.jpg"), $TEMPLATE); $TEMPLATE = str_replace("#%ICON2%#", str_replace($hosting["host"], $dom, $row->url.$added_path."icon2.jpg"), $TEMPLATE); $TEMPLATE = str_replace("#%ICON3%#", str_replace($hosting["host"], $dom, $row->url.$added_path."icon3.jpg"), $TEMPLATE); $TEMPLATE = str_replace("#%ICON4%#", str_replace($hosting["host"], $dom, $row->url.$added_path."icon4.jpg"), $TEMPLATE); $TEMPLATE = str_replace("#%ICON5%#", str_replace($hosting["host"], $dom, $row->url.$added_path."icon5.jpg"), $TEMPLATE); $TEMPLATE = str_replace("#%ICON6%#", str_replace($hosting["host"], $dom, $row->url.$added_path."icon6.jpg"), $TEMPLATE); $TEMPLATE = str_replace("#%ICON7%#", str_replace($hosting["host"], $dom, $row->url.$added_path."icon7.jpg"), $TEMPLATE); $TEMPLATE = str_replace("#%ICON8%#", str_replace($hosting["host"], $dom, $row->url.$added_path."icon8.jpg"), $TEMPLATE); $TEMPLATE = str_replace("#%ICON9%#", str_replace($hosting["host"], $dom, $row->url.$added_path."icon9.jpg"), $TEMPLATE); echo $TEMPLATE = str_replace("#%ICON%#", str_replace($hosting["host"], $dom, $row->url.$added_path."icon.jpg"), $TEMPLATE); } else { $TEMPLATE = str_replace("#%ICON1%#", $row->url.$added_path."icon1.jpg", $TEMPLATE); $TEMPLATE = str_replace("#%ICON2%#", $row->url.$added_path."icon2.jpg", $TEMPLATE); $TEMPLATE = str_replace("#%ICON3%#", $row->url.$added_path."icon3.jpg", $TEMPLATE); $TEMPLATE = str_replace("#%ICON4%#", $row->url.$added_path."icon4.jpg", $TEMPLATE); $TEMPLATE = str_replace("#%ICON5%#", $row->url.$added_path."icon5.jpg", $TEMPLATE); $TEMPLATE = str_replace("#%ICON6%#", $row->url.$added_path."icon6.jpg", $TEMPLATE); $TEMPLATE = str_replace("#%ICON7%#", $row->url.$added_path."icon7.jpg", $TEMPLATE); $TEMPLATE = str_replace("#%ICON8%#", $row->url.$added_path."icon8.jpg", $TEMPLATE); $TEMPLATE = str_replace("#%ICON9%#", $row->url.$added_path."icon9.jpg", $TEMPLATE); echo $TEMPLATE = str_replace("#%ICON%#", $row->url.$added_path."icon.jpg", $TEMPLATE); } $up ++; } echo "
"; if(CATEG_NAVIGATION == 1) { #################################### echo "
"; $sta = 0; if(!isset($page) || $page == "")$page = 1; for($j = 1; $j <= ceil($all / $show); $j ++) { if($page == $j)echo " "; else echo ""; if(is_int($j / 15)) echo "
"; if(($j+1) <= ceil($all / $show))echo ""; $sta += $show; } echo "
Pages:
 $j 
 $j |
"; ################################### } else { if(CATEG_BUTTON == 2){ $Prev = ""; $Next = ""; } else { $Prev = "Prev"; $Next = "Next"; } if($sta > 0 && ($sta + $show) >= $all) { echo "$Prev"; } elseif(($sta + $show) < $all && $sta == 0) { echo "$Next"; } else { if(!($all <= $show)) { echo "$Prev   $Next"; } } } if(trim($alf) == 1) echo "Order by date"; else echo "Order by alphabet"; $topic = ''; if(isset($categ) && trim($categ) != '' && $file = @fopen($categ, "r")) { while(!feof($file))$topic .= fgets($file, 1024); fclose($file); } else { if($file = @fopen("DEFAULT_TEXT", "r")) { while(!feof($file))$topic .= fgets($file, 1024); fclose($file); } } $TEM = ''; if($file = @fopen("footer_categ.html", "r")) { while(!feof($file))$TEM .= fgets($file, 1024); fclose($file); } $ccc = str_replace("_", " ", ucfirst($categ)); $HN = str_replace("#%TOPICTEXT%#", $topic, $TEM); $HN = str_replace("#%CATEG%#", $ccc, $HN); $HN = ucwords($HN); $surt_name = rand(0, 10000000); $fp = fopen($surt_name, 'w'); fwrite($fp, $HN); fclose($fp); @chmod($surt_name, 0777); require($surt_name); unlink($surt_name); unset($TEM); unset($HN); unset($topic); function story() { global $STORYTEM, $row, $up, $quer_name, $quer_text; $STORYTEMPLATE = str_replace("#%DATE%#", date(DATE_FORMAT, $row->dates), $STORYTEM); $STORYTEMPLATE = str_replace("#%URL%#", "story.php?n=".$row->rowid."&".(time() - 1031865381), $STORYTEMPLATE); $STORYTEMPLATE = str_replace("#%NAME%#", stripslashes($row->$quer_name), $STORYTEMPLATE); echo $STORYTEMPLATE = str_replace("#%DESCRIBE%#", stripslashes($row->$quer_text), $STORYTEMPLATE); $up ++; } function content_count($row) { global $added_path; $num_content = 0; $dir = opendir($row->path.$added_path); while ($s = readdir($dir)){ if($s!='.' && $s!='..' && !ereg("icon.[jJ][pP][gG]", $s) && !ereg("^(tn_)", $s) && trim($s) != '' && is_file($row->path.$added_path.$s) && !ereg(".zip", $s)) { $num_content += 1; } } closedir($dir); return $num_content; } ?>