background-color: rgba(255,255,255,.7); position: fixed; bottom: 0; right: 0; width: 50%; border: 1px dotted gray;}</style></head><body>'; echo "Number of files to check: " . mysqli_num_rows($result) . "\n<style>img {display:inline-block}</style><hr>"; $lastHashId = 0; /* fetch associative array */ while ($row = $result->fetch_assoc()) { //var_dump($row); if ($row['hashid'] == $lastHashId) { continue; // skip potential duplicities } $tiny = Nodus\Security\IntEncrypt::encrypt($row['id'], 'Nodus'); $thm = "http://videoth.uloz.to/{$tiny[0]}/{$tiny[1]}/{$tiny[2]}/x{$tiny}.160x120."; echo "<a target=_blank href=https://exec.uloz.to/support/files/file-preview?fileId={$row['id']}>"; for ($i = 0; $i < 10; $i++) { echo "<img src='{$thm}{$i}.jpg' width=100>"; } echo "<br>[{$row['hashid']}] {$row['name']}</a> <button type='button' onclick='s(this, \"https://uloz.to/!{$row['slug']}/\")'>Straight</button> or \n <button type='button' onclick='g(this, \"https://uloz.to/!{$row['slug']}/\")'>Gay</button><hr>"; $lastHashId = $row['hashid']; } echo "<hr>Latest hashid checked: {$lastHashId} <hr>"; echo "<div class=fixed>Straight: <textarea id=straight rows=5 cols=28 onfocus=select()></textarea>\n Gay: <textarea id=gay rows=5 cols=28 onfocus=select()></textarea></div>\n <script>\n var straight = document.getElementById('straight');\n var gay = document.getElementById('gay');\n function s(el, url) {\n //console.log(el.dataset.straight);\n if (el.dataset.straight != 1) {\n el.dataset.straight = 1;\n straight.value = straight.value + url + \"\\n\";\n } else {\n el.dataset.straight = 0;\n straight.value = ('' + straight.value).replace(url + \"\\n\", '');\n }\n }\n function g(el, url) {\n if (el.dataset.gay != 1) {\n el.dataset.gay = 1;\n gay.value = gay.value + url + \"\\n\";\n } else {\n el.dataset.gay = 0;\n gay.value = ('' + gay.value).replace(url + \"\\n\", '');\n }\n }\n </script>"; /* free result set */ $result->close(); } $mysqli->close(); echo "\n\n<hr>Finished\n";
<?php require '/Users/xrevelon/git/ulozto-web/Nodus/Security/IntEncrypt.php'; require '/Users/xrevelon/cnf.php'; echo "\n\n\n"; $data = explode("\n", file_get_contents('./file-id-to-del.txt')); $mysqli = new mysqli($cnf['h'], $cnf['u'], $cnf['p'], $cnf['d']); /* check connection */ if ($mysqli->connect_errno) { printf("Connect failed: %s\n", $mysqli->connect_error); exit; } //select * from file_hash where binary hash = UPPER('a1e657333a500914529a968d85d67623') //var_dump("select * from file_hash where hash in (UNHEX(UPPER('". implode("')),UNHEX(UPPER('", $md5s) ."')))"); /* Select queries return a resultset */ if ($result = $mysqli->query("select * from file_hash left join file using (hashid)\n\t\t\t\t\t\t\t\twhere id in (" . implode(',', $data) . ") and \n\t\t\t\t\t\t\t\tstatus = 'ok'\n\t\t\t\t\t\t\t ")) { echo "Number of files: " . mysqli_num_rows($result) . "\n"; /* fetch associative array */ while ($row = $result->fetch_assoc()) { //var_dump($row); echo "\nhttp://uloz.to/x" . Nodus\Security\IntEncrypt::encrypt($row['id'], 'Nodus') . "/"; } /* free result set */ $result->close(); } $mysqli->close(); echo "\n\nFinished\n";