PASTE icon indicating copy to clipboard operation
PASTE copied to clipboard

I wanna add random url feature

Open snoofox opened this issue 4 years ago • 4 comments

is there any way to add random url in this script just like pastebin

snoofox avatar Apr 22 '21 09:04 snoofox

Sure you can grab random results from the database, you can even make MySQL do it for you, for instance;

SELECT p.* FROM pastes AS p, (SELECT ROUND(RAND() * (SELECT MAX(id) FROM pastes)) AS id) AS x WHERE p.id >= x.id LIMIT 1;

That implementation could probably be something like this;

$query = 'SELECT p.* FROM pastes AS p, (SELECT ROUND(RAND() * (SELECT MAX(id) FROM pastes)) AS id) AS x WHERE p.id >= x.id LIMIT 1';

$result = mysqli_query($con, $query);
$row = mysqli_fetch_assoc($result);

thinkverse avatar Aug 17 '21 12:08 thinkverse

Is there any possibility add an option in configuration admin panel ? and could you please give more detail which php file need modify for random url creation ? @thinkverse

ozzytr avatar Jul 13 '22 20:07 ozzytr

any update or news ?

ozzytr avatar Jul 20 '22 13:07 ozzytr

any update or news ? I need it

ozzytr avatar Sep 13 '22 09:09 ozzytr

Would be handy yes

godgutten avatar Oct 14 '22 20:10 godgutten

look at this solution, it works for me https://github.com/jordansamuel/PASTE/issues/36

manuelkamp avatar Jun 09 '23 14:06 manuelkamp