11-18-2009, 07:38 AM
(This post was last modified: 11-18-2009, 07:41 AM by Brainless Control.)
(11-17-2009, 06:59 PM)Master of The Universe Wrote: That's actually a good idea, and it's even easy to do.Awesome idea Grizzly and ninja geek thanks for the script i've tested it and it's brilliant.
PHP Code:<?php
/*****************************************************************************
@Name: Random MyBB Forum Preview
@Author: NinjaGeek
*****************************************************************************/
$randomPage = rand(0,255);
if(!$searchResponse = file_get_contents("http://www.google.com/search?q=intext%3A+\"Powered+By+MyBB\"&start={$randomPage}")) {
exit;
}
$matches = null;
preg_match_all("/<h3 class=r><a href=\"http:\/\/(.*?)\/(.*?)\"/", $searchResponse, $matches);
print file_get_contents("http://".$matches[1][rand(0, 9)]);
?>
edit: I forgot to say that thie script above will not work right if your user starts browsing the forum, the links are mostly not pointing to the forum it self but to a page on your site.