Page 1 of 1

Random tease

Posted: Thu Jan 29, 2015 11:06 pm
by DailyTwo
Hey guys and gals,

I often thought about a random tease button or script to include either in a session or an online tease or even a forum tease.

So I just got an idea how to solve this, as there isnt a random function on milovana itself :)

I just did a short php-code with test a maximum of 50000 teases. Right now there are almost 30000 teases so the script should work for some time.

All you have to do is either copy the script onto your local webserver or upload it somewhere, where you can run a php script.
Spoiler: show

Code: Select all

<?php$num_teases = 50000;$searchString1 = 'Sorry. The requested tease could not be displayed.';$searchString2 = 'The requested tease could not be found in our database';$searchString3 = 'The requested tease has been removed';$hit = false;while($hit == false){    $test = rand(1,$num_teases);    $content = file_get_contents("http://www.milovana.com/webteases/showtease.php?id=".$test);    if( !strpos( $content, $searchString1 ) && !strpos( $content, $searchString2 ) && !strpos( $content, $searchString3 ) ){        $hit = true;    }}header('Location: http://www.milovana.com/webteases/showtease.php?id='. $test); ?>
This script is still beta and it took me like 15 mins to write. So please tell me if you find any bugs.
I'd also like the milovana team to add this script. Just replace the 50000 with you current maximum of teases.

Re: Random tease

Posted: Fri Jan 30, 2015 7:26 am
by Ghingis
Thanks for the script.

But actualy there's a way (or sort of) to get a random tease.
(You can even use the filters.)

http://www.milovana.com/webteases/#pp=1&sort=random

Re: Random tease

Posted: Fri Jan 30, 2015 2:49 pm
by Chico
............or on the webtease page where the random tease appears, just hit the "refresh" button :-D

Re: Random tease

Posted: Fri Jan 30, 2015 10:47 pm
by DailyTwo
thx Ghingis

didnt know about that option :D

Only difference with my script is that the random tease is immediately opened

Re: Random tease

Posted: Mon Feb 02, 2015 7:40 am
by Trusfrated
...and here is a way to show a random tease that is marked as one of your Favorites!

http://www.milovana.com/webteases/#favs ... ort=random

:wave:

Re: Random tease

Posted: Fri Apr 22, 2022 1:03 pm
by tkct78
This is an old thread that's worth revisiting...

Sadly these links don't actually generate the random tease like they used to. Does anyone know how to fix this?