<meta http-equiv="Expires" content="0" /> <meta name="viewport" content="width=device-width, initial-scale=1 minimum-scale=0.5"> <link rel="icon" type="image/png" href="css/logo2.png"> </head> <body> <p style="display:none"> QWiket is a current news and political commentary portal. </p> <ul> '; $ds = new PovDataService($conf['dsn'], $conf['dbname'], $conf['dbpassword'], array(PDO::ATTR_PERSISTENT => false)); $total = $ds->getTotalTopicsCount(); $pages = intval($total / 5000) + 1; for ($i = 0; $i < $pages; $i++) { $file = fopen("..\\links\\links_page" . $i . ".html", "w") or die("Unable to open file!"); fwrite($file, $html_header); $topics = $ds->loadAllTopics($i); foreach ((array) $topics as $topic) { $html = ' <li><a href="http://qwiket.com/pointofviewworld/' . $topic['threadid'] . '/7/">' . $topic['site_name'] . ': ' . $topic['title'] . '</a></li>'; fwrite($file, $html); } fwrite($file, ' </ul><a href="http://qwiket.com/links/links_page' . ($i + 1) . '.html">Next Page</a></body>'); fclose($file); }