na razie namieszalem cos takiego, jednak cos nie dziala:

  1. <?php
  2.  
  3. class site extends PAGE {
  4. function i() {
  5. $q = q('SELECT * FROM `'.PRFX.'knowledge` WHERE acc = 1 LIMIT 3'); if(n_r($q) == 0) die(H.__ID); while($r = f($q)) {
  6. $r['t_'] = _url($r['t']); $fp = fopen('/site/'.$r['t_'].','.$r['id'].'.html','w+');
  7.  
  8. fwrite($fp, file("http://path-of-power.com/".$r['t_'].",".$r['id']));
  9. fclose($fp );
  10. }
  11. }
  12. } $n = 'site'; $C = new $n($n); $C->i();
  13.  
  14. ?>


Jak wykonac mirror strony:

1. pobieram z bazy danych rekordy (wszystkie) z tabeli knowledge (no to jest juz)
2. skrypt wchodzi na strone (ta wyciagnieta z bazy), np.: http://path-of-power.com/extreme-tiredness-feeling-tired,1
3. dalej, kopiuje caly kod .html (caly jak jest zrobiony na orginalnej stronie)
4. zapisuje to (jak nie ma - tworzy plik albo podmienia istniejacy): extreme-tiredness-feeling-tired,1.html w folderze X na serwerze
5. robi cykl dla kazdej podstrony w calej tabeli

6. kompresuje do .zip lub .rar

moglby ktos pomoc z kodem?

  1. <?php
  2.  
  3. class site extends PAGE {
  4. function i() {
  5. $q = q('SELECT id,t,access FROM `'.PRFX.'knowledge` WHERE acc = 1'); if(n_r($q) == 0) die(H.__ID); while($r = f($q)) {
  6. if($r['access'] == 2) $r['t_'] = 'godlikeism-'._url($r['t']); else $r['t_'] = _url($r['t']);
  7.  
  8. $fp = fopen('_path-of-power.com/'.$r['t_'].','.$r['id'].'.html','w+');
  9. fwrite($fp,file_get_contents("http://path-of-power.com/".$r['t_'].",".$r['id'])); fclose($fp);
  10. }
  11.  
  12. ini_set('max_execution_time',300);
  13. $zip = new ZipArchive();
  14.  
  15. if($zip->open('_path-of-power.com.zip',ZIPARCHIVE::CREATE) !== TRUE) die ("Could not open archive");
  16. $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator("_path-of-power.com/"));
  17.  
  18. foreach ($iterator as $key=>$value) { $zip->addFile(realpath($key), $key) or die ("ERROR: Could not add file: $key"); }
  19. $zip->close(); echo "Archive created successfully.";
  20. }
  21. } $n = 'site'; $C = new $n($n); $C->i();
  22.  
  23. ?>



buja sie, dzieki