file_name = $file_name; else{ $str = eregi_replace("([^#]*)#(.*)","\\1",$file_name); $this->file_name = $str; } if (eregi("(#.*)",$file_name,$array)){ $this->default_anchor = $array[1]; $this->name_anchor = ""; $this->anchor = eregi_replace("#(.*)",base64_encode($this->default_anchor),$this->default_anchor); }else{ $this->default_anchor = ""; $this->name_anchor = base64_encode($file_name); $this->anchor = "#".$this->name_anchor; } if (eregi("(.*)/",$file_name,$array)) $this->rel_path = $array[1]; $this->loaded = 0; } }; $url = array(); //$path = "/www/Documentation/manual_2.4/"; $fin = fopen("index.html","r"); if (!$fin){ echo "Cannot open index.html file for reading!"; exit(8); } $inc = 0; while (!feof($fin)){ $str = fgets($fin,10000); if ($str){ if (eregi("href[^>=]*= *['\"]?([^'\" .>]*).pdf['\" >]",$str)) { echo $str; } else { if (eregi("href[^>=]*= *['\"]?([^'\" >]*)['\" >]",$str,$array)){ for ($i = 1; $i<10; $i++) if ($array[$i] != ""){ $url[$inc] = new url($array[$i]); $str = eregi_replace("$array[$i]",$url[$inc]->anchor,$str); $inc++; } echo $str; } else echo $str; } } } $max = $inc; for ($i = 0; $i < $max; $i++){ $loaded = 0; for ($j = 0; $j < $max; $j++) if (($url[$j]->file_name == $url[$i]->file_name) && ($i != $j) && ($url[$j]->loaded != 0)) $loaded = 1; if (($url[$i]->file_name == 'index.php')||($url[$i]->file_name == 'index.php3')) $loaded = 1; if ($loaded == 0){ $url[$i]->loaded = 1; if ($url[$i]->name_anchor) echo "name_anchor."\">"; if (file_exists($path.$url[$i]->file_name)) $fin = fopen("$path".$url[$i]->file_name,"r"); else $fin = 0; if ($fin){ while (!feof($fin)){ $str = fgets($fin,10000); // $str = eregi_replace("src=['\"]?([^'\"]*)[^'\"]?","src=\"".$url[$i]->rel_path."/\\1\"",$str); // $str = eregi_replace("href=['\"]?([^'\"]*?\.pdf)[^'\"]?","href=\"".$url[$i]->rel_path."/\\1\"",$str); // $str = eregi_replace("href=['\"]?([^'\"]*?\.exe)[^'\"]?","href=\"".$url[$i]->rel_path."/\\1\"",$str); echo "$str"; } } if ($fin) fclose($fin); } } ?>